1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=tahiti -run-pass=instruction-select -global-isel-abort=0 -verify-machineinstrs -o - %s | FileCheck -check-prefix=SI %s
3 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=instruction-select -global-isel-abort=0 -verify-machineinstrs -o - %s | FileCheck -check-prefix=VI %s
4 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=instruction-select -global-isel-abort=0 -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX9 %s
5 # RUN: llc -march=amdgcn -mcpu=gfx1010 -run-pass=instruction-select -global-isel-abort=0 -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX10 %s
6 # RUN: llc -march=amdgcn -mcpu=gfx1100 -run-pass=instruction-select -global-isel-abort=0 -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX10 %s
12 tracksRegLiveness: true
17 ; SI-LABEL: name: fabs_s32_ss
20 ; SI-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
21 ; SI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
22 ; SI-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY]], [[S_MOV_B32_]], implicit-def dead $scc
23 ; SI-NEXT: $sgpr0 = COPY [[S_AND_B32_]]
25 ; VI-LABEL: name: fabs_s32_ss
28 ; VI-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
29 ; VI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
30 ; VI-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY]], [[S_MOV_B32_]], implicit-def dead $scc
31 ; VI-NEXT: $sgpr0 = COPY [[S_AND_B32_]]
33 ; GFX9-LABEL: name: fabs_s32_ss
34 ; GFX9: liveins: $sgpr0
36 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
37 ; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
38 ; GFX9-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY]], [[S_MOV_B32_]], implicit-def dead $scc
39 ; GFX9-NEXT: $sgpr0 = COPY [[S_AND_B32_]]
41 ; GFX10-LABEL: name: fabs_s32_ss
42 ; GFX10: liveins: $sgpr0
44 ; GFX10-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
45 ; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
46 ; GFX10-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY]], [[S_MOV_B32_]], implicit-def dead $scc
47 ; GFX10-NEXT: $sgpr0 = COPY [[S_AND_B32_]]
48 %0:sgpr(s32) = COPY $sgpr0
49 %1:sgpr(s32) = G_FABS %0
57 tracksRegLiveness: true
62 ; SI-LABEL: name: fabs_s32_vv
65 ; SI-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
66 ; SI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
67 ; SI-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
68 ; SI-NEXT: $vgpr0 = COPY [[V_AND_B32_e64_]]
70 ; VI-LABEL: name: fabs_s32_vv
73 ; VI-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
74 ; VI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
75 ; VI-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
76 ; VI-NEXT: $vgpr0 = COPY [[V_AND_B32_e64_]]
78 ; GFX9-LABEL: name: fabs_s32_vv
79 ; GFX9: liveins: $vgpr0
81 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
82 ; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
83 ; GFX9-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
84 ; GFX9-NEXT: $vgpr0 = COPY [[V_AND_B32_e64_]]
86 ; GFX10-LABEL: name: fabs_s32_vv
87 ; GFX10: liveins: $vgpr0
89 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
90 ; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
91 ; GFX10-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
92 ; GFX10-NEXT: $vgpr0 = COPY [[V_AND_B32_e64_]]
93 %0:vgpr(s32) = COPY $vgpr0
94 %1:vgpr(s32) = G_FABS %0
101 regBankSelected: true
102 tracksRegLiveness: true
107 ; SI-LABEL: name: fabs_s32_vs
108 ; SI: liveins: $sgpr0
110 ; SI-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
111 ; SI-NEXT: [[FABS:%[0-9]+]]:vgpr_32(s32) = G_FABS [[COPY]]
112 ; SI-NEXT: $vgpr0 = COPY [[FABS]](s32)
114 ; VI-LABEL: name: fabs_s32_vs
115 ; VI: liveins: $sgpr0
117 ; VI-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
118 ; VI-NEXT: [[FABS:%[0-9]+]]:vgpr_32(s32) = G_FABS [[COPY]]
119 ; VI-NEXT: $vgpr0 = COPY [[FABS]](s32)
121 ; GFX9-LABEL: name: fabs_s32_vs
122 ; GFX9: liveins: $sgpr0
124 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
125 ; GFX9-NEXT: [[FABS:%[0-9]+]]:vgpr_32(s32) = G_FABS [[COPY]]
126 ; GFX9-NEXT: $vgpr0 = COPY [[FABS]](s32)
128 ; GFX10-LABEL: name: fabs_s32_vs
129 ; GFX10: liveins: $sgpr0
131 ; GFX10-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
132 ; GFX10-NEXT: [[FABS:%[0-9]+]]:vgpr_32(s32) = G_FABS [[COPY]]
133 ; GFX10-NEXT: $vgpr0 = COPY [[FABS]](s32)
134 %0:sgpr(s32) = COPY $sgpr0
135 %1:vgpr(s32) = G_FABS %0
142 regBankSelected: true
143 tracksRegLiveness: true
147 liveins: $sgpr0_sgpr1
148 ; SI-LABEL: name: fabs_v2s16_ss
149 ; SI: liveins: $sgpr0_sgpr1
151 ; SI-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
152 ; SI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147450879
153 ; SI-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY]], [[S_MOV_B32_]], implicit-def dead $scc
154 ; SI-NEXT: $sgpr0 = COPY [[S_AND_B32_]]
156 ; VI-LABEL: name: fabs_v2s16_ss
157 ; VI: liveins: $sgpr0_sgpr1
159 ; VI-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
160 ; VI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147450879
161 ; VI-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY]], [[S_MOV_B32_]], implicit-def dead $scc
162 ; VI-NEXT: $sgpr0 = COPY [[S_AND_B32_]]
164 ; GFX9-LABEL: name: fabs_v2s16_ss
165 ; GFX9: liveins: $sgpr0_sgpr1
167 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
168 ; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147450879
169 ; GFX9-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY]], [[S_MOV_B32_]], implicit-def dead $scc
170 ; GFX9-NEXT: $sgpr0 = COPY [[S_AND_B32_]]
172 ; GFX10-LABEL: name: fabs_v2s16_ss
173 ; GFX10: liveins: $sgpr0_sgpr1
175 ; GFX10-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
176 ; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147450879
177 ; GFX10-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY]], [[S_MOV_B32_]], implicit-def dead $scc
178 ; GFX10-NEXT: $sgpr0 = COPY [[S_AND_B32_]]
179 %0:sgpr(<2 x s16>) = COPY $sgpr0
180 %1:sgpr(<2 x s16>) = G_FABS %0
187 regBankSelected: true
188 tracksRegLiveness: true
193 ; SI-LABEL: name: fabs_s16_ss
194 ; SI: liveins: $sgpr0
196 ; SI-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
197 ; SI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 32767
198 ; SI-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY]], [[S_MOV_B32_]], implicit-def dead $scc
199 ; SI-NEXT: $sgpr0 = COPY [[S_AND_B32_]]
201 ; VI-LABEL: name: fabs_s16_ss
202 ; VI: liveins: $sgpr0
204 ; VI-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
205 ; VI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 32767
206 ; VI-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY]], [[S_MOV_B32_]], implicit-def dead $scc
207 ; VI-NEXT: $sgpr0 = COPY [[S_AND_B32_]]
209 ; GFX9-LABEL: name: fabs_s16_ss
210 ; GFX9: liveins: $sgpr0
212 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
213 ; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 32767
214 ; GFX9-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY]], [[S_MOV_B32_]], implicit-def dead $scc
215 ; GFX9-NEXT: $sgpr0 = COPY [[S_AND_B32_]]
217 ; GFX10-LABEL: name: fabs_s16_ss
218 ; GFX10: liveins: $sgpr0
220 ; GFX10-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
221 ; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 32767
222 ; GFX10-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY]], [[S_MOV_B32_]], implicit-def dead $scc
223 ; GFX10-NEXT: $sgpr0 = COPY [[S_AND_B32_]]
224 %0:sgpr(s32) = COPY $sgpr0
225 %1:sgpr(s16) = G_TRUNC %0
226 %2:sgpr(s16) = G_FABS %1
227 %3:sgpr(s32) = G_ANYEXT %2
234 regBankSelected: true
235 tracksRegLiveness: true
240 ; SI-LABEL: name: fabs_s16_vv
241 ; SI: liveins: $vgpr0
243 ; SI-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
244 ; SI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 32767
245 ; SI-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
246 ; SI-NEXT: $vgpr0 = COPY [[V_AND_B32_e64_]]
248 ; VI-LABEL: name: fabs_s16_vv
249 ; VI: liveins: $vgpr0
251 ; VI-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
252 ; VI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 32767
253 ; VI-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
254 ; VI-NEXT: $vgpr0 = COPY [[V_AND_B32_e64_]]
256 ; GFX9-LABEL: name: fabs_s16_vv
257 ; GFX9: liveins: $vgpr0
259 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
260 ; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 32767
261 ; GFX9-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
262 ; GFX9-NEXT: $vgpr0 = COPY [[V_AND_B32_e64_]]
264 ; GFX10-LABEL: name: fabs_s16_vv
265 ; GFX10: liveins: $vgpr0
267 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
268 ; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 32767
269 ; GFX10-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
270 ; GFX10-NEXT: $vgpr0 = COPY [[V_AND_B32_e64_]]
271 %0:vgpr(s32) = COPY $vgpr0
272 %1:vgpr(s16) = G_TRUNC %0
273 %2:vgpr(s16) = G_FABS %1
274 %3:vgpr(s32) = G_ANYEXT %2
281 regBankSelected: true
282 tracksRegLiveness: true
288 ; SI-LABEL: name: fabs_s16_vs
289 ; SI: liveins: $sgpr0
291 ; SI-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
292 ; SI-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
293 ; SI-NEXT: [[FABS:%[0-9]+]]:vgpr_32(s16) = G_FABS [[TRUNC]]
294 ; SI-NEXT: [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY [[FABS]](s16)
295 ; SI-NEXT: $vgpr0 = COPY [[COPY1]](s32)
297 ; VI-LABEL: name: fabs_s16_vs
298 ; VI: liveins: $sgpr0
300 ; VI-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
301 ; VI-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
302 ; VI-NEXT: [[FABS:%[0-9]+]]:vgpr_32(s16) = G_FABS [[TRUNC]]
303 ; VI-NEXT: [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY [[FABS]](s16)
304 ; VI-NEXT: $vgpr0 = COPY [[COPY1]](s32)
306 ; GFX9-LABEL: name: fabs_s16_vs
307 ; GFX9: liveins: $sgpr0
309 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
310 ; GFX9-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
311 ; GFX9-NEXT: [[FABS:%[0-9]+]]:vgpr_32(s16) = G_FABS [[TRUNC]]
312 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY [[FABS]](s16)
313 ; GFX9-NEXT: $vgpr0 = COPY [[COPY1]](s32)
315 ; GFX10-LABEL: name: fabs_s16_vs
316 ; GFX10: liveins: $sgpr0
318 ; GFX10-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
319 ; GFX10-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
320 ; GFX10-NEXT: [[FABS:%[0-9]+]]:vgpr_32(s16) = G_FABS [[TRUNC]]
321 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY [[FABS]](s16)
322 ; GFX10-NEXT: $vgpr0 = COPY [[COPY1]](s32)
323 %0:sgpr(s32) = COPY $sgpr0
324 %1:sgpr(s16) = G_TRUNC %0
325 %2:vgpr(s16) = G_FABS %1
326 %3:vgpr(s32) = G_ANYEXT %2
333 regBankSelected: true
334 tracksRegLiveness: true
339 ; SI-LABEL: name: fabs_v2s16_vv
340 ; SI: liveins: $vgpr0
342 ; SI-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
343 ; SI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147450879
344 ; SI-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
345 ; SI-NEXT: $vgpr0 = COPY [[V_AND_B32_e64_]]
347 ; VI-LABEL: name: fabs_v2s16_vv
348 ; VI: liveins: $vgpr0
350 ; VI-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
351 ; VI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147450879
352 ; VI-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
353 ; VI-NEXT: $vgpr0 = COPY [[V_AND_B32_e64_]]
355 ; GFX9-LABEL: name: fabs_v2s16_vv
356 ; GFX9: liveins: $vgpr0
358 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
359 ; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147450879
360 ; GFX9-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
361 ; GFX9-NEXT: $vgpr0 = COPY [[V_AND_B32_e64_]]
363 ; GFX10-LABEL: name: fabs_v2s16_vv
364 ; GFX10: liveins: $vgpr0
366 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
367 ; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147450879
368 ; GFX10-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
369 ; GFX10-NEXT: $vgpr0 = COPY [[V_AND_B32_e64_]]
370 %0:vgpr(<2 x s16>) = COPY $vgpr0
371 %1:vgpr(<2 x s16>) = G_FABS %0
378 regBankSelected: true
379 tracksRegLiveness: true
384 ; SI-LABEL: name: fabs_v2s16_vs
385 ; SI: liveins: $sgpr0
387 ; SI-NEXT: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
388 ; SI-NEXT: [[FABS:%[0-9]+]]:vgpr_32(<2 x s16>) = G_FABS [[COPY]]
389 ; SI-NEXT: $vgpr0 = COPY [[FABS]](<2 x s16>)
391 ; VI-LABEL: name: fabs_v2s16_vs
392 ; VI: liveins: $sgpr0
394 ; VI-NEXT: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
395 ; VI-NEXT: [[FABS:%[0-9]+]]:vgpr_32(<2 x s16>) = G_FABS [[COPY]]
396 ; VI-NEXT: $vgpr0 = COPY [[FABS]](<2 x s16>)
398 ; GFX9-LABEL: name: fabs_v2s16_vs
399 ; GFX9: liveins: $sgpr0
401 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
402 ; GFX9-NEXT: [[FABS:%[0-9]+]]:vgpr_32(<2 x s16>) = G_FABS [[COPY]]
403 ; GFX9-NEXT: $vgpr0 = COPY [[FABS]](<2 x s16>)
405 ; GFX10-LABEL: name: fabs_v2s16_vs
406 ; GFX10: liveins: $sgpr0
408 ; GFX10-NEXT: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
409 ; GFX10-NEXT: [[FABS:%[0-9]+]]:vgpr_32(<2 x s16>) = G_FABS [[COPY]]
410 ; GFX10-NEXT: $vgpr0 = COPY [[FABS]](<2 x s16>)
411 %0:sgpr(<2 x s16>) = COPY $sgpr0
412 %1:vgpr(<2 x s16>) = G_FABS %0
419 regBankSelected: true
420 tracksRegLiveness: true
424 liveins: $sgpr0_sgpr1
425 ; SI-LABEL: name: fabs_s64_ss
426 ; SI: liveins: $sgpr0_sgpr1
428 ; SI-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
429 ; SI-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub0
430 ; SI-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub1
431 ; SI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
432 ; SI-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY2]], [[S_MOV_B32_]], implicit-def dead $scc
433 ; SI-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY1]], %subreg.sub0, [[S_AND_B32_]], %subreg.sub1
434 ; SI-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
436 ; VI-LABEL: name: fabs_s64_ss
437 ; VI: liveins: $sgpr0_sgpr1
439 ; VI-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
440 ; VI-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub0
441 ; VI-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub1
442 ; VI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
443 ; VI-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY2]], [[S_MOV_B32_]], implicit-def dead $scc
444 ; VI-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY1]], %subreg.sub0, [[S_AND_B32_]], %subreg.sub1
445 ; VI-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
447 ; GFX9-LABEL: name: fabs_s64_ss
448 ; GFX9: liveins: $sgpr0_sgpr1
450 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
451 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub0
452 ; GFX9-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub1
453 ; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
454 ; GFX9-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY2]], [[S_MOV_B32_]], implicit-def dead $scc
455 ; GFX9-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY1]], %subreg.sub0, [[S_AND_B32_]], %subreg.sub1
456 ; GFX9-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
458 ; GFX10-LABEL: name: fabs_s64_ss
459 ; GFX10: liveins: $sgpr0_sgpr1
461 ; GFX10-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
462 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub0
463 ; GFX10-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub1
464 ; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
465 ; GFX10-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY2]], [[S_MOV_B32_]], implicit-def dead $scc
466 ; GFX10-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY1]], %subreg.sub0, [[S_AND_B32_]], %subreg.sub1
467 ; GFX10-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
468 %0:sgpr(s64) = COPY $sgpr0_sgpr1
469 %1:sgpr(s64) = G_FABS %0
470 S_ENDPGM 0, implicit %1
476 regBankSelected: true
477 tracksRegLiveness: true
481 liveins: $vgpr0_vgpr1
482 ; SI-LABEL: name: fabs_s64_vv
483 ; SI: liveins: $vgpr0_vgpr1
485 ; SI-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
486 ; SI-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[COPY]].sub1
487 ; SI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
488 ; SI-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY1]], implicit $exec
489 ; SI-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[COPY]].sub0
490 ; SI-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64 = REG_SEQUENCE [[COPY2]], %subreg.sub0, [[V_AND_B32_e64_]], %subreg.sub1
491 ; SI-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
493 ; VI-LABEL: name: fabs_s64_vv
494 ; VI: liveins: $vgpr0_vgpr1
496 ; VI-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
497 ; VI-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[COPY]].sub1
498 ; VI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
499 ; VI-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY1]], implicit $exec
500 ; VI-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[COPY]].sub0
501 ; VI-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64 = REG_SEQUENCE [[COPY2]], %subreg.sub0, [[V_AND_B32_e64_]], %subreg.sub1
502 ; VI-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
504 ; GFX9-LABEL: name: fabs_s64_vv
505 ; GFX9: liveins: $vgpr0_vgpr1
507 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
508 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[COPY]].sub1
509 ; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
510 ; GFX9-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY1]], implicit $exec
511 ; GFX9-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[COPY]].sub0
512 ; GFX9-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64 = REG_SEQUENCE [[COPY2]], %subreg.sub0, [[V_AND_B32_e64_]], %subreg.sub1
513 ; GFX9-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
515 ; GFX10-LABEL: name: fabs_s64_vv
516 ; GFX10: liveins: $vgpr0_vgpr1
518 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
519 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[COPY]].sub1
520 ; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
521 ; GFX10-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY1]], implicit $exec
522 ; GFX10-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[COPY]].sub0
523 ; GFX10-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64 = REG_SEQUENCE [[COPY2]], %subreg.sub0, [[V_AND_B32_e64_]], %subreg.sub1
524 ; GFX10-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
525 %0:vgpr(s64) = COPY $vgpr0_vgpr1
526 %1:vgpr(s64) = G_FABS %0
527 S_ENDPGM 0, implicit %1
533 regBankSelected: true
534 tracksRegLiveness: true
538 liveins: $sgpr0_sgpr1
539 ; SI-LABEL: name: fabs_s64_vs
540 ; SI: liveins: $sgpr0_sgpr1
542 ; SI-NEXT: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
543 ; SI-NEXT: [[FABS:%[0-9]+]]:vgpr(s64) = G_FABS [[COPY]]
544 ; SI-NEXT: S_ENDPGM 0, implicit [[FABS]](s64)
546 ; VI-LABEL: name: fabs_s64_vs
547 ; VI: liveins: $sgpr0_sgpr1
549 ; VI-NEXT: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
550 ; VI-NEXT: [[FABS:%[0-9]+]]:vgpr(s64) = G_FABS [[COPY]]
551 ; VI-NEXT: S_ENDPGM 0, implicit [[FABS]](s64)
553 ; GFX9-LABEL: name: fabs_s64_vs
554 ; GFX9: liveins: $sgpr0_sgpr1
556 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
557 ; GFX9-NEXT: [[FABS:%[0-9]+]]:vgpr(s64) = G_FABS [[COPY]]
558 ; GFX9-NEXT: S_ENDPGM 0, implicit [[FABS]](s64)
560 ; GFX10-LABEL: name: fabs_s64_vs
561 ; GFX10: liveins: $sgpr0_sgpr1
563 ; GFX10-NEXT: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
564 ; GFX10-NEXT: [[FABS:%[0-9]+]]:vgpr(s64) = G_FABS [[COPY]]
565 ; GFX10-NEXT: S_ENDPGM 0, implicit [[FABS]](s64)
566 %0:sgpr(s64) = COPY $sgpr0_sgpr1
567 %1:vgpr(s64) = G_FABS %0
568 S_ENDPGM 0, implicit %1
571 # Make sure the source register is constrained
573 name: fabs_s64_vv_no_src_constraint
575 regBankSelected: true
576 tracksRegLiveness: true
580 liveins: $vgpr0_vgpr1
581 ; SI-LABEL: name: fabs_s64_vv_no_src_constraint
582 ; SI: liveins: $vgpr0_vgpr1
584 ; SI-NEXT: [[DEF:%[0-9]+]]:vreg_64 = IMPLICIT_DEF
585 ; SI-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY [[DEF]].sub1
586 ; SI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
587 ; SI-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
588 ; SI-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[DEF]].sub0
589 ; SI-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64 = REG_SEQUENCE [[COPY1]], %subreg.sub0, [[V_AND_B32_e64_]], %subreg.sub1
590 ; SI-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
592 ; VI-LABEL: name: fabs_s64_vv_no_src_constraint
593 ; VI: liveins: $vgpr0_vgpr1
595 ; VI-NEXT: [[DEF:%[0-9]+]]:vreg_64 = IMPLICIT_DEF
596 ; VI-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY [[DEF]].sub1
597 ; VI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
598 ; VI-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
599 ; VI-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[DEF]].sub0
600 ; VI-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64 = REG_SEQUENCE [[COPY1]], %subreg.sub0, [[V_AND_B32_e64_]], %subreg.sub1
601 ; VI-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
603 ; GFX9-LABEL: name: fabs_s64_vv_no_src_constraint
604 ; GFX9: liveins: $vgpr0_vgpr1
606 ; GFX9-NEXT: [[DEF:%[0-9]+]]:vreg_64 = IMPLICIT_DEF
607 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY [[DEF]].sub1
608 ; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
609 ; GFX9-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
610 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[DEF]].sub0
611 ; GFX9-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64 = REG_SEQUENCE [[COPY1]], %subreg.sub0, [[V_AND_B32_e64_]], %subreg.sub1
612 ; GFX9-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
614 ; GFX10-LABEL: name: fabs_s64_vv_no_src_constraint
615 ; GFX10: liveins: $vgpr0_vgpr1
617 ; GFX10-NEXT: [[DEF:%[0-9]+]]:vreg_64 = IMPLICIT_DEF
618 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY [[DEF]].sub1
619 ; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
620 ; GFX10-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[COPY]], implicit $exec
621 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[DEF]].sub0
622 ; GFX10-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64 = REG_SEQUENCE [[COPY1]], %subreg.sub0, [[V_AND_B32_e64_]], %subreg.sub1
623 ; GFX10-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
624 %0:vgpr(s64) = IMPLICIT_DEF
625 %1:vgpr(s64) = G_FABS %0:vgpr(s64)
626 S_ENDPGM 0, implicit %1
630 name: fabs_s64_ss_no_src_constraint
632 regBankSelected: true
633 tracksRegLiveness: true
637 liveins: $sgpr0_sgpr1
638 ; SI-LABEL: name: fabs_s64_ss_no_src_constraint
639 ; SI: liveins: $sgpr0_sgpr1
641 ; SI-NEXT: [[DEF:%[0-9]+]]:sreg_64 = IMPLICIT_DEF
642 ; SI-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY [[DEF]].sub0
643 ; SI-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY [[DEF]].sub1
644 ; SI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
645 ; SI-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY1]], [[S_MOV_B32_]], implicit-def dead $scc
646 ; SI-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY]], %subreg.sub0, [[S_AND_B32_]], %subreg.sub1
647 ; SI-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
649 ; VI-LABEL: name: fabs_s64_ss_no_src_constraint
650 ; VI: liveins: $sgpr0_sgpr1
652 ; VI-NEXT: [[DEF:%[0-9]+]]:sreg_64 = IMPLICIT_DEF
653 ; VI-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY [[DEF]].sub0
654 ; VI-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY [[DEF]].sub1
655 ; VI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
656 ; VI-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY1]], [[S_MOV_B32_]], implicit-def dead $scc
657 ; VI-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY]], %subreg.sub0, [[S_AND_B32_]], %subreg.sub1
658 ; VI-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
660 ; GFX9-LABEL: name: fabs_s64_ss_no_src_constraint
661 ; GFX9: liveins: $sgpr0_sgpr1
663 ; GFX9-NEXT: [[DEF:%[0-9]+]]:sreg_64 = IMPLICIT_DEF
664 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY [[DEF]].sub0
665 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY [[DEF]].sub1
666 ; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
667 ; GFX9-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY1]], [[S_MOV_B32_]], implicit-def dead $scc
668 ; GFX9-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY]], %subreg.sub0, [[S_AND_B32_]], %subreg.sub1
669 ; GFX9-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
671 ; GFX10-LABEL: name: fabs_s64_ss_no_src_constraint
672 ; GFX10: liveins: $sgpr0_sgpr1
674 ; GFX10-NEXT: [[DEF:%[0-9]+]]:sreg_64 = IMPLICIT_DEF
675 ; GFX10-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY [[DEF]].sub0
676 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY [[DEF]].sub1
677 ; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
678 ; GFX10-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY1]], [[S_MOV_B32_]], implicit-def dead $scc
679 ; GFX10-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY]], %subreg.sub0, [[S_AND_B32_]], %subreg.sub1
680 ; GFX10-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
681 %0:sgpr(s64) = IMPLICIT_DEF
682 %1:sgpr(s64) = G_FABS %0:sgpr(s64)
683 S_ENDPGM 0, implicit %1