union/struct representations for MAS Registers

David Laight David.Laight at ACULAB.COM
Thu Aug 11 03:38:54 EST 2011


 
> > Bitfields are rather non-portable, the compiler has a lot of choice
> > about how to align the bits in memory.
> 
> I'm ok with the masking stuff.
> However, I'm actually surprised this is true given the 
> maturity of our ABIs.

The C standard says nothing at all about how bitfields are implemented,
I think the first bit might be 0x1, 0x80, 0x1000000 or 0x80000000
when treated as a 32bit value, regardless of the endianness.

Different architectures can (and do) assign things in different ways.
So code that is ok on ppc might fail on arm or x86 (etc).

	David




More information about the Linuxppc-dev mailing list