xref: /llvm-project/llvm/test/CodeGen/AMDGPU/hsa-fp-mode.ll (revision 4490003a22658dcd12527029b2c8682b63d8a9d6)
1; RUN: llc -mtriple=amdgcn--amdhsa -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
2
3; GCN-LABEL: {{^}}test_default_ci:
4; GCN: .amdhsa_dx10_clamp 1
5; GCN: .amdhsa_ieee_mode 1
6; GCN: FloatMode: 240
7define amdgpu_kernel void @test_default_ci(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #0 {
8  store float 0.0, ptr addrspace(1) %out0
9  store double 0.0, ptr addrspace(1) %out1
10  ret void
11}
12
13; GCN-LABEL: {{^}}test_default_vi:
14; GCN: .amdhsa_dx10_clamp 1
15; GCN: .amdhsa_ieee_mode 1
16; GCN: FloatMode: 240
17define amdgpu_kernel void @test_default_vi(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #1 {
18  store float 0.0, ptr addrspace(1) %out0
19  store double 0.0, ptr addrspace(1) %out1
20  ret void
21}
22
23; GCN-LABEL: {{^}}test_f64_denormals:
24; GCN: .amdhsa_dx10_clamp 1
25; GCN: .amdhsa_ieee_mode 1
26; GCN: FloatMode: 192
27define amdgpu_kernel void @test_f64_denormals(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #2 {
28  store float 0.0, ptr addrspace(1) %out0
29  store double 0.0, ptr addrspace(1) %out1
30  ret void
31}
32
33; GCN-LABEL: {{^}}test_f32_denormals:
34; GCN: .amdhsa_dx10_clamp 1
35; GCN: .amdhsa_ieee_mode 1
36; GCN: FloatMode: 48
37define amdgpu_kernel void @test_f32_denormals(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #3 {
38  store float 0.0, ptr addrspace(1) %out0
39  store double 0.0, ptr addrspace(1) %out1
40  ret void
41}
42
43; GCN-LABEL: {{^}}test_f32_f64_denormals:
44; GCN: .amdhsa_dx10_clamp 1
45; GCN: .amdhsa_ieee_mode 1
46; GCN: FloatMode: 240
47define amdgpu_kernel void @test_f32_f64_denormals(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #4 {
48  store float 0.0, ptr addrspace(1) %out0
49  store double 0.0, ptr addrspace(1) %out1
50  ret void
51}
52
53; GCN-LABEL: {{^}}test_no_denormals:
54; GCN: .amdhsa_dx10_clamp 1
55; GCN: .amdhsa_ieee_mode 1
56; GCN: FloatMode: 0
57define amdgpu_kernel void @test_no_denormals(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #5 {
58  store float 0.0, ptr addrspace(1) %out0
59  store double 0.0, ptr addrspace(1) %out1
60  ret void
61}
62
63; GCN-LABEL: {{^}}test_no_dx10_clamp_vi:
64; GCN: .amdhsa_dx10_clamp 0
65; GCN: .amdhsa_ieee_mode 1
66; GCN: FloatMode: 240
67define amdgpu_kernel void @test_no_dx10_clamp_vi(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #6 {
68  store float 0.0, ptr addrspace(1) %out0
69  store double 0.0, ptr addrspace(1) %out1
70  ret void
71}
72
73; GCN-LABEL: {{^}}test_no_ieee_mode_vi:
74; GCN: .amdhsa_dx10_clamp 1
75; GCN: .amdhsa_ieee_mode 0
76; GCN: FloatMode: 240
77define amdgpu_kernel void @test_no_ieee_mode_vi(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #7 {
78  store float 0.0, ptr addrspace(1) %out0
79  store double 0.0, ptr addrspace(1) %out1
80  ret void
81}
82
83; GCN-LABEL: {{^}}test_no_ieee_mode_no_dx10_clamp_vi:
84; GCN: .amdhsa_dx10_clamp 0
85; GCN: .amdhsa_ieee_mode 0
86; GCN: FloatMode: 240
87define amdgpu_kernel void @test_no_ieee_mode_no_dx10_clamp_vi(ptr addrspace(1) %out0, ptr addrspace(1) %out1) #8 {
88  store float 0.0, ptr addrspace(1) %out0
89  store double 0.0, ptr addrspace(1) %out1
90  ret void
91}
92
93attributes #0 = { nounwind "target-cpu"="kaveri" }
94attributes #1 = { nounwind "target-cpu"="fiji" }
95attributes #2 = { nounwind "denormal-fp-math-f32"="preserve-sign,preserve-sign" }
96attributes #3 = { nounwind "denormal-fp-math-f32"="ieee,ieee" "denormal-fp-math"="preserve-sign,preserve-sign" }
97attributes #4 = { nounwind "denormal-fp-math"="ieee,ieee" }
98attributes #5 = { nounwind "denormal-fp-math"="preserve-sign,preserve-sign" }
99attributes #6 = { nounwind "amdgpu-dx10-clamp"="false" "target-cpu"="fiji" }
100attributes #7 = { nounwind "amdgpu-ieee"="false" "target-cpu"="fiji" }
101attributes #8 = { nounwind "amdgpu-dx10-clamp"="false" "amdgpu-ieee"="false" "target-cpu"="fiji" }
102
103!llvm.module.flags = !{!0}
104!0 = !{i32 1, !"amdhsa_code_object_version", i32 400}
105