src/share/vm/runtime/sharedRuntimeTrans.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File bug_jdk8043301 Cdiff src/share/vm/runtime/sharedRuntimeTrans.cpp

src/share/vm/runtime/sharedRuntimeTrans.cpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 54,69 **** #else # define __HI(x) *(int*)&x # define __LO(x) *(1+(int*)&x) #endif ! #if !defined(AIX) ! double copysign(double x, double y) { __HI(x) = (__HI(x)&0x7fffffff)|(__HI(y)&0x80000000); return x; } - #endif /* * ==================================================== * Copyright (c) 1998 Oracle and/or its affiliates. All rights reserved. * --- 54,67 ---- #else # define __HI(x) *(int*)&x # define __LO(x) *(1+(int*)&x) #endif ! static double copysignA(double x, double y) { __HI(x) = (__HI(x)&0x7fffffff)|(__HI(y)&0x80000000); return x; } /* * ==================================================== * Copyright (c) 1998 Oracle and/or its affiliates. All rights reserved. *
*** 85,96 **** two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */ hugeX = 1.0e+300, tiny = 1.0e-300; ! #if !defined(AIX) ! double scalbn (double x, int n) { int k,hx,lx; hx = __HI(x); lx = __LO(x); k = (hx&0x7ff00000)>>20; /* extract exponent */ if (k==0) { /* 0 or subnormal x */ --- 83,93 ---- two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */ hugeX = 1.0e+300, tiny = 1.0e-300; ! static double scalbnA (double x, int n) { int k,hx,lx; hx = __HI(x); lx = __LO(x); k = (hx&0x7ff00000)>>20; /* extract exponent */ if (k==0) { /* 0 or subnormal x */
*** 100,122 **** k = ((hx&0x7ff00000)>>20) - 54; if (n< -50000) return tiny*x; /*underflow*/ } if (k==0x7ff) return x+x; /* NaN or Inf */ k = k+n; ! if (k > 0x7fe) return hugeX*copysign(hugeX,x); /* overflow */ if (k > 0) /* normal result */ {__HI(x) = (hx&0x800fffff)|(k<<20); return x;} if (k <= -54) { if (n > 50000) /* in case integer overflow in n+k */ ! return hugeX*copysign(hugeX,x); /*overflow*/ ! else return tiny*copysign(tiny,x); /*underflow*/ } k += 54; /* subnormal result */ __HI(x) = (hx&0x800fffff)|(k<<20); return x*twom54; } - #endif /* __ieee754_log(x) * Return the logarithm of x * * Method : --- 97,118 ---- k = ((hx&0x7ff00000)>>20) - 54; if (n< -50000) return tiny*x; /*underflow*/ } if (k==0x7ff) return x+x; /* NaN or Inf */ k = k+n; ! if (k > 0x7fe) return hugeX*copysignA(hugeX,x); /* overflow */ if (k > 0) /* normal result */ {__HI(x) = (hx&0x800fffff)|(k<<20); return x;} if (k <= -54) { if (n > 50000) /* in case integer overflow in n+k */ ! return hugeX*copysignA(hugeX,x); /*overflow*/ ! else return tiny*copysignA(tiny,x); /*underflow*/ } k += 54; /* subnormal result */ __HI(x) = (hx&0x800fffff)|(k<<20); return x*twom54; } /* __ieee754_log(x) * Return the logarithm of x * * Method :
*** 717,727 **** t1 = z - t*(P1+t*(P2+t*(P3+t*(P4+t*P5)))); r = (z*t1)/(t1-two)-(w+z*w); z = one-(r-z); j = __HI(z); j += (n<<20); ! if((j>>20)<=0) z = scalbn(z,n); /* subnormal output */ else __HI(z) += (n<<20); return s*z; } --- 713,723 ---- t1 = z - t*(P1+t*(P2+t*(P3+t*(P4+t*P5)))); r = (z*t1)/(t1-two)-(w+z*w); z = one-(r-z); j = __HI(z); j += (n<<20); ! if((j>>20)<=0) z = scalbnA(z,n); /* subnormal output */ else __HI(z) += (n<<20); return s*z; }
src/share/vm/runtime/sharedRuntimeTrans.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File