[BZ #2510, BZ #2830, BZ #3137, BZ #3313, BZ #3426, BZ #3465, BZ #3480, BZ #3483,...
[glibc.git] / sysdeps / i386 / fpu / s_isnanl.c
blobaa459956e9585303bdd860382610ee5d1cbc9aa5
1 /* s_isnanl.c -- long double version for i387 of s_isnan.c.
2 * Conversion to long double by Ulrich Drepper,
3 * Cygnus Support, drepper@cygnus.com.
4 */
6 /*
7 * ====================================================
8 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
10 * Developed at SunPro, a Sun Microsystems, Inc. business.
11 * Permission to use, copy, modify, and distribute this
12 * software is freely granted, provided that this notice
13 * is preserved.
14 * ====================================================
17 #if defined(LIBM_SCCS) && !defined(lint)
18 static char rcsid[] = "$NetBSD: $";
19 #endif
22 * isnanl(x) returns 1 is x is nan, else 0;
23 * no branching!
26 #include "math.h"
27 #include "math_private.h"
29 #ifdef __STDC__
30 int __isnanl(long double x)
31 #else
32 int __isnanl(x)
33 long double x;
34 #endif
36 int32_t se,hx,lx;
37 GET_LDOUBLE_WORDS(se,hx,lx,x);
38 se = (se & 0x7fff) << 1;
39 /* The additional & 0x7fffffff is required because Intel's
40 extended format has the normally implicit 1 explicit
41 present. Sigh! */
42 lx |= hx & 0x7fffffff;
43 se |= (u_int32_t)(lx|(-lx))>>31;
44 se = 0xfffe - se;
45 return (int)((u_int32_t)(se))>>16;
47 hidden_def (__isnanl)
48 weak_alias (__isnanl, isnanl)