diff -uNrp glibc.old/sysdeps/arm/bits/endian.h glibc.new/sysdeps/arm/bits/endian.h --- glibc.old/sysdeps/arm/bits/endian.h 1999-04-12 11:59:13.000000000 -0400 +++ glibc.new/sysdeps/arm/bits/endian.h 2004-02-12 09:15:13.000000000 -0500 @@ -9,4 +9,9 @@ #else #define __BYTE_ORDER __LITTLE_ENDIAN #endif + +#ifdef __VFP_FP__ +#define __FLOAT_WORD_ORDER __BYTE_ORDER +#else #define __FLOAT_WORD_ORDER __BIG_ENDIAN +#endif diff -uNrp glibc.old/sysdeps/arm/gmp-mparam.h glibc.new/sysdeps/arm/gmp-mparam.h --- glibc.old/sysdeps/arm/gmp-mparam.h 2001-07-07 15:21:19.000000000 -0400 +++ glibc.new/sysdeps/arm/gmp-mparam.h 2004-02-12 09:15:13.000000000 -0500 @@ -26,5 +26,13 @@ MA 02111-1307, USA. */ #define BITS_PER_SHORTINT 16 #define BITS_PER_CHAR 8 -#define IEEE_DOUBLE_BIG_ENDIAN 0 -#define IEEE_DOUBLE_MIXED_ENDIAN 1 +#if defined(__ARMEB__) +# define IEEE_DOUBLE_MIXED_ENDIAN 0 +# define IEEE_DOUBLE_BIG_ENDIAN 1 +#elif defined(__VFP_FP__) +# define IEEE_DOUBLE_MIXED_ENDIAN 0 +# define IEEE_DOUBLE_BIG_ENDIAN 0 +#else +# define IEEE_DOUBLE_BIG_ENDIAN 0 +# define IEEE_DOUBLE_MIXED_ENDIAN 1 +#endif diff -uNrp glibc.old/sysdeps/arm/ieee754.h glibc.new/sysdeps/arm/ieee754.h --- glibc.old/sysdeps/arm/ieee754.h 2001-07-07 15:21:19.000000000 -0400 +++ glibc.new/sysdeps/arm/ieee754.h 2001-07-07 15:21:24.000000000 -0400 @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1995, 1996, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1995, 1996, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -32,18 +32,33 @@ union ieee754_float /* This is the IEEE 754 single-precision format. */ struct { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:8; + unsigned int mantissa:23; +#endif /* Big endian. */ +#if __BYTE_ORDER == __LITTLE_ENDIAN unsigned int mantissa:23; unsigned int exponent:8; unsigned int negative:1; +#endif /* Little endian. */ } ieee; /* This format makes it easier to see if a NaN is a signalling NaN. */ struct { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:8; + unsigned int quiet_nan:1; + unsigned int mantissa:22; +#endif /* Big endian. */ +#if __BYTE_ORDER == __LITTLE_ENDIAN unsigned int mantissa:22; unsigned int quiet_nan:1; unsigned int exponent:8; unsigned int negative:1; +#endif /* Little endian. */ } ieee_nan; }; @@ -57,30 +72,61 @@ union ieee754_double /* This is the IEEE 754 double-precision format. */ struct { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:11; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:20; + unsigned int mantissa1:32; +#endif /* Big endian. */ +#if __BYTE_ORDER == __LITTLE_ENDIAN +# if __FLOAT_WORD_ORDER == BIG_ENDIAN unsigned int mantissa0:20; unsigned int exponent:11; unsigned int negative:1; unsigned int mantissa1:32; +# else + /* Together these comprise the mantissa. */ + unsigned int mantissa1:32; + unsigned int mantissa0:20; + unsigned int exponent:11; + unsigned int negative:1; +# endif +#endif /* Little endian. */ } ieee; /* This format makes it easier to see if a NaN is a signalling NaN. */ struct { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; + unsigned int exponent:11; + unsigned int quiet_nan:1; + /* Together these comprise the mantissa. */ + unsigned int mantissa0:19; + unsigned int mantissa1:32; +#else +# if __FLOAT_WORD_ORDER == BIG_ENDIAN unsigned int mantissa0:19; unsigned int quiet_nan:1; unsigned int exponent:11; unsigned int negative:1; unsigned int mantissa1:32; +# else + /* Together these comprise the mantissa. */ + unsigned int mantissa1:32; + unsigned int mantissa0:19; + unsigned int quiet_nan:1; + unsigned int exponent:11; + unsigned int negative:1; +# endif +#endif } ieee_nan; }; #define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */ -/* The following two structures are correct for `new' floating point systems but - wrong for the old FPPC. The only solution seems to be to avoid their use on - old hardware. */ - union ieee854_long_double { long double d; @@ -88,23 +134,61 @@ union ieee854_long_double /* This is the IEEE 854 double-extended-precision format. */ struct { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; unsigned int exponent:15; unsigned int empty:16; + unsigned int mantissa0:32; + unsigned int mantissa1:32; +#endif +#if __BYTE_ORDER == __LITTLE_ENDIAN +# if __FLOAT_WORD_ORDER == BIG_ENDIAN + unsigned int exponent:15; unsigned int negative:1; + unsigned int empty:16; + unsigned int mantissa0:32; + unsigned int mantissa1:32; +# else unsigned int mantissa1:32; unsigned int mantissa0:32; + unsigned int exponent:15; + unsigned int negative:1; + unsigned int empty:16; +# endif +#endif } ieee; /* This is for NaNs in the IEEE 854 double-extended-precision format. */ struct { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned int negative:1; unsigned int exponent:15; unsigned int empty:16; + unsigned int one:1; + unsigned int quiet_nan:1; + unsigned int mantissa0:30; + unsigned int mantissa1:32; +#endif +#if __BYTE_ORDER == __LITTLE_ENDIAN +# if __FLOAT_WORD_ORDER == BIG_ENDIAN + unsigned int exponent:15; unsigned int negative:1; + unsigned int empty:16; + unsigned int mantissa0:30; + unsigned int quiet_nan:1; + unsigned int one:1; + unsigned int mantissa1:32; +# else unsigned int mantissa1:32; unsigned int mantissa0:30; unsigned int quiet_nan:1; unsigned int one:1; + unsigned int exponent:15; + unsigned int negative:1; + unsigned int empty:16; +# endif +#endif } ieee_nan; };