From f46ef017cd6bf47c69c122e206ef0f4872f566a2 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Wed, 4 Aug 2021 18:04:48 +0200 Subject: [PATCH] msvcrt: Don't clear x87 status word x86_64 _clearfp. Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/msvcrt/math.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index ce85cb0da43..d45327b8f1f 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -5315,7 +5315,7 @@ unsigned int CDECL _statusfp(void) unsigned int CDECL _clearfp(void) { unsigned int flags = 0; -#if (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__)) +#if (defined(__GNUC__) || defined(__clang__)) && defined(__i386__) unsigned long fpword; __asm__ __volatile__( "fnstsw %0; fnclex" : "=m" (fpword) ); @@ -5333,6 +5333,8 @@ unsigned int CDECL _clearfp(void) _setfp_sse(NULL, 0, &sse_sw, _MCW_EM); flags |= sse_sw; } +#elif defined(__x86_64__) + _setfp_sse(NULL, 0, &flags, _MCW_EM); #elif defined(__aarch64__) ULONG_PTR fpsr;