Richard Henderson 4851a949b4 Make inline __isnan, __isinf_ns, __finite generic.
For code generation to stay identical on x86_64, this requires that
we define the fp word manipulation macros before including the
generic header.
2012-03-19 06:47:43 -07:00

36 lines
634 B
C

#ifndef _MATH_PRIVATE_H_
#include_next <math_private.h>
#ifndef __isnan
extern __always_inline int
__isnan (double d)
{
uint64_t di;
EXTRACT_WORDS64 (di, d);
return (di & 0x7fffffffffffffffull) > 0x7ff0000000000000ull;
}
#endif
#ifndef __isinf_ns
extern __always_inline int
__isinf_ns (double d)
{
uint64_t di;
EXTRACT_WORDS64 (di, d);
return (di & 0x7fffffffffffffffull) == 0x7ff0000000000000ull;
}
#endif
#ifndef __finite
extern __always_inline int
__finite (double d)
{
uint64_t di;
EXTRACT_WORDS64 (di, d);
return (di & 0x7fffffffffffffffull) < 0x7ff0000000000000ull;
}
#endif
#endif /* _MATH_PRIVATE_H_ */