diff options
author | Richard Henderson <rth@twiddle.net> | 2012-03-18 15:58:00 -0700 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2012-03-19 06:51:39 -0700 |
commit | bd37f2ee314147c69a39817d590149cf1181ef47 (patch) | |
tree | 453f01145f7e526a6f5fdd5f3a6c1dde93f59ce8 /sysdeps/i386/fpu/math_private.h | |
parent | d0adc9223031b606c3c7781b4ec41462796ab313 (diff) | |
download | glibc-bd37f2ee314147c69a39817d590149cf1181ef47.tar.gz glibc-bd37f2ee314147c69a39817d590149cf1181ef47.tar.xz glibc-bd37f2ee314147c69a39817d590149cf1181ef47.zip |
Optimize private 387 fenv access; share code between i386 and x86_64.
Diffstat (limited to 'sysdeps/i386/fpu/math_private.h')
-rw-r--r-- | sysdeps/i386/fpu/math_private.h | 46 |
1 files changed, 2 insertions, 44 deletions
diff --git a/sysdeps/i386/fpu/math_private.h b/sysdeps/i386/fpu/math_private.h index 9236448978..541a7f8d93 100644 --- a/sysdeps/i386/fpu/math_private.h +++ b/sysdeps/i386/fpu/math_private.h @@ -1,48 +1,6 @@ #ifndef _MATH_PRIVATE_H -#include <fenv.h> -#include <fpu_control.h> - -#define math_opt_barrier(x) \ -({ __typeof (x) __x; \ - __asm ("" : "=t" (__x) : "0" (x)); \ - __x; }) -#define math_force_eval(x) \ -do \ - { \ - __typeof (x) __x = (x); \ - if (sizeof (x) <= sizeof (double)) \ - __asm __volatile ("" : : "m" (__x)); \ - else \ - __asm __volatile ("" : : "f" (__x)); \ - } \ -while (0) - -static __always_inline void -libc_feholdexcept_setround_53bit (fenv_t *e, int r) -{ - feholdexcept (e); - fesetround (r); - - fpu_control_t cw; - _FPU_GETCW (cw); - cw &= ~(fpu_control_t) _FPU_EXTENDED; - cw |= _FPU_DOUBLE; - _FPU_SETCW (cw); -} -#define libc_feholdexcept_setround_53bit libc_feholdexcept_setround_53bit - -static __always_inline void -libc_feupdateenv_53bit (fenv_t *e) -{ - feupdateenv (e); - - /* Unfortunately, feupdateenv fails to affect the rounding precision. - We can get that back by restoring the exact control word we saved. */ - _FPU_SETCW (e->__control_word); -} -#define libc_feupdateenv_53bit libc_feupdateenv_53bit - +#include "fenv_private.h" #include_next <math_private.h> -#endif /* _MATH_PRIVATE_H */ +#endif |