< prev index next >

src/cpu/x86/vm/x86_32.ad

Print this page




11453             "REP STOS\t# store EAX into [EDI++] while ECX--" %}
11454   ins_encode %{
11455     __ clear_mem($base$$Register, $cnt$$Register, $zero$$Register);
11456   %}
11457   ins_pipe( pipe_slow );
11458 %}
11459 
11460 instruct rep_fast_stosb(eCXRegI cnt, eDIRegP base, eAXRegI zero, Universe dummy, eFlagsReg cr) %{
11461   predicate(UseFastStosb);
11462   match(Set dummy (ClearArray cnt base));
11463   effect(USE_KILL cnt, USE_KILL base, KILL zero, KILL cr);
11464   format %{ "XOR    EAX,EAX\t# ClearArray:\n\t"
11465             "SHL    ECX,3\t# Convert doublewords to bytes\n\t"
11466             "REP STOSB\t# store EAX into [EDI++] while ECX--" %}
11467   ins_encode %{
11468     __ clear_mem($base$$Register, $cnt$$Register, $zero$$Register);
11469   %}
11470   ins_pipe( pipe_slow );
11471 %}
11472 
11473 instruct string_compare(eDIRegP str1, eCXRegI cnt1, eSIRegP str2, eDXRegI cnt2,
11474                         eAXRegI result, regD tmp1, eFlagsReg cr) %{

11475   match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
11476   effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr);
11477 
11478   format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result   // KILL $tmp1" %}
11479   ins_encode %{
11480     __ string_compare($str1$$Register, $str2$$Register,
11481                       $cnt1$$Register, $cnt2$$Register, $result$$Register,
11482                       $tmp1$$XMMRegister);













































11483   %}
11484   ins_pipe( pipe_slow );
11485 %}
11486 
11487 // fast string equals
11488 instruct string_equals(eDIRegP str1, eSIRegP str2, eCXRegI cnt, eAXRegI result,
11489                        regD tmp1, regD tmp2, eBXRegI tmp3, eFlagsReg cr) %{
11490   match(Set result (StrEquals (Binary str1 str2) cnt));
11491   effect(TEMP tmp1, TEMP tmp2, USE_KILL str1, USE_KILL str2, USE_KILL cnt, KILL tmp3, KILL cr);
11492 
11493   format %{ "String Equals $str1,$str2,$cnt -> $result    // KILL $tmp1, $tmp2, $tmp3" %}
11494   ins_encode %{
11495     __ char_arrays_equals(false, $str1$$Register, $str2$$Register,
11496                           $cnt$$Register, $result$$Register, $tmp3$$Register,
11497                           $tmp1$$XMMRegister, $tmp2$$XMMRegister);
11498   %}

11499   ins_pipe( pipe_slow );
11500 %}
11501 
11502 // fast search of substring with known size.
11503 instruct string_indexof_con(eDIRegP str1, eDXRegI cnt1, eSIRegP str2, immI int_cnt2,
11504                             eBXRegI result, regD vec, eAXRegI cnt2, eCXRegI tmp, eFlagsReg cr) %{
11505   predicate(UseSSE42Intrinsics);
























































11506   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
11507   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, KILL cnt2, KILL tmp, KILL cr);
11508 
11509   format %{ "String IndexOf $str1,$cnt1,$str2,$int_cnt2 -> $result   // KILL $vec, $cnt1, $cnt2, $tmp" %}
11510   ins_encode %{
11511     int icnt2 = (int)$int_cnt2$$constant;
11512     if (icnt2 >= 8) {
11513       // IndexOf for constant substrings with size >= 8 elements
11514       // which don't need to be loaded through stack.
11515       __ string_indexofC8($str1$$Register, $str2$$Register,
11516                           $cnt1$$Register, $cnt2$$Register,
11517                           icnt2, $result$$Register,
11518                           $vec$$XMMRegister, $tmp$$Register);
11519     } else {
11520       // Small strings are loaded through stack if they cross page boundary.
11521       __ string_indexof($str1$$Register, $str2$$Register,
11522                         $cnt1$$Register, $cnt2$$Register,
11523                         icnt2, $result$$Register,
11524                         $vec$$XMMRegister, $tmp$$Register);
11525     }
11526   %}
11527   ins_pipe( pipe_slow );
11528 %}
11529 
11530 instruct string_indexof(eDIRegP str1, eDXRegI cnt1, eSIRegP str2, eAXRegI cnt2,
11531                         eBXRegI result, regD vec, eCXRegI tmp, eFlagsReg cr) %{
11532   predicate(UseSSE42Intrinsics);
11533   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
11534   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL tmp, KILL cr);
11535 
11536   format %{ "String IndexOf $str1,$cnt1,$str2,$cnt2 -> $result   // KILL all" %}
11537   ins_encode %{
11538     __ string_indexof($str1$$Register, $str2$$Register,
11539                       $cnt1$$Register, $cnt2$$Register,
11540                       (-1), $result$$Register,
11541                       $vec$$XMMRegister, $tmp$$Register);













































11542   %}
11543   ins_pipe( pipe_slow );
11544 %}
11545 
11546 // fast array equals
11547 instruct array_equals(eDIRegP ary1, eSIRegP ary2, eAXRegI result,

















11548                       regD tmp1, regD tmp2, eCXRegI tmp3, eBXRegI tmp4, eFlagsReg cr)
11549 %{

11550   match(Set result (AryEq ary1 ary2));
11551   effect(TEMP tmp1, TEMP tmp2, USE_KILL ary1, USE_KILL ary2, KILL tmp3, KILL tmp4, KILL cr);
11552   //ins_cost(300);
11553 
11554   format %{ "Array Equals $ary1,$ary2 -> $result   // KILL $tmp1, $tmp2, $tmp3, $tmp4" %}
11555   ins_encode %{
11556     __ char_arrays_equals(true, $ary1$$Register, $ary2$$Register,
11557                           $tmp3$$Register, $result$$Register, $tmp4$$Register,















11558                           $tmp1$$XMMRegister, $tmp2$$XMMRegister);





























11559   %}
11560   ins_pipe( pipe_slow );
11561 %}
11562 
11563 // encode char[] to byte[] in ISO_8859_1
11564 instruct encode_iso_array(eSIRegP src, eDIRegP dst, eDXRegI len,
11565                           regD tmp1, regD tmp2, regD tmp3, regD tmp4,
11566                           eCXRegI tmp5, eAXRegI result, eFlagsReg cr) %{
11567   match(Set result (EncodeISOArray src (Binary dst len)));
11568   effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, USE_KILL src, USE_KILL dst, USE_KILL len, KILL tmp5, KILL cr);
11569 
11570   format %{ "Encode array $src,$dst,$len -> $result    // KILL ECX, EDX, $tmp1, $tmp2, $tmp3, $tmp4, ESI, EDI " %}
11571   ins_encode %{
11572     __ encode_iso_array($src$$Register, $dst$$Register, $len$$Register,
11573                         $tmp1$$XMMRegister, $tmp2$$XMMRegister, $tmp3$$XMMRegister,
11574                         $tmp4$$XMMRegister, $tmp5$$Register, $result$$Register);
11575   %}
11576   ins_pipe( pipe_slow );
11577 %}
11578 




11453             "REP STOS\t# store EAX into [EDI++] while ECX--" %}
11454   ins_encode %{
11455     __ clear_mem($base$$Register, $cnt$$Register, $zero$$Register);
11456   %}
11457   ins_pipe( pipe_slow );
11458 %}
11459 
11460 instruct rep_fast_stosb(eCXRegI cnt, eDIRegP base, eAXRegI zero, Universe dummy, eFlagsReg cr) %{
11461   predicate(UseFastStosb);
11462   match(Set dummy (ClearArray cnt base));
11463   effect(USE_KILL cnt, USE_KILL base, KILL zero, KILL cr);
11464   format %{ "XOR    EAX,EAX\t# ClearArray:\n\t"
11465             "SHL    ECX,3\t# Convert doublewords to bytes\n\t"
11466             "REP STOSB\t# store EAX into [EDI++] while ECX--" %}
11467   ins_encode %{
11468     __ clear_mem($base$$Register, $cnt$$Register, $zero$$Register);
11469   %}
11470   ins_pipe( pipe_slow );
11471 %}
11472 
11473 instruct string_compareL(eDIRegP str1, eCXRegI cnt1, eSIRegP str2, eDXRegI cnt2,
11474                          eAXRegI result, regD tmp1, eFlagsReg cr) %{
11475   predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::LL);
11476   match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
11477   effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr);
11478 
11479   format %{ "String Compare byte[] $str1,$cnt1,$str2,$cnt2 -> $result   // KILL $tmp1" %}
11480   ins_encode %{
11481     __ string_compare($str1$$Register, $str2$$Register,
11482                       $cnt1$$Register, $cnt2$$Register, $result$$Register,
11483                       $tmp1$$XMMRegister, StrIntrinsicNode::LL);
11484   %}
11485   ins_pipe( pipe_slow );
11486 %}
11487 
11488 instruct string_compareU(eDIRegP str1, eCXRegI cnt1, eSIRegP str2, eDXRegI cnt2,
11489                          eAXRegI result, regD tmp1, eFlagsReg cr) %{
11490   predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::UU);
11491   match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
11492   effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr);
11493 
11494   format %{ "String Compare char[] $str1,$cnt1,$str2,$cnt2 -> $result   // KILL $tmp1" %}
11495   ins_encode %{
11496     __ string_compare($str1$$Register, $str2$$Register,
11497                       $cnt1$$Register, $cnt2$$Register, $result$$Register,
11498                       $tmp1$$XMMRegister, StrIntrinsicNode::UU);
11499   %}
11500   ins_pipe( pipe_slow );
11501 %}
11502 
11503 instruct string_compareLU(eDIRegP str1, eCXRegI cnt1, eSIRegP str2, eDXRegI cnt2,
11504                           eAXRegI result, regD tmp1, eFlagsReg cr) %{
11505   predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::LU);
11506   match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
11507   effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr);
11508 
11509   format %{ "String Compare byte[] $str1,$cnt1,$str2,$cnt2 -> $result   // KILL $tmp1" %}
11510   ins_encode %{
11511     __ string_compare($str1$$Register, $str2$$Register,
11512                       $cnt1$$Register, $cnt2$$Register, $result$$Register,
11513                       $tmp1$$XMMRegister, StrIntrinsicNode::LU);
11514   %}
11515   ins_pipe( pipe_slow );
11516 %}
11517 
11518 instruct string_compareUL(eSIRegP str1, eDXRegI cnt1, eDIRegP str2, eCXRegI cnt2,
11519                           eAXRegI result, regD tmp1, eFlagsReg cr) %{
11520   predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::UL);
11521   match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
11522   effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr);
11523 
11524   format %{ "String Compare byte[] $str1,$cnt1,$str2,$cnt2 -> $result   // KILL $tmp1" %}
11525   ins_encode %{
11526     __ string_compare($str2$$Register, $str1$$Register,
11527                       $cnt2$$Register, $cnt1$$Register, $result$$Register,
11528                       $tmp1$$XMMRegister, StrIntrinsicNode::UL);
11529   %}
11530   ins_pipe( pipe_slow );
11531 %}
11532 
11533 // fast string equals
11534 instruct string_equals(eDIRegP str1, eSIRegP str2, eCXRegI cnt, eAXRegI result,
11535                        regD tmp1, regD tmp2, eBXRegI tmp3, eFlagsReg cr) %{
11536   match(Set result (StrEquals (Binary str1 str2) cnt));
11537   effect(TEMP tmp1, TEMP tmp2, USE_KILL str1, USE_KILL str2, USE_KILL cnt, KILL tmp3, KILL cr);
11538 
11539   format %{ "String Equals $str1,$str2,$cnt -> $result    // KILL $tmp1, $tmp2, $tmp3" %}
11540   ins_encode %{
11541     __ arrays_equals(false, $str1$$Register, $str2$$Register,
11542                      $cnt$$Register, $result$$Register, $tmp3$$Register,
11543                      $tmp1$$XMMRegister, $tmp2$$XMMRegister, false /* char */);
11544   %} 
11545 
11546   ins_pipe( pipe_slow );
11547 %}
11548 
11549 // fast search of substring with known size.
11550 instruct string_indexof_conL(eDIRegP str1, eDXRegI cnt1, eSIRegP str2, immI int_cnt2,
11551                              eBXRegI result, regD vec, eAXRegI cnt2, eCXRegI tmp, eFlagsReg cr) %{
11552   predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LL));
11553   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
11554   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, KILL cnt2, KILL tmp, KILL cr);
11555 
11556   format %{ "String IndexOf byte[] $str1,$cnt1,$str2,$int_cnt2 -> $result   // KILL $vec, $cnt1, $cnt2, $tmp" %}
11557   ins_encode %{
11558     int icnt2 = (int)$int_cnt2$$constant;
11559     if (icnt2 >= 16) {
11560       // IndexOf for constant substrings with size >= 16 elements
11561       // which don't need to be loaded through stack.
11562       __ string_indexofC8($str1$$Register, $str2$$Register,
11563                           $cnt1$$Register, $cnt2$$Register,
11564                           icnt2, $result$$Register,
11565                           $vec$$XMMRegister, $tmp$$Register, StrIntrinsicNode::LL);
11566     } else {
11567       // Small strings are loaded through stack if they cross page boundary.
11568       __ string_indexof($str1$$Register, $str2$$Register,
11569                         $cnt1$$Register, $cnt2$$Register,
11570                         icnt2, $result$$Register,
11571                         $vec$$XMMRegister, $tmp$$Register, StrIntrinsicNode::LL);
11572     }
11573   %}
11574   ins_pipe( pipe_slow );
11575 %}
11576 
11577 // fast search of substring with known size.
11578 instruct string_indexof_conU(eDIRegP str1, eDXRegI cnt1, eSIRegP str2, immI int_cnt2,
11579                              eBXRegI result, regD vec, eAXRegI cnt2, eCXRegI tmp, eFlagsReg cr) %{
11580   predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UU));
11581   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
11582   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, KILL cnt2, KILL tmp, KILL cr);
11583 
11584   format %{ "String IndexOf char[] $str1,$cnt1,$str2,$int_cnt2 -> $result   // KILL $vec, $cnt1, $cnt2, $tmp" %}
11585   ins_encode %{
11586     int icnt2 = (int)$int_cnt2$$constant;
11587     if (icnt2 >= 8) {
11588       // IndexOf for constant substrings with size >= 8 elements
11589       // which don't need to be loaded through stack.
11590       __ string_indexofC8($str1$$Register, $str2$$Register,
11591                           $cnt1$$Register, $cnt2$$Register,
11592                           icnt2, $result$$Register,
11593                           $vec$$XMMRegister, $tmp$$Register, StrIntrinsicNode::UU);
11594     } else {
11595       // Small strings are loaded through stack if they cross page boundary.
11596       __ string_indexof($str1$$Register, $str2$$Register,
11597                         $cnt1$$Register, $cnt2$$Register,
11598                         icnt2, $result$$Register,
11599                         $vec$$XMMRegister, $tmp$$Register, StrIntrinsicNode::UU);
11600     }
11601   %}
11602   ins_pipe( pipe_slow );
11603 %}
11604 
11605 // fast search of substring with known size.
11606 instruct string_indexof_conUL(eDIRegP str1, eDXRegI cnt1, eSIRegP str2, immI int_cnt2,
11607                              eBXRegI result, regD vec, eAXRegI cnt2, eCXRegI tmp, eFlagsReg cr) %{
11608   predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UL));
11609   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
11610   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, KILL cnt2, KILL tmp, KILL cr);
11611 
11612   format %{ "String IndexOf char[] $str1,$cnt1,$str2,$int_cnt2 -> $result   // KILL $vec, $cnt1, $cnt2, $tmp" %}
11613   ins_encode %{
11614     int icnt2 = (int)$int_cnt2$$constant;
11615     if (icnt2 >= 8) {
11616       // IndexOf for constant substrings with size >= 8 elements
11617       // which don't need to be loaded through stack.
11618       __ string_indexofC8($str1$$Register, $str2$$Register,
11619                           $cnt1$$Register, $cnt2$$Register,
11620                           icnt2, $result$$Register,
11621                           $vec$$XMMRegister, $tmp$$Register, StrIntrinsicNode::UL);
11622     } else {
11623       // Small strings are loaded through stack if they cross page boundary.
11624       __ string_indexof($str1$$Register, $str2$$Register,
11625                         $cnt1$$Register, $cnt2$$Register,
11626                         icnt2, $result$$Register,
11627                         $vec$$XMMRegister, $tmp$$Register, StrIntrinsicNode::UL);
11628     }
11629   %}
11630   ins_pipe( pipe_slow );
11631 %}
11632 
11633 instruct string_indexofL(eDIRegP str1, eDXRegI cnt1, eSIRegP str2, eAXRegI cnt2,
11634                          eBXRegI result, regD vec, eCXRegI tmp, eFlagsReg cr) %{
11635   predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LL));
11636   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
11637   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL tmp, KILL cr);
11638 
11639   format %{ "String IndexOf byte[] $str1,$cnt1,$str2,$cnt2 -> $result   // KILL all" %}
11640   ins_encode %{
11641     __ string_indexof($str1$$Register, $str2$$Register,
11642                       $cnt1$$Register, $cnt2$$Register,
11643                       (-1), $result$$Register,
11644                       $vec$$XMMRegister, $tmp$$Register, StrIntrinsicNode::LL);
11645   %}
11646   ins_pipe( pipe_slow );
11647 %}
11648 
11649 instruct string_indexofU(eDIRegP str1, eDXRegI cnt1, eSIRegP str2, eAXRegI cnt2,
11650                          eBXRegI result, regD vec, eCXRegI tmp, eFlagsReg cr) %{
11651   predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UU));
11652   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
11653   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL tmp, KILL cr);
11654 
11655   format %{ "String IndexOf char[] $str1,$cnt1,$str2,$cnt2 -> $result   // KILL all" %}
11656   ins_encode %{
11657     __ string_indexof($str1$$Register, $str2$$Register,
11658                       $cnt1$$Register, $cnt2$$Register,
11659                       (-1), $result$$Register,
11660                       $vec$$XMMRegister, $tmp$$Register, StrIntrinsicNode::UU);
11661   %}
11662   ins_pipe( pipe_slow );
11663 %}
11664 
11665 instruct string_indexofUL(eDIRegP str1, eDXRegI cnt1, eSIRegP str2, eAXRegI cnt2,
11666                          eBXRegI result, regD vec, eCXRegI tmp, eFlagsReg cr) %{
11667   predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UL));
11668   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
11669   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL tmp, KILL cr);
11670 
11671   format %{ "String IndexOf char[] $str1,$cnt1,$str2,$cnt2 -> $result   // KILL all" %}
11672   ins_encode %{
11673     __ string_indexof($str1$$Register, $str2$$Register,
11674                       $cnt1$$Register, $cnt2$$Register,
11675                       (-1), $result$$Register,
11676                       $vec$$XMMRegister, $tmp$$Register, StrIntrinsicNode::UL);
11677   %}
11678   ins_pipe( pipe_slow );
11679 %}
11680 
11681 instruct string_indexofU_char(eDIRegP str1, eDXRegI cnt1, eAXRegI ch,
11682                               eBXRegI result, regD vec1, regD vec2, regD vec3, eCXRegI tmp, eFlagsReg cr) %{
11683   predicate(UseSSE42Intrinsics);
11684   match(Set result (StrIndexOfChar (Binary str1 cnt1) ch));
11685   effect(TEMP vec1, TEMP vec2, TEMP vec3, USE_KILL str1, USE_KILL cnt1, USE_KILL ch, TEMP tmp, KILL cr);
11686   format %{ "String IndexOf char[] $str1,$cnt1,$ch -> $result   // KILL all" %}
11687   ins_encode %{
11688     __ string_indexof_char($str1$$Register, $cnt1$$Register, $ch$$Register, $result$$Register,
11689                            $vec1$$XMMRegister, $vec2$$XMMRegister, $vec3$$XMMRegister, $tmp$$Register);
11690   %}
11691   ins_pipe( pipe_slow );
11692 %}
11693 
11694 // fast array equals
11695 instruct array_equalsB(eDIRegP ary1, eSIRegP ary2, eAXRegI result,
11696                        regD tmp1, regD tmp2, eCXRegI tmp3, eBXRegI tmp4, eFlagsReg cr)
11697 %{
11698   predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::LL);
11699   match(Set result (AryEq ary1 ary2));
11700   effect(TEMP tmp1, TEMP tmp2, USE_KILL ary1, USE_KILL ary2, KILL tmp3, KILL tmp4, KILL cr);
11701   //ins_cost(300);
11702 
11703   format %{ "Array Equals byte[] $ary1,$ary2 -> $result   // KILL $tmp1, $tmp2, $tmp3, $tmp4" %}
11704   ins_encode %{
11705     __ arrays_equals(true, $ary1$$Register, $ary2$$Register,
11706                      $tmp3$$Register, $result$$Register, $tmp4$$Register,
11707                      $tmp1$$XMMRegister, $tmp2$$XMMRegister, false /* char */);
11708   %}
11709   ins_pipe( pipe_slow );
11710 %}
11711 
11712 instruct array_equalsC(eDIRegP ary1, eSIRegP ary2, eAXRegI result,
11713                        regD tmp1, regD tmp2, eCXRegI tmp3, eBXRegI tmp4, eFlagsReg cr)
11714 %{
11715   predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::UU);
11716   match(Set result (AryEq ary1 ary2));
11717   effect(TEMP tmp1, TEMP tmp2, USE_KILL ary1, USE_KILL ary2, KILL tmp3, KILL tmp4, KILL cr);
11718   //ins_cost(300);
11719 
11720   format %{ "Array Equals char[] $ary1,$ary2 -> $result   // KILL $tmp1, $tmp2, $tmp3, $tmp4" %}
11721   ins_encode %{
11722     __ arrays_equals(true, $ary1$$Register, $ary2$$Register,
11723                      $tmp3$$Register, $result$$Register, $tmp4$$Register,
11724                      $tmp1$$XMMRegister, $tmp2$$XMMRegister, true /* char */);
11725   %}
11726   ins_pipe( pipe_slow );
11727 %}
11728 
11729 instruct has_negatives(eSIRegP ary1, eCXRegI len, eAXRegI result,
11730                       regD tmp1, regD tmp2, eBXRegI tmp3, eFlagsReg cr)
11731 %{
11732   match(Set result (HasNegatives ary1 len));
11733   effect(TEMP tmp1, TEMP tmp2, USE_KILL ary1, USE_KILL len, KILL tmp3, KILL cr);
11734 
11735   format %{ "has negatives byte[] $ary1,$len -> $result   // KILL $tmp1, $tmp2, $tmp3" %}
11736   ins_encode %{
11737     __ has_negatives($ary1$$Register, $len$$Register,
11738                      $result$$Register, $tmp3$$Register,
11739                      $tmp1$$XMMRegister, $tmp2$$XMMRegister);
11740   %}
11741   ins_pipe( pipe_slow );
11742 %}
11743 
11744 // fast char[] to byte[] compression
11745 instruct string_compress(eSIRegP src, eDIRegP dst, eDXRegI len, regD tmp1, regD tmp2, regD tmp3, regD tmp4,
11746                          eCXRegI tmp5, eAXRegI result, eFlagsReg cr) %{
11747   match(Set result (StrCompressedCopy src (Binary dst len)));
11748   effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, USE_KILL src, USE_KILL dst, USE_KILL len, KILL tmp5, KILL cr);
11749 
11750   format %{ "String Compress $src,$dst -> $result    // KILL RAX, RCX, RDX" %}
11751   ins_encode %{
11752     __ char_array_compress($src$$Register, $dst$$Register, $len$$Register,
11753                            $tmp1$$XMMRegister, $tmp2$$XMMRegister, $tmp3$$XMMRegister,
11754                            $tmp4$$XMMRegister, $tmp5$$Register, $result$$Register);
11755   %}
11756   ins_pipe( pipe_slow );
11757 %}
11758 
11759 // fast byte[] to char[] inflation
11760 instruct string_inflate(Universe dummy, eSIRegP src, eDIRegP dst, eDXRegI len,
11761                         regD tmp1, eCXRegI tmp2, eFlagsReg cr) %{
11762   match(Set dummy (StrInflatedCopy src (Binary dst len)));
11763   effect(TEMP tmp1, TEMP tmp2, USE_KILL src, USE_KILL dst, USE_KILL len, KILL cr);
11764 
11765   format %{ "String Inflate $src,$dst    // KILL $tmp1, $tmp2" %}
11766   ins_encode %{
11767     __ byte_array_inflate($src$$Register, $dst$$Register, $len$$Register,
11768                           $tmp1$$XMMRegister, $tmp2$$Register);
11769   %}
11770   ins_pipe( pipe_slow );
11771 %}
11772 
11773 // encode char[] to byte[] in ISO_8859_1
11774 instruct encode_iso_array(eSIRegP src, eDIRegP dst, eDXRegI len,
11775                           regD tmp1, regD tmp2, regD tmp3, regD tmp4,
11776                           eCXRegI tmp5, eAXRegI result, eFlagsReg cr) %{
11777   match(Set result (EncodeISOArray src (Binary dst len)));
11778   effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, USE_KILL src, USE_KILL dst, USE_KILL len, KILL tmp5, KILL cr);
11779 
11780   format %{ "Encode array $src,$dst,$len -> $result    // KILL ECX, EDX, $tmp1, $tmp2, $tmp3, $tmp4, ESI, EDI " %}
11781   ins_encode %{
11782     __ encode_iso_array($src$$Register, $dst$$Register, $len$$Register,
11783                         $tmp1$$XMMRegister, $tmp2$$XMMRegister, $tmp3$$XMMRegister,
11784                         $tmp4$$XMMRegister, $tmp5$$Register, $result$$Register);
11785   %}
11786   ins_pipe( pipe_slow );
11787 %}
11788 


< prev index next >