mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-10 07:10:06 +00:00
Ensure additions are not scheduled after fetestexcept in fmaf and fmal.
This commit is contained in:
parent
efb734887e
commit
4842e4fe5f
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
||||
2012-06-01 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
* sysdeps/ieee754/dbl-64/s_fmaf.c (__fmaf): Ensure temp + (double)
|
||||
z computation is not scheduled after fetestexcept.
|
||||
* sysdeps/ieee754/ldbl-128/s_fmal.c: Include <math_private.h>.
|
||||
Use math_force_eval instead of asm to ensure calculation scheduled
|
||||
before exception test.
|
||||
* sysdeps/ieee754/ldbl-96/s_fmal.c: Include <math_private.h>.
|
||||
Ensure a1 + u.d computation is not scheduled after fetestexcept.
|
||||
|
||||
2012-06-01 Aurelien Jarno <aurelien@aurel32.net>
|
||||
|
||||
* sysdeps/ieee754/dbl-64/s_fma.c (__fma): Ensure a1 + u.d
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Compute x * y + z as ternary operation.
|
||||
Copyright (C) 2010, 2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2012 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
|
||||
|
||||
@ -40,6 +40,8 @@ __fmaf (float x, float y, float z)
|
||||
|
||||
/* Perform addition with round to odd. */
|
||||
u.d = temp + (double) z;
|
||||
/* Ensure the addition is not scheduled after fetestexcept call. */
|
||||
math_force_eval (u.d);
|
||||
|
||||
/* Reset rounding mode and test for inexact simultaneously. */
|
||||
int j = libc_feupdateenv_test (&env, FE_INEXACT) != 0;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Compute x * y + z as ternary operation.
|
||||
Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2012 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
#include <math.h>
|
||||
#include <fenv.h>
|
||||
#include <ieee754.h>
|
||||
#include <math_private.h>
|
||||
|
||||
/* This implementation uses rounding to odd to avoid problems with
|
||||
double rounding. See a paper by Boldo and Melquiond:
|
||||
@ -175,7 +176,7 @@ __fmal (long double x, long double y, long double z)
|
||||
u.ieee.mantissa3 |= fetestexcept (FE_INEXACT) != 0;
|
||||
v.d = a1 + u.d;
|
||||
/* Ensure the addition is not scheduled after fetestexcept call. */
|
||||
asm volatile ("" : : "m" (v));
|
||||
math_force_eval (v.d);
|
||||
int j = fetestexcept (FE_INEXACT) != 0;
|
||||
feupdateenv (&env);
|
||||
/* Ensure the following computations are performed in default rounding
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Compute x * y + z as ternary operation.
|
||||
Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2012 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
#include <math.h>
|
||||
#include <fenv.h>
|
||||
#include <ieee754.h>
|
||||
#include <math_private.h>
|
||||
|
||||
/* This implementation uses rounding to odd to avoid problems with
|
||||
double rounding. See a paper by Boldo and Melquiond:
|
||||
@ -174,6 +175,8 @@ __fmal (long double x, long double y, long double z)
|
||||
if ((u.ieee.mantissa1 & 1) == 0)
|
||||
u.ieee.mantissa1 |= fetestexcept (FE_INEXACT) != 0;
|
||||
v.d = a1 + u.d;
|
||||
/* Ensure the addition is not scheduled after fetestexcept call. */
|
||||
math_force_eval (v.d);
|
||||
int j = fetestexcept (FE_INEXACT) != 0;
|
||||
feupdateenv (&env);
|
||||
/* Ensure the following computations are performed in default rounding
|
||||
|
Loading…
Reference in New Issue
Block a user