ieeefp.h and arm
Anthony Green
green@redhat.com
Tue Jan 9 17:45:00 GMT 2001
Hi -
I'm slowly getting gcj working on the arm-elf toolchain so we can
enable it by default in gcc land. I've found what looks to be a
problem in newlib's ieeefp.h (which libgcj borrows).
The arm bits look like this:
#if defined(__arm__) || defined(__thumb__)
/* ARM always has big-endian words. Within those words the byte ordering
will be big or little endian depending upon the target. */
#define __IEEE_BIG_ENDIAN
#ifdef __ARMEL__
#define __IEEE_BYTES_LITTLE_ENDIAN
#endif
#endif
This seems to be at odds with what gcc/config/arm.h says:
#define CPP_ENDIAN_SPEC "\
%{mbig-endian: \
%{mlittle-endian: \
%e-mbig-endian and -mlittle-endian may not be used together} \
-D__ARMEB__ %{mwords-little-endian:-D__ARMWEL__} %{mthumb:-D__THUMBEB__}}\
%{mlittle-endian:-D__ARMEL__ %{mthumb:-D__THUMBEL__}} \
%{!mlittle-endian:%{!mbig-endian:%(cpp_endian_default)}} \
"
/* Default is little endian. */
#define CPP_ENDIAN_DEFAULT_SPEC "-D__ARMEL__ %{mthumb:-D__THUMBEL__}"
So... should ieeefp.h say something like this instead?
#if defined(__arm__) || defined(__thumb__)
#ifdef __ARMEL__
#define __IEEE_LITTLE_ENDIAN
#define __IEEE_BYTES_LITTLE_ENDIAN
#else
#ifdef __ARMEB__
#ifdef __ARMWEL__
#define __IEEE_LITTLE_ENDIAN
#else
#define __IEEE_BIG_ENDIAN
#endif
This doesn't look right either. In any case, the original
definition definitely look wrong.
AG
More information about the Newlib
mailing list