1*181254a7Smrg /* s_isnanl.c -- long double version of s_isnan.c.
2*181254a7Smrg * Conversion to long double by Jakub Jelinek, jj@ultra.linux.cz.
3*181254a7Smrg */
4*181254a7Smrg
5*181254a7Smrg /*
6*181254a7Smrg * ====================================================
7*181254a7Smrg * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
8*181254a7Smrg *
9*181254a7Smrg * Developed at SunPro, a Sun Microsystems, Inc. business.
10*181254a7Smrg * Permission to use, copy, modify, and distribute this
11*181254a7Smrg * software is freely granted, provided that this notice
12*181254a7Smrg * is preserved.
13*181254a7Smrg * ====================================================
14*181254a7Smrg */
15*181254a7Smrg
16*181254a7Smrg #if defined(LIBM_SCCS) && !defined(lint)
17*181254a7Smrg static char rcsid[] = "NetBSD: ";
18*181254a7Smrg #endif
19*181254a7Smrg
20*181254a7Smrg /*
21*181254a7Smrg * isnanq(x) returns 1 is x is nan, else 0;
22*181254a7Smrg * no branching!
23*181254a7Smrg */
24*181254a7Smrg
25*181254a7Smrg #include "quadmath-imp.h"
26*181254a7Smrg
isnanq(__float128 x)27*181254a7Smrg int isnanq(__float128 x)
28*181254a7Smrg {
29*181254a7Smrg int64_t hx,lx;
30*181254a7Smrg GET_FLT128_WORDS64(hx,lx,x);
31*181254a7Smrg hx &= 0x7fffffffffffffffLL;
32*181254a7Smrg hx |= (uint64_t)(lx|(-lx))>>63;
33*181254a7Smrg hx = 0x7fff000000000000LL - hx;
34*181254a7Smrg return (int)((uint64_t)hx>>63);
35*181254a7Smrg }
36