summaryrefslogtreecommitdiff
path: root/lib/thread/atomic-impl+plan9-x64.s
diff options
context:
space:
mode:
Diffstat (limited to 'lib/thread/atomic-impl+plan9-x64.s')
-rw-r--r--lib/thread/atomic-impl+plan9-x64.s23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/thread/atomic-impl+plan9-x64.s b/lib/thread/atomic-impl+plan9-x64.s
index 22318eb..06224d2 100644
--- a/lib/thread/atomic-impl+plan9-x64.s
+++ b/lib/thread/atomic-impl+plan9-x64.s
@@ -1,3 +1,7 @@
+// get variants
+TEXT thread$xget8+0(SB),1,$0
+ MOVB (DI), AX
+ RET
TEXT thread$xget32+0(SB),1,$0
MOVL (DI), AX
RET
@@ -8,6 +12,10 @@ TEXT thread$xgetp+0(SB),1,$0
MOVQ (DI), AX
RET
+// set variants
+TEXT thread$xset8+0(SB),1,$0
+ MOVB SI, (DI)
+ RET
TEXT thread$xset32+0(SB),1,$0
MOVL SI, (DI)
RET
@@ -18,6 +26,11 @@ TEXT thread$xsetp+0(SB),1,$0
MOVQ SI, (DI)
RET
+// add variants
+TEXT thread$xadd8+0(SB),1,$0
+ LOCK; XADDB SI, (DI)
+ MOVL SI, AX
+ RET
TEXT thread$xadd32+0(SB),1,$0
LOCK; XADDL SI, (DI)
MOVL SI, AX
@@ -31,6 +44,11 @@ TEXT thread$xaddp+0(SB),1,$0
MOVQ SI, AX
RET
+// cas variants
+TEXT thread$xcas8+0(SB),1,$0
+ MOVL SI, AX
+ LOCK; CMPXCHGB DX, (DI)
+ RET
TEXT thread$xcas32+0(SB),1,$0
MOVL SI, AX
LOCK; CMPXCHGL DX, (DI)
@@ -44,6 +62,11 @@ TEXT thread$xcasp+0(SB),1,$0
LOCK; CMPXCHGQ DX, (DI)
RET
+// xchg variants
+TEXT thread$xchg8+0(SB),1,$0
+ MOVL SI, AX
+ LOCK; XCHGB (DI), AX
+ RET
TEXT thread$xchg32+0(SB),1,$0
MOVL SI, AX
LOCK; XCHGL (DI), AX