This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: macro BITS_BIG_ENDIAN


Sivan Balaji wrote:
I have been through GCC internals documentation and I am not clear about BITS_BIG_ENDIAN. does BITS_BIG_ENDIAN related to the order of bit field members allocation.

There is no way to control the order of bit-field allocation. Bit-fields are always assigned to the first available bit, possibly constrained by other factors, such as alignment. That means that they start at the low order bit for little-endian, and the high order bit for big-endian. This is the "right" way to do things. It is very unusual for a compiler to do this differently.


The only thing controlled by BITS_BIG_ENDIAN is the bit numbering used for bit-field instructions. Or more specifically, it controls how the operands to ZERO_EXTRACT and SIGN_EXTRACT RTL operators are interpreted. It has no other effect.

Apparently, Red Hat has patches that allow one to switch the order of bit-field allocation, but these patches have not been contributed.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]