blob: 1f846b4ed3daef04485d23e0c422d95474c0e3ec [file] [log] [blame]
Matt Arsenaultfb826fa2013-11-18 20:09:47 +00001; XFAIL: *
2; This will fail until i64 add is enabled
3
4; RUN: llc < %s -march=r600 -mcpu=SI | FileCheck --check-prefix=SI %s
5
6
7declare i32 @llvm.SI.tid() readnone
8
9; SI-LABEL: @test_i64_vreg:
10define void @test_i64_vreg(i64 addrspace(1)* noalias %out, i64 addrspace(1)* noalias %inA, i64 addrspace(1)* noalias %inB) {
11 %tid = call i32 @llvm.SI.tid() readnone
12 %a_ptr = getelementptr i64 addrspace(1)* %inA, i32 %tid
13 %b_ptr = getelementptr i64 addrspace(1)* %inB, i32 %tid
14 %a = load i64 addrspace(1)* %a_ptr
15 %b = load i64 addrspace(1)* %b_ptr
16 %result = add i64 %a, %b
17 store i64 %result, i64 addrspace(1)* %out
18 ret void
19}
20
21; SI-LABEL: @test_i64_sreg:
22define void @test_i64_sreg(i64 addrspace(1)* noalias %out, i64 %a, i64 %b) {
23 %result = add i64 %a, %b
24 store i64 %result, i64 addrspace(1)* %out
25 ret void
26}
27
28; SI-LABEL: @test_v2i64_sreg:
29define void @test_v2i64_sreg(<2 x i64> addrspace(1)* noalias %out, <2 x i64> %a, <2 x i64> %b) {
30 %result = add <2 x i64> %a, %b
31 store <2 x i64> %result, <2 x i64> addrspace(1)* %out
32 ret void
33}
34
35; SI-LABEL: @test_v2i64_vreg:
36define 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) {
37 %tid = call i32 @llvm.SI.tid() readnone
38 %a_ptr = getelementptr <2 x i64> addrspace(1)* %inA, i32 %tid
39 %b_ptr = getelementptr <2 x i64> addrspace(1)* %inB, i32 %tid
40 %a = load <2 x i64> addrspace(1)* %a_ptr
41 %b = load <2 x i64> addrspace(1)* %b_ptr
42 %result = add <2 x i64> %a, %b
43 store <2 x i64> %result, <2 x i64> addrspace(1)* %out
44 ret void
45}