Mercurial > hg > graal-compiler
annotate src/share/vm/runtime/sharedRuntimeMath.hpp @ 20596:4356234e712a
8041992: Fix of JDK-8034775 neglects to account for non-JIT VMs
Summary: Allow 0 compiler threads if no JIT is used.
Reviewed-by: kvn, dholmes
Contributed-by: Severin Gehwolf <sgehwolf@redhat.com>
author | anoll |
---|---|
date | Fri, 02 May 2014 06:24:39 +0200 |
parents | 69ea58782b1a |
children |
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) { |
20289 | 45 DoubleIntConv x; |
46 x.d = d; | |
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
|
47 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
|
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 |
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 static inline int low(double d) { |
20289 | 51 DoubleIntConv x; |
52 x.d = d; | |
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
|
53 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
|
54 } |
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 |
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 static inline void set_high(double* d, int high) { |
20289 | 57 DoubleIntConv conv; |
58 conv.d = *d; | |
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
|
59 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
|
60 *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
|
61 } |
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 |
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 static inline void set_low(double* d, int low) { |
20289 | 64 DoubleIntConv conv; |
65 conv.d = *d; | |
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
|
66 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
|
67 *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
|
68 } |
20286
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
69 |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
70 static double copysignA(double x, double y) { |
20289 | 71 DoubleIntConv convX; |
72 convX.d = x; | |
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
|
73 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
|
74 return convX.d; |
20286
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 |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
77 /* |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
78 * ==================================================== |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
79 * 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
|
80 * |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
81 * 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
|
82 * 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
|
83 * 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
|
84 * is preserved. |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
85 * ==================================================== |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
86 */ |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
87 |
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 * scalbn (double x, int n) |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
90 * 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
|
91 * 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
|
92 * exponentiation or a multiplication. |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
93 */ |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
94 |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
95 static const double |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
96 two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
97 twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */ |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
98 hugeX = 1.0e+300, |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
99 tiny = 1.0e-300; |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
100 |
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
|
101 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
|
102 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
|
103 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
|
104 lx = low(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; /* extract exponent */ |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
106 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
|
107 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
|
108 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
|
109 hx = high(x); |
20286
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
110 k = ((hx&0x7ff00000)>>20) - 54; |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
111 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
|
112 } |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
113 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
|
114 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
|
115 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
|
116 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
|
117 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
|
118 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
|
119 } |
20286
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
120 if (k <= -54) { |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
121 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
|
122 return hugeX*copysignA(hugeX,x); /*overflow*/ |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
123 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
|
124 } |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
125 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
|
126 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
|
127 return x*twom54; |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
128 } |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
129 |
631c3a4ea10c
8043301: Duplicate definitions in vm/runtime/sharedRuntimeTrans.cpp versus math.h in VS2013
lfoltan
parents:
diff
changeset
|
130 #endif // SHARE_VM_RUNTIME_SHAREDRUNTIMEMATH_HPP |