comparison src/share/vm/opto/vectornode.cpp @ 6893:b2c669fd8114

8001183: incorrect results of char vectors right shift operaiton Summary: do vector right shift operation for small int types only after loads Reviewed-by: jrose, dlong
author kvn
date Tue, 23 Oct 2012 13:06:37 -0700
parents aaeb9add1ab3
children
comparison
equal deleted inserted replaced
6892:fd1d564dd460 6893:b2c669fd8114
101 case Op_LShiftL: 101 case Op_LShiftL:
102 assert(bt == T_LONG, "must be"); 102 assert(bt == T_LONG, "must be");
103 return Op_LShiftVL; 103 return Op_LShiftVL;
104 case Op_RShiftI: 104 case Op_RShiftI:
105 switch (bt) { 105 switch (bt) {
106 case T_BOOLEAN: 106 case T_BOOLEAN:return Op_URShiftVB; // boolean is unsigned value
107 case T_CHAR: return Op_URShiftVS; // char is unsigned value
107 case T_BYTE: return Op_RShiftVB; 108 case T_BYTE: return Op_RShiftVB;
108 case T_CHAR:
109 case T_SHORT: return Op_RShiftVS; 109 case T_SHORT: return Op_RShiftVS;
110 case T_INT: return Op_RShiftVI; 110 case T_INT: return Op_RShiftVI;
111 } 111 }
112 ShouldNotReachHere(); 112 ShouldNotReachHere();
113 case Op_RShiftL: 113 case Op_RShiftL:
114 assert(bt == T_LONG, "must be"); 114 assert(bt == T_LONG, "must be");
115 return Op_RShiftVL; 115 return Op_RShiftVL;
116 case Op_URShiftI: 116 case Op_URShiftI:
117 switch (bt) { 117 switch (bt) {
118 case T_BOOLEAN: 118 case T_BOOLEAN:return Op_URShiftVB;
119 case T_BYTE: return Op_URShiftVB; 119 case T_CHAR: return Op_URShiftVS;
120 case T_CHAR: 120 case T_BYTE:
121 case T_SHORT: return Op_URShiftVS; 121 case T_SHORT: return 0; // Vector logical right shift for signed short
122 // values produces incorrect Java result for
123 // negative data because java code should convert
124 // a short value into int value with sign
125 // extension before a shift.
122 case T_INT: return Op_URShiftVI; 126 case T_INT: return Op_URShiftVI;
123 } 127 }
124 ShouldNotReachHere(); 128 ShouldNotReachHere();
125 case Op_URShiftL: 129 case Op_URShiftL:
126 assert(bt == T_LONG, "must be"); 130 assert(bt == T_LONG, "must be");