This is the mail archive of the
mailing list for the GCC project.
Re: macro BITS_BIG_ENDIAN
- From: James E Wilson <wilson at specifixinc dot com>
- To: Sivan Balaji <Sivanßalaji at acmet dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 09 Sep 2004 15:39:53 -0700
- Subject: Re: macro BITS_BIG_ENDIAN
- References: <41402D49.firstname.lastname@example.org>
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
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