16148 format %{ "String IndexOf char[] $str1,$cnt1,$ch -> $result" %} 16149 16150 ins_encode %{ 16151 __ string_indexof_char($str1$$Register, $cnt1$$Register, $ch$$Register, 16152 $result$$Register, $tmp1$$Register, $tmp2$$Register, 16153 $tmp3$$Register); 16154 %} 16155 ins_pipe(pipe_class_memory); 16156 %} 16157 16158 instruct string_equalsL(iRegP_R1 str1, iRegP_R3 str2, iRegI_R4 cnt, 16159 iRegI_R0 result, rFlagsReg cr) 16160 %{ 16161 predicate(((StrEqualsNode*)n)->encoding() == StrIntrinsicNode::LL); 16162 match(Set result (StrEquals (Binary str1 str2) cnt)); 16163 effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt, KILL cr); 16164 16165 format %{ "String Equals $str1,$str2,$cnt -> $result" %} 16166 ins_encode %{ 16167 // Count is in 8-bit bytes; non-Compact chars are 16 bits. 16168 __ arrays_equals($str1$$Register, $str2$$Register, 16169 $result$$Register, $cnt$$Register, 16170 1, /*is_string*/true); 16171 %} 16172 ins_pipe(pipe_class_memory); 16173 %} 16174 16175 instruct string_equalsU(iRegP_R1 str1, iRegP_R3 str2, iRegI_R4 cnt, 16176 iRegI_R0 result, rFlagsReg cr) 16177 %{ 16178 predicate(((StrEqualsNode*)n)->encoding() == StrIntrinsicNode::UU); 16179 match(Set result (StrEquals (Binary str1 str2) cnt)); 16180 effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt, KILL cr); 16181 16182 format %{ "String Equals $str1,$str2,$cnt -> $result" %} 16183 ins_encode %{ 16184 // Count is in 8-bit bytes; non-Compact chars are 16 bits. 16185 __ asrw($cnt$$Register, $cnt$$Register, 1); 16186 __ arrays_equals($str1$$Register, $str2$$Register, 16187 $result$$Register, $cnt$$Register, 16188 2, /*is_string*/true); 16189 %} 16190 ins_pipe(pipe_class_memory); 16191 %} 16192 16193 instruct array_equalsB(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result, 16194 iRegP_R10 tmp, rFlagsReg cr) 16195 %{ 16196 predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::LL); 16197 match(Set result (AryEq ary1 ary2)); 16198 effect(KILL tmp, USE_KILL ary1, USE_KILL ary2, KILL cr); 16199 16200 format %{ "Array Equals $ary1,ary2 -> $result // KILL $tmp" %} 16201 ins_encode %{ 16202 __ arrays_equals($ary1$$Register, $ary2$$Register, 16203 $result$$Register, $tmp$$Register, 16204 1, /*is_string*/false); 16205 %} 16206 ins_pipe(pipe_class_memory); 16207 %} 16208 16209 instruct array_equalsC(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result, 16210 iRegP_R10 tmp, rFlagsReg cr) 16211 %{ 16212 predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::UU); 16213 match(Set result (AryEq ary1 ary2)); 16214 effect(KILL tmp, USE_KILL ary1, USE_KILL ary2, KILL cr); 16215 16216 format %{ "Array Equals $ary1,ary2 -> $result // KILL $tmp" %} 16217 ins_encode %{ 16218 __ arrays_equals($ary1$$Register, $ary2$$Register, 16219 $result$$Register, $tmp$$Register, 16220 2, /*is_string*/false); 16221 %} 16222 ins_pipe(pipe_class_memory); 16223 %} 16224 16225 instruct has_negatives(iRegP_R1 ary1, iRegI_R2 len, iRegI_R0 result, rFlagsReg cr) 16226 %{ 16227 match(Set result (HasNegatives ary1 len)); 16228 effect(USE_KILL ary1, USE_KILL len, KILL cr); 16229 format %{ "has negatives byte[] $ary1,$len -> $result" %} 16230 ins_encode %{ 16231 __ has_negatives($ary1$$Register, $len$$Register, $result$$Register); 16232 %} 16233 ins_pipe( pipe_slow ); 16234 %} 16235 16236 // fast char[] to byte[] compression 16237 instruct string_compress(iRegP_R2 src, iRegP_R1 dst, iRegI_R3 len, 16238 vRegD_V0 tmp1, vRegD_V1 tmp2, 16239 vRegD_V2 tmp3, vRegD_V3 tmp4, 16240 iRegI_R0 result, rFlagsReg cr) | 16148 format %{ "String IndexOf char[] $str1,$cnt1,$ch -> $result" %} 16149 16150 ins_encode %{ 16151 __ string_indexof_char($str1$$Register, $cnt1$$Register, $ch$$Register, 16152 $result$$Register, $tmp1$$Register, $tmp2$$Register, 16153 $tmp3$$Register); 16154 %} 16155 ins_pipe(pipe_class_memory); 16156 %} 16157 16158 instruct string_equalsL(iRegP_R1 str1, iRegP_R3 str2, iRegI_R4 cnt, 16159 iRegI_R0 result, rFlagsReg cr) 16160 %{ 16161 predicate(((StrEqualsNode*)n)->encoding() == StrIntrinsicNode::LL); 16162 match(Set result (StrEquals (Binary str1 str2) cnt)); 16163 effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt, KILL cr); 16164 16165 format %{ "String Equals $str1,$str2,$cnt -> $result" %} 16166 ins_encode %{ 16167 // Count is in 8-bit bytes; non-Compact chars are 16 bits. 16168 __ string_equals($str1$$Register, $str2$$Register, 16169 $result$$Register, $cnt$$Register, 1); 16170 %} 16171 ins_pipe(pipe_class_memory); 16172 %} 16173 16174 instruct string_equalsU(iRegP_R1 str1, iRegP_R3 str2, iRegI_R4 cnt, 16175 iRegI_R0 result, rFlagsReg cr) 16176 %{ 16177 predicate(((StrEqualsNode*)n)->encoding() == StrIntrinsicNode::UU); 16178 match(Set result (StrEquals (Binary str1 str2) cnt)); 16179 effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt, KILL cr); 16180 16181 format %{ "String Equals $str1,$str2,$cnt -> $result" %} 16182 ins_encode %{ 16183 // Count is in 8-bit bytes; non-Compact chars are 16 bits. 16184 __ string_equals($str1$$Register, $str2$$Register, 16185 $result$$Register, $cnt$$Register, 2); 16186 %} 16187 ins_pipe(pipe_class_memory); 16188 %} 16189 16190 instruct array_equalsB(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result, 16191 iRegP_R3 tmp1, iRegP_R4 tmp2, iRegP_R5 tmp3, 16192 iRegP_R10 tmp, rFlagsReg cr) 16193 %{ 16194 predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::LL); 16195 match(Set result (AryEq ary1 ary2)); 16196 effect(KILL tmp, USE_KILL ary1, USE_KILL ary2, TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); 16197 16198 format %{ "Array Equals $ary1,ary2 -> $result // KILL $tmp" %} 16199 ins_encode %{ 16200 __ arrays_equals($ary1$$Register, $ary2$$Register, 16201 $tmp1$$Register, $tmp2$$Register, $tmp3$$Register, 16202 $result$$Register, $tmp$$Register, 1); 16203 %} 16204 ins_pipe(pipe_class_memory); 16205 %} 16206 16207 instruct array_equalsC(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result, 16208 iRegP_R3 tmp1, iRegP_R4 tmp2, iRegP_R5 tmp3, 16209 iRegP_R10 tmp, rFlagsReg cr) 16210 %{ 16211 predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::UU); 16212 match(Set result (AryEq ary1 ary2)); 16213 effect(KILL tmp, USE_KILL ary1, USE_KILL ary2, TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); 16214 16215 format %{ "Array Equals $ary1,ary2 -> $result // KILL $tmp" %} 16216 ins_encode %{ 16217 __ arrays_equals($ary1$$Register, $ary2$$Register, 16218 $tmp1$$Register, $tmp2$$Register, $tmp3$$Register, 16219 $result$$Register, $tmp$$Register, 2); 16220 %} 16221 ins_pipe(pipe_class_memory); 16222 %} 16223 16224 instruct has_negatives(iRegP_R1 ary1, iRegI_R2 len, iRegI_R0 result, rFlagsReg cr) 16225 %{ 16226 match(Set result (HasNegatives ary1 len)); 16227 effect(USE_KILL ary1, USE_KILL len, KILL cr); 16228 format %{ "has negatives byte[] $ary1,$len -> $result" %} 16229 ins_encode %{ 16230 __ has_negatives($ary1$$Register, $len$$Register, $result$$Register); 16231 %} 16232 ins_pipe( pipe_slow ); 16233 %} 16234 16235 // fast char[] to byte[] compression 16236 instruct string_compress(iRegP_R2 src, iRegP_R1 dst, iRegI_R3 len, 16237 vRegD_V0 tmp1, vRegD_V1 tmp2, 16238 vRegD_V2 tmp3, vRegD_V3 tmp4, 16239 iRegI_R0 result, rFlagsReg cr) |