From 7307a6a3cb94b0fd2c801e0ed15e243cbcc469d8 Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Sat, 7 Nov 2015 21:30:56 +0200 Subject: [PATCH] Revert "win32/include/math.h: remoing a "t" modifier usage" This reverts commit 45bc50596874ec7cb26aac3dca3339ba25086436. The new asm code did not work as expected. Coordinated with seiko. --- win32/include/math.h | 41 ++++++++++------------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/win32/include/math.h b/win32/include/math.h index cfcfd9a..251d3f7 100644 --- a/win32/include/math.h +++ b/win32/include/math.h @@ -316,10 +316,7 @@ extern "C" { __CRT_INLINE int __cdecl __fpclassifyl (long double x){ unsigned short sw; - __asm__ ( - "fldt %1 \n" - "fxam \n" - "fstsw %0 \n" : "=a" (sw): "m" (x)); + __asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x)); return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); } @@ -340,11 +337,8 @@ extern "C" { __CRT_INLINE int __cdecl __isnan (double _x) { unsigned short sw; - __asm__ ( - "fldl %1 \n" - "fxam \n" - "fstsw %0 \n" : "=a" (sw) : "m" (_x)); - + __asm__ ("fxam;" + "fstsw %%ax": "=a" (sw) : "t" (_x)); return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) == FP_NAN; } @@ -352,11 +346,8 @@ extern "C" { __CRT_INLINE int __cdecl __isnanf (float _x) { unsigned short sw; - __asm__ ( - "flds %1 \n" - "fxam \n" - "fstsw %0 \n" : "=a" (sw) : "m" (_x)); - + __asm__ ("fxam;" + "fstsw %%ax": "=a" (sw) : "t" (_x)); return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) == FP_NAN; } @@ -364,11 +355,8 @@ extern "C" { __CRT_INLINE int __cdecl __isnanl (long double _x) { unsigned short sw; - __asm__ ( - "fldt %1 \n" - "fxam \n" - "fstsw %0 \n" : "=a" (sw) : "m" (_x)); - + __asm__ ("fxam;" + "fstsw %%ax": "=a" (sw) : "t" (_x)); return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) == FP_NAN; } @@ -384,28 +372,19 @@ extern "C" { /* 7.12.3.6 The signbit macro */ __CRT_INLINE int __cdecl __signbit (double x) { unsigned short stw; - __asm__ ( - "fldl %1 \n" - "fxam \n" - "fstsw %0 \n" : "=a" (stw) : "m" (x)); + __asm__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); return stw & 0x0200; } __CRT_INLINE int __cdecl __signbitf (float x) { unsigned short stw; - __asm__ ( - "flds %1 \n" - "fxam \n" - "fstsw %0 \n" : "=a" (stw) : "m" (x)); + __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); return stw & 0x0200; } __CRT_INLINE int __cdecl __signbitl (long double x) { unsigned short stw; - __asm__ ( - "fldt %1 \n" - "fxam \n" - "fstsw %0 \n" : "=a" (stw) : "m" (x)); + __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); return stw & 0x0200; }