1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -mcpu=fiji -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -disable-gisel-legality-check -o - %s | FileCheck -check-prefix=GFX8 %s
3 # RUN: llc -mtriple=amdgcn -mcpu=gfx900 -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX9 %s
4 # RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX10 %s
5 # RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX11 %s
9 name: fcanonicalize_f16_denorm
14 fp64-fp16-input-denormals: true
15 fp64-fp16-output-denormals: true
20 ; GFX8-LABEL: name: fcanonicalize_f16_denorm
21 ; GFX8: liveins: $vgpr0
23 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
24 ; GFX8-NEXT: [[V_MAX_F16_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F16_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
25 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_MAX_F16_e64_]]
27 ; GFX9-LABEL: name: fcanonicalize_f16_denorm
28 ; GFX9: liveins: $vgpr0
30 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
31 ; GFX9-NEXT: [[V_MAX_F16_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F16_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
32 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_MAX_F16_e64_]]
34 ; GFX10-LABEL: name: fcanonicalize_f16_denorm
35 ; GFX10: liveins: $vgpr0
37 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
38 ; GFX10-NEXT: [[V_MAX_F16_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F16_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
39 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_MAX_F16_e64_]]
41 ; GFX11-LABEL: name: fcanonicalize_f16_denorm
42 ; GFX11: liveins: $vgpr0
44 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
45 ; GFX11-NEXT: [[V_MAX_F16_fake16_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F16_fake16_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
46 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_MAX_F16_fake16_e64_]]
47 %0:vgpr(s32) = COPY $vgpr0
48 %1:vgpr(s16) = G_TRUNC %0
49 %2:vgpr(s16) = G_FCANONICALIZE %1
50 S_ENDPGM 0, implicit %2
55 name: fcanonicalize_f16_flush
60 fp64-fp16-input-denormals: false
61 fp64-fp16-output-denormals: false
66 ; GFX8-LABEL: name: fcanonicalize_f16_flush
67 ; GFX8: liveins: $vgpr0
69 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
70 ; GFX8-NEXT: [[V_MUL_F16_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MUL_F16_e64 0, 15360, 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
71 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_MUL_F16_e64_]]
73 ; GFX9-LABEL: name: fcanonicalize_f16_flush
74 ; GFX9: liveins: $vgpr0
76 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
77 ; GFX9-NEXT: [[V_MAX_F16_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F16_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
78 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_MAX_F16_e64_]]
80 ; GFX10-LABEL: name: fcanonicalize_f16_flush
81 ; GFX10: liveins: $vgpr0
83 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
84 ; GFX10-NEXT: [[V_MAX_F16_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F16_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
85 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_MAX_F16_e64_]]
87 ; GFX11-LABEL: name: fcanonicalize_f16_flush
88 ; GFX11: liveins: $vgpr0
90 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
91 ; GFX11-NEXT: [[V_MAX_F16_fake16_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F16_fake16_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
92 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_MAX_F16_fake16_e64_]]
93 %0:vgpr(s32) = COPY $vgpr0
94 %1:vgpr(s16) = G_TRUNC %0
95 %2:vgpr(s16) = G_FCANONICALIZE %1
96 S_ENDPGM 0, implicit %2
101 name: fcanonicalize_f32_denorm
103 regBankSelected: true
106 fp32-input-denormals: true
107 fp32-output-denormals: true
113 ; GFX8-LABEL: name: fcanonicalize_f32_denorm
114 ; GFX8: liveins: $vgpr0
116 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
117 ; GFX8-NEXT: [[V_MUL_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MUL_F32_e64 0, 1065353216, 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
118 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_MUL_F32_e64_]]
120 ; GFX9-LABEL: name: fcanonicalize_f32_denorm
121 ; GFX9: liveins: $vgpr0
123 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
124 ; GFX9-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
125 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
127 ; GFX10-LABEL: name: fcanonicalize_f32_denorm
128 ; GFX10: liveins: $vgpr0
130 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
131 ; GFX10-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
132 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
134 ; GFX11-LABEL: name: fcanonicalize_f32_denorm
135 ; GFX11: liveins: $vgpr0
137 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
138 ; GFX11-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
139 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
140 %0:vgpr(s32) = COPY $vgpr0
141 %1:vgpr(s32) = G_FCANONICALIZE %0
142 S_ENDPGM 0, implicit %1
147 name: fcanonicalize_f32_flush
149 regBankSelected: true
152 fp32-input-denormals: false
153 fp32-output-denormals: false
159 ; GFX8-LABEL: name: fcanonicalize_f32_flush
160 ; GFX8: liveins: $vgpr0
162 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
163 ; GFX8-NEXT: [[V_MUL_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MUL_F32_e64 0, 1065353216, 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
164 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_MUL_F32_e64_]]
166 ; GFX9-LABEL: name: fcanonicalize_f32_flush
167 ; GFX9: liveins: $vgpr0
169 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
170 ; GFX9-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
171 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
173 ; GFX10-LABEL: name: fcanonicalize_f32_flush
174 ; GFX10: liveins: $vgpr0
176 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
177 ; GFX10-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
178 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
180 ; GFX11-LABEL: name: fcanonicalize_f32_flush
181 ; GFX11: liveins: $vgpr0
183 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
184 ; GFX11-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
185 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
186 %0:vgpr(s32) = COPY $vgpr0
187 %1:vgpr(s32) = G_FCANONICALIZE %0
188 S_ENDPGM 0, implicit %1
193 name: fcanonicalize_v2f16_denorm
195 regBankSelected: true
198 fp64-fp16-input-denormals: true
199 fp64-fp16-output-denormals: true
205 ; GFX8-LABEL: name: fcanonicalize_v2f16_denorm
206 ; GFX8: liveins: $vgpr0
208 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
209 ; GFX8-NEXT: [[V_PK_MAX_F16_:%[0-9]+]]:vgpr_32 = nofpexcept V_PK_MAX_F16 8, [[COPY]], 8, [[COPY]], 0, 0, 0, 0, 0, implicit $mode, implicit $exec
210 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_PK_MAX_F16_]]
212 ; GFX9-LABEL: name: fcanonicalize_v2f16_denorm
213 ; GFX9: liveins: $vgpr0
215 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
216 ; GFX9-NEXT: [[V_PK_MAX_F16_:%[0-9]+]]:vgpr_32 = nofpexcept V_PK_MAX_F16 8, [[COPY]], 8, [[COPY]], 0, 0, 0, 0, 0, implicit $mode, implicit $exec
217 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_PK_MAX_F16_]]
219 ; GFX10-LABEL: name: fcanonicalize_v2f16_denorm
220 ; GFX10: liveins: $vgpr0
222 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
223 ; GFX10-NEXT: [[V_PK_MAX_F16_:%[0-9]+]]:vgpr_32 = nofpexcept V_PK_MAX_F16 8, [[COPY]], 8, [[COPY]], 0, 0, 0, 0, 0, implicit $mode, implicit $exec
224 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_PK_MAX_F16_]]
226 ; GFX11-LABEL: name: fcanonicalize_v2f16_denorm
227 ; GFX11: liveins: $vgpr0
229 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
230 ; GFX11-NEXT: [[V_PK_MAX_F16_:%[0-9]+]]:vgpr_32 = nofpexcept V_PK_MAX_F16 8, [[COPY]], 8, [[COPY]], 0, 0, 0, 0, 0, implicit $mode, implicit $exec
231 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_PK_MAX_F16_]]
232 %0:vgpr(<2 x s16>) = COPY $vgpr0
233 %1:vgpr(<2 x s16>) = G_FCANONICALIZE %0
234 S_ENDPGM 0, implicit %1
239 name: fcanonicalize_v2f16_flush
241 regBankSelected: true
244 fp64-fp16-input-denormals: false
245 fp64-fp16-output-denormals: false
251 ; GFX8-LABEL: name: fcanonicalize_v2f16_flush
252 ; GFX8: liveins: $vgpr0
254 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
255 ; GFX8-NEXT: [[V_PK_MUL_F16_:%[0-9]+]]:vgpr_32 = nofpexcept V_PK_MUL_F16 0, 15360, 8, [[COPY]], 0, 0, 0, 0, 0, implicit $mode, implicit $exec
256 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_PK_MUL_F16_]]
258 ; GFX9-LABEL: name: fcanonicalize_v2f16_flush
259 ; GFX9: liveins: $vgpr0
261 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
262 ; GFX9-NEXT: [[V_PK_MAX_F16_:%[0-9]+]]:vgpr_32 = nofpexcept V_PK_MAX_F16 8, [[COPY]], 8, [[COPY]], 0, 0, 0, 0, 0, implicit $mode, implicit $exec
263 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_PK_MAX_F16_]]
265 ; GFX10-LABEL: name: fcanonicalize_v2f16_flush
266 ; GFX10: liveins: $vgpr0
268 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
269 ; GFX10-NEXT: [[V_PK_MAX_F16_:%[0-9]+]]:vgpr_32 = nofpexcept V_PK_MAX_F16 8, [[COPY]], 8, [[COPY]], 0, 0, 0, 0, 0, implicit $mode, implicit $exec
270 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_PK_MAX_F16_]]
272 ; GFX11-LABEL: name: fcanonicalize_v2f16_flush
273 ; GFX11: liveins: $vgpr0
275 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
276 ; GFX11-NEXT: [[V_PK_MAX_F16_:%[0-9]+]]:vgpr_32 = nofpexcept V_PK_MAX_F16 8, [[COPY]], 8, [[COPY]], 0, 0, 0, 0, 0, implicit $mode, implicit $exec
277 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_PK_MAX_F16_]]
278 %0:vgpr(<2 x s16>) = COPY $vgpr0
279 %1:vgpr(<2 x s16>) = G_FCANONICALIZE %0
280 S_ENDPGM 0, implicit %1
285 name: fcanonicalize_f64_denorm
287 regBankSelected: true
290 fp64-fp16-input-denormals: true
291 fp64-fp16-output-denormals: true
295 liveins: $vgpr0_vgpr1
297 ; GFX8-LABEL: name: fcanonicalize_f64_denorm
298 ; GFX8: liveins: $vgpr0_vgpr1
300 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
301 ; GFX8-NEXT: [[V_MAX_F64_e64_:%[0-9]+]]:vreg_64 = nofpexcept V_MAX_F64_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
302 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_MAX_F64_e64_]]
304 ; GFX9-LABEL: name: fcanonicalize_f64_denorm
305 ; GFX9: liveins: $vgpr0_vgpr1
307 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
308 ; GFX9-NEXT: [[V_MAX_F64_e64_:%[0-9]+]]:vreg_64 = nofpexcept V_MAX_F64_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
309 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_MAX_F64_e64_]]
311 ; GFX10-LABEL: name: fcanonicalize_f64_denorm
312 ; GFX10: liveins: $vgpr0_vgpr1
314 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
315 ; GFX10-NEXT: [[V_MAX_F64_e64_:%[0-9]+]]:vreg_64 = nofpexcept V_MAX_F64_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
316 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_MAX_F64_e64_]]
318 ; GFX11-LABEL: name: fcanonicalize_f64_denorm
319 ; GFX11: liveins: $vgpr0_vgpr1
321 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
322 ; GFX11-NEXT: [[V_MAX_F64_e64_:%[0-9]+]]:vreg_64 = nofpexcept V_MAX_F64_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
323 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_MAX_F64_e64_]]
324 %0:vgpr(s64) = COPY $vgpr0_vgpr1
325 %1:vgpr(s64) = G_FCANONICALIZE %0
326 S_ENDPGM 0, implicit %1
331 name: fcanonicalize_f64_flush
333 regBankSelected: true
336 fp64-fp16-input-denormals: false
337 fp64-fp16-output-denormals: false
341 liveins: $vgpr0_vgpr1
343 ; GFX8-LABEL: name: fcanonicalize_f64_flush
344 ; GFX8: liveins: $vgpr0_vgpr1
346 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
347 ; GFX8-NEXT: [[V_MUL_F64_e64_:%[0-9]+]]:vreg_64 = nofpexcept V_MUL_F64_e64 0, 4607182418800017408, 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
348 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_MUL_F64_e64_]]
350 ; GFX9-LABEL: name: fcanonicalize_f64_flush
351 ; GFX9: liveins: $vgpr0_vgpr1
353 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
354 ; GFX9-NEXT: [[V_MAX_F64_e64_:%[0-9]+]]:vreg_64 = nofpexcept V_MAX_F64_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
355 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_MAX_F64_e64_]]
357 ; GFX10-LABEL: name: fcanonicalize_f64_flush
358 ; GFX10: liveins: $vgpr0_vgpr1
360 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
361 ; GFX10-NEXT: [[V_MAX_F64_e64_:%[0-9]+]]:vreg_64 = nofpexcept V_MAX_F64_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
362 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_MAX_F64_e64_]]
364 ; GFX11-LABEL: name: fcanonicalize_f64_flush
365 ; GFX11: liveins: $vgpr0_vgpr1
367 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
368 ; GFX11-NEXT: [[V_MAX_F64_e64_:%[0-9]+]]:vreg_64 = nofpexcept V_MAX_F64_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
369 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_MAX_F64_e64_]]
370 %0:vgpr(s64) = COPY $vgpr0_vgpr1
371 %1:vgpr(s64) = G_FCANONICALIZE %0
372 S_ENDPGM 0, implicit %1
377 name: fcanonicalize_fabs_f32_denorm
379 regBankSelected: true
382 fp32-input-denormals: true
383 fp32-output-denormals: true
388 ; GFX8-LABEL: name: fcanonicalize_fabs_f32_denorm
389 ; GFX8: liveins: $vgpr0
391 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
392 ; GFX8-NEXT: [[V_MUL_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MUL_F32_e64 0, 1065353216, 2, [[COPY]], 0, 0, implicit $mode, implicit $exec
393 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_MUL_F32_e64_]]
395 ; GFX9-LABEL: name: fcanonicalize_fabs_f32_denorm
396 ; GFX9: liveins: $vgpr0
398 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
399 ; GFX9-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 2, [[COPY]], 2, [[COPY]], 0, 0, implicit $mode, implicit $exec
400 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
402 ; GFX10-LABEL: name: fcanonicalize_fabs_f32_denorm
403 ; GFX10: liveins: $vgpr0
405 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
406 ; GFX10-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 2, [[COPY]], 2, [[COPY]], 0, 0, implicit $mode, implicit $exec
407 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
409 ; GFX11-LABEL: name: fcanonicalize_fabs_f32_denorm
410 ; GFX11: liveins: $vgpr0
412 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
413 ; GFX11-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 2, [[COPY]], 2, [[COPY]], 0, 0, implicit $mode, implicit $exec
414 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
415 %0:vgpr(s32) = COPY $vgpr0
416 %1:vgpr(s32) = G_FABS %0
417 %2:vgpr(s32) = G_FCANONICALIZE %1
418 S_ENDPGM 0, implicit %2
424 name: fcanonicalize_fabs_f32_flush
426 regBankSelected: true
429 fp32-input-denormals: false
430 fp32-output-denormals: false
435 ; GFX8-LABEL: name: fcanonicalize_fabs_f32_flush
436 ; GFX8: liveins: $vgpr0
438 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
439 ; GFX8-NEXT: [[V_MUL_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MUL_F32_e64 0, 1065353216, 2, [[COPY]], 0, 0, implicit $mode, implicit $exec
440 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_MUL_F32_e64_]]
442 ; GFX9-LABEL: name: fcanonicalize_fabs_f32_flush
443 ; GFX9: liveins: $vgpr0
445 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
446 ; GFX9-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 2, [[COPY]], 2, [[COPY]], 0, 0, implicit $mode, implicit $exec
447 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
449 ; GFX10-LABEL: name: fcanonicalize_fabs_f32_flush
450 ; GFX10: liveins: $vgpr0
452 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
453 ; GFX10-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 2, [[COPY]], 2, [[COPY]], 0, 0, implicit $mode, implicit $exec
454 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
456 ; GFX11-LABEL: name: fcanonicalize_fabs_f32_flush
457 ; GFX11: liveins: $vgpr0
459 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
460 ; GFX11-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 2, [[COPY]], 2, [[COPY]], 0, 0, implicit $mode, implicit $exec
461 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
462 %0:vgpr(s32) = COPY $vgpr0
463 %1:vgpr(s32) = G_FABS %0
464 %2:vgpr(s32) = G_FCANONICALIZE %1
465 S_ENDPGM 0, implicit %2
470 name: fcanonicalize_fneg_f32_denorm
472 regBankSelected: true
475 fp32-input-denormals: true
476 fp32-output-denormals: true
481 ; GFX8-LABEL: name: fcanonicalize_fneg_f32_denorm
482 ; GFX8: liveins: $vgpr0
484 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
485 ; GFX8-NEXT: [[V_MUL_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MUL_F32_e64 0, 3212836864, 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
486 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_MUL_F32_e64_]]
488 ; GFX9-LABEL: name: fcanonicalize_fneg_f32_denorm
489 ; GFX9: liveins: $vgpr0
491 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
492 ; GFX9-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 1, [[COPY]], 1, [[COPY]], 0, 0, implicit $mode, implicit $exec
493 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
495 ; GFX10-LABEL: name: fcanonicalize_fneg_f32_denorm
496 ; GFX10: liveins: $vgpr0
498 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
499 ; GFX10-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 1, [[COPY]], 1, [[COPY]], 0, 0, implicit $mode, implicit $exec
500 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
502 ; GFX11-LABEL: name: fcanonicalize_fneg_f32_denorm
503 ; GFX11: liveins: $vgpr0
505 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
506 ; GFX11-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 1, [[COPY]], 1, [[COPY]], 0, 0, implicit $mode, implicit $exec
507 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
508 %0:vgpr(s32) = COPY $vgpr0
509 %1:vgpr(s32) = G_FNEG %0
510 %2:vgpr(s32) = G_FCANONICALIZE %1
511 S_ENDPGM 0, implicit %2
516 name: fcanonicalize_fneg_f32_flush
518 regBankSelected: true
521 fp32-input-denormals: false
522 fp32-output-denormals: false
527 ; GFX8-LABEL: name: fcanonicalize_fneg_f32_flush
528 ; GFX8: liveins: $vgpr0
530 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
531 ; GFX8-NEXT: [[V_MUL_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MUL_F32_e64 0, 3212836864, 0, [[COPY]], 0, 0, implicit $mode, implicit $exec
532 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_MUL_F32_e64_]]
534 ; GFX9-LABEL: name: fcanonicalize_fneg_f32_flush
535 ; GFX9: liveins: $vgpr0
537 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
538 ; GFX9-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 1, [[COPY]], 1, [[COPY]], 0, 0, implicit $mode, implicit $exec
539 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
541 ; GFX10-LABEL: name: fcanonicalize_fneg_f32_flush
542 ; GFX10: liveins: $vgpr0
544 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
545 ; GFX10-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 1, [[COPY]], 1, [[COPY]], 0, 0, implicit $mode, implicit $exec
546 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
548 ; GFX11-LABEL: name: fcanonicalize_fneg_f32_flush
549 ; GFX11: liveins: $vgpr0
551 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
552 ; GFX11-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 1, [[COPY]], 1, [[COPY]], 0, 0, implicit $mode, implicit $exec
553 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
554 %0:vgpr(s32) = COPY $vgpr0
555 %1:vgpr(s32) = G_FNEG %0
556 %2:vgpr(s32) = G_FCANONICALIZE %1
557 S_ENDPGM 0, implicit %2
562 name: fcanonicalize_fneg_fabs_f32_denorm
564 regBankSelected: true
567 fp32-input-denormals: true
568 fp32-output-denormals: true
573 ; GFX8-LABEL: name: fcanonicalize_fneg_fabs_f32_denorm
574 ; GFX8: liveins: $vgpr0
576 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
577 ; GFX8-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483648
578 ; GFX8-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
579 ; GFX8-NEXT: [[V_MUL_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MUL_F32_e64 0, 1065353216, 2, [[V_XOR_B32_e64_]], 0, 0, implicit $mode, implicit $exec
580 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_MUL_F32_e64_]]
582 ; GFX9-LABEL: name: fcanonicalize_fneg_fabs_f32_denorm
583 ; GFX9: liveins: $vgpr0
585 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
586 ; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483648
587 ; GFX9-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
588 ; GFX9-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 2, [[V_XOR_B32_e64_]], 2, [[V_XOR_B32_e64_]], 0, 0, implicit $mode, implicit $exec
589 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
591 ; GFX10-LABEL: name: fcanonicalize_fneg_fabs_f32_denorm
592 ; GFX10: liveins: $vgpr0
594 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
595 ; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483648
596 ; GFX10-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
597 ; GFX10-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 2, [[V_XOR_B32_e64_]], 2, [[V_XOR_B32_e64_]], 0, 0, implicit $mode, implicit $exec
598 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
600 ; GFX11-LABEL: name: fcanonicalize_fneg_fabs_f32_denorm
601 ; GFX11: liveins: $vgpr0
603 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
604 ; GFX11-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483648
605 ; GFX11-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
606 ; GFX11-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 2, [[V_XOR_B32_e64_]], 2, [[V_XOR_B32_e64_]], 0, 0, implicit $mode, implicit $exec
607 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
608 %0:vgpr(s32) = COPY $vgpr0
609 %1:vgpr(s32) = G_FNEG %0
610 %2:vgpr(s32) = G_FABS %1
611 %3:vgpr(s32) = G_FCANONICALIZE %2
612 S_ENDPGM 0, implicit %3
617 name: fcanonicalize_fneg_fabs_f32_flush
619 regBankSelected: true
622 fp32-input-denormals: false
623 fp32-output-denormals: false
628 ; GFX8-LABEL: name: fcanonicalize_fneg_fabs_f32_flush
629 ; GFX8: liveins: $vgpr0
631 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
632 ; GFX8-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483648
633 ; GFX8-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
634 ; GFX8-NEXT: [[V_MUL_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MUL_F32_e64 0, 1065353216, 2, [[V_XOR_B32_e64_]], 0, 0, implicit $mode, implicit $exec
635 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_MUL_F32_e64_]]
637 ; GFX9-LABEL: name: fcanonicalize_fneg_fabs_f32_flush
638 ; GFX9: liveins: $vgpr0
640 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
641 ; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483648
642 ; GFX9-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
643 ; GFX9-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 2, [[V_XOR_B32_e64_]], 2, [[V_XOR_B32_e64_]], 0, 0, implicit $mode, implicit $exec
644 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
646 ; GFX10-LABEL: name: fcanonicalize_fneg_fabs_f32_flush
647 ; GFX10: liveins: $vgpr0
649 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
650 ; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483648
651 ; GFX10-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
652 ; GFX10-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 2, [[V_XOR_B32_e64_]], 2, [[V_XOR_B32_e64_]], 0, 0, implicit $mode, implicit $exec
653 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
655 ; GFX11-LABEL: name: fcanonicalize_fneg_fabs_f32_flush
656 ; GFX11: liveins: $vgpr0
658 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
659 ; GFX11-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483648
660 ; GFX11-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
661 ; GFX11-NEXT: [[V_MAX_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_MAX_F32_e64 2, [[V_XOR_B32_e64_]], 2, [[V_XOR_B32_e64_]], 0, 0, implicit $mode, implicit $exec
662 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_MAX_F32_e64_]]
663 %0:vgpr(s32) = COPY $vgpr0
664 %1:vgpr(s32) = G_FNEG %0
665 %2:vgpr(s32) = G_FABS %1
666 %3:vgpr(s32) = G_FCANONICALIZE %2
667 S_ENDPGM 0, implicit %3