14133 %} 14134 14135 instruct partialSubtypeCheckVsZero(iRegP_R4 sub, iRegP_R0 super, iRegP_R2 temp, iRegP_R5 result, immP0 zero, rFlagsReg cr) 14136 %{ 14137 match(Set cr (CmpP (PartialSubtypeCheck sub super) zero)); 14138 effect(KILL temp, KILL result); 14139 14140 ins_cost(1100); // slightly larger than the next version 14141 format %{ "partialSubtypeCheck $result, $sub, $super == 0" %} 14142 14143 ins_encode(aarch64_enc_partial_subtype_check(sub, super, temp, result)); 14144 14145 opcode(0x0); // Don't zero result reg on hit 14146 14147 ins_pipe(pipe_class_memory); 14148 %} 14149 14150 instruct string_compare(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 cnt2, 14151 iRegI_R0 result, iRegP_R10 tmp1, rFlagsReg cr) 14152 %{ 14153 match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); 14154 effect(KILL tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); 14155 14156 format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result # KILL $tmp1" %} 14157 ins_encode %{ 14158 __ string_compare($str1$$Register, $str2$$Register, 14159 $cnt1$$Register, $cnt2$$Register, $result$$Register, 14160 $tmp1$$Register); 14161 %} 14162 ins_pipe(pipe_class_memory); 14163 %} 14164 14165 instruct string_indexof(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 cnt2, 14166 iRegI_R0 result, iRegI tmp1, iRegI tmp2, iRegI tmp3, iRegI tmp4, rFlagsReg cr) 14167 %{ 14168 match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2))); 14169 effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, 14170 TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL cr); 14171 format %{ "String IndexOf $str1,$cnt1,$str2,$cnt2 -> $result" %} 14172 14173 ins_encode %{ 14174 __ string_indexof($str1$$Register, $str2$$Register, 14175 $cnt1$$Register, $cnt2$$Register, 14176 $tmp1$$Register, $tmp2$$Register, 14177 $tmp3$$Register, $tmp4$$Register, 14178 -1, $result$$Register); 14179 %} 14180 ins_pipe(pipe_class_memory); 14181 %} 14182 14183 instruct string_indexof_con(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, 14184 immI_le_4 int_cnt2, iRegI_R0 result, iRegI tmp1, iRegI tmp2, 14185 iRegI tmp3, iRegI tmp4, rFlagsReg cr) 14186 %{ 14187 match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2))); 14188 effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt1, 14189 TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL cr); 14190 format %{ "String IndexOf $str1,$cnt1,$str2,$int_cnt2 -> $result" %} 14191 14192 ins_encode %{ 14193 int icnt2 = (int)$int_cnt2$$constant; 14194 __ string_indexof($str1$$Register, $str2$$Register, 14195 $cnt1$$Register, zr, 14196 $tmp1$$Register, $tmp2$$Register, 14197 $tmp3$$Register, $tmp4$$Register, 14198 icnt2, $result$$Register); 14199 %} 14200 ins_pipe(pipe_class_memory); 14201 %} 14202 14203 instruct string_equals(iRegP_R1 str1, iRegP_R3 str2, iRegI_R4 cnt, 14204 iRegI_R0 result, iRegP_R10 tmp, rFlagsReg cr) 14205 %{ 14206 match(Set result (StrEquals (Binary str1 str2) cnt)); 14207 effect(KILL tmp, USE_KILL str1, USE_KILL str2, USE_KILL cnt, KILL cr); 14208 14209 format %{ "String Equals $str1,$str2,$cnt -> $result // KILL $tmp" %} 14210 ins_encode %{ 14211 __ string_equals($str1$$Register, $str2$$Register, 14212 $cnt$$Register, $result$$Register, 14213 $tmp$$Register); 14214 %} 14215 ins_pipe(pipe_class_memory); 14216 %} 14217 14218 instruct array_equals(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result, 14219 iRegP_R10 tmp, rFlagsReg cr) 14220 %{ 14221 match(Set result (AryEq ary1 ary2)); 14222 effect(KILL tmp, USE_KILL ary1, USE_KILL ary2, KILL cr); 14223 14224 format %{ "Array Equals $ary1,ary2 -> $result // KILL $tmp" %} 14225 ins_encode %{ 14226 __ char_arrays_equals($ary1$$Register, $ary2$$Register, 14227 $result$$Register, $tmp$$Register); 14228 %} 14229 ins_pipe(pipe_class_memory); 14230 %} 14231 14232 // encode char[] to byte[] in ISO_8859_1 14233 instruct encode_iso_array(iRegP_R2 src, iRegP_R1 dst, iRegI_R3 len, 14234 vRegD_V0 Vtmp1, vRegD_V1 Vtmp2, 14235 vRegD_V2 Vtmp3, vRegD_V3 Vtmp4, 14236 iRegI_R0 result, rFlagsReg cr) 14237 %{ 14238 match(Set result (EncodeISOArray src (Binary dst len))); 14239 effect(USE_KILL src, USE_KILL dst, USE_KILL len, 14240 KILL Vtmp1, KILL Vtmp2, KILL Vtmp3, KILL Vtmp4, KILL cr); | 14133 %} 14134 14135 instruct partialSubtypeCheckVsZero(iRegP_R4 sub, iRegP_R0 super, iRegP_R2 temp, iRegP_R5 result, immP0 zero, rFlagsReg cr) 14136 %{ 14137 match(Set cr (CmpP (PartialSubtypeCheck sub super) zero)); 14138 effect(KILL temp, KILL result); 14139 14140 ins_cost(1100); // slightly larger than the next version 14141 format %{ "partialSubtypeCheck $result, $sub, $super == 0" %} 14142 14143 ins_encode(aarch64_enc_partial_subtype_check(sub, super, temp, result)); 14144 14145 opcode(0x0); // Don't zero result reg on hit 14146 14147 ins_pipe(pipe_class_memory); 14148 %} 14149 14150 instruct string_compare(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 cnt2, 14151 iRegI_R0 result, iRegP_R10 tmp1, rFlagsReg cr) 14152 %{ 14153 predicate(!CompactStrings); 14154 match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); 14155 effect(KILL tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); 14156 14157 format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result # KILL $tmp1" %} 14158 ins_encode %{ 14159 __ string_compare($str1$$Register, $str2$$Register, 14160 $cnt1$$Register, $cnt2$$Register, $result$$Register, 14161 $tmp1$$Register); 14162 %} 14163 ins_pipe(pipe_class_memory); 14164 %} 14165 14166 instruct string_indexof(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 cnt2, 14167 iRegI_R0 result, iRegI tmp1, iRegI tmp2, iRegI tmp3, iRegI tmp4, rFlagsReg cr) 14168 %{ 14169 predicate(!CompactStrings); 14170 match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2))); 14171 effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, 14172 TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL cr); 14173 format %{ "String IndexOf $str1,$cnt1,$str2,$cnt2 -> $result" %} 14174 14175 ins_encode %{ 14176 __ string_indexof($str1$$Register, $str2$$Register, 14177 $cnt1$$Register, $cnt2$$Register, 14178 $tmp1$$Register, $tmp2$$Register, 14179 $tmp3$$Register, $tmp4$$Register, 14180 -1, $result$$Register); 14181 %} 14182 ins_pipe(pipe_class_memory); 14183 %} 14184 14185 instruct string_indexof_con(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, 14186 immI_le_4 int_cnt2, iRegI_R0 result, iRegI tmp1, iRegI tmp2, 14187 iRegI tmp3, iRegI tmp4, rFlagsReg cr) 14188 %{ 14189 predicate(!CompactStrings); 14190 match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2))); 14191 effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt1, 14192 TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL cr); 14193 format %{ "String IndexOf $str1,$cnt1,$str2,$int_cnt2 -> $result" %} 14194 14195 ins_encode %{ 14196 int icnt2 = (int)$int_cnt2$$constant; 14197 __ string_indexof($str1$$Register, $str2$$Register, 14198 $cnt1$$Register, zr, 14199 $tmp1$$Register, $tmp2$$Register, 14200 $tmp3$$Register, $tmp4$$Register, 14201 icnt2, $result$$Register); 14202 %} 14203 ins_pipe(pipe_class_memory); 14204 %} 14205 14206 instruct string_equals(iRegP_R1 str1, iRegP_R3 str2, iRegI_R4 cnt, 14207 iRegI_R0 result, iRegP_R10 tmp, rFlagsReg cr) 14208 %{ 14209 predicate(!CompactStrings); 14210 match(Set result (StrEquals (Binary str1 str2) cnt)); 14211 effect(KILL tmp, USE_KILL str1, USE_KILL str2, USE_KILL cnt, KILL cr); 14212 14213 format %{ "String Equals $str1,$str2,$cnt -> $result // KILL $tmp" %} 14214 ins_encode %{ 14215 __ string_equals($str1$$Register, $str2$$Register, 14216 $cnt$$Register, $result$$Register, 14217 $tmp$$Register); 14218 %} 14219 ins_pipe(pipe_class_memory); 14220 %} 14221 14222 instruct array_equals(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result, 14223 iRegP_R10 tmp, rFlagsReg cr) 14224 %{ 14225 predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::UU); 14226 match(Set result (AryEq ary1 ary2)); 14227 effect(KILL tmp, USE_KILL ary1, USE_KILL ary2, KILL cr); 14228 14229 format %{ "Array Equals $ary1,ary2 -> $result // KILL $tmp" %} 14230 ins_encode %{ 14231 __ char_arrays_equals($ary1$$Register, $ary2$$Register, 14232 $result$$Register, $tmp$$Register); 14233 %} 14234 ins_pipe(pipe_class_memory); 14235 %} 14236 14237 // encode char[] to byte[] in ISO_8859_1 14238 instruct encode_iso_array(iRegP_R2 src, iRegP_R1 dst, iRegI_R3 len, 14239 vRegD_V0 Vtmp1, vRegD_V1 Vtmp2, 14240 vRegD_V2 Vtmp3, vRegD_V3 Vtmp4, 14241 iRegI_R0 result, rFlagsReg cr) 14242 %{ 14243 match(Set result (EncodeISOArray src (Binary dst len))); 14244 effect(USE_KILL src, USE_KILL dst, USE_KILL len, 14245 KILL Vtmp1, KILL Vtmp2, KILL Vtmp3, KILL Vtmp4, KILL cr); |