annotate src/share/vm/runtime/sharedRuntimeMath.hpp @ 20288:a073be2ce5c2

8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp Summary: Fixed parfait warnings caused by __HI and __LO macros in sharedRuntimeMath.hpp by using a union. Reviewed-by: kvn
author thartmann
date Tue, 29 Jul 2014 13:56:29 +0200
parents 631c3a4ea10c
children 69ea58782b1a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20286
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
1 /*
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
4 *
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
7 * published by the Free Software Foundation.
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
8 *
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
13 * accompanied this code).
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
14 *
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
18 *
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
21 * questions.
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
22 *
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
23 */
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
24
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
25 #ifndef SHARE_VM_RUNTIME_SHAREDRUNTIMEMATH_HPP
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
26 #define SHARE_VM_RUNTIME_SHAREDRUNTIMEMATH_HPP
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
27
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
28 #include <math.h>
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
29
20288
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
30 // Used to access the lower/higher 32 bits of a double
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
31 typedef union {
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
32 double d;
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
33 struct {
20286
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
34 #ifdef VM_LITTLE_ENDIAN
20288
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
35 int lo;
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
36 int hi;
20286
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
37 #else
20288
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
38 int hi;
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
39 int lo;
20286
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
40 #endif
20288
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
41 } split;
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
42 } DoubleIntConv;
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
43
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
44 static inline int high(double d) {
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
45 DoubleIntConv x = { d };
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
46 return x.split.hi;
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
47 }
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
48
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
49 static inline int low(double d) {
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
50 DoubleIntConv x = { d };
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
51 return x.split.lo;
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
52 }
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
53
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
54 static inline void set_high(double* d, int high) {
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
55 DoubleIntConv conv = { *d };
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
56 conv.split.hi = high;
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
57 *d = conv.d;
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
58 }
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
59
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
60 static inline void set_low(double* d, int low) {
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
61 DoubleIntConv conv = { *d };
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
62 conv.split.lo = low;
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
63 *d = conv.d;
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
64 }
20286
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
65
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
66 static double copysignA(double x, double y) {
20288
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
67 DoubleIntConv convX = { x };
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
68 convX.split.hi = (convX.split.hi & 0x7fffffff) | (high(y) & 0x80000000);
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
69 return convX.d;
20286
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
70 }
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
71
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
72 /*
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
73 * ====================================================
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
74 * Copyright (c) 1998 Oracle and/or its affiliates. All rights reserved.
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
75 *
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
76 * Developed at SunSoft, a Sun Microsystems, Inc. business.
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
77 * Permission to use, copy, modify, and distribute this
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
78 * software is freely granted, provided that this notice
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
79 * is preserved.
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
80 * ====================================================
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
81 */
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
82
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
83 /*
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
84 * scalbn (double x, int n)
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
85 * scalbn(x,n) returns x* 2**n computed by exponent
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
86 * manipulation rather than by actually performing an
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
87 * exponentiation or a multiplication.
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
88 */
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
89
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
90 static const double
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
91 two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
92 twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
93 hugeX = 1.0e+300,
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
94 tiny = 1.0e-300;
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
95
20288
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
96 static double scalbnA(double x, int n) {
20286
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
97 int k,hx,lx;
20288
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
98 hx = high(x);
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
99 lx = low(x);
20286
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
100 k = (hx&0x7ff00000)>>20; /* extract exponent */
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
101 if (k==0) { /* 0 or subnormal x */
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
102 if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
103 x *= two54;
20288
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
104 hx = high(x);
20286
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
105 k = ((hx&0x7ff00000)>>20) - 54;
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
106 if (n< -50000) return tiny*x; /*underflow*/
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
107 }
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
108 if (k==0x7ff) return x+x; /* NaN or Inf */
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
109 k = k+n;
20288
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
110 if (k > 0x7fe) return hugeX*copysignA(hugeX,x); /* overflow */
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
111 if (k > 0) { /* normal result */
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
112 set_high(&x, (hx&0x800fffff)|(k<<20));
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
113 return x;
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
114 }
20286
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
115 if (k <= -54) {
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
116 if (n > 50000) /* in case integer overflow in n+k */
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
117 return hugeX*copysignA(hugeX,x); /*overflow*/
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
118 else return tiny*copysignA(tiny,x); /*underflow*/
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
119 }
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
120 k += 54; /* subnormal result */
20288
a073be2ce5c2 8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
thartmann
parents: 20286
diff changeset
121 set_high(&x, (hx&0x800fffff)|(k<<20));
20286
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
122 return x*twom54;
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
123 }
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
124
631c3a4ea10c 8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff changeset
125 #endif // SHARE_VM_RUNTIME_SHAREDRUNTIMEMATH_HPP