This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Endianess and double type memory layout
- From: Wei Qin <wqin at EE dot Princeton dot EDU>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 1 Jul 2002 11:45:21 -0400 (EDT)
- Subject: Endianess and double type memory layout
Hi,
I tried to compile soft-fp library for a little endian arm
target, but unable to make it work smoothly. The reason I found is that
for a double type and little endian machine, the library assumes that the
lower 32 bit at the smaller memory address, and the higher 32 bit at the
higher memory address. This is consistent with x86 target.
However, my arm target gcc does the reverse: it saves
the higher 32bit at the low memory address. As a result, the packing and
unpacking of soft-fp fails unless I modified its source code.
So it seems to me that double type memory layout is a different
thing than endianess. Even if the endianess is the same, the compiler has
different choices on double layout.
I am reluctant to modify the library source. Can someone tell me
if I have to modify the source of soft-fp or I actually have some
configuration option when building the cross compiler or when building the
library?
thanks in advance,
Wei