diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/math.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/math.h b/include/math.h index e21d34b868..9ab7aa4403 100644 --- a/include/math.h +++ b/include/math.h @@ -54,6 +54,29 @@ libm_hidden_proto (__expf128) libm_hidden_proto (__expm1f128) # endif +# if __HAVE_DISTINCT_FLOAT128 + +/* __builtin_isinf_sign is broken in GCC < 7 for float128. */ +# if ! __GNUC_PREREQ (7, 0) +# include <ieee754_float128.h> +extern inline int +__isinff128 (_Float128 x) +{ + int64_t hx, lx; + GET_FLOAT128_WORDS64 (hx, lx, x); + lx |= (hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL; + lx |= -lx; + return ~(lx >> 63) & (hx >> 62); +} +# endif + +extern inline _Float128 +fabsf128 (_Float128 x) +{ + return __builtin_fabsf128 (x); +} +# endif + # if !(defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0) # ifndef NO_MATH_REDIRECT /* Declare sqrt for use within GLIBC. Compilers typically inline sqrt as a |