1 ; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
3 ; GCN-LABEL: {{^}}test_default_si:
6 define amdgpu_kernel void @test_default_si(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #0 {
7 store float 0.0, ptr addrspace(1) %out0
8 store double 0.0, ptr addrspace(1) %out1
12 ; GCN-LABEL: {{^}}test_default_vi:
15 define amdgpu_kernel void @test_default_vi(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #1 {
16 store float 0.0, ptr addrspace(1) %out0
17 store double 0.0, ptr addrspace(1) %out1
21 ; GCN-LABEL: {{^}}test_f64_denormals:
24 define amdgpu_kernel void @test_f64_denormals(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #2 {
25 store float 0.0, ptr addrspace(1) %out0
26 store double 0.0, ptr addrspace(1) %out1
30 ; GCN-LABEL: {{^}}test_f32_denormals:
33 define amdgpu_kernel void @test_f32_denormals(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #3 {
34 store float 0.0, ptr addrspace(1) %out0
35 store double 0.0, ptr addrspace(1) %out1
39 ; GCN-LABEL: {{^}}test_f32_f64_denormals:
42 define amdgpu_kernel void @test_f32_f64_denormals(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #4 {
43 store float 0.0, ptr addrspace(1) %out0
44 store double 0.0, ptr addrspace(1) %out1
48 ; GCN-LABEL: {{^}}test_no_denormals
51 define amdgpu_kernel void @test_no_denormals(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #5 {
52 store float 0.0, ptr addrspace(1) %out0
53 store double 0.0, ptr addrspace(1) %out1
57 ; GCN-LABEL: {{^}}test_f16_f64_denormals:
60 define amdgpu_kernel void @test_f16_f64_denormals(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #6 {
61 store half 0.0, ptr addrspace(1) %out0
62 store double 0.0, ptr addrspace(1) %out1
66 ; GCN-LABEL: {{^}}test_no_f16_f64_denormals:
69 define amdgpu_kernel void @test_no_f16_f64_denormals(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #7 {
70 store half 0.0, ptr addrspace(1) %out0
71 store double 0.0, ptr addrspace(1) %out1
75 ; GCN-LABEL: {{^}}test_f32_f16_f64_denormals:
78 define amdgpu_kernel void @test_f32_f16_f64_denormals(ptr addrspace(1) %out0, ptr addrspace(1) %out1, ptr addrspace(1) %out2) #8 {
79 store half 0.0, ptr addrspace(1) %out0
80 store float 0.0, ptr addrspace(1) %out1
81 store double 0.0, ptr addrspace(1) %out2
85 ; GCN-LABEL: {{^}}test_just_f32_attr_flush
88 define amdgpu_kernel void @test_just_f32_attr_flush(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #9 {
89 store float 0.0, ptr addrspace(1) %out0
90 store double 0.0, ptr addrspace(1) %out1
94 ; GCN-LABEL: {{^}}test_flush_all_outputs:
97 define amdgpu_kernel void @test_flush_all_outputs(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #10 {
98 store float 0.0, ptr addrspace(1) %out0
99 store double 0.0, ptr addrspace(1) %out1
103 ; GCN-LABEL: {{^}}test_flush_all_inputs:
104 ; GCN: FloatMode: 160
106 define amdgpu_kernel void @test_flush_all_inputs(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #11 {
107 store float 0.0, ptr addrspace(1) %out0
108 store double 0.0, ptr addrspace(1) %out1
112 ; GCN-LABEL: {{^}}test_flush_f32_inputs:
113 ; GCN: FloatMode: 224
115 define amdgpu_kernel void @test_flush_f32_inputs(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #12 {
116 store float 0.0, ptr addrspace(1) %out0
117 store double 0.0, ptr addrspace(1) %out1
121 ; GCN-LABEL: {{^}}test_flush_f32_outputs:
122 ; GCN: FloatMode: 208
124 define amdgpu_kernel void @test_flush_f32_outputs(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #13 {
125 store float 0.0, ptr addrspace(1) %out0
126 store double 0.0, ptr addrspace(1) %out1
130 ; GCN-LABEL: {{^}}test_flush_f64_inputs:
131 ; GCN: FloatMode: 176
133 define amdgpu_kernel void @test_flush_f64_inputs(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #14 {
134 store float 0.0, ptr addrspace(1) %out0
135 store double 0.0, ptr addrspace(1) %out1
139 ; GCN-LABEL: {{^}}test_flush_f64_outputs:
140 ; GCN: FloatMode: 112
142 define amdgpu_kernel void @test_flush_f64_outputs(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #15 {
143 store float 0.0, ptr addrspace(1) %out0
144 store double 0.0, ptr addrspace(1) %out1
148 ; GCN-LABEL: {{^}}kill_gs_const:
149 ; GCN: FloatMode: 240
151 define amdgpu_gs void @kill_gs_const() {
153 %cmp0 = icmp ule i32 0, 3
154 call void @llvm.amdgcn.kill(i1 %cmp0)
155 %cmp1 = icmp ule i32 3, 0
156 call void @llvm.amdgcn.kill(i1 %cmp1)
160 ; GCN-LABEL: {{^}}kill_vcc_implicit_def:
161 ; GCN: FloatMode: 240
163 define amdgpu_ps float @kill_vcc_implicit_def(ptr addrspace(4) inreg, ptr addrspace(4) inreg, ptr addrspace(4) inreg, ptr addrspace(4) inreg, 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) {
165 %tmp0 = fcmp olt float %13, 0.0
166 call void @llvm.amdgcn.kill(i1 %tmp0)
167 %tmp1 = select i1 %tmp0, float 1.0, float 0.0
171 declare void @llvm.amdgcn.kill(i1)
173 attributes #0 = { nounwind "target-cpu"="tahiti" }
174 attributes #1 = { nounwind "target-cpu"="fiji" }
175 attributes #2 = { nounwind "denormal-fp-math"="ieee,ieee" }
176 attributes #3 = { nounwind "denormal-fp-math-f32"="ieee,ieee" }
177 attributes #4 = { nounwind "denormal-fp-math"="ieee,ieee" }
178 attributes #5 = { nounwind "denormal-fp-math"="preserve-sign,preserve-sign" }
179 attributes #6 = { nounwind "denormal-fp-math"="ieee,ieee" }
180 attributes #7 = { nounwind "denormal-fp-math-f32"="ieee,ieee" "denormal-fp-math"="preserve-sign,preserve-sign" }
181 attributes #8 = { nounwind "denormal-fp-math"="ieee,ieee" }
182 attributes #9 = { nounwind "denormal-fp-math-f32"="preserve-sign,preserve-sign" }
183 attributes #10 = { nounwind "denormal-fp-math"="preserve-sign,ieee" }
184 attributes #11 = { nounwind "denormal-fp-math"="ieee,preserve-sign" }
185 attributes #12 = { nounwind "denormal-fp-math-f32"="ieee,preserve-sign" "denormal-fp-math"="ieee,ieee" }
186 attributes #13 = { nounwind "denormal-fp-math-f32"="preserve-sign,ieee" "denormal-fp-math"="ieee,ieee" }
187 attributes #14 = { nounwind "denormal-fp-math"="ieee,preserve-sign" "denormal-fp-math-f32"="ieee,ieee" }
188 attributes #15 = { nounwind "denormal-fp-math"="preserve-sign,ieee" "denormal-fp-math-f32"="ieee,ieee" }