[Cbe-oss-dev] Does the gcc attribute ((aligned 128))); work?

Guilherme Cox cox at computer.org
Wed May 27 05:50:09 EST 2009


Hi,

I don't know if this is the best place to talk about this kind of
stuff, but I asked on the Forum and I didn't get any good answer. If
here is not the place, let me know where I can send my email.

In the programming tutorial, it says:

"The MFC supports naturally aligned transfer sizes of 1, 2, 4, or 8
bytes, and multiples of 16-bytes, with a maximum transfer size of 16
KB. Peak performance can be achieved for transfers when both the EA
and LSA are 128-byte aligned and the size of the transfer is a
multiple of 128 bytes."

When I define a variable:

int a attribute ((aligned 128)));

and check out the address &a, it's not 128bytes aligned..

printf( "a is: %p", &a );

the output was:
a is: 0xfffff826010

if a is 128 byte aligned this address is invalid.

Am I doing something wrong?

I tested the same on SPE and got the same result (not the same address
but an address not aligned ;))

Thank's for any information, even if I am totally wrong in my concepts..

Guilherme

-- 
.cox

Mitch Hedberg  - "My fake plants died because I did not pretend to
water them." - http://www.brainyquote.com/quotes/authors/m/mitch_hedberg.html



More information about the cbe-oss-dev mailing list