1; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
2
3; GCN-LABEL: {{^}}test_default_si:
4; GCN: FloatMode: 192
5; GCN: IeeeMode: 1
6define void @test_default_si(float addrspace(1)* %out0, double addrspace(1)* %out1) #0 {
7  store float 0.0, float addrspace(1)* %out0
8  store double 0.0, double addrspace(1)* %out1
9  ret void
10}
11
12; GCN-LABEL: {{^}}test_default_vi:
13; GCN: FloatMode: 192
14; GCN: IeeeMode: 1
15define void @test_default_vi(float addrspace(1)* %out0, double addrspace(1)* %out1) #1 {
16  store float 0.0, float addrspace(1)* %out0
17  store double 0.0, double addrspace(1)* %out1
18  ret void
19}
20
21; GCN-LABEL: {{^}}test_f64_denormals:
22; GCN: FloatMode: 192
23; GCN: IeeeMode: 1
24define void @test_f64_denormals(float addrspace(1)* %out0, double addrspace(1)* %out1) #2 {
25  store float 0.0, float addrspace(1)* %out0
26  store double 0.0, double addrspace(1)* %out1
27  ret void
28}
29
30; GCN-LABEL: {{^}}test_f32_denormals:
31; GCNL: FloatMode: 48
32; GCN: IeeeMode: 1
33define void @test_f32_denormals(float addrspace(1)* %out0, double addrspace(1)* %out1) #3 {
34  store float 0.0, float addrspace(1)* %out0
35  store double 0.0, double addrspace(1)* %out1
36  ret void
37}
38
39; GCN-LABEL: {{^}}test_f32_f64_denormals:
40; GCN: FloatMode: 240
41; GCN: IeeeMode: 1
42define void @test_f32_f64_denormals(float addrspace(1)* %out0, double addrspace(1)* %out1) #4 {
43  store float 0.0, float addrspace(1)* %out0
44  store double 0.0, double addrspace(1)* %out1
45  ret void
46}
47
48; GCN-LABEL: {{^}}test_no_denormals
49; GCN: FloatMode: 0
50; GCN: IeeeMode: 1
51define void @test_no_denormals(float addrspace(1)* %out0, double addrspace(1)* %out1) #5 {
52  store float 0.0, float addrspace(1)* %out0
53  store double 0.0, double addrspace(1)* %out1
54  ret void
55}
56
57; GCN-LABEL: {{^}}kill_gs_const:
58; GCN: IeeeMode: 0
59define amdgpu_gs void @kill_gs_const() {
60main_body:
61  %0 = icmp ule i32 0, 3
62  %1 = select i1 %0, float 1.000000e+00, float -1.000000e+00
63  call void @llvm.AMDGPU.kill(float %1)
64  %2 = icmp ule i32 3, 0
65  %3 = select i1 %2, float 1.000000e+00, float -1.000000e+00
66  call void @llvm.AMDGPU.kill(float %3)
67  ret void
68}
69
70; GCN-LABEL: {{^}}kill_vcc_implicit_def:
71; GCN: IeeeMode: 0
72define amdgpu_ps void @kill_vcc_implicit_def([6 x <16 x i8>] addrspace(2)* byval, [17 x <16 x i8>] addrspace(2)* byval, [17 x <4 x i32>] addrspace(2)* byval, [34 x <8 x i32>] addrspace(2)* byval, float inreg, i32 inreg, <2 x i32>, <2 x i32>, <2 x i32>, <3 x i32>, <2 x i32>, <2 x i32>, <2 x i32>, float, float, float, float, float, float, i32, float, float) {
73entry:
74  %tmp0 = fcmp olt float %13, 0.0
75  call void @llvm.AMDGPU.kill(float %14)
76  %tmp1 = select i1 %tmp0, float 1.0, float 0.0
77  call void @llvm.SI.export(i32 15, i32 1, i32 1, i32 1, i32 1, float %tmp1, float %tmp1, float %tmp1, float %tmp1)
78  ret void
79}
80
81
82declare void @llvm.AMDGPU.kill(float)
83declare void @llvm.SI.export(i32, i32, i32, i32, i32, float, float, float, float)
84
85attributes #0 = { nounwind "target-cpu"="tahiti" }
86attributes #1 = { nounwind "target-cpu"="fiji" }
87attributes #2 = { nounwind "target-features"="+fp64-denormals" }
88attributes #3 = { nounwind "target-features"="+fp32-denormals" }
89attributes #4 = { nounwind "target-features"="+fp32-denormals,+fp64-denormals" }
90attributes #5 = { nounwind "target-features"="-fp32-denormals,-fp64-denormals" }
91