From 45bc50596874ec7cb26aac3dca3339ba25086436 Mon Sep 17 00:00:00 2001 From: seyko Date: Thu, 5 Nov 2015 14:27:41 +0300 Subject: [PATCH] win32/include/math.h: remoing a "t" modifier usage replaced by loading a float argument from memory and using the "m" modifier --- win32/include/math.h | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/win32/include/math.h b/win32/include/math.h index 251d3f7c..cfcfd9a7 100644 --- a/win32/include/math.h +++ b/win32/include/math.h @@ -316,7 +316,10 @@ extern "C" { __CRT_INLINE int __cdecl __fpclassifyl (long double x){ unsigned short sw; - __asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x)); + __asm__ ( + "fldt %1 \n" + "fxam \n" + "fstsw %0 \n" : "=a" (sw): "m" (x)); return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); } @@ -337,8 +340,11 @@ extern "C" { __CRT_INLINE int __cdecl __isnan (double _x) { unsigned short sw; - __asm__ ("fxam;" - "fstsw %%ax": "=a" (sw) : "t" (_x)); + __asm__ ( + "fldl %1 \n" + "fxam \n" + "fstsw %0 \n" : "=a" (sw) : "m" (_x)); + return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) == FP_NAN; } @@ -346,8 +352,11 @@ extern "C" { __CRT_INLINE int __cdecl __isnanf (float _x) { unsigned short sw; - __asm__ ("fxam;" - "fstsw %%ax": "=a" (sw) : "t" (_x)); + __asm__ ( + "flds %1 \n" + "fxam \n" + "fstsw %0 \n" : "=a" (sw) : "m" (_x)); + return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) == FP_NAN; } @@ -355,8 +364,11 @@ extern "C" { __CRT_INLINE int __cdecl __isnanl (long double _x) { unsigned short sw; - __asm__ ("fxam;" - "fstsw %%ax": "=a" (sw) : "t" (_x)); + __asm__ ( + "fldt %1 \n" + "fxam \n" + "fstsw %0 \n" : "=a" (sw) : "m" (_x)); + return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) == FP_NAN; } @@ -372,19 +384,28 @@ extern "C" { /* 7.12.3.6 The signbit macro */ __CRT_INLINE int __cdecl __signbit (double x) { unsigned short stw; - __asm__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); + __asm__ ( + "fldl %1 \n" + "fxam \n" + "fstsw %0 \n" : "=a" (stw) : "m" (x)); return stw & 0x0200; } __CRT_INLINE int __cdecl __signbitf (float x) { unsigned short stw; - __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); + __asm__ ( + "flds %1 \n" + "fxam \n" + "fstsw %0 \n" : "=a" (stw) : "m" (x)); return stw & 0x0200; } __CRT_INLINE int __cdecl __signbitl (long double x) { unsigned short stw; - __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); + __asm__ ( + "fldt %1 \n" + "fxam \n" + "fstsw %0 \n" : "=a" (stw) : "m" (x)); return stw & 0x0200; }