diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-11-18 20:09:47 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-11-18 20:09:47 +0000 |
commit | e64a2896094be370f5ca3d755f62c762fb94b37a (patch) | |
tree | 380c065a1d26e1dd8a02a6d1a49df1651626752a /test/CodeGen/R600/add_i64.ll | |
parent | 15703e0a71e7583b107499045374c364976452e2 (diff) | |
download | external_llvm-e64a2896094be370f5ca3d755f62c762fb94b37a.zip external_llvm-e64a2896094be370f5ca3d755f62c762fb94b37a.tar.gz external_llvm-e64a2896094be370f5ca3d755f62c762fb94b37a.tar.bz2 |
R600/SI: Implement add i64, but do not yet enable.
Test doesn't actually check the output. I need
to fix add i64 being matched for the addressing
calculations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195040 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/R600/add_i64.ll')
-rw-r--r-- | test/CodeGen/R600/add_i64.ll | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/CodeGen/R600/add_i64.ll b/test/CodeGen/R600/add_i64.ll new file mode 100644 index 0000000..1f846b4 --- /dev/null +++ b/test/CodeGen/R600/add_i64.ll @@ -0,0 +1,45 @@ +; XFAIL: * +; This will fail until i64 add is enabled + +; RUN: llc < %s -march=r600 -mcpu=SI | FileCheck --check-prefix=SI %s + + +declare i32 @llvm.SI.tid() readnone + +; SI-LABEL: @test_i64_vreg: +define void @test_i64_vreg(i64 addrspace(1)* noalias %out, i64 addrspace(1)* noalias %inA, i64 addrspace(1)* noalias %inB) { + %tid = call i32 @llvm.SI.tid() readnone + %a_ptr = getelementptr i64 addrspace(1)* %inA, i32 %tid + %b_ptr = getelementptr i64 addrspace(1)* %inB, i32 %tid + %a = load i64 addrspace(1)* %a_ptr + %b = load i64 addrspace(1)* %b_ptr + %result = add i64 %a, %b + store i64 %result, i64 addrspace(1)* %out + ret void +} + +; SI-LABEL: @test_i64_sreg: +define void @test_i64_sreg(i64 addrspace(1)* noalias %out, i64 %a, i64 %b) { + %result = add i64 %a, %b + store i64 %result, i64 addrspace(1)* %out + ret void +} + +; SI-LABEL: @test_v2i64_sreg: +define void @test_v2i64_sreg(<2 x i64> addrspace(1)* noalias %out, <2 x i64> %a, <2 x i64> %b) { + %result = add <2 x i64> %a, %b + store <2 x i64> %result, <2 x i64> addrspace(1)* %out + ret void +} + +; SI-LABEL: @test_v2i64_vreg: +define void @test_v2i64_vreg(<2 x i64> addrspace(1)* noalias %out, <2 x i64> addrspace(1)* noalias %inA, <2 x i64> addrspace(1)* noalias %inB) { + %tid = call i32 @llvm.SI.tid() readnone + %a_ptr = getelementptr <2 x i64> addrspace(1)* %inA, i32 %tid + %b_ptr = getelementptr <2 x i64> addrspace(1)* %inB, i32 %tid + %a = load <2 x i64> addrspace(1)* %a_ptr + %b = load <2 x i64> addrspace(1)* %b_ptr + %result = add <2 x i64> %a, %b + store <2 x i64> %result, <2 x i64> addrspace(1)* %out + ret void +} |