diff options
author | das <das@FreeBSD.org> | 2005-03-07 04:55:40 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2005-03-07 04:55:40 +0000 |
commit | 4d2ad621bf42c8dfb26c6371162292b6d9077822 (patch) | |
tree | 92e8fd0a8fbcac5092e4823a6de21db940423701 | |
parent | 5bfaaf046488af0dd3a30704b1de957d8e998484 (diff) | |
download | FreeBSD-src-4d2ad621bf42c8dfb26c6371162292b6d9077822.zip FreeBSD-src-4d2ad621bf42c8dfb26c6371162292b6d9077822.tar.gz |
- 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.
-rw-r--r-- | lib/libc/ia64/_fpmath.h | 12 |
1 files changed, 10 insertions, 2 deletions
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 |