From c4814b6b3a2b4f264a461a27667a139387968ee1 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Wed, 14 Mar 2012 17:20:10 +0100 Subject: Implement and use libc_feholdexcept_setround_53bit and libc_feupdateenv_53bit so that double arithmetic in s_sin is done in 53 bit (without extend i386 double precision) --- sysdeps/i386/fpu/math_private.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'sysdeps/i386') diff --git a/sysdeps/i386/fpu/math_private.h b/sysdeps/i386/fpu/math_private.h index 5253998a57..d96996fadf 100644 --- a/sysdeps/i386/fpu/math_private.h +++ b/sysdeps/i386/fpu/math_private.h @@ -16,4 +16,33 @@ do \ while (0) #include_next + +# include + +# undef libc_feholdexcept_setround_53bit +# define libc_feholdexcept_setround_53bit(e, r) \ + do \ + { \ + fpu_control_t cw; \ + libc_feholdexcept_setround (e, r); \ + _FPU_GETCW (cw); \ + cw &= ~(fpu_control_t) _FPU_EXTENDED; \ + cw |= _FPU_DOUBLE; \ + _FPU_SETCW (cw); \ + } \ + while (0) + +# undef libc_feupdateenv_53bit +# define libc_feupdateenv_53bit(e) \ + do \ + { \ + fpu_control_t cw; \ + libc_feupdateenv (e); \ + _FPU_GETCW (cw); \ + cw &= ~(fpu_control_t) _FPU_EXTENDED; \ + cw |= _FPU_EXTENDED; \ + _FPU_SETCW (cw); \ + } \ + while (0) + #endif -- cgit v1.2.3