Skip to content

Commit d4b17f5

Browse files
committed
internal/runtime/atomic: reset wrong jump target in Cas{,64} on loong64
The implementation here needs to be consistent with ssa.OpLOONG64LoweredAtomicCas{32,64}, which was ignored in CL 613396. Change-Id: I72e8d2318e0c1935cc3a35ab5098f8a84e48bcd5 Reviewed-on: https://go-review.googlesource.com/c/go/+/699395 Reviewed-by: Keith Randall <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Reviewed-by: sophie zhao <[email protected]> Reviewed-by: Meidan Li <[email protected]>
1 parent 6a08e80 commit d4b17f5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/internal/runtime/atomic/atomic_loong64.s

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ TEXT ·Cas(SB), NOSPLIT, $0-17
1919
MOVW new+12(FP), R6
2020

2121
MOVBU internal∕cpu·Loong64+const_offsetLOONG64HasLAMCAS(SB), R8
22-
BEQ R8, cas_again
22+
BEQ R8, ll_sc
2323
MOVV R5, R7 // backup old value
2424
AMCASDBW R6, (R4), R5
2525
BNE R7, R5, cas_fail0
@@ -30,6 +30,7 @@ cas_fail0:
3030
MOVB R0, ret+16(FP)
3131
RET
3232

33+
ll_sc:
3334
// Implemented using the ll-sc instruction pair
3435
DBAR $0x14 // LoadAcquire barrier
3536
cas_again:
@@ -60,7 +61,7 @@ TEXT ·Cas64(SB), NOSPLIT, $0-25
6061
MOVV new+16(FP), R6
6162

6263
MOVBU internal∕cpu·Loong64+const_offsetLOONG64HasLAMCAS(SB), R8
63-
BEQ R8, cas64_again
64+
BEQ R8, ll_sc_64
6465
MOVV R5, R7 // backup old value
6566
AMCASDBV R6, (R4), R5
6667
BNE R7, R5, cas64_fail0
@@ -71,6 +72,7 @@ cas64_fail0:
7172
MOVB R0, ret+24(FP)
7273
RET
7374

75+
ll_sc_64:
7476
// Implemented using the ll-sc instruction pair
7577
DBAR $0x14
7678
cas64_again:

0 commit comments

Comments
 (0)