R600/SI: Add a stub GCNTargetMachine
[oota-llvm.git] / test / CodeGen / R600 / m0-spill.ll
1 ; RUN: llc < %s -march=amdgcn -mcpu=SI -verify-machineinstrs | FileCheck %s
2
3 @lds = external addrspace(3) global [64 x float]
4
5 ; CHECK-LABEL: {{^}}main:
6 ; CHECK-NOT: v_readlane_b32 m0
7 define void @main(<16 x i8> addrspace(2)* inreg, <16 x i8> addrspace(2)* inreg, <32 x i8> addrspace(2)* inreg, i32 inreg) "ShaderType"="0" {
8 main_body:
9   %4 = call float @llvm.SI.fs.constant(i32 0, i32 0, i32 %3)
10   %cmp = fcmp ueq float 0.0, %4
11   br i1 %cmp, label %if, label %else
12
13 if:
14   %lds_ptr = getelementptr [64 x float] addrspace(3)* @lds, i32 0, i32 0
15   %lds_data = load float addrspace(3)* %lds_ptr
16   br label %endif
17
18 else:
19   %interp = call float @llvm.SI.fs.constant(i32 0, i32 0, i32 %3)
20   br label %endif
21
22 endif:
23   %export = phi float [%lds_data, %if], [%interp, %else]
24   %5 = call i32 @llvm.SI.packf16(float %export, float %export)
25   %6 = bitcast i32 %5 to float
26   call void @llvm.SI.export(i32 15, i32 1, i32 1, i32 0, i32 1, float %6, float %6, float %6, float %6)
27   ret void
28 }
29
30 declare float @llvm.SI.fs.constant(i32, i32, i32) readnone
31
32 declare i32 @llvm.SI.packf16(float, float) readnone
33
34 declare void @llvm.SI.export(i32, i32, i32, i32, i32, float, float, float, float)