1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -run-pass=legalizer %s -o - | FileCheck %s
5 name: test_anyext_s32_to_s64
10 ; CHECK-LABEL: name: test_anyext_s32_to_s64
11 ; CHECK: liveins: $vgpr0
13 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
14 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[COPY]](s32)
15 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[ANYEXT]](s64)
16 %0:_(s32) = COPY $vgpr0
17 %1:_(s64) = G_ANYEXT %0
18 $vgpr0_vgpr1 = COPY %1
22 name: test_anyext_s16_to_s64
27 ; CHECK-LABEL: name: test_anyext_s16_to_s64
28 ; CHECK: liveins: $vgpr0
30 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
31 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[COPY]](s32)
32 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[ANYEXT]](s64)
33 %0:_(s32) = COPY $vgpr0
34 %1:_(s16) = G_TRUNC %0
35 %2:_(s64) = G_ANYEXT %1
36 $vgpr0_vgpr1 = COPY %2
40 name: test_anyext_s16_to_s32
45 ; CHECK-LABEL: name: test_anyext_s16_to_s32
46 ; CHECK: liveins: $vgpr0
48 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
49 ; CHECK-NEXT: $vgpr0 = COPY [[COPY]](s32)
50 %0:_(s32) = COPY $vgpr0
51 %1:_(s16) = G_TRUNC %0
52 %2:_(s32) = G_ANYEXT %1
57 name: test_anyext_s24_to_s32
62 ; CHECK-LABEL: name: test_anyext_s24_to_s32
63 ; CHECK: liveins: $vgpr0
65 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
66 ; CHECK-NEXT: $vgpr0 = COPY [[COPY]](s32)
67 %0:_(s32) = COPY $vgpr0
68 %1:_(s24) = G_TRUNC %0
69 %2:_(s32) = G_ANYEXT %1
74 name: test_anyext_s1_to_s32
78 ; CHECK-LABEL: name: test_anyext_s1_to_s32
79 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
80 ; CHECK-NEXT: $vgpr0 = COPY [[C]](s32)
81 %0:_(s1) = G_CONSTANT i1 0
82 %1:_(s32) = G_ANYEXT %0
87 name: test_anyext_s1_to_s64
91 ; CHECK-LABEL: name: test_anyext_s1_to_s64
92 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
93 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[C]](s64)
94 %0:_(s1) = G_CONSTANT i1 0
95 %1:_(s64) = G_ANYEXT %0
96 $vgpr0_vgpr1 = COPY %1
100 name: test_anyext_v2s16_to_v2s32
105 ; CHECK-LABEL: name: test_anyext_v2s16_to_v2s32
106 ; CHECK: liveins: $vgpr0
108 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
109 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
110 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
111 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
112 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[BITCAST]](s32), [[LSHR]](s32)
113 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
114 %0:_(<2 x s16>) = COPY $vgpr0
115 %1:_(<2 x s32>) = G_ANYEXT %0
116 $vgpr0_vgpr1 = COPY %1
120 name: test_anyext_v3s16_to_v3s32
123 liveins: $vgpr0_vgpr1
125 ; CHECK-LABEL: name: test_anyext_v3s16_to_v3s32
126 ; CHECK: liveins: $vgpr0_vgpr1
128 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr0_vgpr1
129 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY]](<4 x s16>)
130 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[UV]](<2 x s16>)
131 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
132 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
133 ; CHECK-NEXT: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[UV1]](<2 x s16>)
134 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[BITCAST]](s32), [[LSHR]](s32), [[BITCAST1]](s32)
135 ; CHECK-NEXT: $vgpr0_vgpr1_vgpr2 = COPY [[BUILD_VECTOR]](<3 x s32>)
136 %0:_(<4 x s16>) = COPY $vgpr0_vgpr1
137 %1:_(<3 x s16>) = G_EXTRACT %0, 0
138 %2:_(<3 x s32>) = G_ANYEXT %1
139 $vgpr0_vgpr1_vgpr2 = COPY %2
143 name: test_anyext_v4s16_to_v4s32
148 ; CHECK-LABEL: name: test_anyext_v4s16_to_v4s32
149 ; CHECK: liveins: $vgpr0
151 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
152 ; CHECK-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[DEF]](<4 x s32>)
153 %0:_(<4 x s16>) = G_IMPLICIT_DEF
154 %1:_(<4 x s32>) = G_ANYEXT %0
155 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
159 name: test_anyext_v2s32_to_v2s64
162 liveins: $vgpr0_vgpr1
164 ; CHECK-LABEL: name: test_anyext_v2s32_to_v2s64
165 ; CHECK: liveins: $vgpr0_vgpr1
167 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
168 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
169 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[UV]](s32)
170 ; CHECK-NEXT: [[ANYEXT1:%[0-9]+]]:_(s64) = G_ANYEXT [[UV1]](s32)
171 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[ANYEXT]](s64), [[ANYEXT1]](s64)
172 ; CHECK-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x s64>)
173 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
174 %1:_(<2 x s64>) = G_ANYEXT %0
175 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
179 name: test_anyext_v3s32_to_v3s64
182 liveins: $vgpr0_vgpr1_vgpr2
184 ; CHECK-LABEL: name: test_anyext_v3s32_to_v3s64
185 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2
187 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
188 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<3 x s32>)
189 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[UV]](s32)
190 ; CHECK-NEXT: [[ANYEXT1:%[0-9]+]]:_(s64) = G_ANYEXT [[UV1]](s32)
191 ; CHECK-NEXT: [[ANYEXT2:%[0-9]+]]:_(s64) = G_ANYEXT [[UV2]](s32)
192 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<3 x s64>) = G_BUILD_VECTOR [[ANYEXT]](s64), [[ANYEXT1]](s64), [[ANYEXT2]](s64)
193 ; CHECK-NEXT: S_NOP 0, implicit [[BUILD_VECTOR]](<3 x s64>)
194 %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
195 %1:_(<3 x s64>) = G_ANYEXT %0
201 name: test_anyext_v4s32_to_v4s64
204 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
206 ; CHECK-LABEL: name: test_anyext_v4s32_to_v4s64
207 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
209 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
210 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<4 x s32>)
211 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[UV]](s32)
212 ; CHECK-NEXT: [[ANYEXT1:%[0-9]+]]:_(s64) = G_ANYEXT [[UV1]](s32)
213 ; CHECK-NEXT: [[ANYEXT2:%[0-9]+]]:_(s64) = G_ANYEXT [[UV2]](s32)
214 ; CHECK-NEXT: [[ANYEXT3:%[0-9]+]]:_(s64) = G_ANYEXT [[UV3]](s32)
215 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s64>) = G_BUILD_VECTOR [[ANYEXT]](s64), [[ANYEXT1]](s64), [[ANYEXT2]](s64), [[ANYEXT3]](s64)
216 ; CHECK-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY [[BUILD_VECTOR]](<4 x s64>)
217 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
218 %1:_(<4 x s64>) = G_ANYEXT %0
219 $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY %1
223 name: test_anyext_s8_to_s16
228 ; CHECK-LABEL: name: test_anyext_s8_to_s16
229 ; CHECK: liveins: $vgpr0
231 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
232 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
233 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC]](s16)
234 %0:_(s32) = COPY $vgpr0
235 %1:_(s8) = G_TRUNC %0
236 %2:_(s16) = G_ANYEXT %1
237 S_ENDPGM 0, implicit %2
241 name: test_anyext_s8_to_s24
246 ; CHECK-LABEL: name: test_anyext_s8_to_s24
247 ; CHECK: liveins: $vgpr0
249 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
250 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s24) = G_TRUNC [[COPY]](s32)
251 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC]](s24)
252 %0:_(s32) = COPY $vgpr0
253 %1:_(s8) = G_TRUNC %0
254 %2:_(s24) = G_ANYEXT %1
255 S_ENDPGM 0, implicit %2
259 name: test_anyext_s7_to_s32
264 ; CHECK-LABEL: name: test_anyext_s7_to_s32
265 ; CHECK: liveins: $vgpr0
267 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
268 ; CHECK-NEXT: S_ENDPGM 0, implicit [[COPY]](s32)
269 %0:_(s32) = COPY $vgpr0
270 %1:_(s7) = G_TRUNC %0
271 %2:_(s32) = G_ANYEXT %1
272 S_ENDPGM 0, implicit %2
276 name: test_anyext_s8_to_s32
281 ; CHECK-LABEL: name: test_anyext_s8_to_s32
282 ; CHECK: liveins: $vgpr0
284 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
285 ; CHECK-NEXT: S_ENDPGM 0, implicit [[COPY]](s32)
286 %0:_(s32) = COPY $vgpr0
287 %1:_(s8) = G_TRUNC %0
288 %2:_(s32) = G_ANYEXT %1
289 S_ENDPGM 0, implicit %2
293 name: test_anyext_s32_to_s96
298 ; CHECK-LABEL: name: test_anyext_s32_to_s96
299 ; CHECK: liveins: $vgpr0
301 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
302 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
303 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[DEF]](s32)
304 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
305 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s192) = G_MERGE_VALUES [[MV]](s64), [[DEF1]](s64), [[DEF1]](s64)
306 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s96) = G_TRUNC [[MV1]](s192)
307 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC]](s96)
308 %0:_(s32) = COPY $vgpr0
309 %1:_(s96) = G_ANYEXT %0
310 S_ENDPGM 0, implicit %1
314 name: test_anyext_s32_to_s128
319 ; CHECK-LABEL: name: test_anyext_s32_to_s128
320 ; CHECK: liveins: $vgpr0
322 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
323 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
324 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[DEF]](s32)
325 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
326 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[MV]](s64), [[DEF1]](s64)
327 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV1]](s128)
328 %0:_(s32) = COPY $vgpr0
329 %1:_(s128) = G_ANYEXT %0
330 S_ENDPGM 0, implicit %1
334 name: test_anyext_s32_to_s160
339 ; CHECK-LABEL: name: test_anyext_s32_to_s160
340 ; CHECK: liveins: $vgpr0
342 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
343 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
344 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[DEF]](s32)
345 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
346 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s320) = G_MERGE_VALUES [[MV]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64)
347 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s160) = G_TRUNC [[MV1]](s320)
348 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC]](s160)
349 %0:_(s32) = COPY $vgpr0
350 %1:_(s160) = G_ANYEXT %0
351 S_ENDPGM 0, implicit %1
355 name: test_anyext_s32_to_s192
360 ; CHECK-LABEL: name: test_anyext_s32_to_s192
361 ; CHECK: liveins: $vgpr0
363 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
364 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
365 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[DEF]](s32)
366 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
367 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s192) = G_MERGE_VALUES [[MV]](s64), [[DEF1]](s64), [[DEF1]](s64)
368 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV1]](s192)
369 %0:_(s32) = COPY $vgpr0
370 %1:_(s192) = G_ANYEXT %0
371 S_ENDPGM 0, implicit %1
375 name: test_anyext_s32_to_s224
380 ; CHECK-LABEL: name: test_anyext_s32_to_s224
381 ; CHECK: liveins: $vgpr0
383 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
384 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
385 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[DEF]](s32)
386 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
387 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s448) = G_MERGE_VALUES [[MV]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64)
388 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s224) = G_TRUNC [[MV1]](s448)
389 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC]](s224)
390 %0:_(s32) = COPY $vgpr0
391 %1:_(s224) = G_ANYEXT %0
392 S_ENDPGM 0, implicit %1
396 name: test_anyext_s32_to_s256
401 ; CHECK-LABEL: name: test_anyext_s32_to_s256
402 ; CHECK: liveins: $vgpr0
404 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
405 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
406 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[DEF]](s32)
407 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
408 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s256) = G_MERGE_VALUES [[MV]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64)
409 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV1]](s256)
410 %0:_(s32) = COPY $vgpr0
411 %1:_(s256) = G_ANYEXT %0
412 S_ENDPGM 0, implicit %1
416 name: test_anyext_s32_to_s512
421 ; CHECK-LABEL: name: test_anyext_s32_to_s512
422 ; CHECK: liveins: $vgpr0
424 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
425 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
426 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[DEF]](s32)
427 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
428 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s512) = G_MERGE_VALUES [[MV]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64)
429 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV1]](s512)
430 %0:_(s32) = COPY $vgpr0
431 %1:_(s512) = G_ANYEXT %0
432 S_ENDPGM 0, implicit %1
436 name: test_anyext_s32_to_s992
441 ; CHECK-LABEL: name: test_anyext_s32_to_s992
442 ; CHECK: liveins: $vgpr0
444 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
445 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
446 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[DEF]](s32)
447 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
448 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s448) = G_MERGE_VALUES [[MV]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64)
449 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s224) = G_TRUNC [[MV1]](s448)
450 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC]](s224)
451 %0:_(s32) = COPY $vgpr0
452 %1:_(s224) = G_ANYEXT %0
453 S_ENDPGM 0, implicit %1
457 name: test_anyext_s32_to_s1024
462 ; CHECK-LABEL: name: test_anyext_s32_to_s1024
463 ; CHECK: liveins: $vgpr0
465 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
466 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
467 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[DEF]](s32)
468 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
469 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s1024) = G_MERGE_VALUES [[MV]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64)
470 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV1]](s1024)
471 %0:_(s32) = COPY $vgpr0
472 %1:_(s1024) = G_ANYEXT %0
473 S_ENDPGM 0, implicit %1
477 name: test_anyext_s64_to_s128
480 liveins: $vgpr0_vgpr1
482 ; CHECK-LABEL: name: test_anyext_s64_to_s128
483 ; CHECK: liveins: $vgpr0_vgpr1
485 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
486 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
487 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[COPY]](s64), [[DEF]](s64)
488 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV]](s128)
489 %0:_(s64) = COPY $vgpr0_vgpr1
490 %1:_(s128) = G_ANYEXT %0
491 S_ENDPGM 0, implicit %1
495 name: test_anyext_s64_to_s192
498 liveins: $vgpr0_vgpr1
500 ; CHECK-LABEL: name: test_anyext_s64_to_s192
501 ; CHECK: liveins: $vgpr0_vgpr1
503 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
504 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
505 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s192) = G_MERGE_VALUES [[COPY]](s64), [[DEF]](s64), [[DEF]](s64)
506 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV]](s192)
507 %0:_(s64) = COPY $vgpr0_vgpr1
508 %1:_(s192) = G_ANYEXT %0
509 S_ENDPGM 0, implicit %1
513 name: test_anyext_s64_to_s256
516 liveins: $vgpr0_vgpr1
518 ; CHECK-LABEL: name: test_anyext_s64_to_s256
519 ; CHECK: liveins: $vgpr0_vgpr1
521 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
522 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
523 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s256) = G_MERGE_VALUES [[COPY]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64)
524 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV]](s256)
525 %0:_(s64) = COPY $vgpr0_vgpr1
526 %1:_(s256) = G_ANYEXT %0
527 S_ENDPGM 0, implicit %1
531 name: test_anyext_s64_to_s512
534 liveins: $vgpr0_vgpr1
536 ; CHECK-LABEL: name: test_anyext_s64_to_s512
537 ; CHECK: liveins: $vgpr0_vgpr1
539 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
540 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
541 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s512) = G_MERGE_VALUES [[COPY]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64)
542 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV]](s512)
543 %0:_(s64) = COPY $vgpr0_vgpr1
544 %1:_(s512) = G_ANYEXT %0
545 S_ENDPGM 0, implicit %1
549 name: test_anyext_s64_to_s1024
552 liveins: $vgpr0_vgpr1
554 ; CHECK-LABEL: name: test_anyext_s64_to_s1024
555 ; CHECK: liveins: $vgpr0_vgpr1
557 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
558 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
559 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s1024) = G_MERGE_VALUES [[COPY]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64)
560 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV]](s1024)
561 %0:_(s64) = COPY $vgpr0_vgpr1
562 %1:_(s1024) = G_ANYEXT %0
563 S_ENDPGM 0, implicit %1
567 name: test_anyext_s96_to_s128
570 liveins: $vgpr0_vgpr1_vgpr2
572 ; CHECK-LABEL: name: test_anyext_s96_to_s128
573 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2
575 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2
576 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s96)
577 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
578 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[UV]](s32), [[UV1]](s32)
579 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[UV2]](s32), [[DEF]](s32)
580 ; CHECK-NEXT: [[MV2:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[MV]](s64), [[MV1]](s64)
581 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV2]](s128)
582 %0:_(s96) = COPY $vgpr0_vgpr1_vgpr2
583 %1:_(s128) = G_ANYEXT %0
584 S_ENDPGM 0, implicit %1
588 name: test_anyext_s128_to_s256
591 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
593 ; CHECK-LABEL: name: test_anyext_s128_to_s256
594 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
596 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
597 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](s128)
598 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
599 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s256) = G_MERGE_VALUES [[UV]](s64), [[UV1]](s64), [[DEF]](s64), [[DEF]](s64)
600 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV]](s256)
601 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
602 %1:_(s256) = G_ANYEXT %0
603 S_ENDPGM 0, implicit %1
607 name: test_anyext_s32_to_s88
612 ; CHECK-LABEL: name: test_anyext_s32_to_s88
613 ; CHECK: liveins: $vgpr0
615 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
616 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
617 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
618 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
619 ; CHECK-NEXT: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C1]](s32)
620 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
621 ; CHECK-NEXT: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C2]](s32)
622 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
623 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
624 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
625 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C3]]
626 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
627 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C3]]
628 ; CHECK-NEXT: [[C4:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
629 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C4]](s16)
630 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
631 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR1]](s32)
632 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C3]]
633 ; CHECK-NEXT: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR2]](s32)
634 ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s16) = G_SHL [[TRUNC3]], [[C4]](s16)
635 ; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND2]], [[SHL1]]
636 ; CHECK-NEXT: [[TRUNC4:%[0-9]+]]:_(s16) = G_TRUNC [[DEF]](s32)
637 ; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s16) = G_AND [[TRUNC4]], [[C3]]
638 ; CHECK-NEXT: [[SHL2:%[0-9]+]]:_(s16) = G_SHL [[AND3]], [[C4]](s16)
639 ; CHECK-NEXT: [[OR2:%[0-9]+]]:_(s16) = G_OR [[AND3]], [[SHL2]]
640 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s16) = COPY [[OR2]](s16)
641 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[OR]](s16)
642 ; CHECK-NEXT: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[OR1]](s16)
643 ; CHECK-NEXT: [[SHL3:%[0-9]+]]:_(s32) = G_SHL [[ZEXT1]], [[C1]](s32)
644 ; CHECK-NEXT: [[OR3:%[0-9]+]]:_(s32) = G_OR [[ZEXT]], [[SHL3]]
645 ; CHECK-NEXT: [[ZEXT2:%[0-9]+]]:_(s32) = G_ZEXT [[OR2]](s16)
646 ; CHECK-NEXT: [[ZEXT3:%[0-9]+]]:_(s32) = G_ZEXT [[COPY1]](s16)
647 ; CHECK-NEXT: [[SHL4:%[0-9]+]]:_(s32) = G_SHL [[ZEXT3]], [[C1]](s32)
648 ; CHECK-NEXT: [[OR4:%[0-9]+]]:_(s32) = G_OR [[ZEXT2]], [[SHL4]]
649 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[OR3]](s32), [[OR4]](s32)
650 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
651 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s704) = G_MERGE_VALUES [[MV]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64)
652 ; CHECK-NEXT: [[TRUNC5:%[0-9]+]]:_(s88) = G_TRUNC [[MV1]](s704)
653 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC5]](s88)
654 %0:_(s32) = COPY $vgpr0
655 %1:_(s88) = G_ANYEXT %0
656 S_ENDPGM 0, implicit %1
659 # The instruction count blows up for this and takes too long to
660 # generate checks. This fails on a G_MERGE_VALUES to s4160
663 # name: test_anyext_s32_to_s65
668 # %0:_(s32) = COPY $vgpr0
669 # %1:_(s65) = G_ANYEXT %0
670 # S_ENDPGM 0, implicit %1
674 name: test_anyext_s2_to_s112
679 ; CHECK-LABEL: name: test_anyext_s2_to_s112
680 ; CHECK: liveins: $vgpr0
682 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
683 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
684 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
685 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
686 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]]
687 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[LSHR]], [[C]](s32)
688 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
689 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
690 ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[C2]], [[C]](s32)
691 ; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s32) = G_OR [[C2]], [[SHL1]]
692 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[OR]](s32), [[OR1]](s32)
693 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
694 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s448) = G_MERGE_VALUES [[MV]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64)
695 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s112) = G_TRUNC [[MV1]](s448)
696 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC]](s112)
697 %0:_(s32) = COPY $vgpr0
698 %1:_(s2) = G_TRUNC %0
699 %2:_(s112) = G_ANYEXT %1
700 S_ENDPGM 0, implicit %2
704 name: test_anyext_s112_to_s128
707 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
708 ; CHECK-LABEL: name: test_anyext_s112_to_s128
709 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
711 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
712 ; CHECK-NEXT: S_ENDPGM 0, implicit [[COPY]](s128)
713 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
714 %1:_(s112) = G_TRUNC %0
715 %2:_(s128) = G_ANYEXT %1
716 S_ENDPGM 0, implicit %2