mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-18 02:50:09 +00:00
f83af095b6
* include/math.h: Declare __isinf_internal, __isinfl_internal, __isnan_internal, and __isnanl_internal. * stdio-common/printf_fp.c: Use INTUSE for calls to __isinf, __isinfl, __isnan, and __isnanl. * stdio-common/printf_size.c: Likewise. * sysdeps/generic/printf_fphex.c: Likewise. * sysdeps/i386/fpu/s_isinfl.c: Also define _internal alias. * sysdeps/i386/fpu/s_isnanl.c: Likewise. * sysdeps/ia64/fpu/s_isinf.S: Likewise. * sysdeps/ia64/fpu/s_isnan.S: Likewise. * sysdeps/ieee754/dbl-64/s_isinf.c: Likewise. * sysdeps/ieee754/dbl-64/s_isnan.c: Likewise. * sysdeps/ieee754/flt-32/s_isinff.c: Likewise. * sysdeps/ieee754/flt-32/s_isnanf.c: Likewise. * sysdeps/ieee754/ldbl-128/s_isinfl.c: Likewise. * sysdeps/ieee754/ldbl-128/s_isnanl.c: Likewise. * sysdeps/ieee754/ldbl-96/s_isinfl.c: Likewise. * sysdeps/m68k/s_isinfl.c: Likewise. * sysdeps/m68k/fpu/s_isinf.c: Likewise. * sysdeps/powerpc/fpu/s_isnan.c: Likewise.
30 lines
582 B
C
30 lines
582 B
C
/*
|
|
* Written by J.T. Conklin <jtc@netbsd.org>.
|
|
* Change for long double by Jakub Jelinek <jj@ultra.linux.cz>
|
|
* Public domain.
|
|
*/
|
|
|
|
#if defined(LIBM_SCCS) && !defined(lint)
|
|
static char rcsid[] = "$NetBSD: $";
|
|
#endif
|
|
|
|
/*
|
|
* isinfl(x) returns 1 if x is inf, -1 if x is -inf, else 0;
|
|
* no branching!
|
|
*/
|
|
|
|
#include "math.h"
|
|
#include "math_private.h"
|
|
|
|
int
|
|
__isinfl (long double x)
|
|
{
|
|
int64_t hx,lx;
|
|
GET_LDOUBLE_WORDS64(hx,lx,x);
|
|
lx |= (hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL;
|
|
lx |= -lx;
|
|
return ~(lx >> 63) & (hx >> 62);
|
|
}
|
|
INTDEF(__isinfl)
|
|
weak_alias (__isinfl, isinfl)
|