Print this page
5262 libm needs to be carefully unifdef'd
5268 libm doesn't need to hide symbols which are already local
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 -#if defined(ELFOBJ)
31 30 #pragma weak isinfl = __isinfl
32 31 #pragma weak isnormall = __isnormall
33 32 #pragma weak issubnormall = __issubnormall
34 33 #pragma weak iszerol = __iszerol
35 34 #pragma weak signbitl = __signbitl
36 -#endif
37 35
38 36 #include "libm.h"
39 37
40 38 #if defined(__sparc)
41 39 int
42 40 isinfl(long double x) {
43 41 int *px = (int *) &x;
44 42 return ((px[0] & ~0x80000000) == 0x7fff0000 && px[1] == 0 &&
45 43 px[2] == 0 && px[3] == 0);
46 44 }
47 45
48 46 int
49 47 isnormall(long double x) {
50 48 int *px = (int *) &x;
51 49 return ((unsigned) ((px[0] & 0x7fff0000) - 0x10000) < 0x7ffe0000);
52 50 }
53 51
54 52 int
55 53 issubnormall(long double x) {
56 54 int *px = (int *) &x;
57 55 px[0] &= ~0x80000000;
58 56 return (px[0] < 0x00010000 && (px[0] | px[1] | px[2] | px[3]) != 0);
59 57 }
60 58
61 59 int
62 60 iszerol(long double x) {
63 61 int *px = (int *) &x;
64 62 return (((px[0] & ~0x80000000) | px[1] | px[2] | px[3]) == 0);
65 63 }
66 64
67 65 int
68 66 signbitl(long double x) {
69 67 unsigned *px = (unsigned *) &x;
70 68 return (px[0] >> 31);
71 69 }
72 70 #elif defined(__x86)
73 71 int
74 72 isinfl(long double x) {
75 73 int *px = (int *) &x;
76 74 #if defined(HANDLE_UNSUPPORTED)
77 75 return ((px[2] & 0x7fff) == 0x7fff &&
78 76 ((px[1] ^ 0x80000000) | px[0]) == 0);
79 77 #else
80 78 return ((px[2] & 0x7fff) == 0x7fff &&
81 79 ((px[1] & ~0x80000000) | px[0]) == 0);
82 80 #endif
83 81 }
84 82
85 83 int
86 84 isnormall(long double x) {
87 85 int *px = (int *) &x;
88 86 #if defined(HANDLE_UNSUPPORTED)
89 87 return ((unsigned) ((px[2] & 0x7fff) - 1) < 0x7ffe &&
90 88 (px[1] & 0x80000000) != 0);
91 89 #else
92 90 return ((unsigned) ((px[2] & 0x7fff) - 1) < 0x7ffe);
93 91 #endif
94 92 }
95 93
96 94 int
97 95 issubnormall(long double x) {
98 96 int *px = (int *) &x;
99 97 return ((px[2] & 0x7fff) == 0 && (px[0] | px[1]) != 0);
100 98 }
101 99
102 100 int
103 101 iszerol(long double x) {
104 102 int *px = (int *) &x;
105 103 return (((px[2] & 0x7fff) | px[0] | px[1]) == 0);
106 104 }
107 105
108 106 int
109 107 signbitl(long double x) {
110 108 unsigned *px = (unsigned *) &x;
111 109 return ((px[2] >> 15) & 1);
112 110 }
113 111 #endif /* defined(__sparc) || defined(__x86) */
↓ open down ↓ |
67 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX