diff options
Diffstat (limited to 'sysdeps/ieee754/ldbl-96/s_fmal.c')
-rw-r--r-- | sysdeps/ieee754/ldbl-96/s_fmal.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sysdeps/ieee754/ldbl-96/s_fmal.c b/sysdeps/ieee754/ldbl-96/s_fmal.c index eec5a02e0b..f1467fda3d 100644 --- a/sysdeps/ieee754/ldbl-96/s_fmal.c +++ b/sysdeps/ieee754/ldbl-96/s_fmal.c @@ -1,5 +1,5 @@ /* Compute x * y + z as ternary operation. - Copyright (C) 2010-2015 Free Software Foundation, Inc. + Copyright (C) 2010-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2010. @@ -68,7 +68,7 @@ __fmal (long double x, long double y, long double z) if (u.ieee.exponent + v.ieee.exponent > 0x7fff + IEEE854_LONG_DOUBLE_BIAS) return x * y; - /* If x * y is less than 1/4 of LDBL_DENORM_MIN, neither the + /* If x * y is less than 1/4 of LDBL_TRUE_MIN, neither the result nor whether there is underflow depends on its exact value, only on its sign. */ if (u.ieee.exponent + v.ieee.exponent @@ -92,8 +92,8 @@ __fmal (long double x, long double y, long double z) && w.ieee.mantissa1 == 0 && w.ieee.mantissa0 == 0x80000000))) { - volatile long double force_underflow = x * y; - (void) force_underflow; + long double force_underflow = x * y; + math_force_eval (force_underflow); } return v.d * 0x1p-65L; } @@ -119,7 +119,7 @@ __fmal (long double x, long double y, long double z) very small, adjust them up to avoid spurious underflows, rather than down. */ if (u.ieee.exponent + v.ieee.exponent - <= IEEE854_LONG_DOUBLE_BIAS + LDBL_MANT_DIG) + <= IEEE854_LONG_DOUBLE_BIAS + 2 * LDBL_MANT_DIG) { if (u.ieee.exponent > v.ieee.exponent) u.ieee.exponent += 2 * LDBL_MANT_DIG + 2; @@ -177,7 +177,10 @@ __fmal (long double x, long double y, long double z) /* Ensure correct sign of exact 0 + 0. */ if (__glibc_unlikely ((x == 0 || y == 0) && z == 0)) - return x * y + z; + { + x = math_opt_barrier (x); + return x * y + z; + } fenv_t env; feholdexcept (&env); |