summaryrefslogtreecommitdiffstats
path: root/winsup/mingw/mingwex/fegetenv.c
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/mingw/mingwex/fegetenv.c')
-rw-r--r--winsup/mingw/mingwex/fegetenv.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/winsup/mingw/mingwex/fegetenv.c b/winsup/mingw/mingwex/fegetenv.c
index 930105673..0c5d591e7 100644
--- a/winsup/mingw/mingwex/fegetenv.c
+++ b/winsup/mingw/mingwex/fegetenv.c
@@ -1,4 +1,5 @@
#include <fenv.h>
+#include "cpu_features.h"
/* 7.6.4.1
The fegetenv function stores the current floating-point environment
@@ -10,5 +11,10 @@ int fegetenv (fenv_t * envp)
/* fnstenv sets control word to non-stop for all exceptions, so we
need to reload our env to restore the original mask. */
__asm__ ("fldenv %0" : : "m" (*envp));
+
+ /* And the SSE environment. */
+ if (__HAS_SSE)
+ __asm__ ("stmxcsr %0" : "=m" (envp->__mxcsr));
+
return 0;
}