summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/atomic-load-store-wide.ll
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-08-24 22:33:28 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-08-24 22:33:28 +0000
commit9c73a57b20d132b809b51b33fc5a9984755a303b (patch)
treef9115521c1c1922a4431571dc895263783f1ab70 /llvm/test/CodeGen/X86/atomic-load-store-wide.ll
parenteee864520ce4c5abde0f332d46b53d18fb53bdab (diff)
downloadbcm5719-llvm-9c73a57b20d132b809b51b33fc5a9984755a303b.tar.gz
bcm5719-llvm-9c73a57b20d132b809b51b33fc5a9984755a303b.zip
Hook up 64-bit atomic load/store on x86-32. I plan to write more efficient implementations eventually.
llvm-svn: 138505
Diffstat (limited to 'llvm/test/CodeGen/X86/atomic-load-store-wide.ll')
-rw-r--r--llvm/test/CodeGen/X86/atomic-load-store-wide.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/atomic-load-store-wide.ll b/llvm/test/CodeGen/X86/atomic-load-store-wide.ll
new file mode 100644
index 00000000000..227883e5592
--- /dev/null
+++ b/llvm/test/CodeGen/X86/atomic-load-store-wide.ll
@@ -0,0 +1,19 @@
+; RUN: llc < %s -march=x86 | FileCheck %s
+
+; 64-bit load/store on x86-32
+; FIXME: The generated code can be substantially improved.
+
+define void @test1(i64* %ptr, i64 %val1) {
+; CHECK: test1
+; CHECK: cmpxchg8b
+; CHECK-NEXT: jne
+ store atomic i64 %val1, i64* %ptr seq_cst, align 4
+ ret void
+}
+
+define i64 @test2(i64* %ptr) {
+; CHECK: test2
+; CHECK: cmpxchg8b
+ %val = load atomic i64* %ptr seq_cst, align 4
+ ret i64 %val
+}
OpenPOWER on IntegriCloud