8559dd92d0
consistent with GCC's __builtin_signbit. * mingwex/math/signbitf.c (__signbitf): Likewise. * mingwex/math/signbitf.c (__signbitl): Likewise. * include/math.h (__signbit, __signbitf, __signbitl): Likewise for inlines.
14 lines
256 B
C
14 lines
256 B
C
#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);
|
|
|