From 4d2ad621bf42c8dfb26c6371162292b6d9077822 Mon Sep 17 00:00:00 2001 From: das Date: Mon, 7 Mar 2005 04:55:40 +0000 Subject: - 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(-) (limited to 'lib') diff --git a/lib/libc/ia64/_fpmath.h b/lib/libc/ia64/_fpmath.h index 5ece910..7f24e76 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 -- cgit v1.1