[llvm] r213406 - Add tests for atomic adds on floats.
Eli Bendersky
eliben at google.com
Fri Jul 18 13:11:26 PDT 2014
Author: eliben
Date: Fri Jul 18 15:11:26 2014
New Revision: 213406
URL: http://llvm.org/viewvc/llvm-project?rev=213406&view=rev
Log:
Add tests for atomic adds on floats.
Modified:
llvm/trunk/test/CodeGen/NVPTX/atomics.ll
Modified: llvm/trunk/test/CodeGen/NVPTX/atomics.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/NVPTX/atomics.ll?rev=213406&r1=213405&r2=213406&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/NVPTX/atomics.ll (original)
+++ llvm/trunk/test/CodeGen/NVPTX/atomics.ll Fri Jul 18 15:11:26 2014
@@ -139,3 +139,30 @@ define i64 @atom19(i64* %subr, i64 %val)
%ret = atomicrmw umin i64* %subr, i64 %val seq_cst
ret i64 %ret
}
+
+declare float @llvm.nvvm.atomic.load.add.f32.p0f32(float* %addr, float %val)
+
+; CHECK-LABEL: atomic_add_f32_generic
+define float @atomic_add_f32_generic(float* %addr, float %val) {
+; CHECK: atom.add.f32
+ %ret = call float @llvm.nvvm.atomic.load.add.f32.p0f32(float* %addr, float %val)
+ ret float %ret
+}
+
+declare float @llvm.nvvm.atomic.load.add.f32.p1f32(float addrspace(1)* %addr, float %val)
+
+; CHECK-LABEL: atomic_add_f32_addrspace1
+define float @atomic_add_f32_addrspace1(float addrspace(1)* %addr, float %val) {
+; CHECK: atom.global.add.f32
+ %ret = call float @llvm.nvvm.atomic.load.add.f32.p1f32(float addrspace(1)* %addr, float %val)
+ ret float %ret
+}
+
+declare float @llvm.nvvm.atomic.load.add.f32.p3f32(float addrspace(3)* %addr, float %val)
+
+; CHECK-LABEL: atomic_add_f32_addrspace3
+define float @atomic_add_f32_addrspace3(float addrspace(3)* %addr, float %val) {
+; CHECK: atom.shared.add.f32
+ %ret = call float @llvm.nvvm.atomic.load.add.f32.p3f32(float addrspace(3)* %addr, float %val)
+ ret float %ret
+}
More information about the llvm-commits
mailing list