diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2006-07-03 14:32:58 +0400 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2006-07-03 14:32:58 +0400 |
commit | f34428eb356a001928e1786d51cbfe216ebeef83 (patch) | |
tree | d6319e46a0cc4bdaae18f49f4a4ad821677f895e /winsup/mingw/mingwex/fegetround.c | |
parent | 69d5f3329f4869d6d0e20f610926934fc0044dce (diff) |
Support SSE float environment in fenv.h functions.
* cpu_features.c: New file.
* cpu_features.h: New file.
* crt1.c: Include "cpu_features.h".
(__mingw_CRTStartup): Call cpu_features_init().
* Makefile.in (MING_OBJS): Add cpu_features.c.
(SRCDIST_FILES): Add cpu_features.c, cpu_features.h.
* include/fenv,h ( fenv_t;): Append __mxcsr field.
(__MXCSR_EXCEPT_FLAG_SHIFT): New define.
(__MXCSR_EXCEPT_MASK_SHIFT): New define.
(__MXCSR_ROUND_FLAG_SHIFT): New define.
* mingwex/feclearexcept.c: Include "cpu_features.h".
Handle SSE environment.
* mingwex/fegetenv.c: Likewise.
* mingwex/feholdexcept.c: Likewise.
* mingwex/fesetenv.c: Likewise.
* mingwex/fesetexceptflag.c: Likewise.
* mingwex/fesetround.c: Likewise.
* mingwex/fetestexcept.c: Likewise.
* mingwex/feupdateenv.c: Likewise.
* mingwex/fegetround.c: Add comment.
Diffstat (limited to 'winsup/mingw/mingwex/fegetround.c')
-rw-r--r-- | winsup/mingw/mingwex/fegetround.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/winsup/mingw/mingwex/fegetround.c b/winsup/mingw/mingwex/fegetround.c index 076b1068c..01d42849f 100644 --- a/winsup/mingw/mingwex/fegetround.c +++ b/winsup/mingw/mingwex/fegetround.c @@ -1,4 +1,5 @@ #include <fenv.h> +#include "cpu_features.h" /* 7.6.3.1 The fegetround function returns the value of the rounding direction @@ -9,6 +10,10 @@ fegetround (void) { unsigned short _cw; __asm__ ("fnstcw %0;" : "=m" (_cw)); + + /* If the MXCSR flag is different, there is no way to indicate, so just + report the FPU flag. */ return _cw & (FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO); + } |