blob: c5c2a11e62c2520542b41ae39da70b5969ee85f5 [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
Matt Arsenault08f7e372013-11-18 20:09:50 +000021; SI-LABEL: @one_sgpr:
22define void @one_sgpr(i64 addrspace(1)* noalias %out, i64 addrspace(1)* noalias %in, i64 addrspace(1)* noalias %in_bar, i64 %a) {
23 %foo = load i64 addrspace(1)* %in, align 8
24 %result = add i64 %foo, %a
Matt Arsenaultfb826fa2013-11-18 20:09:47 +000025 store i64 %result, i64 addrspace(1)* %out
26 ret void
27}
28
Matt Arsenault08f7e372013-11-18 20:09:50 +000029; FIXME: This case is broken
30;
31; Swap the arguments. Check that the SGPR -> VGPR copy works with the
32; SGPR as other operand.
33;
34; XXXSI-LABEL: @one_sgpr_reversed:
35; define void @one_sgpr_reversed(i64 addrspace(1)* noalias %out, i64 addrspace(1)* noalias %in, i64 %a) {
36; %foo = load i64 addrspace(1)* %in, align 8
37; %result = add i64 %a, %foo
38; store i64 %result, i64 addrspace(1)* %out
39; ret void
40; }
41
42
Matt Arsenaultfb826fa2013-11-18 20:09:47 +000043; SI-LABEL: @test_v2i64_sreg:
44define void @test_v2i64_sreg(<2 x i64> addrspace(1)* noalias %out, <2 x i64> %a, <2 x i64> %b) {
45 %result = add <2 x i64> %a, %b
46 store <2 x i64> %result, <2 x i64> addrspace(1)* %out
47 ret void
48}
49
50; SI-LABEL: @test_v2i64_vreg:
51define 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) {
52 %tid = call i32 @llvm.SI.tid() readnone
53 %a_ptr = getelementptr <2 x i64> addrspace(1)* %inA, i32 %tid
54 %b_ptr = getelementptr <2 x i64> addrspace(1)* %inB, i32 %tid
55 %a = load <2 x i64> addrspace(1)* %a_ptr
56 %b = load <2 x i64> addrspace(1)* %b_ptr
57 %result = add <2 x i64> %a, %b
58 store <2 x i64> %result, <2 x i64> addrspace(1)* %out
59 ret void
60}