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