diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | include/math.h | 23 | ||||
-rw-r--r-- | sysdeps/generic/math_private.h | 23 |
3 files changed, 31 insertions, 23 deletions
@@ -1,3 +1,11 @@ +2018-09-05 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/generic/math_private.h + [__HAVE_DISTINCT_FLOAT128 && !__GNUC_PREREQ (7, 0)] (__isinff128): + Move this inline function .... + [__HAVE_DISTINCT_FLOAT128] (fabsf128): And this one .... + * include/math.h [!_ISOMAC]: To here.... + 2018-09-04 Joseph Myers <joseph@codesourcery.com> * sysdeps/generic/fenv_private.h [FE_ALL_EXCEPT == 0]: Move this 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 diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h index 220367b9de..c79b65fa6e 100644 --- a/sysdeps/generic/math_private.h +++ b/sysdeps/generic/math_private.h @@ -222,29 +222,6 @@ do { \ # undef _Mdouble_ #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 - /* Prototypes for functions of the IBM Accurate Mathematical Library. */ |