aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2015-11-06 04:14:10 +0200
committerAvi Halachmi (:avih) <avihpit@yahoo.com>2015-11-07 22:17:21 +0200
commit6e261a107cf92a62817e81c78b52470d81218e4a (patch)
treeab0e90d325ca0a4410cf9f439a2b50ae84607e53
parent7307a6a3cb94b0fd2c801e0ed15e243cbcc469d8 (diff)
downloadtinycc-6e261a107cf92a62817e81c78b52470d81218e4a.tar.gz
tinycc-6e261a107cf92a62817e81c78b52470d81218e4a.tar.bz2
win: math.h: isnan: use macro, similar to others (still broken)
It was broken due to tcc not able to compile asm with 't' constraint, and it's still broken because fpclassify on which it now depends has the same issue. Next commit will fix this.
-rw-r--r--win32/include/math.h33
1 files changed, 1 insertions, 32 deletions
diff --git a/win32/include/math.h b/win32/include/math.h
index 251d3f7..d923f17 100644
--- a/win32/include/math.h
+++ b/win32/include/math.h
@@ -333,38 +333,7 @@ extern "C" {
/* 7.12.3.4 */
/* We don't need to worry about trucation here:
A NaN stays a NaN. */
-
- __CRT_INLINE int __cdecl __isnan (double _x)
- {
- unsigned short sw;
- __asm__ ("fxam;"
- "fstsw %%ax": "=a" (sw) : "t" (_x));
- return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
- == FP_NAN;
- }
-
- __CRT_INLINE int __cdecl __isnanf (float _x)
- {
- unsigned short sw;
- __asm__ ("fxam;"
- "fstsw %%ax": "=a" (sw) : "t" (_x));
- return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
- == FP_NAN;
- }
-
- __CRT_INLINE int __cdecl __isnanl (long double _x)
- {
- unsigned short sw;
- __asm__ ("fxam;"
- "fstsw %%ax": "=a" (sw) : "t" (_x));
- return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
- == FP_NAN;
- }
-
-
-#define isnan(x) (sizeof (x) == sizeof (float) ? __isnanf (x) \
- : sizeof (x) == sizeof (double) ? __isnan (x) \
- : __isnanl (x))
+#define isnan(x) (fpclassify(x) == FP_NAN)
/* 7.12.3.5 */
#define isnormal(x) (fpclassify(x) == FP_NORMAL)