Print this page
11210 libm should be cstyle(1ONBLD) clean
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.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
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
20 20 */
21 21
22 22 /*
23 23 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
24 24 */
25 +
25 26 /*
26 27 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
27 28 * Use is subject to license terms.
28 29 */
29 30
30 31 #include "libm.h"
31 32
32 33 #if defined(__sparc)
33 34 int
34 -isinfl(long double x) {
35 - int *px = (int *) &x;
36 - return ((px[0] & ~0x80000000) == 0x7fff0000 && px[1] == 0 &&
37 - px[2] == 0 && px[3] == 0);
35 +isinfl(long double x)
36 +{
37 + int *px = (int *)&x;
38 +
39 + return ((px[0] & ~0x80000000) == 0x7fff0000 && px[1] == 0 && px[2] ==
40 + 0 && px[3] == 0);
38 41 }
39 42
40 43 int
41 -isnormall(long double x) {
42 - int *px = (int *) &x;
43 - return ((unsigned) ((px[0] & 0x7fff0000) - 0x10000) < 0x7ffe0000);
44 +isnormall(long double x)
45 +{
46 + int *px = (int *)&x;
47 +
48 + return ((unsigned)((px[0] & 0x7fff0000) - 0x10000) < 0x7ffe0000);
44 49 }
45 50
46 51 int
47 -issubnormall(long double x) {
48 - int *px = (int *) &x;
52 +issubnormall(long double x)
53 +{
54 + int *px = (int *)&x;
55 +
49 56 px[0] &= ~0x80000000;
50 57 return (px[0] < 0x00010000 && (px[0] | px[1] | px[2] | px[3]) != 0);
51 58 }
52 59
53 60 int
54 -iszerol(long double x) {
55 - int *px = (int *) &x;
61 +iszerol(long double x)
62 +{
63 + int *px = (int *)&x;
64 +
56 65 return (((px[0] & ~0x80000000) | px[1] | px[2] | px[3]) == 0);
57 66 }
58 67
59 68 int
60 -signbitl(long double x) {
61 - unsigned *px = (unsigned *) &x;
69 +signbitl(long double x)
70 +{
71 + unsigned *px = (unsigned *)&x;
72 +
62 73 return (px[0] >> 31);
63 74 }
64 75 #elif defined(__x86)
65 76 int
66 -isinfl(long double x) {
67 - int *px = (int *) &x;
77 +isinfl(long double x)
78 +{
79 + int *px = (int *)&x;
80 +
68 81 #if defined(HANDLE_UNSUPPORTED)
69 - return ((px[2] & 0x7fff) == 0x7fff &&
70 - ((px[1] ^ 0x80000000) | px[0]) == 0);
82 + return ((px[2] & 0x7fff) == 0x7fff && ((px[1] ^ 0x80000000) | px[0]) ==
83 + 0);
71 84 #else
72 - return ((px[2] & 0x7fff) == 0x7fff &&
73 - ((px[1] & ~0x80000000) | px[0]) == 0);
85 + return ((px[2] & 0x7fff) == 0x7fff && ((px[1] & ~0x80000000) | px[0]) ==
86 + 0);
74 87 #endif
75 88 }
76 89
77 90 int
78 -isnormall(long double x) {
79 - int *px = (int *) &x;
91 +isnormall(long double x)
92 +{
93 + int *px = (int *)&x;
94 +
80 95 #if defined(HANDLE_UNSUPPORTED)
81 - return ((unsigned) ((px[2] & 0x7fff) - 1) < 0x7ffe &&
82 - (px[1] & 0x80000000) != 0);
96 + return ((unsigned)((px[2] & 0x7fff) - 1) < 0x7ffe && (px[1] &
97 + 0x80000000) != 0);
83 98 #else
84 - return ((unsigned) ((px[2] & 0x7fff) - 1) < 0x7ffe);
99 + return ((unsigned)((px[2] & 0x7fff) - 1) < 0x7ffe);
85 100 #endif
86 101 }
87 102
88 103 int
89 -issubnormall(long double x) {
90 - int *px = (int *) &x;
104 +issubnormall(long double x)
105 +{
106 + int *px = (int *)&x;
107 +
91 108 return ((px[2] & 0x7fff) == 0 && (px[0] | px[1]) != 0);
92 109 }
93 110
94 111 int
95 -iszerol(long double x) {
96 - int *px = (int *) &x;
112 +iszerol(long double x)
113 +{
114 + int *px = (int *)&x;
115 +
97 116 return (((px[2] & 0x7fff) | px[0] | px[1]) == 0);
98 117 }
99 118
100 119 int
101 -signbitl(long double x) {
102 - unsigned *px = (unsigned *) &x;
120 +signbitl(long double x)
121 +{
122 + unsigned *px = (unsigned *)&x;
123 +
103 124 return ((px[2] >> 15) & 1);
104 125 }
105 -#endif /* defined(__sparc) || defined(__x86) */
126 +#endif /* defined(__sparc) || defined(__x86) */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX