10445 __ clear_mem($base$$Register, $cnt$$Register, $zero$$Register); 10446 %} 10447 ins_pipe(pipe_slow); 10448 %} 10449 10450 instruct rep_fast_stosb(rcx_RegL cnt, rdi_RegP base, rax_RegI zero, Universe dummy, 10451 rFlagsReg cr) 10452 %{ 10453 predicate(UseFastStosb); 10454 match(Set dummy (ClearArray cnt base)); 10455 effect(USE_KILL cnt, USE_KILL base, KILL zero, KILL cr); 10456 format %{ "xorq rax, rax\t# ClearArray:\n\t" 10457 "shlq rcx,3\t# Convert doublewords to bytes\n\t" 10458 "rep stosb\t# Store rax to *rdi++ while rcx--" %} 10459 ins_encode %{ 10460 __ clear_mem($base$$Register, $cnt$$Register, $zero$$Register); 10461 %} 10462 ins_pipe( pipe_slow ); 10463 %} 10464 10465 instruct string_compare(rdi_RegP str1, rcx_RegI cnt1, rsi_RegP str2, rdx_RegI cnt2, 10466 rax_RegI result, regD tmp1, rFlagsReg cr) 10467 %{ 10468 match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); 10469 effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); 10470 10471 format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result // KILL $tmp1" %} 10472 ins_encode %{ 10473 __ string_compare($str1$$Register, $str2$$Register, 10474 $cnt1$$Register, $cnt2$$Register, $result$$Register, 10475 $tmp1$$XMMRegister); 10476 %} 10477 ins_pipe( pipe_slow ); 10478 %} 10479 10480 // fast search of substring with known size. 10481 instruct string_indexof_con(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, immI int_cnt2, 10482 rbx_RegI result, regD vec, rax_RegI cnt2, rcx_RegI tmp, rFlagsReg cr) 10483 %{ 10484 predicate(UseSSE42Intrinsics); 10485 match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2))); 10486 effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, KILL cnt2, KILL tmp, KILL cr); 10487 10488 format %{ "String IndexOf $str1,$cnt1,$str2,$int_cnt2 -> $result // KILL $vec, $cnt1, $cnt2, $tmp" %} 10489 ins_encode %{ 10490 int icnt2 = (int)$int_cnt2$$constant; 10491 if (icnt2 >= 8) { 10492 // IndexOf for constant substrings with size >= 8 elements 10493 // which don't need to be loaded through stack. 10494 __ string_indexofC8($str1$$Register, $str2$$Register, 10495 $cnt1$$Register, $cnt2$$Register, 10496 icnt2, $result$$Register, 10497 $vec$$XMMRegister, $tmp$$Register); 10498 } else { 10499 // Small strings are loaded through stack if they cross page boundary. 10500 __ string_indexof($str1$$Register, $str2$$Register, 10501 $cnt1$$Register, $cnt2$$Register, 10502 icnt2, $result$$Register, 10503 $vec$$XMMRegister, $tmp$$Register); 10504 } 10505 %} 10506 ins_pipe( pipe_slow ); 10507 %} 10508 10509 instruct string_indexof(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, rax_RegI cnt2, 10510 rbx_RegI result, regD vec, rcx_RegI tmp, rFlagsReg cr) 10511 %{ 10512 predicate(UseSSE42Intrinsics); 10513 match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2))); 10514 effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL tmp, KILL cr); 10515 10516 format %{ "String IndexOf $str1,$cnt1,$str2,$cnt2 -> $result // KILL all" %} 10517 ins_encode %{ 10518 __ string_indexof($str1$$Register, $str2$$Register, 10519 $cnt1$$Register, $cnt2$$Register, 10520 (-1), $result$$Register, 10521 $vec$$XMMRegister, $tmp$$Register); 10522 %} 10523 ins_pipe( pipe_slow ); 10524 %} 10525 10526 // fast string equals 10527 instruct string_equals(rdi_RegP str1, rsi_RegP str2, rcx_RegI cnt, rax_RegI result, 10528 regD tmp1, regD tmp2, rbx_RegI tmp3, rFlagsReg cr) 10529 %{ 10530 match(Set result (StrEquals (Binary str1 str2) cnt)); 10531 effect(TEMP tmp1, TEMP tmp2, USE_KILL str1, USE_KILL str2, USE_KILL cnt, KILL tmp3, KILL cr); 10532 10533 format %{ "String Equals $str1,$str2,$cnt -> $result // KILL $tmp1, $tmp2, $tmp3" %} 10534 ins_encode %{ 10535 __ char_arrays_equals(false, $str1$$Register, $str2$$Register, 10536 $cnt$$Register, $result$$Register, $tmp3$$Register, 10537 $tmp1$$XMMRegister, $tmp2$$XMMRegister); 10538 %} 10539 ins_pipe( pipe_slow ); 10540 %} 10541 10542 // fast array equals 10543 instruct array_equals(rdi_RegP ary1, rsi_RegP ary2, rax_RegI result, 10544 regD tmp1, regD tmp2, rcx_RegI tmp3, rbx_RegI tmp4, rFlagsReg cr) 10545 %{ 10546 match(Set result (AryEq ary1 ary2)); 10547 effect(TEMP tmp1, TEMP tmp2, USE_KILL ary1, USE_KILL ary2, KILL tmp3, KILL tmp4, KILL cr); 10548 //ins_cost(300); 10549 10550 format %{ "Array Equals $ary1,$ary2 -> $result // KILL $tmp1, $tmp2, $tmp3, $tmp4" %} 10551 ins_encode %{ 10552 __ char_arrays_equals(true, $ary1$$Register, $ary2$$Register, 10553 $tmp3$$Register, $result$$Register, $tmp4$$Register, 10554 $tmp1$$XMMRegister, $tmp2$$XMMRegister); 10555 %} 10556 ins_pipe( pipe_slow ); 10557 %} 10558 10559 // encode char[] to byte[] in ISO_8859_1 10560 instruct encode_iso_array(rsi_RegP src, rdi_RegP dst, rdx_RegI len, 10561 regD tmp1, regD tmp2, regD tmp3, regD tmp4, 10562 rcx_RegI tmp5, rax_RegI result, rFlagsReg cr) %{ 10563 match(Set result (EncodeISOArray src (Binary dst len))); 10564 effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, USE_KILL src, USE_KILL dst, USE_KILL len, KILL tmp5, KILL cr); 10565 10566 format %{ "Encode array $src,$dst,$len -> $result // KILL RCX, RDX, $tmp1, $tmp2, $tmp3, $tmp4, RSI, RDI " %} 10567 ins_encode %{ 10568 __ encode_iso_array($src$$Register, $dst$$Register, $len$$Register, 10569 $tmp1$$XMMRegister, $tmp2$$XMMRegister, $tmp3$$XMMRegister, 10570 $tmp4$$XMMRegister, $tmp5$$Register, $result$$Register); 10571 %} 10572 ins_pipe( pipe_slow ); 10573 %} 10574 | 10445 __ clear_mem($base$$Register, $cnt$$Register, $zero$$Register); 10446 %} 10447 ins_pipe(pipe_slow); 10448 %} 10449 10450 instruct rep_fast_stosb(rcx_RegL cnt, rdi_RegP base, rax_RegI zero, Universe dummy, 10451 rFlagsReg cr) 10452 %{ 10453 predicate(UseFastStosb); 10454 match(Set dummy (ClearArray cnt base)); 10455 effect(USE_KILL cnt, USE_KILL base, KILL zero, KILL cr); 10456 format %{ "xorq rax, rax\t# ClearArray:\n\t" 10457 "shlq rcx,3\t# Convert doublewords to bytes\n\t" 10458 "rep stosb\t# Store rax to *rdi++ while rcx--" %} 10459 ins_encode %{ 10460 __ clear_mem($base$$Register, $cnt$$Register, $zero$$Register); 10461 %} 10462 ins_pipe( pipe_slow ); 10463 %} 10464 10465 instruct string_compareL(rdi_RegP str1, rcx_RegI cnt1, rsi_RegP str2, rdx_RegI cnt2, 10466 rax_RegI result, regD tmp1, rFlagsReg cr) 10467 %{ 10468 predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::LL); 10469 match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); 10470 effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); 10471 10472 format %{ "String Compare byte[] $str1,$cnt1,$str2,$cnt2 -> $result // KILL $tmp1" %} 10473 ins_encode %{ 10474 __ string_compare($str1$$Register, $str2$$Register, 10475 $cnt1$$Register, $cnt2$$Register, $result$$Register, 10476 $tmp1$$XMMRegister, StrIntrinsicNode::LL); 10477 %} 10478 ins_pipe( pipe_slow ); 10479 %} 10480 10481 instruct string_compareU(rdi_RegP str1, rcx_RegI cnt1, rsi_RegP str2, rdx_RegI cnt2, 10482 rax_RegI result, regD tmp1, rFlagsReg cr) 10483 %{ 10484 predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::UU); 10485 match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); 10486 effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); 10487 10488 format %{ "String Compare char[] $str1,$cnt1,$str2,$cnt2 -> $result // KILL $tmp1" %} 10489 ins_encode %{ 10490 __ string_compare($str1$$Register, $str2$$Register, 10491 $cnt1$$Register, $cnt2$$Register, $result$$Register, 10492 $tmp1$$XMMRegister, StrIntrinsicNode::UU); 10493 %} 10494 ins_pipe( pipe_slow ); 10495 %} 10496 10497 instruct string_compareLU(rdi_RegP str1, rcx_RegI cnt1, rsi_RegP str2, rdx_RegI cnt2, 10498 rax_RegI result, regD tmp1, rFlagsReg cr) 10499 %{ 10500 predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::LU); 10501 match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); 10502 effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); 10503 10504 format %{ "String Compare byte[] $str1,$cnt1,$str2,$cnt2 -> $result // KILL $tmp1" %} 10505 ins_encode %{ 10506 __ string_compare($str1$$Register, $str2$$Register, 10507 $cnt1$$Register, $cnt2$$Register, $result$$Register, 10508 $tmp1$$XMMRegister, StrIntrinsicNode::LU); 10509 %} 10510 ins_pipe( pipe_slow ); 10511 %} 10512 10513 instruct string_compareUL(rsi_RegP str1, rdx_RegI cnt1, rdi_RegP str2, rcx_RegI cnt2, 10514 rax_RegI result, regD tmp1, rFlagsReg cr) 10515 %{ 10516 predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::UL); 10517 match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); 10518 effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); 10519 10520 format %{ "String Compare byte[] $str1,$cnt1,$str2,$cnt2 -> $result // KILL $tmp1" %} 10521 ins_encode %{ 10522 __ string_compare($str2$$Register, $str1$$Register, 10523 $cnt2$$Register, $cnt1$$Register, $result$$Register, 10524 $tmp1$$XMMRegister, StrIntrinsicNode::UL); 10525 %} 10526 ins_pipe( pipe_slow ); 10527 %} 10528 10529 // fast search of substring with known size. 10530 instruct string_indexof_conL(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, immI int_cnt2, 10531 rbx_RegI result, regD vec, rax_RegI cnt2, rcx_RegI tmp, rFlagsReg cr) 10532 %{ 10533 predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LL)); 10534 match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2))); 10535 effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, KILL cnt2, KILL tmp, KILL cr); 10536 10537 format %{ "String IndexOf byte[] $str1,$cnt1,$str2,$int_cnt2 -> $result // KILL $vec, $cnt1, $cnt2, $tmp" %} 10538 ins_encode %{ 10539 int icnt2 = (int)$int_cnt2$$constant; 10540 if (icnt2 >= 16) { 10541 // IndexOf for constant substrings with size >= 16 elements 10542 // which don't need to be loaded through stack. 10543 __ string_indexofC8($str1$$Register, $str2$$Register, 10544 $cnt1$$Register, $cnt2$$Register, 10545 icnt2, $result$$Register, 10546 $vec$$XMMRegister, $tmp$$Register, StrIntrinsicNode::LL); 10547 } else { 10548 // Small strings are loaded through stack if they cross page boundary. 10549 __ string_indexof($str1$$Register, $str2$$Register, 10550 $cnt1$$Register, $cnt2$$Register, 10551 icnt2, $result$$Register, 10552 $vec$$XMMRegister, $tmp$$Register, StrIntrinsicNode::LL); 10553 } 10554 %} 10555 ins_pipe( pipe_slow ); 10556 %} 10557 10558 // fast search of substring with known size. 10559 instruct string_indexof_conU(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, immI int_cnt2, 10560 rbx_RegI result, regD vec, rax_RegI cnt2, rcx_RegI tmp, rFlagsReg cr) 10561 %{ 10562 predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UU)); 10563 match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2))); 10564 effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, KILL cnt2, KILL tmp, KILL cr); 10565 10566 format %{ "String IndexOf char[] $str1,$cnt1,$str2,$int_cnt2 -> $result // KILL $vec, $cnt1, $cnt2, $tmp" %} 10567 ins_encode %{ 10568 int icnt2 = (int)$int_cnt2$$constant; 10569 if (icnt2 >= 8) { 10570 // IndexOf for constant substrings with size >= 8 elements 10571 // which don't need to be loaded through stack. 10572 __ string_indexofC8($str1$$Register, $str2$$Register, 10573 $cnt1$$Register, $cnt2$$Register, 10574 icnt2, $result$$Register, 10575 $vec$$XMMRegister, $tmp$$Register, StrIntrinsicNode::UU); 10576 } else { 10577 // Small strings are loaded through stack if they cross page boundary. 10578 __ string_indexof($str1$$Register, $str2$$Register, 10579 $cnt1$$Register, $cnt2$$Register, 10580 icnt2, $result$$Register, 10581 $vec$$XMMRegister, $tmp$$Register, StrIntrinsicNode::UU); 10582 } 10583 %} 10584 ins_pipe( pipe_slow ); 10585 %} 10586 10587 // fast search of substring with known size. 10588 instruct string_indexof_conUL(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, immI int_cnt2, 10589 rbx_RegI result, regD vec, rax_RegI cnt2, rcx_RegI tmp, rFlagsReg cr) 10590 %{ 10591 predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UL)); 10592 match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2))); 10593 effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, KILL cnt2, KILL tmp, KILL cr); 10594 10595 format %{ "String IndexOf char[] $str1,$cnt1,$str2,$int_cnt2 -> $result // KILL $vec, $cnt1, $cnt2, $tmp" %} 10596 ins_encode %{ 10597 int icnt2 = (int)$int_cnt2$$constant; 10598 if (icnt2 >= 8) { 10599 // IndexOf for constant substrings with size >= 8 elements 10600 // which don't need to be loaded through stack. 10601 __ string_indexofC8($str1$$Register, $str2$$Register, 10602 $cnt1$$Register, $cnt2$$Register, 10603 icnt2, $result$$Register, 10604 $vec$$XMMRegister, $tmp$$Register, StrIntrinsicNode::UL); 10605 } else { 10606 // Small strings are loaded through stack if they cross page boundary. 10607 __ string_indexof($str1$$Register, $str2$$Register, 10608 $cnt1$$Register, $cnt2$$Register, 10609 icnt2, $result$$Register, 10610 $vec$$XMMRegister, $tmp$$Register, StrIntrinsicNode::UL); 10611 } 10612 %} 10613 ins_pipe( pipe_slow ); 10614 %} 10615 10616 instruct string_indexofL(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, rax_RegI cnt2, 10617 rbx_RegI result, regD vec, rcx_RegI tmp, rFlagsReg cr) 10618 %{ 10619 predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LL)); 10620 match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2))); 10621 effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL tmp, KILL cr); 10622 10623 format %{ "String IndexOf byte[] $str1,$cnt1,$str2,$cnt2 -> $result // KILL all" %} 10624 ins_encode %{ 10625 __ string_indexof($str1$$Register, $str2$$Register, 10626 $cnt1$$Register, $cnt2$$Register, 10627 (-1), $result$$Register, 10628 $vec$$XMMRegister, $tmp$$Register, StrIntrinsicNode::LL); 10629 %} 10630 ins_pipe( pipe_slow ); 10631 %} 10632 10633 instruct string_indexofU(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, rax_RegI cnt2, 10634 rbx_RegI result, regD vec, rcx_RegI tmp, rFlagsReg cr) 10635 %{ 10636 predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UU)); 10637 match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2))); 10638 effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL tmp, KILL cr); 10639 10640 format %{ "String IndexOf char[] $str1,$cnt1,$str2,$cnt2 -> $result // KILL all" %} 10641 ins_encode %{ 10642 __ string_indexof($str1$$Register, $str2$$Register, 10643 $cnt1$$Register, $cnt2$$Register, 10644 (-1), $result$$Register, 10645 $vec$$XMMRegister, $tmp$$Register, StrIntrinsicNode::UU); 10646 %} 10647 ins_pipe( pipe_slow ); 10648 %} 10649 10650 instruct string_indexofUL(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, rax_RegI cnt2, 10651 rbx_RegI result, regD vec, rcx_RegI tmp, rFlagsReg cr) 10652 %{ 10653 predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UL)); 10654 match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2))); 10655 effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL tmp, KILL cr); 10656 10657 format %{ "String IndexOf char[] $str1,$cnt1,$str2,$cnt2 -> $result // KILL all" %} 10658 ins_encode %{ 10659 __ string_indexof($str1$$Register, $str2$$Register, 10660 $cnt1$$Register, $cnt2$$Register, 10661 (-1), $result$$Register, 10662 $vec$$XMMRegister, $tmp$$Register, StrIntrinsicNode::UL); 10663 %} 10664 ins_pipe( pipe_slow ); 10665 %} 10666 10667 instruct string_indexofU_char(rdi_RegP str1, rdx_RegI cnt1, rax_RegI ch, 10668 rbx_RegI result, regD vec1, regD vec2, regD vec3, rcx_RegI tmp, rFlagsReg cr) 10669 %{ 10670 predicate(UseSSE42Intrinsics); 10671 match(Set result (StrIndexOfChar (Binary str1 cnt1) ch)); 10672 effect(TEMP vec1, TEMP vec2, TEMP vec3, USE_KILL str1, USE_KILL cnt1, USE_KILL ch, TEMP tmp, KILL cr); 10673 format %{ "String IndexOf char[] $str1,$cnt1,$ch -> $result // KILL all" %} 10674 ins_encode %{ 10675 __ string_indexof_char($str1$$Register, $cnt1$$Register, $ch$$Register, $result$$Register, 10676 $vec1$$XMMRegister, $vec2$$XMMRegister, $vec3$$XMMRegister, $tmp$$Register); 10677 %} 10678 ins_pipe( pipe_slow ); 10679 %} 10680 10681 // fast string equals 10682 instruct string_equals(rdi_RegP str1, rsi_RegP str2, rcx_RegI cnt, rax_RegI result, 10683 regD tmp1, regD tmp2, rbx_RegI tmp3, rFlagsReg cr) 10684 %{ 10685 match(Set result (StrEquals (Binary str1 str2) cnt)); 10686 effect(TEMP tmp1, TEMP tmp2, USE_KILL str1, USE_KILL str2, USE_KILL cnt, KILL tmp3, KILL cr); 10687 10688 format %{ "String Equals $str1,$str2,$cnt -> $result // KILL $tmp1, $tmp2, $tmp3" %} 10689 ins_encode %{ 10690 __ arrays_equals(false, $str1$$Register, $str2$$Register, 10691 $cnt$$Register, $result$$Register, $tmp3$$Register, 10692 $tmp1$$XMMRegister, $tmp2$$XMMRegister, false /* char */); 10693 %} 10694 ins_pipe( pipe_slow ); 10695 %} 10696 10697 // fast array equals 10698 instruct array_equalsB(rdi_RegP ary1, rsi_RegP ary2, rax_RegI result, 10699 regD tmp1, regD tmp2, rcx_RegI tmp3, rbx_RegI tmp4, rFlagsReg cr) 10700 %{ 10701 predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::LL); 10702 match(Set result (AryEq ary1 ary2)); 10703 effect(TEMP tmp1, TEMP tmp2, USE_KILL ary1, USE_KILL ary2, KILL tmp3, KILL tmp4, KILL cr); 10704 10705 format %{ "Array Equals byte[] $ary1,$ary2 -> $result // KILL $tmp1, $tmp2, $tmp3, $tmp4" %} 10706 ins_encode %{ 10707 __ arrays_equals(true, $ary1$$Register, $ary2$$Register, 10708 $tmp3$$Register, $result$$Register, $tmp4$$Register, 10709 $tmp1$$XMMRegister, $tmp2$$XMMRegister, false /* char */); 10710 %} 10711 ins_pipe( pipe_slow ); 10712 %} 10713 10714 instruct array_equalsC(rdi_RegP ary1, rsi_RegP ary2, rax_RegI result, 10715 regD tmp1, regD tmp2, rcx_RegI tmp3, rbx_RegI tmp4, rFlagsReg cr) 10716 %{ 10717 predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::UU); 10718 match(Set result (AryEq ary1 ary2)); 10719 effect(TEMP tmp1, TEMP tmp2, USE_KILL ary1, USE_KILL ary2, KILL tmp3, KILL tmp4, KILL cr); 10720 10721 format %{ "Array Equals char[] $ary1,$ary2 -> $result // KILL $tmp1, $tmp2, $tmp3, $tmp4" %} 10722 ins_encode %{ 10723 __ arrays_equals(true, $ary1$$Register, $ary2$$Register, 10724 $tmp3$$Register, $result$$Register, $tmp4$$Register, 10725 $tmp1$$XMMRegister, $tmp2$$XMMRegister, true /* char */); 10726 %} 10727 ins_pipe( pipe_slow ); 10728 %} 10729 10730 instruct has_negatives(rsi_RegP ary1, rcx_RegI len, rax_RegI result, 10731 regD tmp1, regD tmp2, rbx_RegI tmp3, rFlagsReg cr) 10732 %{ 10733 match(Set result (HasNegatives ary1 len)); 10734 effect(TEMP tmp1, TEMP tmp2, USE_KILL ary1, USE_KILL len, KILL tmp3, KILL cr); 10735 10736 format %{ "has negatives byte[] $ary1,$len -> $result // KILL $tmp1, $tmp2, $tmp3" %} 10737 ins_encode %{ 10738 __ has_negatives($ary1$$Register, $len$$Register, 10739 $result$$Register, $tmp3$$Register, 10740 $tmp1$$XMMRegister, $tmp2$$XMMRegister); 10741 %} 10742 ins_pipe( pipe_slow ); 10743 %} 10744 10745 // fast char[] to byte[] compression 10746 instruct string_compress(rsi_RegP src, rdi_RegP dst, rdx_RegI len, regD tmp1, regD tmp2, regD tmp3, regD tmp4, 10747 rcx_RegI tmp5, rax_RegI result, rFlagsReg cr) %{ 10748 match(Set result (StrCompressedCopy src (Binary dst len))); 10749 effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, USE_KILL src, USE_KILL dst, USE_KILL len, KILL tmp5, KILL cr); 10750 10751 format %{ "String Compress $src,$dst -> $result // KILL RAX, RCX, RDX" %} 10752 ins_encode %{ 10753 __ char_array_compress($src$$Register, $dst$$Register, $len$$Register, 10754 $tmp1$$XMMRegister, $tmp2$$XMMRegister, $tmp3$$XMMRegister, 10755 $tmp4$$XMMRegister, $tmp5$$Register, $result$$Register); 10756 %} 10757 ins_pipe( pipe_slow ); 10758 %} 10759 10760 // fast byte[] to char[] inflation 10761 instruct string_inflate(Universe dummy, rsi_RegP src, rdi_RegP dst, rdx_RegI len, 10762 regD tmp1, rcx_RegI tmp2, rFlagsReg cr) %{ 10763 match(Set dummy (StrInflatedCopy src (Binary dst len))); 10764 effect(TEMP tmp1, TEMP tmp2, USE_KILL src, USE_KILL dst, USE_KILL len, KILL cr); 10765 10766 format %{ "String Inflate $src,$dst // KILL $tmp1, $tmp2" %} 10767 ins_encode %{ 10768 __ byte_array_inflate($src$$Register, $dst$$Register, $len$$Register, 10769 $tmp1$$XMMRegister, $tmp2$$Register); 10770 %} 10771 ins_pipe( pipe_slow ); 10772 %} 10773 10774 // encode char[] to byte[] in ISO_8859_1 10775 instruct encode_iso_array(rsi_RegP src, rdi_RegP dst, rdx_RegI len, 10776 regD tmp1, regD tmp2, regD tmp3, regD tmp4, 10777 rcx_RegI tmp5, rax_RegI result, rFlagsReg cr) %{ 10778 match(Set result (EncodeISOArray src (Binary dst len))); 10779 effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, USE_KILL src, USE_KILL dst, USE_KILL len, KILL tmp5, KILL cr); 10780 10781 format %{ "Encode array $src,$dst,$len -> $result // KILL RCX, RDX, $tmp1, $tmp2, $tmp3, $tmp4, RSI, RDI " %} 10782 ins_encode %{ 10783 __ encode_iso_array($src$$Register, $dst$$Register, $len$$Register, 10784 $tmp1$$XMMRegister, $tmp2$$XMMRegister, $tmp3$$XMMRegister, 10785 $tmp4$$XMMRegister, $tmp5$$Register, $result$$Register); 10786 %} 10787 ins_pipe( pipe_slow ); 10788 %} 10789 |