Mercurial > hg > CbC > CbC_gcc
comparison libquadmath/math/isinfq.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 561a7518be6b |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 /* | 1 /* |
2 * Written by J.T. Conklin <jtc@netbsd.org>. | 2 * Written by J.T. Conklin <jtc@netbsd.org>. |
3 * Change for long double by Jakub Jelinek <jj@ultra.linux.cz> | 3 * Change for long double by Jakub Jelinek <jj@ultra.linux.cz> |
4 * Public domain. | 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! | |
5 */ | 14 */ |
6 | 15 |
7 #include "quadmath-imp.h" | 16 #include "quadmath-imp.h" |
8 | 17 |
9 int | 18 int |
10 isinfq (__float128 x) | 19 isinfq (__float128 x) |
11 { | 20 { |
12 int64_t hx,lx; | 21 int64_t hx,lx; |
13 GET_FLT128_WORDS64(hx,lx,x); | 22 GET_FLT128_WORDS64(hx,lx,x); |
14 lx |= (hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL; | 23 lx |= (hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL; |
15 lx |= -lx; | 24 lx |= -lx; |
16 return ~(lx >> 63) & (hx >> 62); | 25 return ~(lx >> 63) & (hx >> 62); |
17 } | 26 } |