annotate libquadmath/math/isnanq.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
1 /* s_isnanl.c -- long double version of s_isnan.c.
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 * Conversion to long double by Jakub Jelinek, jj@ultra.linux.cz.
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 */
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 /*
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 * ====================================================
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 *
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 * Developed at SunPro, a Sun Microsystems, Inc. business.
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 * Permission to use, copy, modify, and distribute this
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 * software is freely granted, provided that this notice
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 * is preserved.
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 * ====================================================
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 */
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
16 #if defined(LIBM_SCCS) && !defined(lint)
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
17 static char rcsid[] = "$NetBSD: $";
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
18 #endif
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
19
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
20 /*
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
21 * isnanq(x) returns 1 is x is nan, else 0;
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
22 * no branching!
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
23 */
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
24
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 #include "quadmath-imp.h"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
27 int isnanq(__float128 x)
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
29 int64_t hx,lx;
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
30 GET_FLT128_WORDS64(hx,lx,x);
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
31 hx &= 0x7fffffffffffffffLL;
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
32 hx |= (uint64_t)(lx|(-lx))>>63;
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
33 hx = 0x7fff000000000000LL - hx;
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
34 return (int)((uint64_t)hx>>63);
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 }