src/share/vm/runtime/sharedRuntimeTrans.cpp

changeset 7002
a073be2ce5c2
parent 7000
631c3a4ea10c
child 7535
7ae4e26cb1e0
     1.1 --- a/src/share/vm/runtime/sharedRuntimeTrans.cpp	Tue Jul 29 13:54:16 2014 +0200
     1.2 +++ b/src/share/vm/runtime/sharedRuntimeTrans.cpp	Tue Jul 29 13:56:29 2014 +0200
     1.3 @@ -40,6 +40,7 @@
     1.4  // generated; can not figure out how to turn down optimization for one
     1.5  // file in the IDE on Windows
     1.6  #ifdef WIN32
     1.7 +# pragma warning( disable: 4748 ) // /GS can not protect parameters and local variables from local buffer overrun because optimizations are disabled in function
     1.8  # pragma optimize ( "", off )
     1.9  #endif
    1.10  
    1.11 @@ -114,8 +115,8 @@
    1.12    int k,hx,i,j;
    1.13    unsigned lx;
    1.14  
    1.15 -  hx = __HI(x);               /* high word of x */
    1.16 -  lx = __LO(x);               /* low  word of x */
    1.17 +  hx = high(x);               /* high word of x */
    1.18 +  lx = low(x);                /* low  word of x */
    1.19  
    1.20    k=0;
    1.21    if (hx < 0x00100000) {                   /* x < 2**-1022  */
    1.22 @@ -123,13 +124,13 @@
    1.23        return -two54/zero;             /* log(+-0)=-inf */
    1.24      if (hx<0) return (x-x)/zero;   /* log(-#) = NaN */
    1.25      k -= 54; x *= two54; /* subnormal number, scale up x */
    1.26 -    hx = __HI(x);             /* high word of x */
    1.27 +    hx = high(x);             /* high word of x */
    1.28    }
    1.29    if (hx >= 0x7ff00000) return x+x;
    1.30    k += (hx>>20)-1023;
    1.31    hx &= 0x000fffff;
    1.32    i = (hx+0x95f64)&0x100000;
    1.33 -  __HI(x) = hx|(i^0x3ff00000);        /* normalize x or x/2 */
    1.34 +  set_high(&x, hx|(i^0x3ff00000)); /* normalize x or x/2 */
    1.35    k += (i>>20);
    1.36    f = x-1.0;
    1.37    if((0x000fffff&(2+hx))<3) {  /* |f| < 2**-20 */
    1.38 @@ -208,8 +209,8 @@
    1.39    int i,k,hx;
    1.40    unsigned lx;
    1.41  
    1.42 -  hx = __HI(x);       /* high word of x */
    1.43 -  lx = __LO(x);       /* low word of x */
    1.44 +  hx = high(x);       /* high word of x */
    1.45 +  lx = low(x);        /* low word of x */
    1.46  
    1.47    k=0;
    1.48    if (hx < 0x00100000) {                  /* x < 2**-1022  */
    1.49 @@ -217,14 +218,14 @@
    1.50        return -two54/zero;             /* log(+-0)=-inf */
    1.51      if (hx<0) return (x-x)/zero;        /* log(-#) = NaN */
    1.52      k -= 54; x *= two54; /* subnormal number, scale up x */
    1.53 -    hx = __HI(x);                /* high word of x */
    1.54 +    hx = high(x);                /* high word of x */
    1.55    }
    1.56    if (hx >= 0x7ff00000) return x+x;
    1.57    k += (hx>>20)-1023;
    1.58    i  = ((unsigned)k&0x80000000)>>31;
    1.59    hx = (hx&0x000fffff)|((0x3ff-i)<<20);
    1.60    y  = (double)(k+i);
    1.61 -  __HI(x) = hx;
    1.62 +  set_high(&x, hx);
    1.63    z  = y*log10_2lo + ivln10*__ieee754_log(x);
    1.64    return  z+y*log10_2hi;
    1.65  }
    1.66 @@ -319,14 +320,14 @@
    1.67    int k=0,xsb;
    1.68    unsigned hx;
    1.69  
    1.70 -  hx  = __HI(x);        /* high word of x */
    1.71 +  hx  = high(x);                /* high word of x */
    1.72    xsb = (hx>>31)&1;             /* sign bit of x */
    1.73    hx &= 0x7fffffff;             /* high word of |x| */
    1.74  
    1.75    /* filter out non-finite argument */
    1.76    if(hx >= 0x40862E42) {                        /* if |x|>=709.78... */
    1.77      if(hx>=0x7ff00000) {
    1.78 -      if(((hx&0xfffff)|__LO(x))!=0)
    1.79 +      if(((hx&0xfffff)|low(x))!=0)
    1.80          return x+x;             /* NaN */
    1.81        else return (xsb==0)? x:0.0;      /* exp(+-inf)={inf,0} */
    1.82      }
    1.83 @@ -357,10 +358,10 @@
    1.84    if(k==0)      return one-((x*c)/(c-2.0)-x);
    1.85    else          y = one-((lo-(x*c)/(2.0-c))-hi);
    1.86    if(k >= -1021) {
    1.87 -    __HI(y) += (k<<20); /* add k to y's exponent */
    1.88 +    set_high(&y, high(y) + (k<<20)); /* add k to y's exponent */
    1.89      return y;
    1.90    } else {
    1.91 -    __HI(y) += ((k+1000)<<20);/* add k to y's exponent */
    1.92 +    set_high(&y, high(y) + ((k+1000)<<20)); /* add k to y's exponent */
    1.93      return y*twom1000;
    1.94    }
    1.95  }
    1.96 @@ -447,8 +448,8 @@
    1.97    unsigned lx,ly;
    1.98  
    1.99    i0 = ((*(int*)&one)>>29)^1; i1=1-i0;
   1.100 -  hx = __HI(x); lx = __LO(x);
   1.101 -  hy = __HI(y); ly = __LO(y);
   1.102 +  hx = high(x); lx = low(x);
   1.103 +  hy = high(y); ly = low(y);
   1.104    ix = hx&0x7fffffff;  iy = hy&0x7fffffff;
   1.105  
   1.106    /* y==zero: x**0 = 1 */
   1.107 @@ -548,14 +549,14 @@
   1.108      u = ivln2_h*t;      /* ivln2_h has 21 sig. bits */
   1.109      v = t*ivln2_l-w*ivln2;
   1.110      t1 = u+v;
   1.111 -    __LO(t1) = 0;
   1.112 +    set_low(&t1, 0);
   1.113      t2 = v-(t1-u);
   1.114    } else {
   1.115      double ss,s2,s_h,s_l,t_h,t_l;
   1.116      n = 0;
   1.117      /* take care subnormal number */
   1.118      if(ix<0x00100000)
   1.119 -      {ax *= two53; n -= 53; ix = __HI(ax); }
   1.120 +      {ax *= two53; n -= 53; ix = high(ax); }
   1.121      n  += ((ix)>>20)-0x3ff;
   1.122      j  = ix&0x000fffff;
   1.123      /* determine interval */
   1.124 @@ -563,17 +564,17 @@
   1.125      if(j<=0x3988E) k=0;         /* |x|<sqrt(3/2) */
   1.126      else if(j<0xBB67A) k=1;     /* |x|<sqrt(3)   */
   1.127      else {k=0;n+=1;ix -= 0x00100000;}
   1.128 -    __HI(ax) = ix;
   1.129 +    set_high(&ax, ix);
   1.130  
   1.131      /* compute ss = s_h+s_l = (x-1)/(x+1) or (x-1.5)/(x+1.5) */
   1.132      u = ax-bp[k];               /* bp[0]=1.0, bp[1]=1.5 */
   1.133      v = one/(ax+bp[k]);
   1.134      ss = u*v;
   1.135      s_h = ss;
   1.136 -    __LO(s_h) = 0;
   1.137 +    set_low(&s_h, 0);
   1.138      /* t_h=ax+bp[k] High */
   1.139      t_h = zeroX;
   1.140 -    __HI(t_h)=((ix>>1)|0x20000000)+0x00080000+(k<<18);
   1.141 +    set_high(&t_h, ((ix>>1)|0x20000000)+0x00080000+(k<<18));
   1.142      t_l = ax - (t_h-bp[k]);
   1.143      s_l = v*((u-s_h*t_h)-s_h*t_l);
   1.144      /* compute log(ax) */
   1.145 @@ -582,32 +583,32 @@
   1.146      r += s_l*(s_h+ss);
   1.147      s2  = s_h*s_h;
   1.148      t_h = 3.0+s2+r;
   1.149 -    __LO(t_h) = 0;
   1.150 +    set_low(&t_h, 0);
   1.151      t_l = r-((t_h-3.0)-s2);
   1.152      /* u+v = ss*(1+...) */
   1.153      u = s_h*t_h;
   1.154      v = s_l*t_h+t_l*ss;
   1.155      /* 2/(3log2)*(ss+...) */
   1.156      p_h = u+v;
   1.157 -    __LO(p_h) = 0;
   1.158 +    set_low(&p_h, 0);
   1.159      p_l = v-(p_h-u);
   1.160      z_h = cp_h*p_h;             /* cp_h+cp_l = 2/(3*log2) */
   1.161      z_l = cp_l*p_h+p_l*cp+dp_l[k];
   1.162      /* log2(ax) = (ss+..)*2/(3*log2) = n + dp_h + z_h + z_l */
   1.163      t = (double)n;
   1.164      t1 = (((z_h+z_l)+dp_h[k])+t);
   1.165 -    __LO(t1) = 0;
   1.166 +    set_low(&t1, 0);
   1.167      t2 = z_l-(((t1-t)-dp_h[k])-z_h);
   1.168    }
   1.169  
   1.170    /* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */
   1.171    y1  = y;
   1.172 -  __LO(y1) = 0;
   1.173 +  set_low(&y1, 0);
   1.174    p_l = (y-y1)*t1+y*t2;
   1.175    p_h = y1*t1;
   1.176    z = p_l+p_h;
   1.177 -  j = __HI(z);
   1.178 -  i = __LO(z);
   1.179 +  j = high(z);
   1.180 +  i = low(z);
   1.181    if (j>=0x40900000) {                          /* z >= 1024 */
   1.182      if(((j-0x40900000)|i)!=0)                   /* if z > 1024 */
   1.183        return s*hugeX*hugeX;                     /* overflow */
   1.184 @@ -631,13 +632,13 @@
   1.185      n = j+(0x00100000>>(k+1));
   1.186      k = ((n&0x7fffffff)>>20)-0x3ff;     /* new k for n */
   1.187      t = zeroX;
   1.188 -    __HI(t) = (n&~(0x000fffff>>k));
   1.189 +    set_high(&t, (n&~(0x000fffff>>k)));
   1.190      n = ((n&0x000fffff)|0x00100000)>>(20-k);
   1.191      if(j<0) n = -n;
   1.192      p_h -= t;
   1.193    }
   1.194    t = p_l+p_h;
   1.195 -  __LO(t) = 0;
   1.196 +  set_low(&t, 0);
   1.197    u = t*lg2_h;
   1.198    v = (p_l-(t-p_h))*lg2+t*lg2_l;
   1.199    z = u+v;
   1.200 @@ -646,10 +647,10 @@
   1.201    t1  = z - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
   1.202    r  = (z*t1)/(t1-two)-(w+z*w);
   1.203    z  = one-(r-z);
   1.204 -  j  = __HI(z);
   1.205 +  j  = high(z);
   1.206    j += (n<<20);
   1.207    if((j>>20)<=0) z = scalbnA(z,n);       /* subnormal output */
   1.208 -  else __HI(z) += (n<<20);
   1.209 +  else set_high(&z, high(z) + (n<<20));
   1.210    return s*z;
   1.211  }
   1.212  

mercurial