src/hotspot/cpu/x86/x86_64.ad
changeset 51857 9978fea8a371
parent 51501 535cce23fa8b
child 51996 84743156e780
equal deleted inserted replaced
51856:11b9d3a6f31c 51857:9978fea8a371
  3654 
  3654 
  3655    format %{ %}
  3655    format %{ %}
  3656    interface(REG_INTER);
  3656    interface(REG_INTER);
  3657 %}
  3657 %}
  3658 
  3658 
       
  3659 // Float register operands
       
  3660 operand vlRegF() %{
       
  3661    constraint(ALLOC_IN_RC(float_reg_vl));
       
  3662    match(RegF);
       
  3663 
       
  3664    format %{ %}
       
  3665    interface(REG_INTER);
       
  3666 %}
       
  3667 
  3659 // Double register operands
  3668 // Double register operands
  3660 operand regD() %{
  3669 operand regD() %{
  3661    constraint(ALLOC_IN_RC(double_reg));
  3670    constraint(ALLOC_IN_RC(double_reg));
  3662    match(RegD);
  3671    match(RegD);
  3663 
  3672 
  3664    format %{ %}
  3673    format %{ %}
  3665    interface(REG_INTER);
  3674    interface(REG_INTER);
  3666 %}
  3675 %}
  3667 
  3676 
       
  3677 // Double register operands
       
  3678 operand vlRegD() %{
       
  3679    constraint(ALLOC_IN_RC(double_reg_vl));
       
  3680    match(RegD);
       
  3681 
       
  3682    format %{ %}
       
  3683    interface(REG_INTER);
       
  3684 %}
       
  3685 
  3668 // Vectors
  3686 // Vectors
  3669 operand vecS() %{
  3687 operand vecS() %{
  3670   constraint(ALLOC_IN_RC(vectors_reg));
  3688   constraint(ALLOC_IN_RC(vectors_reg_vlbwdq));
  3671   match(VecS);
  3689   match(VecS);
  3672 
  3690 
  3673   format %{ %}
  3691   format %{ %}
  3674   interface(REG_INTER);
  3692   interface(REG_INTER);
  3675 %}
  3693 %}
  3676 
  3694 
  3677 operand vecD() %{
  3695 // Vectors
  3678   constraint(ALLOC_IN_RC(vectord_reg));
  3696 operand legVecS() %{
  3679   match(VecD);
  3697   constraint(ALLOC_IN_RC(vectors_reg_legacy));
       
  3698   match(VecS);
  3680 
  3699 
  3681   format %{ %}
  3700   format %{ %}
  3682   interface(REG_INTER);
  3701   interface(REG_INTER);
  3683 %}
  3702 %}
  3684 
  3703 
  3685 operand vecX() %{
  3704 operand vecD() %{
  3686   constraint(ALLOC_IN_RC(vectorx_reg));
  3705   constraint(ALLOC_IN_RC(vectord_reg_vlbwdq));
  3687   match(VecX);
  3706   match(VecD);
  3688 
  3707 
  3689   format %{ %}
  3708   format %{ %}
  3690   interface(REG_INTER);
  3709   interface(REG_INTER);
  3691 %}
  3710 %}
  3692 
  3711 
       
  3712 operand legVecD() %{
       
  3713   constraint(ALLOC_IN_RC(vectord_reg_legacy));
       
  3714   match(VecD);
       
  3715 
       
  3716   format %{ %}
       
  3717   interface(REG_INTER);
       
  3718 %}
       
  3719 
       
  3720 operand vecX() %{
       
  3721   constraint(ALLOC_IN_RC(vectorx_reg_vlbwdq));
       
  3722   match(VecX);
       
  3723 
       
  3724   format %{ %}
       
  3725   interface(REG_INTER);
       
  3726 %}
       
  3727 
       
  3728 operand legVecX() %{
       
  3729   constraint(ALLOC_IN_RC(vectorx_reg_legacy));
       
  3730   match(VecX);
       
  3731 
       
  3732   format %{ %}
       
  3733   interface(REG_INTER);
       
  3734 %}
       
  3735 
  3693 operand vecY() %{
  3736 operand vecY() %{
  3694   constraint(ALLOC_IN_RC(vectory_reg));
  3737   constraint(ALLOC_IN_RC(vectory_reg_vlbwdq));
       
  3738   match(VecY);
       
  3739 
       
  3740   format %{ %}
       
  3741   interface(REG_INTER);
       
  3742 %}
       
  3743 
       
  3744 operand legVecY() %{
       
  3745   constraint(ALLOC_IN_RC(vectory_reg_legacy));
  3695   match(VecY);
  3746   match(VecY);
  3696 
  3747 
  3697   format %{ %}
  3748   format %{ %}
  3698   interface(REG_INTER);
  3749   interface(REG_INTER);
  3699 %}
  3750 %}
  5285     __ movflt($dst$$XMMRegister, $mem$$Address);
  5336     __ movflt($dst$$XMMRegister, $mem$$Address);
  5286   %}
  5337   %}
  5287   ins_pipe(pipe_slow); // XXX
  5338   ins_pipe(pipe_slow); // XXX
  5288 %}
  5339 %}
  5289 
  5340 
       
  5341 // Load Float
       
  5342 instruct MoveF2VL(vlRegF dst, regF src) %{
       
  5343   match(Set dst src);
       
  5344   format %{ "movss $dst,$src\t! load float (4 bytes)" %}
       
  5345   ins_encode %{
       
  5346     __ movflt($dst$$XMMRegister, $src$$XMMRegister);
       
  5347   %}
       
  5348   ins_pipe( fpu_reg_reg );
       
  5349 %}
       
  5350 
       
  5351 // Load Float
       
  5352 instruct MoveVL2F(regF dst, vlRegF src) %{
       
  5353   match(Set dst src);
       
  5354   format %{ "movss $dst,$src\t! load float (4 bytes)" %}
       
  5355   ins_encode %{
       
  5356     __ movflt($dst$$XMMRegister, $src$$XMMRegister);
       
  5357   %}
       
  5358   ins_pipe( fpu_reg_reg );
       
  5359 %}
       
  5360 
  5290 // Load Double
  5361 // Load Double
  5291 instruct loadD_partial(regD dst, memory mem)
  5362 instruct loadD_partial(regD dst, memory mem)
  5292 %{
  5363 %{
  5293   predicate(!UseXmmLoadAndClearUpper);
  5364   predicate(!UseXmmLoadAndClearUpper);
  5294   match(Set dst (LoadD mem));
  5365   match(Set dst (LoadD mem));
  5310   format %{ "movsd   $dst, $mem\t# double" %}
  5381   format %{ "movsd   $dst, $mem\t# double" %}
  5311   ins_encode %{
  5382   ins_encode %{
  5312     __ movdbl($dst$$XMMRegister, $mem$$Address);
  5383     __ movdbl($dst$$XMMRegister, $mem$$Address);
  5313   %}
  5384   %}
  5314   ins_pipe(pipe_slow); // XXX
  5385   ins_pipe(pipe_slow); // XXX
       
  5386 %}
       
  5387 
       
  5388 // Load Double
       
  5389 instruct MoveD2VL(vlRegD dst, regD src) %{
       
  5390   match(Set dst src);
       
  5391   format %{ "movsd $dst,$src\t! load double (8 bytes)" %}
       
  5392   ins_encode %{
       
  5393     __ movdbl($dst$$XMMRegister, $src$$XMMRegister);
       
  5394   %}
       
  5395   ins_pipe( fpu_reg_reg );
       
  5396 %}
       
  5397 
       
  5398 // Load Double
       
  5399 instruct MoveVL2D(regD dst, vlRegD src) %{
       
  5400   match(Set dst src);
       
  5401   format %{ "movsd $dst,$src\t! load double (8 bytes)" %}
       
  5402   ins_encode %{
       
  5403     __ movdbl($dst$$XMMRegister, $src$$XMMRegister);
       
  5404   %}
       
  5405   ins_pipe( fpu_reg_reg );
  5315 %}
  5406 %}
  5316 
  5407 
  5317 // Load Effective Address
  5408 // Load Effective Address
  5318 instruct leaP8(rRegP dst, indOffset8 mem)
  5409 instruct leaP8(rRegP dst, indOffset8 mem)
  5319 %{
  5410 %{
 10856   %}
 10947   %}
 10857   ins_pipe(pipe_slow);
 10948   ins_pipe(pipe_slow);
 10858 %}
 10949 %}
 10859 
 10950 
 10860 instruct string_compareL(rdi_RegP str1, rcx_RegI cnt1, rsi_RegP str2, rdx_RegI cnt2,
 10951 instruct string_compareL(rdi_RegP str1, rcx_RegI cnt1, rsi_RegP str2, rdx_RegI cnt2,
 10861                          rax_RegI result, regD tmp1, rFlagsReg cr)
 10952                          rax_RegI result, legVecS tmp1, rFlagsReg cr)
 10862 %{
 10953 %{
 10863   predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::LL);
 10954   predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::LL);
 10864   match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
 10955   match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
 10865   effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr);
 10956   effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr);
 10866 
 10957 
 10872   %}
 10963   %}
 10873   ins_pipe( pipe_slow );
 10964   ins_pipe( pipe_slow );
 10874 %}
 10965 %}
 10875 
 10966 
 10876 instruct string_compareU(rdi_RegP str1, rcx_RegI cnt1, rsi_RegP str2, rdx_RegI cnt2,
 10967 instruct string_compareU(rdi_RegP str1, rcx_RegI cnt1, rsi_RegP str2, rdx_RegI cnt2,
 10877                          rax_RegI result, regD tmp1, rFlagsReg cr)
 10968                          rax_RegI result, legVecS tmp1, rFlagsReg cr)
 10878 %{
 10969 %{
 10879   predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::UU);
 10970   predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::UU);
 10880   match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
 10971   match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
 10881   effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr);
 10972   effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr);
 10882 
 10973 
 10888   %}
 10979   %}
 10889   ins_pipe( pipe_slow );
 10980   ins_pipe( pipe_slow );
 10890 %}
 10981 %}
 10891 
 10982 
 10892 instruct string_compareLU(rdi_RegP str1, rcx_RegI cnt1, rsi_RegP str2, rdx_RegI cnt2,
 10983 instruct string_compareLU(rdi_RegP str1, rcx_RegI cnt1, rsi_RegP str2, rdx_RegI cnt2,
 10893                           rax_RegI result, regD tmp1, rFlagsReg cr)
 10984                           rax_RegI result, legVecS tmp1, rFlagsReg cr)
 10894 %{
 10985 %{
 10895   predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::LU);
 10986   predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::LU);
 10896   match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
 10987   match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
 10897   effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr);
 10988   effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr);
 10898 
 10989 
 10904   %}
 10995   %}
 10905   ins_pipe( pipe_slow );
 10996   ins_pipe( pipe_slow );
 10906 %}
 10997 %}
 10907 
 10998 
 10908 instruct string_compareUL(rsi_RegP str1, rdx_RegI cnt1, rdi_RegP str2, rcx_RegI cnt2,
 10999 instruct string_compareUL(rsi_RegP str1, rdx_RegI cnt1, rdi_RegP str2, rcx_RegI cnt2,
 10909                           rax_RegI result, regD tmp1, rFlagsReg cr)
 11000                           rax_RegI result, legVecS tmp1, rFlagsReg cr)
 10910 %{
 11001 %{
 10911   predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::UL);
 11002   predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::UL);
 10912   match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
 11003   match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
 10913   effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr);
 11004   effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr);
 10914 
 11005 
 10921   ins_pipe( pipe_slow );
 11012   ins_pipe( pipe_slow );
 10922 %}
 11013 %}
 10923 
 11014 
 10924 // fast search of substring with known size.
 11015 // fast search of substring with known size.
 10925 instruct string_indexof_conL(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, immI int_cnt2,
 11016 instruct string_indexof_conL(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, immI int_cnt2,
 10926                              rbx_RegI result, regD vec, rax_RegI cnt2, rcx_RegI tmp, rFlagsReg cr)
 11017                              rbx_RegI result, legVecS vec, rax_RegI cnt2, rcx_RegI tmp, rFlagsReg cr)
 10927 %{
 11018 %{
 10928   predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LL));
 11019   predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LL));
 10929   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
 11020   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
 10930   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, KILL cnt2, KILL tmp, KILL cr);
 11021   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, KILL cnt2, KILL tmp, KILL cr);
 10931 
 11022 
 10950   ins_pipe( pipe_slow );
 11041   ins_pipe( pipe_slow );
 10951 %}
 11042 %}
 10952 
 11043 
 10953 // fast search of substring with known size.
 11044 // fast search of substring with known size.
 10954 instruct string_indexof_conU(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, immI int_cnt2,
 11045 instruct string_indexof_conU(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, immI int_cnt2,
 10955                              rbx_RegI result, regD vec, rax_RegI cnt2, rcx_RegI tmp, rFlagsReg cr)
 11046                              rbx_RegI result, legVecS vec, rax_RegI cnt2, rcx_RegI tmp, rFlagsReg cr)
 10956 %{
 11047 %{
 10957   predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UU));
 11048   predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UU));
 10958   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
 11049   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
 10959   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, KILL cnt2, KILL tmp, KILL cr);
 11050   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, KILL cnt2, KILL tmp, KILL cr);
 10960 
 11051 
 10979   ins_pipe( pipe_slow );
 11070   ins_pipe( pipe_slow );
 10980 %}
 11071 %}
 10981 
 11072 
 10982 // fast search of substring with known size.
 11073 // fast search of substring with known size.
 10983 instruct string_indexof_conUL(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, immI int_cnt2,
 11074 instruct string_indexof_conUL(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, immI int_cnt2,
 10984                              rbx_RegI result, regD vec, rax_RegI cnt2, rcx_RegI tmp, rFlagsReg cr)
 11075                              rbx_RegI result, legVecS vec, rax_RegI cnt2, rcx_RegI tmp, rFlagsReg cr)
 10985 %{
 11076 %{
 10986   predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UL));
 11077   predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UL));
 10987   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
 11078   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
 10988   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, KILL cnt2, KILL tmp, KILL cr);
 11079   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, KILL cnt2, KILL tmp, KILL cr);
 10989 
 11080 
 11007   %}
 11098   %}
 11008   ins_pipe( pipe_slow );
 11099   ins_pipe( pipe_slow );
 11009 %}
 11100 %}
 11010 
 11101 
 11011 instruct string_indexofL(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, rax_RegI cnt2,
 11102 instruct string_indexofL(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, rax_RegI cnt2,
 11012                          rbx_RegI result, regD vec, rcx_RegI tmp, rFlagsReg cr)
 11103                          rbx_RegI result, legVecS vec, rcx_RegI tmp, rFlagsReg cr)
 11013 %{
 11104 %{
 11014   predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LL));
 11105   predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LL));
 11015   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
 11106   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
 11016   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL tmp, KILL cr);
 11107   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL tmp, KILL cr);
 11017 
 11108 
 11024   %}
 11115   %}
 11025   ins_pipe( pipe_slow );
 11116   ins_pipe( pipe_slow );
 11026 %}
 11117 %}
 11027 
 11118 
 11028 instruct string_indexofU(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, rax_RegI cnt2,
 11119 instruct string_indexofU(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, rax_RegI cnt2,
 11029                          rbx_RegI result, regD vec, rcx_RegI tmp, rFlagsReg cr)
 11120                          rbx_RegI result, legVecS vec, rcx_RegI tmp, rFlagsReg cr)
 11030 %{
 11121 %{
 11031   predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UU));
 11122   predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UU));
 11032   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
 11123   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
 11033   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL tmp, KILL cr);
 11124   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL tmp, KILL cr);
 11034 
 11125 
 11041   %}
 11132   %}
 11042   ins_pipe( pipe_slow );
 11133   ins_pipe( pipe_slow );
 11043 %}
 11134 %}
 11044 
 11135 
 11045 instruct string_indexofUL(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, rax_RegI cnt2,
 11136 instruct string_indexofUL(rdi_RegP str1, rdx_RegI cnt1, rsi_RegP str2, rax_RegI cnt2,
 11046                          rbx_RegI result, regD vec, rcx_RegI tmp, rFlagsReg cr)
 11137                          rbx_RegI result, legVecS vec, rcx_RegI tmp, rFlagsReg cr)
 11047 %{
 11138 %{
 11048   predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UL));
 11139   predicate(UseSSE42Intrinsics && (((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UL));
 11049   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
 11140   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
 11050   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL tmp, KILL cr);
 11141   effect(TEMP vec, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL tmp, KILL cr);
 11051 
 11142 
 11058   %}
 11149   %}
 11059   ins_pipe( pipe_slow );
 11150   ins_pipe( pipe_slow );
 11060 %}
 11151 %}
 11061 
 11152 
 11062 instruct string_indexofU_char(rdi_RegP str1, rdx_RegI cnt1, rax_RegI ch,
 11153 instruct string_indexofU_char(rdi_RegP str1, rdx_RegI cnt1, rax_RegI ch,
 11063                               rbx_RegI result, regD vec1, regD vec2, regD vec3, rcx_RegI tmp, rFlagsReg cr)
 11154                               rbx_RegI result, legVecS vec1, legVecS vec2, legVecS vec3, rcx_RegI tmp, rFlagsReg cr)
 11064 %{
 11155 %{
 11065   predicate(UseSSE42Intrinsics);
 11156   predicate(UseSSE42Intrinsics);
 11066   match(Set result (StrIndexOfChar (Binary str1 cnt1) ch));
 11157   match(Set result (StrIndexOfChar (Binary str1 cnt1) ch));
 11067   effect(TEMP vec1, TEMP vec2, TEMP vec3, USE_KILL str1, USE_KILL cnt1, USE_KILL ch, TEMP tmp, KILL cr);
 11158   effect(TEMP vec1, TEMP vec2, TEMP vec3, USE_KILL str1, USE_KILL cnt1, USE_KILL ch, TEMP tmp, KILL cr);
 11068   format %{ "String IndexOf char[] $str1,$cnt1,$ch -> $result   // KILL all" %}
 11159   format %{ "String IndexOf char[] $str1,$cnt1,$ch -> $result   // KILL all" %}
 11073   ins_pipe( pipe_slow );
 11164   ins_pipe( pipe_slow );
 11074 %}
 11165 %}
 11075 
 11166 
 11076 // fast string equals
 11167 // fast string equals
 11077 instruct string_equals(rdi_RegP str1, rsi_RegP str2, rcx_RegI cnt, rax_RegI result,
 11168 instruct string_equals(rdi_RegP str1, rsi_RegP str2, rcx_RegI cnt, rax_RegI result,
 11078                        regD tmp1, regD tmp2, rbx_RegI tmp3, rFlagsReg cr)
 11169                        legVecS tmp1, legVecS tmp2, rbx_RegI tmp3, rFlagsReg cr)
 11079 %{
 11170 %{
 11080   match(Set result (StrEquals (Binary str1 str2) cnt));
 11171   match(Set result (StrEquals (Binary str1 str2) cnt));
 11081   effect(TEMP tmp1, TEMP tmp2, USE_KILL str1, USE_KILL str2, USE_KILL cnt, KILL tmp3, KILL cr);
 11172   effect(TEMP tmp1, TEMP tmp2, USE_KILL str1, USE_KILL str2, USE_KILL cnt, KILL tmp3, KILL cr);
 11082 
 11173 
 11083   format %{ "String Equals $str1,$str2,$cnt -> $result    // KILL $tmp1, $tmp2, $tmp3" %}
 11174   format %{ "String Equals $str1,$str2,$cnt -> $result    // KILL $tmp1, $tmp2, $tmp3" %}
 11089   ins_pipe( pipe_slow );
 11180   ins_pipe( pipe_slow );
 11090 %}
 11181 %}
 11091 
 11182 
 11092 // fast array equals
 11183 // fast array equals
 11093 instruct array_equalsB(rdi_RegP ary1, rsi_RegP ary2, rax_RegI result,
 11184 instruct array_equalsB(rdi_RegP ary1, rsi_RegP ary2, rax_RegI result,
 11094                        regD tmp1, regD tmp2, rcx_RegI tmp3, rbx_RegI tmp4, rFlagsReg cr)
 11185                        legVecS tmp1, legVecS tmp2, rcx_RegI tmp3, rbx_RegI tmp4, rFlagsReg cr)
 11095 %{
 11186 %{
 11096   predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::LL);
 11187   predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::LL);
 11097   match(Set result (AryEq ary1 ary2));
 11188   match(Set result (AryEq ary1 ary2));
 11098   effect(TEMP tmp1, TEMP tmp2, USE_KILL ary1, USE_KILL ary2, KILL tmp3, KILL tmp4, KILL cr);
 11189   effect(TEMP tmp1, TEMP tmp2, USE_KILL ary1, USE_KILL ary2, KILL tmp3, KILL tmp4, KILL cr);
 11099 
 11190 
 11105   %}
 11196   %}
 11106   ins_pipe( pipe_slow );
 11197   ins_pipe( pipe_slow );
 11107 %}
 11198 %}
 11108 
 11199 
 11109 instruct array_equalsC(rdi_RegP ary1, rsi_RegP ary2, rax_RegI result,
 11200 instruct array_equalsC(rdi_RegP ary1, rsi_RegP ary2, rax_RegI result,
 11110                       regD tmp1, regD tmp2, rcx_RegI tmp3, rbx_RegI tmp4, rFlagsReg cr)
 11201                       legVecS tmp1, legVecS tmp2, rcx_RegI tmp3, rbx_RegI tmp4, rFlagsReg cr)
 11111 %{
 11202 %{
 11112   predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::UU);
 11203   predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::UU);
 11113   match(Set result (AryEq ary1 ary2));
 11204   match(Set result (AryEq ary1 ary2));
 11114   effect(TEMP tmp1, TEMP tmp2, USE_KILL ary1, USE_KILL ary2, KILL tmp3, KILL tmp4, KILL cr);
 11205   effect(TEMP tmp1, TEMP tmp2, USE_KILL ary1, USE_KILL ary2, KILL tmp3, KILL tmp4, KILL cr);
 11115 
 11206 
 11121   %}
 11212   %}
 11122   ins_pipe( pipe_slow );
 11213   ins_pipe( pipe_slow );
 11123 %}
 11214 %}
 11124 
 11215 
 11125 instruct has_negatives(rsi_RegP ary1, rcx_RegI len, rax_RegI result,
 11216 instruct has_negatives(rsi_RegP ary1, rcx_RegI len, rax_RegI result,
 11126                       regD tmp1, regD tmp2, rbx_RegI tmp3, rFlagsReg cr)
 11217                       legVecS tmp1, legVecS tmp2, rbx_RegI tmp3, rFlagsReg cr)
 11127 %{
 11218 %{
 11128   match(Set result (HasNegatives ary1 len));
 11219   match(Set result (HasNegatives ary1 len));
 11129   effect(TEMP tmp1, TEMP tmp2, USE_KILL ary1, USE_KILL len, KILL tmp3, KILL cr);
 11220   effect(TEMP tmp1, TEMP tmp2, USE_KILL ary1, USE_KILL len, KILL tmp3, KILL cr);
 11130 
 11221 
 11131   format %{ "has negatives byte[] $ary1,$len -> $result   // KILL $tmp1, $tmp2, $tmp3" %}
 11222   format %{ "has negatives byte[] $ary1,$len -> $result   // KILL $tmp1, $tmp2, $tmp3" %}
 11136   %}
 11227   %}
 11137   ins_pipe( pipe_slow );
 11228   ins_pipe( pipe_slow );
 11138 %}
 11229 %}
 11139 
 11230 
 11140 // fast char[] to byte[] compression
 11231 // fast char[] to byte[] compression
 11141 instruct string_compress(rsi_RegP src, rdi_RegP dst, rdx_RegI len, regD tmp1, regD tmp2, regD tmp3, regD tmp4,
 11232 instruct string_compress(rsi_RegP src, rdi_RegP dst, rdx_RegI len, legVecS tmp1, legVecS tmp2, legVecS tmp3, legVecS tmp4,
 11142                          rcx_RegI tmp5, rax_RegI result, rFlagsReg cr) %{
 11233                          rcx_RegI tmp5, rax_RegI result, rFlagsReg cr) %{
 11143   match(Set result (StrCompressedCopy src (Binary dst len)));
 11234   match(Set result (StrCompressedCopy src (Binary dst len)));
 11144   effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, USE_KILL src, USE_KILL dst, USE_KILL len, KILL tmp5, KILL cr);
 11235   effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, USE_KILL src, USE_KILL dst, USE_KILL len, KILL tmp5, KILL cr);
 11145 
 11236 
 11146   format %{ "String Compress $src,$dst -> $result    // KILL RAX, RCX, RDX" %}
 11237   format %{ "String Compress $src,$dst -> $result    // KILL RAX, RCX, RDX" %}
 11152   ins_pipe( pipe_slow );
 11243   ins_pipe( pipe_slow );
 11153 %}
 11244 %}
 11154 
 11245 
 11155 // fast byte[] to char[] inflation
 11246 // fast byte[] to char[] inflation
 11156 instruct string_inflate(Universe dummy, rsi_RegP src, rdi_RegP dst, rdx_RegI len,
 11247 instruct string_inflate(Universe dummy, rsi_RegP src, rdi_RegP dst, rdx_RegI len,
 11157                         regD tmp1, rcx_RegI tmp2, rFlagsReg cr) %{
 11248                         legVecS tmp1, rcx_RegI tmp2, rFlagsReg cr) %{
 11158   match(Set dummy (StrInflatedCopy src (Binary dst len)));
 11249   match(Set dummy (StrInflatedCopy src (Binary dst len)));
 11159   effect(TEMP tmp1, TEMP tmp2, USE_KILL src, USE_KILL dst, USE_KILL len, KILL cr);
 11250   effect(TEMP tmp1, TEMP tmp2, USE_KILL src, USE_KILL dst, USE_KILL len, KILL cr);
 11160 
 11251 
 11161   format %{ "String Inflate $src,$dst    // KILL $tmp1, $tmp2" %}
 11252   format %{ "String Inflate $src,$dst    // KILL $tmp1, $tmp2" %}
 11162   ins_encode %{
 11253   ins_encode %{
 11166   ins_pipe( pipe_slow );
 11257   ins_pipe( pipe_slow );
 11167 %}
 11258 %}
 11168 
 11259 
 11169 // encode char[] to byte[] in ISO_8859_1
 11260 // encode char[] to byte[] in ISO_8859_1
 11170 instruct encode_iso_array(rsi_RegP src, rdi_RegP dst, rdx_RegI len,
 11261 instruct encode_iso_array(rsi_RegP src, rdi_RegP dst, rdx_RegI len,
 11171                           regD tmp1, regD tmp2, regD tmp3, regD tmp4,
 11262                           legVecS tmp1, legVecS tmp2, legVecS tmp3, legVecS tmp4,
 11172                           rcx_RegI tmp5, rax_RegI result, rFlagsReg cr) %{
 11263                           rcx_RegI tmp5, rax_RegI result, rFlagsReg cr) %{
 11173   match(Set result (EncodeISOArray src (Binary dst len)));
 11264   match(Set result (EncodeISOArray src (Binary dst len)));
 11174   effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, USE_KILL src, USE_KILL dst, USE_KILL len, KILL tmp5, KILL cr);
 11265   effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, USE_KILL src, USE_KILL dst, USE_KILL len, KILL tmp5, KILL cr);
 11175 
 11266 
 11176   format %{ "Encode array $src,$dst,$len -> $result    // KILL RCX, RDX, $tmp1, $tmp2, $tmp3, $tmp4, RSI, RDI " %}
 11267   format %{ "Encode array $src,$dst,$len -> $result    // KILL RCX, RDX, $tmp1, $tmp2, $tmp3, $tmp4, RSI, RDI " %}