Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/sharedRuntimeTrans.cpp @ 14909:4ca6dc0799b6
Backout jdk9 merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Tue, 01 Apr 2014 13:57:07 +0200 |
parents | 8a9bb7821e28 |
children | 52b4284cb496 |
comparison
equal
deleted
inserted
replaced
14908:8db6e76cb658 | 14909:4ca6dc0799b6 |
---|---|
54 #else | 54 #else |
55 # define __HI(x) *(int*)&x | 55 # define __HI(x) *(int*)&x |
56 # define __LO(x) *(1+(int*)&x) | 56 # define __LO(x) *(1+(int*)&x) |
57 #endif | 57 #endif |
58 | 58 |
59 #if !defined(AIX) | |
60 double copysign(double x, double y) { | 59 double copysign(double x, double y) { |
61 __HI(x) = (__HI(x)&0x7fffffff)|(__HI(y)&0x80000000); | 60 __HI(x) = (__HI(x)&0x7fffffff)|(__HI(y)&0x80000000); |
62 return x; | 61 return x; |
63 } | 62 } |
64 #endif | |
65 | 63 |
66 /* | 64 /* |
67 * ==================================================== | 65 * ==================================================== |
68 * Copyright (c) 1998 Oracle and/or its affiliates. All rights reserved. | 66 * Copyright (c) 1998 Oracle and/or its affiliates. All rights reserved. |
69 * | 67 * |
85 two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ | 83 two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ |
86 twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */ | 84 twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */ |
87 hugeX = 1.0e+300, | 85 hugeX = 1.0e+300, |
88 tiny = 1.0e-300; | 86 tiny = 1.0e-300; |
89 | 87 |
90 #if !defined(AIX) | |
91 double scalbn (double x, int n) { | 88 double scalbn (double x, int n) { |
92 int k,hx,lx; | 89 int k,hx,lx; |
93 hx = __HI(x); | 90 hx = __HI(x); |
94 lx = __LO(x); | 91 lx = __LO(x); |
95 k = (hx&0x7ff00000)>>20; /* extract exponent */ | 92 k = (hx&0x7ff00000)>>20; /* extract exponent */ |
112 } | 109 } |
113 k += 54; /* subnormal result */ | 110 k += 54; /* subnormal result */ |
114 __HI(x) = (hx&0x800fffff)|(k<<20); | 111 __HI(x) = (hx&0x800fffff)|(k<<20); |
115 return x*twom54; | 112 return x*twom54; |
116 } | 113 } |
117 #endif | |
118 | 114 |
119 /* __ieee754_log(x) | 115 /* __ieee754_log(x) |
120 * Return the logarithm of x | 116 * Return the logrithm of x |
121 * | 117 * |
122 * Method : | 118 * Method : |
123 * 1. Argument Reduction: find k and f such that | 119 * 1. Argument Reduction: find k and f such that |
124 * x = 2^k * (1+f), | 120 * x = 2^k * (1+f), |
125 * where sqrt(2)/2 < 1+f < sqrt(2) . | 121 * where sqrt(2)/2 < 1+f < sqrt(2) . |