so that double arithmetic in s_sin is done in 53 bit (without extend i386 double precision)
#define libc_feholdexcept_setroundl(e, r) \
do { feholdexcept (e); fesetround (r); } while (0)
+#define libc_feholdexcept_setround_53bit(e, r) \
+ libc_feholdexcept_setround (e, r)
+
#define libc_fetestexcept(e) fetestexcept (e)
#define libc_fetestexceptf(e) fetestexcept (e)
#define libc_fetestexceptl(e) fetestexcept (e)
#define libc_feupdateenvf(e) (void) feupdateenv (e)
#define libc_feupdateenvl(e) (void) feupdateenv (e)
+#define libc_feupdateenv_53bit(e) libc_feupdateenv (e)
+
#define __nan(str) \
(__builtin_constant_p (str) && str[0] == '\0' ? NAN : __nan (str))
#define __nanf(str) \
while (0)
#include_next <math_private.h>
+
+# include <fpu_control.h>
+
+# 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
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001, 2009, 2011 Free Software Foundation
+ * Copyright (C) 2001-2012 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
fenv_t env;
double retval = 0;
- libc_feholdexcept_setround (&env, FE_TONEAREST);
+ libc_feholdexcept_setround_53bit (&env, FE_TONEAREST);
u.x = x;
m = u.i[HIGH_HALF];
}
ret:
- libc_feupdateenv (&env);
+ libc_feupdateenv_53bit (&env);
return retval;
}
fenv_t env;
double retval = 0;
- libc_feholdexcept_setround (&env, FE_TONEAREST);
+ libc_feholdexcept_setround_53bit (&env, FE_TONEAREST);
u.x = x;
m = u.i[HIGH_HALF];
}
ret:
- libc_feupdateenv (&env);
+ libc_feupdateenv_53bit (&env);
return retval;
}