Re: Alignment problems with MIPS cross-compiler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Roy,

As I understand it, alignment is modulo whatever the given platform supports.

If the components on MIPS only support, say, 16 bytes (which I'm just pulling out of thin air), then specifying __attribute__((__aligned__(256))) will be ineffective.

Some platforms only support alignments of 4. Others 8 or 16. I don't know what MIPS supports.

In this case, when I say "platform", that comprises the OS as well as the assembler and linker. Least useful denominator rule applies.

Also note, some (most?) platforms require that the alignment be a one of 2^x (where x is 0 to some "n"). So if you tested __attribute__((__aligned__(3))) for a RGB quantity, for example, I wouldn't be surprised to find out that it wasn't honored everywhere as one may expect. Caveat emptor!

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux