diff src/hotspot/share/opto/mulnode.cpp @ 53643:7d3cde494494

8214206: Fix for JDK-8213419 is broken on 32-bit Reviewed-by: mdoerr, shade
author roland
date Thu, 22 Nov 2018 17:25:47 +0100
parents 1089e8fd8439
children 0037ea3c7322
line wrap: on
line diff
--- a/src/hotspot/share/opto/mulnode.cpp	Fri Nov 23 10:57:07 2018 +0100
+++ b/src/hotspot/share/opto/mulnode.cpp	Thu Nov 22 17:25:47 2018 +0100
@@ -199,21 +199,21 @@
   Node *res = NULL;
   unsigned int bit1 = abs_con & (0-abs_con);       // Extract low bit
   if (bit1 == abs_con) {           // Found a power of 2?
-    res = new LShiftINode(in(1), phase->intcon(log2_intptr(bit1)));
+    res = new LShiftINode(in(1), phase->intcon(log2_uint(bit1)));
   } else {
 
     // Check for constant with 2 bits set
     unsigned int bit2 = abs_con-bit1;
     bit2 = bit2 & (0-bit2);          // Extract 2nd bit
     if (bit2 + bit1 == abs_con) {    // Found all bits in con?
-      Node *n1 = phase->transform( new LShiftINode(in(1), phase->intcon(log2_intptr(bit1))));
-      Node *n2 = phase->transform( new LShiftINode(in(1), phase->intcon(log2_intptr(bit2))));
+      Node *n1 = phase->transform( new LShiftINode(in(1), phase->intcon(log2_uint(bit1))));
+      Node *n2 = phase->transform( new LShiftINode(in(1), phase->intcon(log2_uint(bit2))));
       res = new AddINode(n2, n1);
 
     } else if (is_power_of_2(abs_con+1)) {
       // Sleezy: power-of-2 -1.  Next time be generic.
       unsigned int temp = abs_con + 1;
-      Node *n1 = phase->transform(new LShiftINode(in(1), phase->intcon(log2_intptr(temp))));
+      Node *n1 = phase->transform(new LShiftINode(in(1), phase->intcon(log2_uint(temp))));
       res = new SubINode(n1, in(1));
     } else {
       return MulNode::Ideal(phase, can_reshape);
@@ -445,7 +445,7 @@
     // Masking off high bits which are always zero is useless.
     const TypeInt* t1 = phase->type( in(1) )->isa_int();
     if (t1 != NULL && t1->_lo >= 0) {
-      jint t1_support = right_n_bits(1 + log2_intptr(t1->_hi));
+      jint t1_support = right_n_bits(1 + log2_jint(t1->_hi));
       if ((t1_support & con) == t1_support)
         return in1;
     }