This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Words endian is different in registers than in memory
- From: Andrew Haley <aph at redhat dot com>
- To: Anders Ådland <adland at stud dot ntnu dot no>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 26 Feb 2003 16:07:53 +0000 (GMT)
- Subject: Words endian is different in registers than in memory
- References: <Pine.LNX.4.51.0302261635400.17532@gaupe.stud.ntnu.no>
=?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.