summaryrefslogtreecommitdiffstats
path: root/winsup/mingw/mingwex/signbit.c
blob: 7f86c86a3083090f28007b329fb8cc4e77e56720 (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;
}

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