16137 %} 16138 16139 instruct string_indexofU_char(iRegP_R1 str1, iRegI_R2 cnt1, iRegI_R3 ch, 16140 iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, 16141 iRegINoSp tmp3, rFlagsReg cr) 16142 %{ 16143 match(Set result (StrIndexOfChar (Binary str1 cnt1) ch)); 16144 effect(USE_KILL str1, USE_KILL cnt1, USE_KILL ch, 16145 TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); 16146 16147 format %{ "String IndexOf char[] $str1,$cnt1,$ch -> $result" %} 16148 16149 ins_encode %{ 16150 __ string_indexof_char($str1$$Register, $cnt1$$Register, $ch$$Register, 16151 $result$$Register, $tmp1$$Register, $tmp2$$Register, 16152 $tmp3$$Register); 16153 %} 16154 ins_pipe(pipe_class_memory); 16155 %} 16156 16157 instruct string_equalsL(iRegP_R1 str1, iRegP_R3 str2, iRegI_R4 cnt, 16158 iRegI_R0 result, rFlagsReg cr) 16159 %{ 16160 predicate(((StrEqualsNode*)n)->encoding() == StrIntrinsicNode::LL); 16161 match(Set result (StrEquals (Binary str1 str2) cnt)); 16162 effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt, KILL cr); 16163 16164 format %{ "String Equals $str1,$str2,$cnt -> $result" %} 16165 ins_encode %{ 16166 // Count is in 8-bit bytes; non-Compact chars are 16 bits. 16167 __ arrays_equals($str1$$Register, $str2$$Register, 16168 $result$$Register, $cnt$$Register, 16169 1, /*is_string*/true); 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 __ asrw($cnt$$Register, $cnt$$Register, 1); 16185 __ arrays_equals($str1$$Register, $str2$$Register, 16186 $result$$Register, $cnt$$Register, 16187 2, /*is_string*/true); 16188 %} 16189 ins_pipe(pipe_class_memory); 16190 %} 16191 16192 instruct array_equalsB(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result, 16193 iRegP_R10 tmp, rFlagsReg cr) 16194 %{ 16195 predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::LL); 16196 match(Set result (AryEq ary1 ary2)); 16197 effect(KILL tmp, USE_KILL ary1, USE_KILL ary2, KILL cr); 16198 16199 format %{ "Array Equals $ary1,ary2 -> $result // KILL $tmp" %} 16200 ins_encode %{ 16201 __ arrays_equals($ary1$$Register, $ary2$$Register, 16202 $result$$Register, $tmp$$Register, 16203 1, /*is_string*/false); 16204 %} 16205 ins_pipe(pipe_class_memory); 16206 %} 16207 16208 instruct array_equalsC(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result, 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, KILL cr); 16214 16215 format %{ "Array Equals $ary1,ary2 -> $result // KILL $tmp" %} 16216 ins_encode %{ 16217 __ arrays_equals($ary1$$Register, $ary2$$Register, 16218 $result$$Register, $tmp$$Register, 16219 2, /*is_string*/false); 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 %{ | 16137 %} 16138 16139 instruct string_indexofU_char(iRegP_R1 str1, iRegI_R2 cnt1, iRegI_R3 ch, 16140 iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, 16141 iRegINoSp tmp3, rFlagsReg cr) 16142 %{ 16143 match(Set result (StrIndexOfChar (Binary str1 cnt1) ch)); 16144 effect(USE_KILL str1, USE_KILL cnt1, USE_KILL ch, 16145 TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr); 16146 16147 format %{ "String IndexOf char[] $str1,$cnt1,$ch -> $result" %} 16148 16149 ins_encode %{ 16150 __ string_indexof_char($str1$$Register, $cnt1$$Register, $ch$$Register, 16151 $result$$Register, $tmp1$$Register, $tmp2$$Register, 16152 $tmp3$$Register); 16153 %} 16154 ins_pipe(pipe_class_memory); 16155 %} 16156 16157 instruct string_equalsL(iRegP_R1 str1, iRegP_R3 str2, iRegP_R4 cnt, 16158 iRegI_R0 result, rFlagsReg cr) 16159 %{ 16160 predicate(((StrEqualsNode*)n)->encoding() == StrIntrinsicNode::LL); 16161 match(Set result (StrEquals (Binary str1 str2) cnt)); 16162 effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt, KILL cr); 16163 16164 format %{ "String Equals $str1,$str2,$cnt -> $result" %} 16165 ins_encode %{ 16166 // Count is in 8-bit bytes; non-Compact chars are 16 bits. 16167 __ arrays_equals($str1$$Register, $str2$$Register, 16168 $result$$Register, $cnt$$Register, 16169 1, /*is_string*/true); 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 __ asrw($cnt$$Register, $cnt$$Register, 1); 16185 __ arrays_equals($str1$$Register, $str2$$Register, 16186 $result$$Register, $cnt$$Register, 16187 2, /*is_string*/true); 16188 %} 16189 ins_pipe(pipe_class_memory); 16190 %} 16191 16192 instruct array_equalsB(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result, 16193 iRegP_R4 tmp, rFlagsReg cr) 16194 %{ 16195 predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::LL); 16196 match(Set result (AryEq ary1 ary2)); 16197 effect(KILL tmp, USE_KILL ary1, USE_KILL ary2, KILL cr); 16198 16199 format %{ "Array Equals $ary1,ary2 -> $result // KILL $tmp" %} 16200 ins_encode %{ 16201 __ arrays_equals($ary1$$Register, $ary2$$Register, 16202 $result$$Register, $tmp$$Register, 16203 1, /*is_string*/false); 16204 %} 16205 ins_pipe(pipe_class_memory); 16206 %} 16207 16208 instruct array_equalsC(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result, 16209 iRegP_R4 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, KILL cr); 16214 16215 format %{ "Array Equals $ary1,ary2 -> $result // KILL $tmp" %} 16216 ins_encode %{ 16217 __ arrays_equals($ary1$$Register, $ary2$$Register, 16218 $result$$Register, $tmp$$Register, 16219 2, /*is_string*/false); 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 %{ |