History

win32/include/math.h: remoing a "t" modifier usage

replaced by loading a float argument from memory and using the "m" modifier

seyko committed 11 years ago

Commit 45bc5051 parent f7dd3d41 file · +31 −10Browse files

Unified · Split

win32/include/math.h+31−10
@@ -316,7 +316,10 @@ extern "C" { · 315 unmodified lines
316316
317317 __CRT_INLINE int __cdecl __fpclassifyl (long double x){
318318 unsigned short sw;
319− __asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x));
319+ __asm__ (
320+ "fldt %1 \n"
321+ "fxam \n"
322+ "fstsw %0 \n" : "=a" (sw): "m" (x));
320323 return sw & (FP_NAN | FP_NORMAL | FP_ZERO );
321324 }
322325
@@ -337,8 +340,11 @@ extern "C" { · 14 unmodified lines
337340 __CRT_INLINE int __cdecl __isnan (double _x)
338341 {
339342 unsigned short sw;
340− __asm__ ("fxam;"
341− "fstsw %%ax": "=a" (sw) : "t" (_x));
343+ __asm__ (
344+ "fldl %1 \n"
345+ "fxam \n"
346+ "fstsw %0 \n" : "=a" (sw) : "m" (_x));
347+
342348 return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
343349 == FP_NAN;
344350 }
@@ -346,8 +352,11 @@ extern "C" { · 1 unmodified line
346352 __CRT_INLINE int __cdecl __isnanf (float _x)
347353 {
348354 unsigned short sw;
349− __asm__ ("fxam;"
350− "fstsw %%ax": "=a" (sw) : "t" (_x));
355+ __asm__ (
356+ "flds %1 \n"
357+ "fxam \n"
358+ "fstsw %0 \n" : "=a" (sw) : "m" (_x));
359+
351360 return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
352361 == FP_NAN;
353362 }
@@ -355,8 +364,11 @@ extern "C" { · 1 unmodified line
355364 __CRT_INLINE int __cdecl __isnanl (long double _x)
356365 {
357366 unsigned short sw;
358− __asm__ ("fxam;"
359− "fstsw %%ax": "=a" (sw) : "t" (_x));
367+ __asm__ (
368+ "fldt %1 \n"
369+ "fxam \n"
370+ "fstsw %0 \n" : "=a" (sw) : "m" (_x));
371+
360372 return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
361373 == FP_NAN;
362374 }
@@ -372,19 +384,28 @@ extern "C" { · 9 unmodified lines
372384 /* 7.12.3.6 The signbit macro */
373385 __CRT_INLINE int __cdecl __signbit (double x) {
374386 unsigned short stw;
375− __asm__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
387+ __asm__ (
388+ "fldl %1 \n"
389+ "fxam \n"
390+ "fstsw %0 \n" : "=a" (stw) : "m" (x));
376391 return stw & 0x0200;
377392 }
378393
379394 __CRT_INLINE int __cdecl __signbitf (float x) {
380395 unsigned short stw;
381− __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
396+ __asm__ (
397+ "flds %1 \n"
398+ "fxam \n"
399+ "fstsw %0 \n" : "=a" (stw) : "m" (x));
382400 return stw & 0x0200;
383401 }
384402
385403 __CRT_INLINE int __cdecl __signbitl (long double x) {
386404 unsigned short stw;
387− __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
405+ __asm__ (
406+ "fldt %1 \n"
407+ "fxam \n"
408+ "fstsw %0 \n" : "=a" (stw) : "m" (x));
388409 return stw & 0x0200;
389410 }
390411

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t