From 21f9dd806fe3a9bfd792d7aeb7b28ee6e582742d Mon Sep 17 00:00:00 2001 From: David Schultz Date: Mon, 7 Mar 2005 04:55:40 +0000 Subject: [PATCH] - Define LDBL_NBIT to be a mask indicating the position of the integer bit in a long double. For architectures that don't have such a bit, LDBL_NBIT is 0. This makes it possible to say `mantissa & ~LDBL_NBIT' in places that previously used an #ifdef to select the right expression. The optimizer should dispense with the extra arithmetic when LDBL_NBIT is 0 anyway. - Add an XXX comment for the big endian case. --- lib/libc/ia64/_fpmath.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/libc/ia64/_fpmath.h b/lib/libc/ia64/_fpmath.h index 5ece9109ed0..7f24e768ff2 100644 --- a/lib/libc/ia64/_fpmath.h +++ b/lib/libc/ia64/_fpmath.h @@ -49,9 +49,17 @@ union IEEEl2bits { }; #if _BYTE_ORDER == _LITTLE_ENDIAN -#define mask_nbit_l(u) ((u).bits.manh &= 0x7fffffff) +#define LDBL_NBIT 0x80000000 +#define mask_nbit_l(u) ((u).bits.manh &= ~LDBL_NBIT) #else /* _BIG_ENDIAN */ -#define mask_nbit_l(u) ((u).bits.manh &= 0xffffff7f) +/* + * XXX This doesn't look right. Very few machines have a different + * endianness for integers and floating-point, and in nextafterl() + * we assume that none do. If you have an environment for testing + * this, please let me know. --das + */ +#define LDBL_NBIT 0x80 +#define mask_nbit_l(u) ((u).bits.manh &= ~LDBL_NBIT) #endif #define LDBL_MANH_SIZE 32