Piotr Caban : msvcrt: Don't set x87 control word in x86_64 fesetenv.

Alexandre Julliard julliard at winehq.org
Wed Jul 21 16:04:30 CDT 2021


Module: wine
Branch: master
Commit: 67c7c40351741ce3ceecddc22eb1e298af170eb2
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=67c7c40351741ce3ceecddc22eb1e298af170eb2

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed Jul 21 13:21:23 2021 +0200

msvcrt: Don't set x87 control word in x86_64 fesetenv.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcrt/math.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c
index 2b7249c5451..922fd7818a5 100644
--- a/dlls/msvcrt/math.c
+++ b/dlls/msvcrt/math.c
@@ -5873,6 +5873,7 @@ int CDECL fesetenv(const fenv_t *env)
 {
 #if (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))
     unsigned int x87_cw, sse_cw, x87_stat, sse_stat;
+#ifdef __i386__
     struct {
         WORD control_word;
         WORD unused1;
@@ -5887,6 +5888,7 @@ int CDECL fesetenv(const fenv_t *env)
         WORD data_segment;
         WORD unused5;
     } fenv;
+#endif
 
     TRACE( "(%p)\n", env );
 
@@ -5900,6 +5902,7 @@ int CDECL fesetenv(const fenv_t *env)
     if (!fenv_decode(env->_Fe_stat, &x87_stat, &sse_stat))
         return 1;
 
+#ifdef __i386__
     __asm__ __volatile__( "fnstenv %0" : "=m" (fenv) );
 
     fenv.control_word &= ~0xc3d;
@@ -5938,6 +5941,7 @@ int CDECL fesetenv(const fenv_t *env)
 
     __asm__ __volatile__( "fldenv %0" : : "m" (fenv) : "st", "st(1)",
             "st(2)", "st(3)", "st(4)", "st(5)", "st(6)", "st(7)" );
+#endif
 
     if (sse2_supported)
     {




More information about the wine-cvs mailing list