diff --git a/ChangeLog b/ChangeLog index 5eb0d43..4a3e672 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2014-07-03 Richard Henderson + * sysdeps/ieee754/dbl-64/s_fma.c (__fma): Use math_force_eval before + feclearexcept; use math_opt_barrier instead of open-coded asm; fix + typo in exact zero test. + * sysdeps/alpha/fpu/s_nearbyintf.c: Remove file. * sysdeps/alpha/fpu/s_nearbyint.c (__nearbyint): Remove; include sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c. diff --git a/sysdeps/ieee754/dbl-64/s_fma.c b/sysdeps/ieee754/dbl-64/s_fma.c index 389acd4..3bd7f71 100644 --- a/sysdeps/ieee754/dbl-64/s_fma.c +++ b/sysdeps/ieee754/dbl-64/s_fma.c @@ -198,16 +198,16 @@ __fma (double x, double y, double z) t1 = m1 - t1; t2 = z - t2; double a2 = t1 + t2; + /* Ensure the addition is not scheduled after feclearexcept call. */ + math_force_eval (a2); feclearexcept (FE_INEXACT); - /* If the result is an exact zero, ensure it has the correct - sign. */ - if (a1 == 0 && m2 == 0) + /* If the result is an exact zero, ensure it has the correct sign. */ + if (a1 == 0 && a2 == 0) { libc_feupdateenv (&env); - /* Ensure that round-to-nearest value of z + m1 is not - reused. */ - asm volatile ("" : "=m" (z) : "m" (z)); + /* Ensure that round-to-nearest value of z + m1 is not reused. */ + z = math_opt_barrier (z); return z + m1; }