summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/thread/atomic-impl+plan9-x64.s9
-rw-r--r--lib/thread/atomic-impl+x64.s16
2 files changed, 12 insertions, 13 deletions
diff --git a/lib/thread/atomic-impl+plan9-x64.s b/lib/thread/atomic-impl+plan9-x64.s
index 2b4f5dd..8765199 100644
--- a/lib/thread/atomic-impl+plan9-x64.s
+++ b/lib/thread/atomic-impl+plan9-x64.s
@@ -32,13 +32,16 @@ TEXT thread$xaddp+0(SB),1,$0
RET
TEXT thread$xsub32+0(SB),1,$0
- LOCK; XADDL SI, (DI)
+ LOCK; XSUBL SI, (DI)
+ MOVL SI, AX
RET
TEXT thread$xsub64+0(SB),1,$0
- LOCK; XADDQ SI, (DI)
+ LOCK; XSUBQ SI, (DI)
+ MOVQ SI, AX
RET
TEXT thread$xsubp+0(SB),1,$0
- LOCK; XADDQ SI, (DI)
+ LOCK; XSUBQ SI, (DI)
+ MOVQ SI, AX
RET
TEXT thread$xcas32+0(SB),1,$0
diff --git a/lib/thread/atomic-impl+x64.s b/lib/thread/atomic-impl+x64.s
index 8824ba2..43986bb 100644
--- a/lib/thread/atomic-impl+x64.s
+++ b/lib/thread/atomic-impl+x64.s
@@ -8,6 +8,7 @@ thread$xget64:
thread$xgetp:
movq (%rdi), %rax
ret
+
.globl thread$xset32
thread$xset32:
movl %esi, (%rdi)
@@ -18,26 +19,20 @@ thread$xset64:
thread$xsetp:
movq %rsi, (%rdi)
ret
+
.globl thread$xadd32
thread$xadd32:
lock xaddl %esi, (%rdi)
+ movl %esi,%eax
ret
.globl thread$xadd64
.globl thread$xaddp
thread$xadd64:
thread$xaddp:
lock xaddq %rsi, (%rdi)
+ movq %rsi,%rax
ret
-.globl thread$xsub32
-thread$xsub32:
- lock xaddl %esi, (%rdi)
- ret
-.globl thread$xsub64
-.globl thread$xsubp
-thread$xsub64:
-thread$xsubp:
- lock xaddq %rsi, (%rdi)
- ret
+
.globl thread$xcas32
thread$xcas32:
movl %esi, %eax
@@ -50,6 +45,7 @@ thread$xcasp:
movq %rsi, %rax
lock cmpxchgq %rdx, (%rdi)
ret
+
.globl thread$xchg32
thread$xchg32:
movl %esi, %eax