diff options
author | Joseph Myers <joseph@codesourcery.com> | 2012-11-03 19:48:53 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2012-11-03 19:48:53 +0000 |
commit | 5b5b04d6282df0364424c6f2c0462e5c1a4394b0 (patch) | |
tree | bef8cb91fffbf78e56f18479234abb47ce3054b2 /sysdeps/sparc | |
parent | fbeafedeea37e0af1984a6511018d159f5ceed6a (diff) | |
download | glibc-5b5b04d6282df0364424c6f2c0462e5c1a4394b0.tar.gz glibc-5b5b04d6282df0364424c6f2c0462e5c1a4394b0.tar.xz glibc-5b5b04d6282df0364424c6f2c0462e5c1a4394b0.zip |
Make fma use of Dekker and Knuth algorithms use round-to-nearest (bug 14796).
Diffstat (limited to 'sysdeps/sparc')
-rw-r--r-- | sysdeps/sparc/fpu/fclrexcpt.c | 3 | ||||
-rw-r--r-- | sysdeps/sparc/fpu/fenv_private.h | 12 |
2 files changed, 14 insertions, 1 deletions
diff --git a/sysdeps/sparc/fpu/fclrexcpt.c b/sysdeps/sparc/fpu/fclrexcpt.c index 82b6ac4e2e..50ec4f4ff3 100644 --- a/sysdeps/sparc/fpu/fclrexcpt.c +++ b/sysdeps/sparc/fpu/fclrexcpt.c @@ -1,5 +1,5 @@ /* Clear given exceptions in current floating-point environment. - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -39,4 +39,5 @@ strong_alias (__feclearexcept, __old_feclearexcept) compat_symbol (libm, __old_feclearexcept, feclearexcept, GLIBC_2_1); #endif +libm_hidden_ver (__feclearexcept, feclearexcept) versioned_symbol (libm, __feclearexcept, feclearexcept, GLIBC_2_2); diff --git a/sysdeps/sparc/fpu/fenv_private.h b/sysdeps/sparc/fpu/fenv_private.h index a6e8e95a55..8690879ddc 100644 --- a/sysdeps/sparc/fpu/fenv_private.h +++ b/sysdeps/sparc/fpu/fenv_private.h @@ -14,6 +14,15 @@ libc_feholdexcept (fenv_t *e) } static __always_inline void +libc_fesetround (int r) +{ + fenv_t etmp; + __fenv_stfsr(etmp); + etmp = (etmp & ~__FE_ROUND_MASK) | (r); + __fenv_ldfsr(etmp); +} + +static __always_inline void libc_feholdexcept_setround (fenv_t *e, int r) { fenv_t etmp; @@ -79,6 +88,7 @@ libc_feresetround (fenv_t *e) } #define libc_feholdexceptf libc_feholdexcept +#define libc_fesetroundf libc_fesetround #define libc_feholdexcept_setroundf libc_feholdexcept_setround #define libc_fetestexceptf libc_fetestexcept #define libc_fesetenvf libc_fesetenv @@ -87,6 +97,7 @@ libc_feresetround (fenv_t *e) #define libc_feholdsetroundf libc_feholdsetround #define libc_feresetroundf libc_feresetround #define libc_feholdexcept libc_feholdexcept +#define libc_fesetround libc_fesetround #define libc_feholdexcept_setround libc_feholdexcept_setround #define libc_fetestexcept libc_fetestexcept #define libc_fesetenv libc_fesetenv @@ -95,6 +106,7 @@ libc_feresetround (fenv_t *e) #define libc_feholdsetround libc_feholdsetround #define libc_feresetround libc_feresetround #define libc_feholdexceptl libc_feholdexcept +#define libc_fesetroundl libc_fesetround #define libc_feholdexcept_setroundl libc_feholdexcept_setround #define libc_fetestexceptl libc_fetestexcept #define libc_fesetenvl libc_fesetenv |