File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed
Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -1248,6 +1248,7 @@ amo:
12481248amo__no_write_rd:
12491249
12501250 # modify
1251+ set rs1 result # hack
12511252 op add @counter @counter amo_op
12521253
12531254 # swap
@@ -1266,10 +1267,18 @@ amo__no_write_rd:
12661267 op xor result result rs2
12671268 jump amo__done_modify always
12681269 # min
1269- op min result result rs2
1270+ op add ret @counter 1
1271+ jump swap_signedness_rs1_rs2 always
1272+ # continue into minu
1273+ # minu
1274+ op min result rs1 rs2
12701275 jump amo__done_modify always
12711276 # max
1272- op max result result rs2
1277+ op add ret @counter 1
1278+ jump swap_signedness_rs1_rs2 always
1279+ # continue into maxu
1280+ # maxu
1281+ op max result rs1 rs2
12731282amo__done_modify:
12741283
12751284 # write
@@ -1298,24 +1307,22 @@ AMOXOR.W:
12981307
12991308AMOMIN.W:
13001309 # R-type: arg1=rs1, arg2=rs2, arg3=rd
1301- op add ret @counter 1
1302- jump swap_signedness_rs1_rs2 always
1303- # continue into AMOMINU.W
1310+ set amo_op 10 # min
1311+ jump amo always
13041312
13051313AMOMINU.W:
13061314 # R-type: arg1=rs1, arg2=rs2, arg3=rd
1307- set amo_op 10 # min
1315+ set amo_op 12 # minu
13081316 jump amo always
13091317
13101318AMOMAX.W:
13111319 # R-type: arg1=rs1, arg2=rs2, arg3=rd
1312- op add ret @counter 1
1313- jump swap_signedness_rs1_rs2 always
1314- # continue into AMOMAXU.W
1320+ set amo_op 14 # max
1321+ jump amo always
13151322
13161323AMOMAXU.W:
13171324 # R-type: arg1=rs1, arg2=rs2, arg3=rd
1318- set amo_op 12 # max
1325+ set amo_op 16 # maxu
13191326 jump amo always
13201327
13211328# most of the register-register instructions are identical to their register-immediate counterparts
You can’t perform that action at this time.
0 commit comments