Skip to content

Commit c7d3a44

Browse files
zifeihanRealFYang
authored andcommitted
8284937: riscv: should not allocate special register for temp
Reviewed-by: fyang Backport-of: 145dfed03c21ffe233203c1117d02b552bd17630
1 parent 34f7641 commit c7d3a44

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

src/hotspot/cpu/riscv/riscv.ad

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,42 +1864,42 @@ encode %{
18641864
}
18651865
%}
18661866

1867-
enc_class riscv_enc_cmpxchgw(iRegINoSp res, memory mem, iRegINoSp oldval, iRegINoSp newval) %{
1867+
enc_class riscv_enc_cmpxchgw(iRegINoSp res, memory mem, iRegI oldval, iRegI newval) %{
18681868
MacroAssembler _masm(&cbuf);
18691869
__ cmpxchg(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::int32,
18701870
/*acquire*/ Assembler::relaxed, /*release*/ Assembler::rl, $res$$Register,
18711871
/*result as bool*/ true);
18721872
%}
18731873

1874-
enc_class riscv_enc_cmpxchgn(iRegINoSp res, memory mem, iRegINoSp oldval, iRegINoSp newval) %{
1874+
enc_class riscv_enc_cmpxchgn(iRegINoSp res, memory mem, iRegI oldval, iRegI newval) %{
18751875
MacroAssembler _masm(&cbuf);
18761876
__ cmpxchg(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::uint32,
18771877
/*acquire*/ Assembler::relaxed, /*release*/ Assembler::rl, $res$$Register,
18781878
/*result as bool*/ true);
18791879
%}
18801880

1881-
enc_class riscv_enc_cmpxchg(iRegINoSp res, memory mem, iRegLNoSp oldval, iRegLNoSp newval) %{
1881+
enc_class riscv_enc_cmpxchg(iRegINoSp res, memory mem, iRegL oldval, iRegL newval) %{
18821882
MacroAssembler _masm(&cbuf);
18831883
__ cmpxchg(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::int64,
18841884
/*acquire*/ Assembler::relaxed, /*release*/ Assembler::rl, $res$$Register,
18851885
/*result as bool*/ true);
18861886
%}
18871887

1888-
enc_class riscv_enc_cmpxchgw_acq(iRegINoSp res, memory mem, iRegINoSp oldval, iRegINoSp newval) %{
1888+
enc_class riscv_enc_cmpxchgw_acq(iRegINoSp res, memory mem, iRegI oldval, iRegI newval) %{
18891889
MacroAssembler _masm(&cbuf);
18901890
__ cmpxchg(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::int32,
18911891
/*acquire*/ Assembler::aq, /*release*/ Assembler::rl, $res$$Register,
18921892
/*result as bool*/ true);
18931893
%}
18941894

1895-
enc_class riscv_enc_cmpxchgn_acq(iRegINoSp res, memory mem, iRegINoSp oldval, iRegINoSp newval) %{
1895+
enc_class riscv_enc_cmpxchgn_acq(iRegINoSp res, memory mem, iRegI oldval, iRegI newval) %{
18961896
MacroAssembler _masm(&cbuf);
18971897
__ cmpxchg(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::uint32,
18981898
/*acquire*/ Assembler::aq, /*release*/ Assembler::rl, $res$$Register,
18991899
/*result as bool*/ true);
19001900
%}
19011901

1902-
enc_class riscv_enc_cmpxchg_acq(iRegINoSp res, memory mem, iRegLNoSp oldval, iRegLNoSp newval) %{
1902+
enc_class riscv_enc_cmpxchg_acq(iRegINoSp res, memory mem, iRegL oldval, iRegL newval) %{
19031903
MacroAssembler _masm(&cbuf);
19041904
__ cmpxchg(as_Register($mem$$base), $oldval$$Register, $newval$$Register, Assembler::int64,
19051905
/*acquire*/ Assembler::aq, /*release*/ Assembler::rl, $res$$Register,
@@ -2036,7 +2036,7 @@ encode %{
20362036
%}
20372037

20382038
// using the cr register as the bool result: 0 for success; others failed.
2039-
enc_class riscv_enc_fast_lock(iRegP object, iRegP box, iRegP tmp1, iRegP tmp2) %{
2039+
enc_class riscv_enc_fast_lock(iRegP object, iRegP box, iRegPNoSp tmp1, iRegPNoSp tmp2) %{
20402040
MacroAssembler _masm(&cbuf);
20412041
Register flag = t1;
20422042
Register oop = as_Register($object$$reg);
@@ -2123,7 +2123,7 @@ encode %{
21232123
%}
21242124

21252125
// using cr flag to indicate the fast_unlock result: 0 for success; others failed.
2126-
enc_class riscv_enc_fast_unlock(iRegP object, iRegP box, iRegP tmp1, iRegP tmp2) %{
2126+
enc_class riscv_enc_fast_unlock(iRegP object, iRegP box, iRegPNoSp tmp1, iRegPNoSp tmp2) %{
21272127
MacroAssembler _masm(&cbuf);
21282128
Register flag = t1;
21292129
Register oop = as_Register($object$$reg);
@@ -4902,7 +4902,7 @@ instruct storePConditional(memory heap_top_ptr, iRegP oldval, iRegP newval, rFla
49024902
// when attempting to rebias a lock towards the current thread. We
49034903
// must use the acquire form of cmpxchg in order to guarantee acquire
49044904
// semantics in this case.
4905-
instruct storeLConditional(indirect mem, iRegLNoSp oldval, iRegLNoSp newval, rFlagsReg cr)
4905+
instruct storeLConditional(indirect mem, iRegL oldval, iRegL newval, rFlagsReg cr)
49064906
%{
49074907
match(Set cr (StoreLConditional mem (Binary oldval newval)));
49084908

@@ -4924,7 +4924,7 @@ instruct storeLConditional(indirect mem, iRegLNoSp oldval, iRegLNoSp newval, rFl
49244924

49254925
// storeIConditional also has acquire semantics, for no better reason
49264926
// than matching storeLConditional.
4927-
instruct storeIConditional(indirect mem, iRegINoSp oldval, iRegINoSp newval, rFlagsReg cr)
4927+
instruct storeIConditional(indirect mem, iRegI oldval, iRegI newval, rFlagsReg cr)
49284928
%{
49294929
match(Set cr (StoreIConditional mem (Binary oldval newval)));
49304930

@@ -4947,7 +4947,7 @@ instruct storeIConditional(indirect mem, iRegINoSp oldval, iRegINoSp newval, rFl
49474947
// standard CompareAndSwapX when we are using barriers
49484948
// these have higher priority than the rules selected by a predicate
49494949
instruct compareAndSwapB(iRegINoSp res, indirect mem, iRegI_R12 oldval, iRegI_R13 newval,
4950-
iRegI tmp1, iRegI tmp2, iRegI tmp3, rFlagsReg cr)
4950+
iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, rFlagsReg cr)
49514951
%{
49524952
match(Set res (CompareAndSwapB mem (Binary oldval newval)));
49534953

@@ -4970,7 +4970,7 @@ instruct compareAndSwapB(iRegINoSp res, indirect mem, iRegI_R12 oldval, iRegI_R1
49704970
%}
49714971

49724972
instruct compareAndSwapS(iRegINoSp res, indirect mem, iRegI_R12 oldval, iRegI_R13 newval,
4973-
iRegI tmp1, iRegI tmp2, iRegI tmp3, rFlagsReg cr)
4973+
iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, rFlagsReg cr)
49744974
%{
49754975
match(Set res (CompareAndSwapS mem (Binary oldval newval)));
49764976

@@ -4992,7 +4992,7 @@ instruct compareAndSwapS(iRegINoSp res, indirect mem, iRegI_R12 oldval, iRegI_R1
49924992
ins_pipe(pipe_slow);
49934993
%}
49944994

4995-
instruct compareAndSwapI(iRegINoSp res, indirect mem, iRegINoSp oldval, iRegINoSp newval)
4995+
instruct compareAndSwapI(iRegINoSp res, indirect mem, iRegI oldval, iRegI newval)
49964996
%{
49974997
match(Set res (CompareAndSwapI mem (Binary oldval newval)));
49984998

@@ -5008,7 +5008,7 @@ instruct compareAndSwapI(iRegINoSp res, indirect mem, iRegINoSp oldval, iRegINoS
50085008
ins_pipe(pipe_slow);
50095009
%}
50105010

5011-
instruct compareAndSwapL(iRegINoSp res, indirect mem, iRegLNoSp oldval, iRegLNoSp newval)
5011+
instruct compareAndSwapL(iRegINoSp res, indirect mem, iRegL oldval, iRegL newval)
50125012
%{
50135013
match(Set res (CompareAndSwapL mem (Binary oldval newval)));
50145014

@@ -5040,7 +5040,7 @@ instruct compareAndSwapP(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval
50405040
ins_pipe(pipe_slow);
50415041
%}
50425042

5043-
instruct compareAndSwapN(iRegINoSp res, indirect mem, iRegNNoSp oldval, iRegNNoSp newval)
5043+
instruct compareAndSwapN(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval)
50445044
%{
50455045
match(Set res (CompareAndSwapN mem (Binary oldval newval)));
50465046

@@ -5058,7 +5058,7 @@ instruct compareAndSwapN(iRegINoSp res, indirect mem, iRegNNoSp oldval, iRegNNoS
50585058

50595059
// alternative CompareAndSwapX when we are eliding barriers
50605060
instruct compareAndSwapBAcq(iRegINoSp res, indirect mem, iRegI_R12 oldval, iRegI_R13 newval,
5061-
iRegI tmp1, iRegI tmp2, iRegI tmp3, rFlagsReg cr)
5061+
iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, rFlagsReg cr)
50625062
%{
50635063
predicate(needs_acquiring_load_reserved(n));
50645064

@@ -5083,7 +5083,7 @@ instruct compareAndSwapBAcq(iRegINoSp res, indirect mem, iRegI_R12 oldval, iRegI
50835083
%}
50845084

50855085
instruct compareAndSwapSAcq(iRegINoSp res, indirect mem, iRegI_R12 oldval, iRegI_R13 newval,
5086-
iRegI tmp1, iRegI tmp2, iRegI tmp3, rFlagsReg cr)
5086+
iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, rFlagsReg cr)
50875087
%{
50885088
predicate(needs_acquiring_load_reserved(n));
50895089

@@ -5107,7 +5107,7 @@ instruct compareAndSwapSAcq(iRegINoSp res, indirect mem, iRegI_R12 oldval, iRegI
51075107
ins_pipe(pipe_slow);
51085108
%}
51095109

5110-
instruct compareAndSwapIAcq(iRegINoSp res, indirect mem, iRegINoSp oldval, iRegINoSp newval)
5110+
instruct compareAndSwapIAcq(iRegINoSp res, indirect mem, iRegI oldval, iRegI newval)
51115111
%{
51125112
predicate(needs_acquiring_load_reserved(n));
51135113

@@ -5125,7 +5125,7 @@ instruct compareAndSwapIAcq(iRegINoSp res, indirect mem, iRegINoSp oldval, iRegI
51255125
ins_pipe(pipe_slow);
51265126
%}
51275127

5128-
instruct compareAndSwapLAcq(iRegINoSp res, indirect mem, iRegLNoSp oldval, iRegLNoSp newval)
5128+
instruct compareAndSwapLAcq(iRegINoSp res, indirect mem, iRegL oldval, iRegL newval)
51295129
%{
51305130
predicate(needs_acquiring_load_reserved(n));
51315131

@@ -5161,7 +5161,7 @@ instruct compareAndSwapPAcq(iRegINoSp res, indirect mem, iRegP oldval, iRegP new
51615161
ins_pipe(pipe_slow);
51625162
%}
51635163

5164-
instruct compareAndSwapNAcq(iRegINoSp res, indirect mem, iRegNNoSp oldval, iRegNNoSp newval)
5164+
instruct compareAndSwapNAcq(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval)
51655165
%{
51665166
predicate(needs_acquiring_load_reserved(n));
51675167

@@ -5186,7 +5186,7 @@ instruct compareAndSwapNAcq(iRegINoSp res, indirect mem, iRegNNoSp oldval, iRegN
51865186
// can't check the type of memory ordering here, so we always emit a
51875187
// sc_d(w) with rl bit set.
51885188
instruct compareAndExchangeB(iRegINoSp res, indirect mem, iRegI_R12 oldval, iRegI_R13 newval,
5189-
iRegI tmp1, iRegI tmp2, iRegI tmp3, rFlagsReg cr)
5189+
iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, rFlagsReg cr)
51905190
%{
51915191
match(Set res (CompareAndExchangeB mem (Binary oldval newval)));
51925192

@@ -5208,7 +5208,7 @@ instruct compareAndExchangeB(iRegINoSp res, indirect mem, iRegI_R12 oldval, iReg
52085208
%}
52095209

52105210
instruct compareAndExchangeS(iRegINoSp res, indirect mem, iRegI_R12 oldval, iRegI_R13 newval,
5211-
iRegI tmp1, iRegI tmp2, iRegI tmp3, rFlagsReg cr)
5211+
iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, rFlagsReg cr)
52125212
%{
52135213
match(Set res (CompareAndExchangeS mem (Binary oldval newval)));
52145214

@@ -5310,7 +5310,7 @@ instruct compareAndExchangeP(iRegPNoSp res, indirect mem, iRegP oldval, iRegP ne
53105310
%}
53115311

53125312
instruct compareAndExchangeBAcq(iRegINoSp res, indirect mem, iRegI_R12 oldval, iRegI_R13 newval,
5313-
iRegI tmp1, iRegI tmp2, iRegI tmp3, rFlagsReg cr)
5313+
iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, rFlagsReg cr)
53145314
%{
53155315
predicate(needs_acquiring_load_reserved(n));
53165316

@@ -5334,7 +5334,7 @@ instruct compareAndExchangeBAcq(iRegINoSp res, indirect mem, iRegI_R12 oldval, i
53345334
%}
53355335

53365336
instruct compareAndExchangeSAcq(iRegINoSp res, indirect mem, iRegI_R12 oldval, iRegI_R13 newval,
5337-
iRegI tmp1, iRegI tmp2, iRegI tmp3, rFlagsReg cr)
5337+
iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, rFlagsReg cr)
53385338
%{
53395339
predicate(needs_acquiring_load_reserved(n));
53405340

@@ -5446,7 +5446,7 @@ instruct compareAndExchangePAcq(iRegPNoSp res, indirect mem, iRegP oldval, iRegP
54465446
%}
54475447

54485448
instruct weakCompareAndSwapB(iRegINoSp res, indirect mem, iRegI_R12 oldval, iRegI_R13 newval,
5449-
iRegI tmp1, iRegI tmp2, iRegI tmp3, rFlagsReg cr)
5449+
iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, rFlagsReg cr)
54505450
%{
54515451
match(Set res (WeakCompareAndSwapB mem (Binary oldval newval)));
54525452

@@ -5470,7 +5470,7 @@ instruct weakCompareAndSwapB(iRegINoSp res, indirect mem, iRegI_R12 oldval, iReg
54705470
%}
54715471

54725472
instruct weakCompareAndSwapS(iRegINoSp res, indirect mem, iRegI_R12 oldval, iRegI_R13 newval,
5473-
iRegI tmp1, iRegI tmp2, iRegI tmp3, rFlagsReg cr)
5473+
iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, rFlagsReg cr)
54745474
%{
54755475
match(Set res (WeakCompareAndSwapS mem (Binary oldval newval)));
54765476

@@ -5574,7 +5574,7 @@ instruct weakCompareAndSwapP(iRegINoSp res, indirect mem, iRegP oldval, iRegP ne
55745574
%}
55755575

55765576
instruct weakCompareAndSwapBAcq(iRegINoSp res, indirect mem, iRegI_R12 oldval, iRegI_R13 newval,
5577-
iRegI tmp1, iRegI tmp2, iRegI tmp3, rFlagsReg cr)
5577+
iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, rFlagsReg cr)
55785578
%{
55795579
predicate(needs_acquiring_load_reserved(n));
55805580

@@ -5600,7 +5600,7 @@ instruct weakCompareAndSwapBAcq(iRegINoSp res, indirect mem, iRegI_R12 oldval, i
56005600
%}
56015601

56025602
instruct weakCompareAndSwapSAcq(iRegINoSp res, indirect mem, iRegI_R12 oldval, iRegI_R13 newval,
5603-
iRegI tmp1, iRegI tmp2, iRegI tmp3, rFlagsReg cr)
5603+
iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, rFlagsReg cr)
56045604
%{
56055605
predicate(needs_acquiring_load_reserved(n));
56065606

0 commit comments

Comments
 (0)