Print this page
11528 Makefile.noget can get gone
11529 Use -Wno-maybe-initialized
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libc/port/fp/_base_sup.c
+++ new/usr/src/lib/libc/port/fp/_base_sup.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
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
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 2008 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 +/*
28 + * Copyright 2019 Joyent, Inc.
29 + */
30 +
27 31 #include "lint.h"
28 32 #include <sys/types.h>
29 33 #include "base_conversion.h"
30 34 #include <sys/isa_defs.h>
31 35
32 36 /*
33 37 * Miscellaneous support routines used in base conversion
34 38 */
35 39
36 40 static const union {
37 41 unsigned int u[2];
38 42 double d;
39 43 } C[] = {
40 44 #ifdef _LITTLE_ENDIAN
41 45 { 0x00000000u, 0x00100000u },
42 46 { 0x00000001u, 0x7ff00000u }
43 47 #else
44 48 { 0x00100000u, 0x00000000u },
45 49 { 0x7ff00000u, 0x00000001u }
46 50 #endif
47 51 };
48 52
49 53 #define minnormal C[0].d
50 54 #define signalingnan C[1].d
51 55
52 56 /* raise the floating point exceptions indicated by ef */
53 57 void
54 58 __base_conversion_set_exception(fp_exception_field_type ef)
55 59 {
56 60 double t;
57 61 volatile double tstored __unused;
58 62
59 63 if (ef == (1 << fp_inexact)) {
60 64 t = 9.999999962747097015E-1;
61 65 /*
62 66 * 28 sig bits so product isn't inexact in extended
63 67 * accumulator, causing two inexact traps.
64 68 */
65 69 } else if ((ef & (1 << fp_invalid)) != 0) {
66 70 t = signalingnan;
67 71 } else if ((ef & (1 << fp_overflow)) != 0) {
68 72 t = 4.149515553422842866E+180;
69 73 /*
70 74 * 28 sig bits so product isn't inexact in extended
71 75 * accumulator, causing inexact trap prior to overflow trap
72 76 * on store.
73 77 */
74 78 } else if ((ef & (1 << fp_underflow)) != 0) {
75 79 t = minnormal;
76 80 } else
77 81 return;
78 82
79 83 /* Storage forces exception */
80 84 tstored = t * t;
↓ open down ↓ |
44 lines elided |
↑ open up ↑ |
81 85 #if defined(__lint)
82 86 tstored = tstored;
83 87 #endif
84 88 }
85 89
86 90 /*
87 91 * The following routine is no longer used in libc, but we have
88 92 * to leave it for now because it's still used by Sun's old Fortran
89 93 * runtime libraries. Today this is a bug; in the days of SunOS 4.x,
90 94 * when the relevant design decisions were made, it was a feature.
95 + *
96 + * Regardless, on 32-bit, 'quadruple' under GCC is not 128 bits, so it
97 + * uses uninitialized memory...
91 98 */
99 +#pragma GCC diagnostic ignored "-Wuninitialized"
92 100 enum fp_class_type
93 101 __class_quadruple(quadruple *x)
94 102 {
95 103 quadruple_equivalence kluge;
96 104
97 105 kluge.x = *x;
98 106 if (kluge.f.msw.exponent == 0) { /* 0 or sub */
99 107 if ((kluge.f.msw.significand == 0) &&
100 108 (kluge.f.significand2 == 0) &&
101 109 (kluge.f.significand3 == 0) &&
102 110 (kluge.f.significand4 == 0))
103 111 return (fp_zero);
104 112 else
105 113 return (fp_subnormal);
106 114 } else if (kluge.f.msw.exponent == 0x7fff) { /* inf or nan */
107 115 if ((kluge.f.msw.significand == 0) &&
108 116 (kluge.f.significand2 == 0) &&
109 117 (kluge.f.significand3 == 0) &&
110 118 (kluge.f.significand4 == 0))
111 119 return (fp_infinity);
112 120 else if ((kluge.f.msw.significand & 0xffff) >=
113 121 (unsigned int)0x8000)
114 122 return (fp_quiet);
115 123 else
116 124 return (fp_signaling);
117 125 } else
118 126 return (fp_normal);
119 127 }
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX