Skip to content

Commit e898048

Browse files
Ningsheng JianAndrew Haley
Ningsheng Jian
authored and
Andrew Haley
committed
8307572: AArch64: Vector registers are clobbered by some macroassemblers
Reviewed-by: aph Backport-of: 33d9a857308eed53e06b448691910bc8aa2f8fc9
1 parent f80be82 commit e898048

File tree

6 files changed

+391
-57
lines changed

6 files changed

+391
-57
lines changed

src/hotspot/cpu/aarch64/aarch64.ad

+75-50
Original file line numberDiff line numberDiff line change
@@ -16770,14 +16770,17 @@ instruct string_compareLU(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4
1677016770
%}
1677116771

1677216772
instruct string_indexofUU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 cnt2,
16773-
iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3,
16774-
iRegINoSp tmp4, iRegINoSp tmp5, iRegINoSp tmp6, rFlagsReg cr)
16773+
iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2,
16774+
iRegINoSp tmp3, iRegINoSp tmp4, iRegINoSp tmp5, iRegINoSp tmp6,
16775+
vRegD_V0 vtmp0, vRegD_V1 vtmp1, rFlagsReg cr)
1677516776
%{
1677616777
predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UU);
1677716778
match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
1677816779
effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2,
16779-
TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, TEMP tmp6, KILL cr);
16780-
format %{ "String IndexOf $str1,$cnt1,$str2,$cnt2 -> $result (UU)" %}
16780+
TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, TEMP tmp6,
16781+
TEMP vtmp0, TEMP vtmp1, KILL cr);
16782+
format %{ "String IndexOf $str1,$cnt1,$str2,$cnt2 -> $result (UU) "
16783+
"# KILL $str1 $cnt1 $str2 $cnt2 $tmp1 $tmp2 $tmp3 $tmp4 $tmp5 $tmp6 V0-V1 cr" %}
1678116784

1678216785
ins_encode %{
1678316786
__ string_indexof($str1$$Register, $str2$$Register,
@@ -16791,14 +16794,17 @@ instruct string_indexofUU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2
1679116794
%}
1679216795

1679316796
instruct string_indexofLL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 cnt2,
16794-
iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3,
16795-
iRegINoSp tmp4, iRegINoSp tmp5, iRegINoSp tmp6, rFlagsReg cr)
16797+
iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3,
16798+
iRegINoSp tmp4, iRegINoSp tmp5, iRegINoSp tmp6,
16799+
vRegD_V0 vtmp0, vRegD_V1 vtmp1, rFlagsReg cr)
1679616800
%{
1679716801
predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LL);
1679816802
match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
1679916803
effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2,
16800-
TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, TEMP tmp6, KILL cr);
16801-
format %{ "String IndexOf $str1,$cnt1,$str2,$cnt2 -> $result (LL)" %}
16804+
TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, TEMP tmp6,
16805+
TEMP vtmp0, TEMP vtmp1, KILL cr);
16806+
format %{ "String IndexOf $str1,$cnt1,$str2,$cnt2 -> $result (LL) "
16807+
"# KILL $str1 $cnt1 $str2 $cnt2 $tmp1 $tmp2 $tmp3 $tmp4 $tmp5 $tmp6 V0-V1 cr" %}
1680216808

1680316809
ins_encode %{
1680416810
__ string_indexof($str1$$Register, $str2$$Register,
@@ -16812,14 +16818,17 @@ instruct string_indexofLL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2
1681216818
%}
1681316819

1681416820
instruct string_indexofUL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 cnt2,
16815-
iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3,
16816-
iRegINoSp tmp4, iRegINoSp tmp5, iRegINoSp tmp6, rFlagsReg cr)
16821+
iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2,iRegINoSp tmp3,
16822+
iRegINoSp tmp4, iRegINoSp tmp5, iRegINoSp tmp6,
16823+
vRegD_V0 vtmp0, vRegD_V1 vtmp1, rFlagsReg cr)
1681716824
%{
1681816825
predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UL);
1681916826
match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
1682016827
effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2,
16821-
TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, TEMP tmp6, KILL cr);
16822-
format %{ "String IndexOf $str1,$cnt1,$str2,$cnt2 -> $result (UL)" %}
16828+
TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5,
16829+
TEMP tmp6, TEMP vtmp0, TEMP vtmp1, KILL cr);
16830+
format %{ "String IndexOf $str1,$cnt1,$str2,$cnt2 -> $result (UL) "
16831+
"# KILL $str1 cnt1 $str2 $cnt2 $tmp1 $tmp2 $tmp3 $tmp4 $tmp5 $tmp6 V0-V1 cr" %}
1682316832

1682416833
ins_encode %{
1682516834
__ string_indexof($str1$$Register, $str2$$Register,
@@ -16833,14 +16842,15 @@ instruct string_indexofUL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2
1683316842
%}
1683416843

1683516844
instruct string_indexof_conUU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2,
16836-
immI_le_4 int_cnt2, iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2,
16837-
iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr)
16845+
immI_le_4 int_cnt2, iRegI_R0 result, iRegINoSp tmp1,
16846+
iRegINoSp tmp2, iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr)
1683816847
%{
1683916848
predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UU);
1684016849
match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
1684116850
effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt1,
1684216851
TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL cr);
16843-
format %{ "String IndexOf $str1,$cnt1,$str2,$int_cnt2 -> $result (UU)" %}
16852+
format %{ "String IndexOf $str1,$cnt1,$str2,$int_cnt2 -> $result (UU) "
16853+
"# KILL $str1 $cnt1 $str2 $tmp1 $tmp2 $tmp3 $tmp4 cr" %}
1684416854

1684516855
ins_encode %{
1684616856
int icnt2 = (int)$int_cnt2$$constant;
@@ -16854,14 +16864,15 @@ instruct string_indexof_conUU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2,
1685416864
%}
1685516865

1685616866
instruct string_indexof_conLL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2,
16857-
immI_le_4 int_cnt2, iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2,
16858-
iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr)
16867+
immI_le_4 int_cnt2, iRegI_R0 result, iRegINoSp tmp1,
16868+
iRegINoSp tmp2, iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr)
1685916869
%{
1686016870
predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LL);
1686116871
match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
1686216872
effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt1,
1686316873
TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL cr);
16864-
format %{ "String IndexOf $str1,$cnt1,$str2,$int_cnt2 -> $result (LL)" %}
16874+
format %{ "String IndexOf $str1,$cnt1,$str2,$int_cnt2 -> $result (LL) "
16875+
"# KILL $str1 $cnt1 $str2 $tmp1 $tmp2 $tmp3 $tmp4 cr" %}
1686516876

1686616877
ins_encode %{
1686716878
int icnt2 = (int)$int_cnt2$$constant;
@@ -16875,14 +16886,15 @@ instruct string_indexof_conLL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2,
1687516886
%}
1687616887

1687716888
instruct string_indexof_conUL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2,
16878-
immI_1 int_cnt2, iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2,
16879-
iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr)
16889+
immI_1 int_cnt2, iRegI_R0 result, iRegINoSp tmp1,
16890+
iRegINoSp tmp2, iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr)
1688016891
%{
1688116892
predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UL);
1688216893
match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
1688316894
effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt1,
1688416895
TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL cr);
16885-
format %{ "String IndexOf $str1,$cnt1,$str2,$int_cnt2 -> $result (UL)" %}
16896+
format %{ "String IndexOf $str1,$cnt1,$str2,$int_cnt2 -> $result (UL) "
16897+
"# KILL $str1 $cnt1 $str2 $tmp1 $tmp2 $tmp3 $tmp4 cr" %}
1688616898

1688716899
ins_encode %{
1688816900
int icnt2 = (int)$int_cnt2$$constant;
@@ -16967,13 +16979,17 @@ instruct string_equalsU(iRegP_R1 str1, iRegP_R3 str2, iRegI_R4 cnt,
1696716979

1696816980
instruct array_equalsB(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result,
1696916981
iRegP_R3 tmp1, iRegP_R4 tmp2, iRegP_R5 tmp3,
16982+
vRegD_V0 vtmp0, vRegD_V1 vtmp1, vRegD_V2 vtmp2, vRegD_V3 vtmp3,
16983+
vRegD_V4 vtmp4, vRegD_V5 vtmp5, vRegD_V6 vtmp6, vRegD_V7 vtmp7,
1697016984
iRegP_R10 tmp, rFlagsReg cr)
1697116985
%{
1697216986
predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::LL);
1697316987
match(Set result (AryEq ary1 ary2));
16974-
effect(KILL tmp, USE_KILL ary1, USE_KILL ary2, TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr);
16988+
effect(KILL tmp, USE_KILL ary1, USE_KILL ary2, TEMP tmp1, TEMP tmp2, TEMP tmp3,
16989+
TEMP vtmp0, TEMP vtmp1, TEMP vtmp2, TEMP vtmp3, TEMP vtmp4, TEMP vtmp5,
16990+
TEMP vtmp6, TEMP vtmp7, KILL cr);
1697516991

16976-
format %{ "Array Equals $ary1,ary2 -> $result // KILL $tmp" %}
16992+
format %{ "Array Equals $ary1,ary2 -> $result # KILL $ary1 $ary2 $tmp $tmp1 $tmp2 $tmp3 V0-V7 cr" %}
1697716993
ins_encode %{
1697816994
address tpc = __ arrays_equals($ary1$$Register, $ary2$$Register,
1697916995
$tmp1$$Register, $tmp2$$Register, $tmp3$$Register,
@@ -16988,13 +17004,17 @@ instruct array_equalsB(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result,
1698817004

1698917005
instruct array_equalsC(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result,
1699017006
iRegP_R3 tmp1, iRegP_R4 tmp2, iRegP_R5 tmp3,
17007+
vRegD_V0 vtmp0, vRegD_V1 vtmp1, vRegD_V2 vtmp2, vRegD_V3 vtmp3,
17008+
vRegD_V4 vtmp4, vRegD_V5 vtmp5, vRegD_V6 vtmp6, vRegD_V7 vtmp7,
1699117009
iRegP_R10 tmp, rFlagsReg cr)
1699217010
%{
1699317011
predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::UU);
1699417012
match(Set result (AryEq ary1 ary2));
16995-
effect(KILL tmp, USE_KILL ary1, USE_KILL ary2, TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr);
17013+
effect(KILL tmp, USE_KILL ary1, USE_KILL ary2, TEMP tmp1, TEMP tmp2, TEMP tmp3,
17014+
TEMP vtmp0, TEMP vtmp1, TEMP vtmp2, TEMP vtmp3, TEMP vtmp4, TEMP vtmp5,
17015+
TEMP vtmp6, TEMP vtmp7, KILL cr);
1699617016

16997-
format %{ "Array Equals $ary1,ary2 -> $result // KILL $tmp" %}
17017+
format %{ "Array Equals $ary1,ary2 -> $result # KILL $ary1 $ary2 $tmp $tmp1 $tmp2 $tmp3 V0-V7 cr" %}
1699817018
ins_encode %{
1699917019
address tpc = __ arrays_equals($ary1$$Register, $ary2$$Register,
1700017020
$tmp1$$Register, $tmp2$$Register, $tmp3$$Register,
@@ -17024,36 +17044,39 @@ instruct has_negatives(iRegP_R1 ary1, iRegI_R2 len, iRegI_R0 result, rFlagsReg c
1702417044

1702517045
// fast char[] to byte[] compression
1702617046
instruct string_compress(iRegP_R2 src, iRegP_R1 dst, iRegI_R3 len,
17027-
vRegD_V0 tmp1, vRegD_V1 tmp2,
17028-
vRegD_V2 tmp3, vRegD_V3 tmp4,
17047+
vRegD_V0 vtmp0, vRegD_V1 vtmp1, vRegD_V2 vtmp2,
17048+
vRegD_V3 vtmp3, vRegD_V4 vtmp4, vRegD_V5 vtmp5,
1702917049
iRegI_R0 result, rFlagsReg cr)
1703017050
%{
1703117051
match(Set result (StrCompressedCopy src (Binary dst len)));
17032-
effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4,
17052+
effect(TEMP vtmp0, TEMP vtmp1, TEMP vtmp2, TEMP vtmp3, TEMP vtmp4, TEMP vtmp5,
1703317053
USE_KILL src, USE_KILL dst, USE len, KILL cr);
1703417054

17035-
format %{ "String Compress $src,$dst,$len -> $result // KILL $src,$dst" %}
17055+
format %{ "String Compress $src,$dst,$len -> $result # KILL $src $dst V0-V5 cr" %}
1703617056
ins_encode %{
1703717057
__ char_array_compress($src$$Register, $dst$$Register, $len$$Register,
17038-
$result$$Register,
17039-
$tmp1$$FloatRegister, $tmp2$$FloatRegister,
17040-
$tmp3$$FloatRegister, $tmp4$$FloatRegister);
17058+
$result$$Register, $vtmp0$$FloatRegister, $vtmp1$$FloatRegister,
17059+
$vtmp2$$FloatRegister, $vtmp3$$FloatRegister,
17060+
$vtmp4$$FloatRegister, $vtmp5$$FloatRegister);
1704117061
%}
1704217062
ins_pipe(pipe_slow);
1704317063
%}
1704417064

1704517065
// fast byte[] to char[] inflation
17046-
instruct string_inflate(Universe dummy, iRegP_R0 src, iRegP_R1 dst, iRegI_R2 len,
17047-
vRegD_V0 tmp1, vRegD_V1 tmp2, vRegD_V2 tmp3, iRegP_R3 tmp4, rFlagsReg cr)
17066+
instruct string_inflate(Universe dummy, iRegP_R0 src, iRegP_R1 dst, iRegI_R2 len, iRegP_R3 tmp,
17067+
vRegD_V0 vtmp0, vRegD_V1 vtmp1, vRegD_V2 vtmp2, vRegD_V3 vtmp3,
17068+
vRegD_V4 vtmp4, vRegD_V5 vtmp5, vRegD_V6 vtmp6, rFlagsReg cr)
1704817069
%{
1704917070
match(Set dummy (StrInflatedCopy src (Binary dst len)));
17050-
effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, USE_KILL src, USE_KILL dst, USE_KILL len, KILL cr);
17071+
effect(TEMP vtmp0, TEMP vtmp1, TEMP vtmp2, TEMP vtmp3,
17072+
TEMP vtmp4, TEMP vtmp5, TEMP vtmp6, TEMP tmp,
17073+
USE_KILL src, USE_KILL dst, USE_KILL len, KILL cr);
1705117074

17052-
format %{ "String Inflate $src,$dst // KILL $tmp1, $tmp2" %}
17075+
format %{ "String Inflate $src,$dst # KILL $tmp $src $dst $len V0-V6 cr" %}
1705317076
ins_encode %{
1705417077
address tpc = __ byte_array_inflate($src$$Register, $dst$$Register, $len$$Register,
17055-
$tmp1$$FloatRegister, $tmp2$$FloatRegister,
17056-
$tmp3$$FloatRegister, $tmp4$$Register);
17078+
$vtmp0$$FloatRegister, $vtmp1$$FloatRegister,
17079+
$vtmp2$$FloatRegister, $tmp$$Register);
1705717080
if (tpc == NULL) {
1705817081
ciEnv::current()->record_failure("CodeCache is full");
1705917082
return;
@@ -17064,41 +17087,43 @@ instruct string_inflate(Universe dummy, iRegP_R0 src, iRegP_R1 dst, iRegI_R2 len
1706417087

1706517088
// encode char[] to byte[] in ISO_8859_1
1706617089
instruct encode_iso_array(iRegP_R2 src, iRegP_R1 dst, iRegI_R3 len,
17067-
vRegD_V0 vtmp0, vRegD_V1 vtmp1,
17068-
vRegD_V2 vtmp2, vRegD_V3 vtmp3,
17090+
vRegD_V0 vtmp0, vRegD_V1 vtmp1, vRegD_V2 vtmp2,
17091+
vRegD_V3 vtmp3, vRegD_V4 vtmp4, vRegD_V5 vtmp5,
1706917092
iRegI_R0 result, rFlagsReg cr)
1707017093
%{
1707117094
predicate(!((EncodeISOArrayNode*)n)->is_ascii());
1707217095
match(Set result (EncodeISOArray src (Binary dst len)));
17073-
effect(USE_KILL src, USE_KILL dst, USE len,
17074-
KILL vtmp0, KILL vtmp1, KILL vtmp2, KILL vtmp3, KILL cr);
17096+
effect(USE_KILL src, USE_KILL dst, USE len, KILL vtmp0, KILL vtmp1,
17097+
KILL vtmp2, KILL vtmp3, KILL vtmp4, KILL vtmp5, KILL cr);
1707517098

17076-
format %{ "Encode ISO array $src,$dst,$len -> $result" %}
17099+
format %{ "Encode ISO array $src,$dst,$len -> $result # KILL $src $dst V0-V5 cr" %}
1707717100
ins_encode %{
1707817101
__ encode_iso_array($src$$Register, $dst$$Register, $len$$Register,
1707917102
$result$$Register, false,
1708017103
$vtmp0$$FloatRegister, $vtmp1$$FloatRegister,
17081-
$vtmp2$$FloatRegister, $vtmp3$$FloatRegister);
17104+
$vtmp2$$FloatRegister, $vtmp3$$FloatRegister,
17105+
$vtmp4$$FloatRegister, $vtmp5$$FloatRegister);
1708217106
%}
1708317107
ins_pipe(pipe_class_memory);
1708417108
%}
1708517109

1708617110
instruct encode_ascii_array(iRegP_R2 src, iRegP_R1 dst, iRegI_R3 len,
17087-
vRegD_V0 vtmp0, vRegD_V1 vtmp1,
17088-
vRegD_V2 vtmp2, vRegD_V3 vtmp3,
17111+
vRegD_V0 vtmp0, vRegD_V1 vtmp1, vRegD_V2 vtmp2,
17112+
vRegD_V3 vtmp3, vRegD_V4 vtmp4, vRegD_V5 vtmp5,
1708917113
iRegI_R0 result, rFlagsReg cr)
1709017114
%{
1709117115
predicate(((EncodeISOArrayNode*)n)->is_ascii());
1709217116
match(Set result (EncodeISOArray src (Binary dst len)));
17093-
effect(USE_KILL src, USE_KILL dst, USE len,
17094-
KILL vtmp0, KILL vtmp1, KILL vtmp2, KILL vtmp3, KILL cr);
17117+
effect(USE_KILL src, USE_KILL dst, USE len, KILL vtmp0, KILL vtmp1,
17118+
KILL vtmp2, KILL vtmp3, KILL vtmp4, KILL vtmp5, KILL cr);
1709517119

17096-
format %{ "Encode ASCII array $src,$dst,$len -> $result" %}
17120+
format %{ "Encode ASCII array $src,$dst,$len -> $result # KILL $src $dst V0-V5 cr" %}
1709717121
ins_encode %{
1709817122
__ encode_iso_array($src$$Register, $dst$$Register, $len$$Register,
1709917123
$result$$Register, true,
1710017124
$vtmp0$$FloatRegister, $vtmp1$$FloatRegister,
17101-
$vtmp2$$FloatRegister, $vtmp3$$FloatRegister);
17125+
$vtmp2$$FloatRegister, $vtmp3$$FloatRegister,
17126+
$vtmp4$$FloatRegister, $vtmp5$$FloatRegister);
1710217127
%}
1710317128
ins_pipe(pipe_class_memory);
1710417129
%}

src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
typedef void (MacroAssembler::* chr_insn)(Register Rt, const Address &adr);
4444

4545
// Search for str1 in str2 and return index or -1
46+
// Clobbers: rscratch1, rscratch2, rflags. May also clobber v0-v1, when icnt1==-1.
4647
void C2_MacroAssembler::string_indexof(Register str2, Register str1,
4748
Register cnt2, Register cnt1,
4849
Register tmp1, Register tmp2,

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

+11-5
Original file line numberDiff line numberDiff line change
@@ -4514,6 +4514,8 @@ address MacroAssembler::has_negatives(Register ary1, Register len, Register resu
45144514
return pc();
45154515
}
45164516

4517+
// Clobbers: rscratch1, rscratch2, rflags
4518+
// May also clobber v0-v7 when (!UseSimpleArrayEquals && UseSIMDForArrayEquals)
45174519
address MacroAssembler::arrays_equals(Register a1, Register a2, Register tmp3,
45184520
Register tmp4, Register tmp5, Register result,
45194521
Register cnt1, int elem_size) {
@@ -5049,10 +5051,12 @@ void MacroAssembler::fill_words(Register base, Register cnt, Register value)
50495051
// Using 'umaxv' in the ASCII-case comes with a small penalty but does
50505052
// avoid additional bloat.
50515053
//
5054+
// Clobbers: src, dst, res, rscratch1, rscratch2, rflags
50525055
void MacroAssembler::encode_iso_array(Register src, Register dst,
50535056
Register len, Register res, bool ascii,
50545057
FloatRegister vtmp0, FloatRegister vtmp1,
5055-
FloatRegister vtmp2, FloatRegister vtmp3)
5058+
FloatRegister vtmp2, FloatRegister vtmp3,
5059+
FloatRegister vtmp4, FloatRegister vtmp5)
50565060
{
50575061
Register cnt = res;
50585062
Register max = rscratch1;
@@ -5071,8 +5075,8 @@ void MacroAssembler::encode_iso_array(Register src, Register dst,
50715075
br(LT, DONE_32);
50725076
ld1(vtmp0, vtmp1, vtmp2, vtmp3, T8H, Address(post(src, 64)));
50735077
// Extract lower bytes.
5074-
FloatRegister vlo0 = v4;
5075-
FloatRegister vlo1 = v5;
5078+
FloatRegister vlo0 = vtmp4;
5079+
FloatRegister vlo1 = vtmp5;
50765080
uzp1(vlo0, T16B, vtmp0, vtmp1);
50775081
uzp1(vlo1, T16B, vtmp2, vtmp3);
50785082
// Merge bits...
@@ -5145,6 +5149,7 @@ void MacroAssembler::encode_iso_array(Register src, Register dst,
51455149
}
51465150

51475151
// Inflate byte[] array to char[].
5152+
// Clobbers: src, dst, len, rflags, rscratch1, v0-v6
51485153
address MacroAssembler::byte_array_inflate(Register src, Register dst, Register len,
51495154
FloatRegister vtmp1, FloatRegister vtmp2,
51505155
FloatRegister vtmp3, Register tmp4) {
@@ -5253,8 +5258,9 @@ address MacroAssembler::byte_array_inflate(Register src, Register dst, Register
52535258
void MacroAssembler::char_array_compress(Register src, Register dst, Register len,
52545259
Register res,
52555260
FloatRegister tmp0, FloatRegister tmp1,
5256-
FloatRegister tmp2, FloatRegister tmp3) {
5257-
encode_iso_array(src, dst, len, res, false, tmp0, tmp1, tmp2, tmp3);
5261+
FloatRegister tmp2, FloatRegister tmp3,
5262+
FloatRegister tmp4, FloatRegister tmp5) {
5263+
encode_iso_array(src, dst, len, res, false, tmp0, tmp1, tmp2, tmp3, tmp4, tmp5);
52585264
// Adjust result: res == len ? len : 0
52595265
cmp(len, res);
52605266
csel(res, res, zr, EQ);

src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -1275,12 +1275,14 @@ class MacroAssembler: public Assembler {
12751275
void char_array_compress(Register src, Register dst, Register len,
12761276
Register res,
12771277
FloatRegister vtmp0, FloatRegister vtmp1,
1278-
FloatRegister vtmp2, FloatRegister vtmp3);
1278+
FloatRegister vtmp2, FloatRegister vtmp3,
1279+
FloatRegister vtmp4, FloatRegister vtmp5);
12791280

12801281
void encode_iso_array(Register src, Register dst,
12811282
Register len, Register res, bool ascii,
12821283
FloatRegister vtmp0, FloatRegister vtmp1,
1283-
FloatRegister vtmp2, FloatRegister vtmp3);
1284+
FloatRegister vtmp2, FloatRegister vtmp3,
1285+
FloatRegister vtmp4, FloatRegister vtmp5);
12841286

12851287
void fast_log(FloatRegister vtmp0, FloatRegister vtmp1, FloatRegister vtmp2,
12861288
FloatRegister vtmp3, FloatRegister vtmp4, FloatRegister vtmp5,

0 commit comments

Comments
 (0)