* mingwex/math/signbit.c (__signbit): Make return value

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.
This commit is contained in:
Danny Smith 2005-05-03 08:39:19 +00:00
parent 38efa5f128
commit 8559dd92d0
5 changed files with 15 additions and 6 deletions

View File

@ -1,3 +1,12 @@
2005-05-03 Danny Smith <dannysmith@users.sourceforge.net>
* mingwex/math/signbit.c (__signbit): Make return value
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.
2005-05-02 Danny Smith <dannysmith@users.sourceforge.net>
* include/_mingw.h (__MINGW_ATTRIB_NONNULL): Don't define as

View File

@ -373,19 +373,19 @@ __CRT_INLINE int __cdecl __isnanl (long double _x)
__CRT_INLINE int __cdecl __signbit (double x) {
unsigned short stw;
__asm__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
return stw & 0x0200;
return (stw & 0x0200) != 0;
}
__CRT_INLINE int __cdecl __signbitf (float x) {
unsigned short stw;
__asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
return stw & 0x0200;
return (stw & 0x0200) != 0;
}
__CRT_INLINE int __cdecl __signbitl (long double x) {
unsigned short stw;
__asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
return stw & 0x0200;
return (stw & 0x0200) != 0;
}
#define signbit(x) (sizeof (x) == sizeof (float) ? __signbitf (x) \

View File

@ -5,7 +5,7 @@ int __signbit (double x) {
__asm__ ("fxam; fstsw %%ax;"
: "=a" (sw)
: "t" (x) );
return sw & __FP_SIGNBIT;
return (sw & __FP_SIGNBIT) != 0;
}
#undef signbit

View File

@ -5,6 +5,6 @@ int __signbitf (float x) {
__asm__ ("fxam; fstsw %%ax;"
: "=a" (sw)
: "t" (x) );
return sw & __FP_SIGNBIT;
return (sw & __FP_SIGNBIT) != 0;
}
int __attribute__ ((alias ("__signbitf"))) signbitf (float);

View File

@ -5,7 +5,7 @@ int __signbitl (long double x) {
__asm__ ("fxam; fstsw %%ax;"
: "=a" (sw)
: "t" (x) );
return sw & __FP_SIGNBIT;
return (sw & __FP_SIGNBIT) != 0;
}
int __attribute__ ((alias ("__signbitl"))) signbitl (long double);