diff options
author | Ulrich Drepper <drepper@gmail.com> | 2011-10-18 15:11:31 -0400 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2011-10-18 15:11:31 -0400 |
commit | d9a8d0abcc976f7ffe319a376ddd3497486e9726 (patch) | |
tree | 8bf41c5c082f4154657e72955711a73dff64dbea /sysdeps/x86_64 | |
parent | 4855e3ddf5061dd8ddcefafc7185f6f70937434b (diff) | |
download | glibc-d9a8d0abcc976f7ffe319a376ddd3497486e9726.zip glibc-d9a8d0abcc976f7ffe319a376ddd3497486e9726.tar.gz glibc-d9a8d0abcc976f7ffe319a376ddd3497486e9726.tar.bz2 |
Use new internal libc_fe* interfaces in more functions
Diffstat (limited to 'sysdeps/x86_64')
-rw-r--r-- | sysdeps/x86_64/fpu/math_private.h | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/sysdeps/x86_64/fpu/math_private.h b/sysdeps/x86_64/fpu/math_private.h index 28bd9ce..de4f121 100644 --- a/sysdeps/x86_64/fpu/math_private.h +++ b/sysdeps/x86_64/fpu/math_private.h @@ -129,7 +129,8 @@ do { \ asm volatile ("stmxcsr %0" : "=m" (*&mxcsr)); \ (mxcsr & 0x6000) >> 3; \ }) -// #define libc_fegetroundf() fegetround () +#undef libc_fegetroundf +#define libc_fegetroundf() libc_fegetround () // #define libc_fegetroundl() fegetround () #undef libc_fesetround @@ -140,7 +141,8 @@ do { \ mxcsr = (mxcsr & ~0x6000) | ((r) << 3); \ asm volatile ("ldmxcsr %0" : : "m" (*&mxcsr)); \ } while (0) -// #define libc_fesetroundf(r) (void) fesetround (r) +#undef libc_fesetroundf +#define libc_fesetroundf(r) libc_fesetround (r) // #define libc_fesetroundl(r) (void) fesetround (r) #undef libc_feholdexcept @@ -152,7 +154,8 @@ do { \ mxcsr = (mxcsr | 0x1f80) & ~0x3f; \ asm volatile ("ldmxcsr %0" : : "m" (*&mxcsr)); \ } while (0) -// #define libc_feholdexceptf(e) (void) feholdexcept (e) +#undef libc_feholdexceptf +#define libc_feholdexceptf(e) libc_feholdexcept (e) // #define libc_feholdexceptl(e) (void) feholdexcept (e) #undef libc_feholdexcept_setround @@ -164,11 +167,33 @@ do { \ mxcsr = ((mxcsr | 0x1f80) & ~0x603f) | ((r) << 3); \ asm volatile ("ldmxcsr %0" : : "m" (*&mxcsr)); \ } while (0) -// #define libc_feholdexcept_setroundf(e, r) ... +#undef libc_feholdexcept_setroundf +#define libc_feholdexcept_setroundf(e, r) libc_feholdexcept_setround (e, r) // #define libc_feholdexcept_setroundl(e, r) ... +#undef libc_fetestexcept +#define libc_fetestexcept(e) \ + ({ unsigned int mxcsr; asm volatile ("stmxcsr %0" : "=m" (*&mxcsr)); \ + mxcsr & (e) & FE_ALL_EXCEPT; }) +#undef libc_fetestexceptf +#define libc_fetestexceptf(e) libc_fetestexcept (e) +// #define libc_fetestexceptl(e) fetestexcept (e) + #undef libc_fesetenv #define libc_fesetenv(e) \ asm volatile ("ldmxcsr %0" : : "m" ((e)->__mxcsr)) -// #define libc_fesetenvf(e) (void) fesetenv (e) +#undef libc_fesetenvf +#define libc_fesetenvf(e) libc_fesetenv (e) // #define libc_fesetenvl(e) (void) fesetenv (e) + +#undef libc_feupdateenv +#define libc_feupdateenv(e) \ + do { \ + unsigned int mxcsr; \ + asm volatile ("stmxcsr %0" : "=m" (*&mxcsr)); \ + asm volatile ("ldmxcsr %0" : : "m" ((e)->__mxcsr)); \ + feraiseexcept (mxcsr & FE_ALL_EXCEPT); \ + } while (0) +#undef libc_feupdateenvf +#define libc_feupdateenvf(e) libc_feupdateenv (e) +// #define libc_feupdateenvl(e) (void) feupdateenv (e) |