Skip to content

Commit

Permalink
JDK-8338449
Browse files Browse the repository at this point in the history
  • Loading branch information
MBaesken committed Oct 14, 2024
1 parent 1581508 commit e44ff11
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/hotspot/share/runtime/sharedRuntimeTrans.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#include "jni.h"
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/sharedRuntime.hpp"
#include "sanitizers/ub.hpp"

#include <limits>

// This file contains copies of the fdlibm routines used by
// StrictMath. It turns out that it is almost always required to use
Expand Down Expand Up @@ -110,11 +113,14 @@ ln2_hi = 6.93147180369123816490e-01, /* 3fe62e42 fee00000 */

static double zero = 0.0;

ATTRIBUTE_NO_UBSAN
static double __ieee754_log(double x) {
double hfsq,f,s,z,R,w,t1,t2,dk;
int k,hx,i,j;
unsigned lx;

static_assert(std::numeric_limits<double>::is_iec559, "IEEE 754 required");

hx = high(x); /* high word of x */
lx = low(x); /* low word of x */

Expand Down Expand Up @@ -204,11 +210,14 @@ ivln10 = 4.34294481903251816668e-01, /* 0x3FDBCB7B, 0x1526E50E */
log10_2hi = 3.01029995663611771306e-01, /* 0x3FD34413, 0x509F6000 */
log10_2lo = 3.69423907715893078616e-13; /* 0x3D59FEF3, 0x11F12B36 */

ATTRIBUTE_NO_UBSAN
static double __ieee754_log10(double x) {
double y,z;
int i,k,hx;
unsigned lx;

static_assert(std::numeric_limits<double>::is_iec559, "IEEE 754 required");

hx = high(x); /* high word of x */
lx = low(x); /* low word of x */

Expand Down Expand Up @@ -440,13 +449,16 @@ bp[] = {1.0, 1.5,},
ivln2_h = 1.44269502162933349609e+00, /* 0x3FF71547, 0x60000000 =24b 1/ln2*/
ivln2_l = 1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail*/

ATTRIBUTE_NO_UBSAN
static double __ieee754_pow(double x, double y) {
double z,ax,z_h,z_l,p_h,p_l;
double y1,t1,t2,r,s,t,u,v,w;
int i0,i1,i,j,k,yisint,n;
int hx,hy,ix,iy;
unsigned lx,ly;

static_assert(std::numeric_limits<double>::is_iec559, "IEEE 754 required");

i0 = ((*(int*)&one)>>29)^1; i1=1-i0;
hx = high(x); lx = low(x);
hy = high(y); ly = low(y);
Expand Down

0 comments on commit e44ff11

Please sign in to comment.