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]

Words endian is different in registers than in memory


=?ISO-8859-1?Q?Anders=5F=C5dland?= writes:
 > Hi
 > 
 > I am porting GCC to a new architecture and have one problem when defining
 > WORDS_BIG_ENDIAN because "GCC fundamentally assumes that the order of
 > words in memory is the same as the order in registers." In my case it
 > should be defined as 0 when working with memory and 1 when working with
 > registers.

I think you're saying that Register 0 is the high word of R0:R1, but
memory has little endian words, with the low word first, so you want
to store R0 in a higher address than R1.  Could you swap the register
names so that gcc's internal register zero maps on to real hardware
register 1, and vice versa?  You'd have something like REG:SI 0 r1 and
REG:SI 1 r0.

Andrew.


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