summaryrefslogtreecommitdiff
path: root/src/runtime/atomic_power64x.s
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2014-10-27 17:17:06 -0400
committerAustin Clements <austin@google.com>2014-10-27 17:17:06 -0400
commit87729004ae12c22611b6bccf42211cb1f712ddb0 (patch)
tree35f11e6f80feaa92f9f0b3f985a711d691d92665 /src/runtime/atomic_power64x.s
parente7797eae182f602d8d08d936f74257a93484d5fd (diff)
parentfcceea1097e0f86dac0d71bd2fa0b37ab66d8143 (diff)
downloadgo-87729004ae12c22611b6bccf42211cb1f712ddb0.tar.gz
[dev.power64] all: merge default into dev.power64
LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/164110043
Diffstat (limited to 'src/runtime/atomic_power64x.s')
-rw-r--r--src/runtime/atomic_power64x.s37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/runtime/atomic_power64x.s b/src/runtime/atomic_power64x.s
new file mode 100644
index 000000000..c08590ac9
--- /dev/null
+++ b/src/runtime/atomic_power64x.s
@@ -0,0 +1,37 @@
+// Copyright 2014 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build power64 power64le
+
+#include "../../cmd/ld/textflag.h"
+
+// uint32 runtime·atomicload(uint32 volatile* addr)
+TEXT ·atomicload(SB),NOSPLIT,$-8-8
+ MOVD 0(FP), R3
+ SYNC
+ MOVWZ 0(R3), R3
+ CMPW R3, R3, CR7
+ BC 4, 30, 1(PC) // bne- cr7,0x4
+ ISYNC
+ RETURN
+
+// uint64 runtime·atomicload64(uint64 volatile* addr)
+TEXT ·atomicload64(SB),NOSPLIT,$-8-8
+ MOVD 0(FP), R3
+ SYNC
+ MOVD 0(R3), R3
+ CMP R3, R3, CR7
+ BC 4, 30, 1(PC) // bne- cr7,0x4
+ ISYNC
+ RETURN
+
+// void *runtime·atomicloadp(void *volatile *addr)
+TEXT ·atomicloadp(SB),NOSPLIT,$-8-8
+ MOVD 0(FP), R3
+ SYNC
+ MOVD 0(R3), R3
+ CMP R3, R3, CR7
+ BC 4, 30, 1(PC) // bne- cr7,0x4
+ ISYNC
+ RETURN