summaryrefslogtreecommitdiffstats
path: root/winsup/mingw/mingwex/math/signbit.c
blob: 997ddf86b48bb4a044ba8063181470b59959bcf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#define __FP_SIGNBIT  0x0200

int __signbit (double x) {
  unsigned short sw;
  __asm__ ("fxam; fstsw %%ax;"
	   : "=a" (sw)
	   : "t" (x) );
  return (sw & __FP_SIGNBIT) != 0;
}

#undef signbit
int __attribute__ ((alias ("__signbit"))) signbit (double);