From: Ulrich Drepper Date: Mon, 17 Mar 1997 04:06:58 +0000 (+0000) Subject: Return -1 for -inf. X-Git-Tag: cvs/glibc-2_0_4~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b5225b600d1943bf66ee53ae4dd0e636117a394;p=thirdparty%2Fglibc.git Return -1 for -inf. --- diff --git a/sysdeps/libm-i387/s_isinfl.c b/sysdeps/libm-i387/s_isinfl.c index 3ee53d5ecc3..f07898fd1be 100644 --- a/sysdeps/libm-i387/s_isinfl.c +++ b/sysdeps/libm-i387/s_isinfl.c @@ -10,7 +10,7 @@ static char rcsid[] = "$NetBSD: $"; #endif /* - * isinfl(x) returns 1 is x is inf, else 0; + * isinfl(x) returns 1 if x is inf, -1 if x is -inf, else 0; * no branching! */ @@ -26,11 +26,11 @@ static char rcsid[] = "$NetBSD: $"; { int32_t se,hx,lx; GET_LDOUBLE_WORDS(se,hx,lx,x); - se &= 0x7fff; - se ^= 0x7fff; /* This additional ^ 0x80000000 is necessary because in Intel's - internal representation the implicit one is explicit. */ - se |= (hx ^ 0x80000000) | lx; - return (se == 0); + internal representation of the implicit one is explicit. */ + lx |= (hx ^ 0x80000000) | ((se & 0x7fff) ^ 0x7fff); + lx |= -lx; + se &= 0x8000; + return ~(lx >> 31) & (1 - (se >> 14)); } weak_alias (__isinfl, isinfl)