• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * This file has no copyright assigned and is placed in the Public Domain.
3  * This file is part of the mingw-w64 runtime package.
4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5  */
6 #include <math.h>
7 int
__isnanf(float _x)8 __isnanf (float _x)
9 {
10 #if defined(__x86_64__) || defined(_AMD64_) || defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_)
11     __mingw_flt_type_t hlp;
12     int i;
13 
14     hlp.x = _x;
15     i = hlp.val & 0x7fffffff;
16     i = 0x7f800000 - i;
17     return (int) (((unsigned int) i) >> 31);
18 #elif defined(__i386__) || defined(_X86_)
19   unsigned short _sw;
20   __asm__ __volatile__ ("fxam;"
21 	   "fstsw %%ax": "=a" (_sw) : "t" (_x) );
22   return (_sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
23     == FP_NAN;
24 #endif
25 }
26 
27 int __attribute__ ((alias ("__isnanf"))) isnanf (float);
28