summaryrefslogtreecommitdiff
path: root/src/runtime/atomic_power64x.s
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-10-29 12:25:24 -0400
committerRuss Cox <rsc@golang.org>2014-10-29 12:25:24 -0400
commit710efc5a3085f55968c120abb25206fb72c05d46 (patch)
tree433262b4bdac6643d923971ea21bb39cb69822a7 /src/runtime/atomic_power64x.s
parent40520a21d8b050635a417666db959f75d757fff5 (diff)
parentcc517ca5f7183e7f5d91bf75897b23cc0f4ed04f (diff)
downloadgo-710efc5a3085f55968c120abb25206fb72c05d46.tar.gz
[dev.garbage] all: merge dev.power64 (5ad5e85cfb99) into dev.garbage
The goal here is to get the big-endian fixes so that in some upcoming code movement for write barriers I don't make them unmergeable. LGTM=rlh R=rlh CC=golang-codereviews https://codereview.appspot.com/166890043
Diffstat (limited to 'src/runtime/atomic_power64x.s')
-rw-r--r--src/runtime/atomic_power64x.s40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/runtime/atomic_power64x.s b/src/runtime/atomic_power64x.s
new file mode 100644
index 000000000..e72871761
--- /dev/null
+++ b/src/runtime/atomic_power64x.s
@@ -0,0 +1,40 @@
+// 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 "textflag.h"
+
+// uint32 runtime·atomicload(uint32 volatile* addr)
+TEXT ·atomicload(SB),NOSPLIT,$-8-12
+ MOVD 0(FP), R3
+ SYNC
+ MOVWZ 0(R3), R3
+ CMPW R3, R3, CR7
+ BC 4, 30, 1(PC) // bne- cr7,0x4
+ ISYNC
+ MOVW R3, ret+8(FP)
+ RETURN
+
+// uint64 runtime·atomicload64(uint64 volatile* addr)
+TEXT ·atomicload64(SB),NOSPLIT,$-8-16
+ MOVD 0(FP), R3
+ SYNC
+ MOVD 0(R3), R3
+ CMP R3, R3, CR7
+ BC 4, 30, 1(PC) // bne- cr7,0x4
+ ISYNC
+ MOVD R3, ret+8(FP)
+ RETURN
+
+// void *runtime·atomicloadp(void *volatile *addr)
+TEXT ·atomicloadp(SB),NOSPLIT,$-8-16
+ MOVD 0(FP), R3
+ SYNC
+ MOVD 0(R3), R3
+ CMP R3, R3, CR7
+ BC 4, 30, 1(PC) // bne- cr7,0x4
+ ISYNC
+ MOVD R3, ret+8(FP)
+ RETURN