summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2014-01-30 04:48:46 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2014-01-30 04:48:46 +0000
commit17ca0f8f80b034131d05233076c85e958572ad4d (patch)
treef982ef8a73649e51f822f7263c2909473d2e3b0d /test
parent09f38a0ef13bf542f7b3f1862d718e33e7de587b (diff)
downloadllvm-17ca0f8f80b034131d05233076c85e958572ad4d.tar.gz
llvm-17ca0f8f80b034131d05233076c85e958572ad4d.tar.bz2
llvm-17ca0f8f80b034131d05233076c85e958572ad4d.tar.xz
Implement SPARCv9 atomic_swap_64 with a pseudo.
The SWAP instruction only exists in a 32-bit variant, but the 64-bit atomic swap can be implemented in terms of CASX, like the other atomic rmw primitives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200453 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/SPARC/atomics.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/CodeGen/SPARC/atomics.ll b/test/CodeGen/SPARC/atomics.ll
index 6d2b48287c..b10336c980 100644
--- a/test/CodeGen/SPARC/atomics.ll
+++ b/test/CodeGen/SPARC/atomics.ll
@@ -62,6 +62,15 @@ entry:
ret i32 %b
}
+; CHECK-LABEL: test_swap_i64
+; CHECK: casx [%o1],
+
+define i64 @test_swap_i64(i64 %a, i64* %ptr) {
+entry:
+ %b = atomicrmw xchg i64* %ptr, i64 42 monotonic
+ ret i64 %b
+}
+
; CHECK-LABEL: test_load_add_32
; CHECK: membar
; CHECK: add [[V:%[gilo][0-7]]], %o1, [[U:%[gilo][0-7]]]