- 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.
This commit is contained in:
das 2005-03-07 04:55:40 +00:00
parent 5bfaaf0464
commit 4d2ad621bf

View File

@ -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