| 1 |
/* |
| 2 |
* Written by J.T. Conklin <[email protected]>. |
| 3 |
* Change for long double by Jakub Jelinek <[email protected]> |
| 4 |
* Public domain. |
| 5 |
*/ |
| 6 |
|
| 7 |
#if defined(LIBM_SCCS) && !defined(lint) |
| 8 |
static char rcsid[] = "$NetBSD: $"; |
| 9 |
#endif |
| 10 |
|
| 11 |
/* |
| 12 |
* isinfq(x) returns 1 if x is inf, -1 if x is -inf, else 0; |
| 13 |
* no branching! |
| 14 |
*/ |
| 15 |
|
| 16 |
#include "quadmath-imp.h" |
| 17 |
|
| 18 |
int |
| 19 |
isinfq (__float128 x) |
| 20 |
{ |
| 21 |
int64_t hx,lx; |
| 22 |
GET_FLT128_WORDS64(hx,lx,x); |
| 23 |
lx |= (hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL; |
| 24 |
lx |= -lx; |
| 25 |
return ~(lx >> 63) & (hx >> 62); |
| 26 |
} |