1 ; RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
3 ; GCN-LABEL: {{^}}kernel_ieee_mode_default:
4 ; GCN: {{buffer|global|flat}}_load_dword [[VAL0:v[0-9]+]]
5 ; GCN: {{buffer|global|flat}}_load_dword [[VAL1:v[0-9]+]]
6 ; GCN-DAG: v_mul_f32_e32 [[QUIET0:v[0-9]+]], 1.0, [[VAL0]]
7 ; GCN-DAG: v_mul_f32_e32 [[QUIET1:v[0-9]+]], 1.0, [[VAL1]]
8 ; GCN: v_min_f32_e32 [[MIN:v[0-9]+]], [[QUIET0]], [[QUIET1]]
10 define amdgpu_kernel void @kernel_ieee_mode_default() #0 {
11 %val0 = load volatile float, ptr addrspace(1) undef
12 %val1 = load volatile float, ptr addrspace(1) undef
13 %min = call float @llvm.minnum.f32(float %val0, float %val1)
14 store volatile float %min, ptr addrspace(1) undef
18 ; GCN-LABEL: {{^}}kernel_ieee_mode_on:
19 ; GCN: {{buffer|global|flat}}_load_dword [[VAL0:v[0-9]+]]
20 ; GCN: {{buffer|global|flat}}_load_dword [[VAL1:v[0-9]+]]
21 ; GCN-DAG: v_mul_f32_e32 [[QUIET0:v[0-9]+]], 1.0, [[VAL0]]
22 ; GCN-DAG: v_mul_f32_e32 [[QUIET1:v[0-9]+]], 1.0, [[VAL1]]
23 ; GCN: v_min_f32_e32 [[MIN:v[0-9]+]], [[QUIET0]], [[QUIET1]]
25 define amdgpu_kernel void @kernel_ieee_mode_on() #1 {
26 %val0 = load volatile float, ptr addrspace(1) undef
27 %val1 = load volatile float, ptr addrspace(1) undef
28 %min = call float @llvm.minnum.f32(float %val0, float %val1)
29 store volatile float %min, ptr addrspace(1) undef
33 ; GCN-LABEL: {{^}}kernel_ieee_mode_off:
34 ; GCN: {{buffer|global|flat}}_load_dword [[VAL0:v[0-9]+]]
35 ; GCN: {{buffer|global|flat}}_load_dword [[VAL1:v[0-9]+]]
38 ; GCN: v_min_f32_e32 [[MIN:v[0-9]+]], [[VAL0]], [[VAL1]]
40 define amdgpu_kernel void @kernel_ieee_mode_off() #2 {
41 %val0 = load volatile float, ptr addrspace(1) undef
42 %val1 = load volatile float, ptr addrspace(1) undef
43 %min = call float @llvm.minnum.f32(float %val0, float %val1)
44 store volatile float %min, ptr addrspace(1) undef
48 ; GCN-LABEL: {{^}}func_ieee_mode_default:
49 ; GCN: {{buffer|global|flat}}_load_dword [[VAL0:v[0-9]+]]
50 ; GCN: {{buffer|global|flat}}_load_dword [[VAL1:v[0-9]+]]
51 ; GCN-DAG: v_mul_f32_e32 [[QUIET0:v[0-9]+]], 1.0, [[VAL0]]
52 ; GCN-DAG: v_mul_f32_e32 [[QUIET1:v[0-9]+]], 1.0, [[VAL1]]
53 ; GCN: v_min_f32_e32 [[MIN:v[0-9]+]], [[QUIET0]], [[QUIET1]]
55 define void @func_ieee_mode_default() #0 {
56 %val0 = load volatile float, ptr addrspace(1) undef
57 %val1 = load volatile float, ptr addrspace(1) undef
58 %min = call float @llvm.minnum.f32(float %val0, float %val1)
59 store volatile float %min, ptr addrspace(1) undef
63 ; GCN-LABEL: {{^}}func_ieee_mode_on:
64 ; GCN: {{buffer|global|flat}}_load_dword [[VAL0:v[0-9]+]]
65 ; GCN: {{buffer|global|flat}}_load_dword [[VAL1:v[0-9]+]]
66 ; GCN-DAG: v_mul_f32_e32 [[QUIET0:v[0-9]+]], 1.0, [[VAL0]]
67 ; GCN-DAG: v_mul_f32_e32 [[QUIET1:v[0-9]+]], 1.0, [[VAL1]]
68 ; GCN: v_min_f32_e32 [[MIN:v[0-9]+]], [[QUIET0]], [[QUIET1]]
70 define void @func_ieee_mode_on() #1 {
71 %val0 = load volatile float, ptr addrspace(1) undef
72 %val1 = load volatile float, ptr addrspace(1) undef
73 %min = call float @llvm.minnum.f32(float %val0, float %val1)
74 store volatile float %min, ptr addrspace(1) undef
78 ; GCN-LABEL: {{^}}func_ieee_mode_off:
79 ; GCN: {{buffer|global|flat}}_load_dword [[VAL0:v[0-9]+]]
80 ; GCN: {{buffer|global|flat}}_load_dword [[VAL1:v[0-9]+]]
83 ; GCN: v_min_f32_e32 [[MIN:v[0-9]+]], [[VAL0]], [[VAL1]]
85 define void @func_ieee_mode_off() #2 {
86 %val0 = load volatile float, ptr addrspace(1) undef
87 %val1 = load volatile float, ptr addrspace(1) undef
88 %min = call float @llvm.minnum.f32(float %val0, float %val1)
89 store volatile float %min, ptr addrspace(1) undef
93 ; GCN-LABEL: {{^}}cs_ieee_mode_default:
94 ; GCN: {{buffer|global|flat}}_load_dword [[VAL0:v[0-9]+]]
95 ; GCN: {{buffer|global|flat}}_load_dword [[VAL1:v[0-9]+]]
98 ; GCN: v_min_f32_e32 [[MIN:v[0-9]+]], [[QUIET0]], [[QUIET1]]
100 define amdgpu_cs void @cs_ieee_mode_default() #0 {
101 %val0 = load volatile float, ptr addrspace(1) undef
102 %val1 = load volatile float, ptr addrspace(1) undef
103 %min = call float @llvm.minnum.f32(float %val0, float %val1)
104 store volatile float %min, ptr addrspace(1) undef
108 ; GCN-LABEL: {{^}}cs_ieee_mode_on:
109 ; GCN: {{buffer|global|flat}}_load_dword [[VAL0:v[0-9]+]]
110 ; GCN: {{buffer|global|flat}}_load_dword [[VAL1:v[0-9]+]]
111 ; GCN-DAG: v_mul_f32_e32 [[QUIET0:v[0-9]+]], 1.0, [[VAL0]]
112 ; GCN-DAG: v_mul_f32_e32 [[QUIET1:v[0-9]+]], 1.0, [[VAL1]]
113 ; GCN: v_min_f32_e32 [[MIN:v[0-9]+]], [[QUIET0]], [[QUIET1]]
115 define amdgpu_cs void @cs_ieee_mode_on() #1 {
116 %val0 = load volatile float, ptr addrspace(1) undef
117 %val1 = load volatile float, ptr addrspace(1) undef
118 %min = call float @llvm.minnum.f32(float %val0, float %val1)
119 store volatile float %min, ptr addrspace(1) undef
123 ; GCN-LABEL: {{^}}cs_ieee_mode_off:
124 ; GCN: {{buffer|global|flat}}_load_dword [[VAL0:v[0-9]+]]
125 ; GCN: {{buffer|global|flat}}_load_dword [[VAL1:v[0-9]+]]
128 ; GCN: v_min_f32_e32 [[MIN:v[0-9]+]], [[VAL0]], [[VAL1]]
130 define amdgpu_cs void @cs_ieee_mode_off() #2 {
131 %val0 = load volatile float, ptr addrspace(1) undef
132 %val1 = load volatile float, ptr addrspace(1) undef
133 %min = call float @llvm.minnum.f32(float %val0, float %val1)
134 store volatile float %min, ptr addrspace(1) undef
138 ; GCN-LABEL: {{^}}ps_ieee_mode_default:
139 ; GCN: {{buffer|global|flat}}_load_dword [[VAL0:v[0-9]+]]
140 ; GCN: {{buffer|global|flat}}_load_dword [[VAL1:v[0-9]+]]
143 ; GCN: v_min_f32_e32 [[MIN:v[0-9]+]], [[VAL0]], [[VAL1]]
145 define amdgpu_ps void @ps_ieee_mode_default() #0 {
146 %val0 = load volatile float, ptr addrspace(1) undef
147 %val1 = load volatile float, ptr addrspace(1) undef
148 %min = call float @llvm.minnum.f32(float %val0, float %val1)
149 store volatile float %min, ptr addrspace(1) undef
153 ; GCN-LABEL: {{^}}ps_ieee_mode_on:
154 ; GCN: {{buffer|global|flat}}_load_dword [[VAL0:v[0-9]+]]
155 ; GCN: {{buffer|global|flat}}_load_dword [[VAL1:v[0-9]+]]
156 ; GCN-DAG: v_mul_f32_e32 [[QUIET0:v[0-9]+]], 1.0, [[VAL0]]
157 ; GCN-DAG: v_mul_f32_e32 [[QUIET1:v[0-9]+]], 1.0, [[VAL1]]
158 ; GCN: v_min_f32_e32 [[MIN:v[0-9]+]], [[QUIET0]], [[QUIET1]]
160 define amdgpu_ps void @ps_ieee_mode_on() #1 {
161 %val0 = load volatile float, ptr addrspace(1) undef
162 %val1 = load volatile float, ptr addrspace(1) undef
163 %min = call float @llvm.minnum.f32(float %val0, float %val1)
164 store volatile float %min, ptr addrspace(1) undef
168 ; GCN-LABEL: {{^}}ps_ieee_mode_off:
169 ; GCN: {{buffer|global|flat}}_load_dword [[VAL0:v[0-9]+]]
170 ; GCN: {{buffer|global|flat}}_load_dword [[VAL1:v[0-9]+]]
173 ; GCN: v_min_f32_e32 [[MIN:v[0-9]+]], [[VAL0]], [[VAL1]]
175 define amdgpu_ps void @ps_ieee_mode_off() #2 {
176 %val0 = load volatile float, ptr addrspace(1) undef
177 %val1 = load volatile float, ptr addrspace(1) undef
178 %min = call float @llvm.minnum.f32(float %val0, float %val1)
179 store volatile float %min, ptr addrspace(1) undef
183 declare float @llvm.minnum.f32(float, float) #3
185 attributes #0 = { nounwind }
186 attributes #1 = { nounwind "amdgpu-ieee"="true" }
187 attributes #2 = { nounwind "amdgpu-ieee"="false" }
188 attributes #3 = { nounwind readnone speculatable }