Print this page
5261 libm should stop using synonyms.h
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libm/common/Q/ieee_funcl.c
+++ new/usr/src/lib/libm/common/Q/ieee_funcl.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
↓ open down ↓ |
19 lines elided |
↑ open up ↑ |
20 20 */
21 21
22 22 /*
23 23 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
24 24 */
25 25 /*
26 26 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
27 27 * Use is subject to license terms.
28 28 */
29 29
30 -#pragma weak isinfl = __isinfl
31 -#pragma weak isnormall = __isnormall
32 -#pragma weak issubnormall = __issubnormall
33 -#pragma weak iszerol = __iszerol
34 -#pragma weak signbitl = __signbitl
35 -
36 30 #include "libm.h"
37 31
38 32 #if defined(__sparc)
39 33 int
40 34 isinfl(long double x) {
41 35 int *px = (int *) &x;
42 36 return ((px[0] & ~0x80000000) == 0x7fff0000 && px[1] == 0 &&
43 37 px[2] == 0 && px[3] == 0);
44 38 }
45 39
46 40 int
47 41 isnormall(long double x) {
48 42 int *px = (int *) &x;
49 43 return ((unsigned) ((px[0] & 0x7fff0000) - 0x10000) < 0x7ffe0000);
50 44 }
51 45
52 46 int
53 47 issubnormall(long double x) {
54 48 int *px = (int *) &x;
55 49 px[0] &= ~0x80000000;
56 50 return (px[0] < 0x00010000 && (px[0] | px[1] | px[2] | px[3]) != 0);
57 51 }
58 52
59 53 int
60 54 iszerol(long double x) {
61 55 int *px = (int *) &x;
62 56 return (((px[0] & ~0x80000000) | px[1] | px[2] | px[3]) == 0);
63 57 }
64 58
65 59 int
66 60 signbitl(long double x) {
67 61 unsigned *px = (unsigned *) &x;
68 62 return (px[0] >> 31);
69 63 }
70 64 #elif defined(__x86)
71 65 int
72 66 isinfl(long double x) {
73 67 int *px = (int *) &x;
74 68 #if defined(HANDLE_UNSUPPORTED)
75 69 return ((px[2] & 0x7fff) == 0x7fff &&
76 70 ((px[1] ^ 0x80000000) | px[0]) == 0);
77 71 #else
78 72 return ((px[2] & 0x7fff) == 0x7fff &&
79 73 ((px[1] & ~0x80000000) | px[0]) == 0);
80 74 #endif
81 75 }
82 76
83 77 int
84 78 isnormall(long double x) {
85 79 int *px = (int *) &x;
86 80 #if defined(HANDLE_UNSUPPORTED)
87 81 return ((unsigned) ((px[2] & 0x7fff) - 1) < 0x7ffe &&
88 82 (px[1] & 0x80000000) != 0);
89 83 #else
90 84 return ((unsigned) ((px[2] & 0x7fff) - 1) < 0x7ffe);
91 85 #endif
92 86 }
93 87
94 88 int
95 89 issubnormall(long double x) {
96 90 int *px = (int *) &x;
97 91 return ((px[2] & 0x7fff) == 0 && (px[0] | px[1]) != 0);
98 92 }
99 93
100 94 int
101 95 iszerol(long double x) {
102 96 int *px = (int *) &x;
103 97 return (((px[2] & 0x7fff) | px[0] | px[1]) == 0);
104 98 }
105 99
106 100 int
107 101 signbitl(long double x) {
108 102 unsigned *px = (unsigned *) &x;
109 103 return ((px[2] >> 15) & 1);
110 104 }
111 105 #endif /* defined(__sparc) || defined(__x86) */
↓ open down ↓ |
66 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX