annotate libquadmath/math/copysignq.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_copysignl.c -- long double version of s_copysign.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 * copysignq(long double x, long double y)
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
22 * copysignq(x,y) returns a value with the magnitude of x and
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
23 * with the sign bit of y.
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
24 */
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
25
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
26 #define NO_MATH_REDIRECT
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
27
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 #include "quadmath-imp.h"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
30 __float128 copysignq(__float128 x, __float128 y)
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
32 uint64_t hx,hy;
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
33 GET_FLT128_MSW64(hx,x);
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
34 GET_FLT128_MSW64(hy,y);
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
35 SET_FLT128_MSW64(x,(hx&0x7fffffffffffffffULL)
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
36 |(hy&0x8000000000000000ULL));
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
37 return x;
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 }