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: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
12 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[COPY]](s32)
13 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[ANYEXT]](s64)
14 %0:_(s32) = COPY $vgpr0
15 %1:_(s64) = G_ANYEXT %0
16 $vgpr0_vgpr1 = COPY %1
20 name: test_anyext_s16_to_s64
25 ; CHECK-LABEL: name: test_anyext_s16_to_s64
26 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
27 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[COPY]](s32)
28 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[ANYEXT]](s64)
29 %0:_(s32) = COPY $vgpr0
30 %1:_(s16) = G_TRUNC %0
31 %2:_(s64) = G_ANYEXT %1
32 $vgpr0_vgpr1 = COPY %2
36 name: test_anyext_s16_to_s32
41 ; CHECK-LABEL: name: test_anyext_s16_to_s32
42 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
43 ; CHECK-NEXT: $vgpr0 = COPY [[COPY]](s32)
44 %0:_(s32) = COPY $vgpr0
45 %1:_(s16) = G_TRUNC %0
46 %2:_(s32) = G_ANYEXT %1
51 name: test_anyext_s24_to_s32
56 ; CHECK-LABEL: name: test_anyext_s24_to_s32
57 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
58 ; CHECK-NEXT: $vgpr0 = COPY [[COPY]](s32)
59 %0:_(s32) = COPY $vgpr0
60 %1:_(s24) = G_TRUNC %0
61 %2:_(s32) = G_ANYEXT %1
66 name: test_anyext_s1_to_s32
70 ; CHECK-LABEL: name: test_anyext_s1_to_s32
71 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
72 ; CHECK-NEXT: $vgpr0 = COPY [[C]](s32)
73 %0:_(s1) = G_CONSTANT i1 0
74 %1:_(s32) = G_ANYEXT %0
79 name: test_anyext_s1_to_s64
83 ; CHECK-LABEL: name: test_anyext_s1_to_s64
84 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
85 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[C]](s64)
86 %0:_(s1) = G_CONSTANT i1 0
87 %1:_(s64) = G_ANYEXT %0
88 $vgpr0_vgpr1 = COPY %1
92 name: test_anyext_v2s16_to_v2s32
97 ; CHECK-LABEL: name: test_anyext_v2s16_to_v2s32
98 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
99 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
100 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
101 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
102 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[BITCAST]](s32), [[LSHR]](s32)
103 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
104 %0:_(<2 x s16>) = COPY $vgpr0
105 %1:_(<2 x s32>) = G_ANYEXT %0
106 $vgpr0_vgpr1 = COPY %1
110 name: test_anyext_v3s16_to_v3s32
113 liveins: $vgpr0_vgpr1
115 ; CHECK-LABEL: name: test_anyext_v3s16_to_v3s32
116 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr0_vgpr1
117 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY]](<4 x s16>)
118 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[UV]](<2 x s16>)
119 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
120 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
121 ; CHECK-NEXT: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[UV1]](<2 x s16>)
122 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[BITCAST]](s32), [[LSHR]](s32), [[BITCAST1]](s32)
123 ; CHECK-NEXT: $vgpr0_vgpr1_vgpr2 = COPY [[BUILD_VECTOR]](<3 x s32>)
124 %0:_(<4 x s16>) = COPY $vgpr0_vgpr1
125 %1:_(<3 x s16>) = G_EXTRACT %0, 0
126 %2:_(<3 x s32>) = G_ANYEXT %1
127 $vgpr0_vgpr1_vgpr2 = COPY %2
131 name: test_anyext_v4s16_to_v4s32
136 ; CHECK-LABEL: name: test_anyext_v4s16_to_v4s32
137 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
138 ; CHECK-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[DEF]](<4 x s32>)
139 %0:_(<4 x s16>) = G_IMPLICIT_DEF
140 %1:_(<4 x s32>) = G_ANYEXT %0
141 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
145 name: test_anyext_v2s32_to_v2s64
148 liveins: $vgpr0_vgpr1
150 ; CHECK-LABEL: name: test_anyext_v2s32_to_v2s64
151 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
152 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
153 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[UV]](s32)
154 ; CHECK-NEXT: [[ANYEXT1:%[0-9]+]]:_(s64) = G_ANYEXT [[UV1]](s32)
155 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[ANYEXT]](s64), [[ANYEXT1]](s64)
156 ; CHECK-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x s64>)
157 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
158 %1:_(<2 x s64>) = G_ANYEXT %0
159 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
163 name: test_anyext_v3s32_to_v3s64
166 liveins: $vgpr0_vgpr1_vgpr2
168 ; CHECK-LABEL: name: test_anyext_v3s32_to_v3s64
169 ; CHECK: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
170 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<3 x s32>)
171 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[UV]](s32)
172 ; CHECK-NEXT: [[ANYEXT1:%[0-9]+]]:_(s64) = G_ANYEXT [[UV1]](s32)
173 ; CHECK-NEXT: [[ANYEXT2:%[0-9]+]]:_(s64) = G_ANYEXT [[UV2]](s32)
174 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<3 x s64>) = G_BUILD_VECTOR [[ANYEXT]](s64), [[ANYEXT1]](s64), [[ANYEXT2]](s64)
175 ; CHECK-NEXT: S_NOP 0, implicit [[BUILD_VECTOR]](<3 x s64>)
176 %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
177 %1:_(<3 x s64>) = G_ANYEXT %0
183 name: test_anyext_v4s32_to_v4s64
186 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
188 ; CHECK-LABEL: name: test_anyext_v4s32_to_v4s64
189 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
190 ; 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>)
191 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[UV]](s32)
192 ; CHECK-NEXT: [[ANYEXT1:%[0-9]+]]:_(s64) = G_ANYEXT [[UV1]](s32)
193 ; CHECK-NEXT: [[ANYEXT2:%[0-9]+]]:_(s64) = G_ANYEXT [[UV2]](s32)
194 ; CHECK-NEXT: [[ANYEXT3:%[0-9]+]]:_(s64) = G_ANYEXT [[UV3]](s32)
195 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s64>) = G_BUILD_VECTOR [[ANYEXT]](s64), [[ANYEXT1]](s64), [[ANYEXT2]](s64), [[ANYEXT3]](s64)
196 ; CHECK-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY [[BUILD_VECTOR]](<4 x s64>)
197 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
198 %1:_(<4 x s64>) = G_ANYEXT %0
199 $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY %1
203 name: test_anyext_s8_to_s16
208 ; CHECK-LABEL: name: test_anyext_s8_to_s16
209 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
210 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
211 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC]](s16)
212 %0:_(s32) = COPY $vgpr0
213 %1:_(s8) = G_TRUNC %0
214 %2:_(s16) = G_ANYEXT %1
215 S_ENDPGM 0, implicit %2
219 name: test_anyext_s8_to_s24
224 ; CHECK-LABEL: name: test_anyext_s8_to_s24
225 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
226 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s24) = G_TRUNC [[COPY]](s32)
227 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC]](s24)
228 %0:_(s32) = COPY $vgpr0
229 %1:_(s8) = G_TRUNC %0
230 %2:_(s24) = G_ANYEXT %1
231 S_ENDPGM 0, implicit %2
235 name: test_anyext_s7_to_s32
240 ; CHECK-LABEL: name: test_anyext_s7_to_s32
241 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
242 ; CHECK-NEXT: S_ENDPGM 0, implicit [[COPY]](s32)
243 %0:_(s32) = COPY $vgpr0
244 %1:_(s7) = G_TRUNC %0
245 %2:_(s32) = G_ANYEXT %1
246 S_ENDPGM 0, implicit %2
250 name: test_anyext_s8_to_s32
255 ; CHECK-LABEL: name: test_anyext_s8_to_s32
256 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
257 ; CHECK-NEXT: S_ENDPGM 0, implicit [[COPY]](s32)
258 %0:_(s32) = COPY $vgpr0
259 %1:_(s8) = G_TRUNC %0
260 %2:_(s32) = G_ANYEXT %1
261 S_ENDPGM 0, implicit %2
265 name: test_anyext_s32_to_s96
270 ; CHECK-LABEL: name: test_anyext_s32_to_s96
271 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
272 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
273 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[DEF]](s32)
274 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
275 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s192) = G_MERGE_VALUES [[MV]](s64), [[DEF1]](s64), [[DEF1]](s64)
276 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s96) = G_TRUNC [[MV1]](s192)
277 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC]](s96)
278 %0:_(s32) = COPY $vgpr0
279 %1:_(s96) = G_ANYEXT %0
280 S_ENDPGM 0, implicit %1
284 name: test_anyext_s32_to_s128
289 ; CHECK-LABEL: name: test_anyext_s32_to_s128
290 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
291 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
292 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[DEF]](s32)
293 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
294 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[MV]](s64), [[DEF1]](s64)
295 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV1]](s128)
296 %0:_(s32) = COPY $vgpr0
297 %1:_(s128) = G_ANYEXT %0
298 S_ENDPGM 0, implicit %1
302 name: test_anyext_s32_to_s160
307 ; CHECK-LABEL: name: test_anyext_s32_to_s160
308 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
309 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
310 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[DEF]](s32)
311 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
312 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s320) = G_MERGE_VALUES [[MV]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64)
313 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s160) = G_TRUNC [[MV1]](s320)
314 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC]](s160)
315 %0:_(s32) = COPY $vgpr0
316 %1:_(s160) = G_ANYEXT %0
317 S_ENDPGM 0, implicit %1
321 name: test_anyext_s32_to_s192
326 ; CHECK-LABEL: name: test_anyext_s32_to_s192
327 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
328 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
329 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[DEF]](s32)
330 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
331 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s192) = G_MERGE_VALUES [[MV]](s64), [[DEF1]](s64), [[DEF1]](s64)
332 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV1]](s192)
333 %0:_(s32) = COPY $vgpr0
334 %1:_(s192) = G_ANYEXT %0
335 S_ENDPGM 0, implicit %1
339 name: test_anyext_s32_to_s224
344 ; CHECK-LABEL: name: test_anyext_s32_to_s224
345 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
346 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
347 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[DEF]](s32)
348 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
349 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s448) = G_MERGE_VALUES [[MV]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64)
350 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s224) = G_TRUNC [[MV1]](s448)
351 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC]](s224)
352 %0:_(s32) = COPY $vgpr0
353 %1:_(s224) = G_ANYEXT %0
354 S_ENDPGM 0, implicit %1
358 name: test_anyext_s32_to_s256
363 ; CHECK-LABEL: name: test_anyext_s32_to_s256
364 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
365 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
366 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[DEF]](s32)
367 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
368 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s256) = G_MERGE_VALUES [[MV]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64)
369 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV1]](s256)
370 %0:_(s32) = COPY $vgpr0
371 %1:_(s256) = G_ANYEXT %0
372 S_ENDPGM 0, implicit %1
376 name: test_anyext_s32_to_s512
381 ; CHECK-LABEL: name: test_anyext_s32_to_s512
382 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
383 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
384 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[DEF]](s32)
385 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
386 ; 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)
387 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV1]](s512)
388 %0:_(s32) = COPY $vgpr0
389 %1:_(s512) = G_ANYEXT %0
390 S_ENDPGM 0, implicit %1
394 name: test_anyext_s32_to_s992
399 ; CHECK-LABEL: name: test_anyext_s32_to_s992
400 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
401 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
402 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[DEF]](s32)
403 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
404 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s448) = G_MERGE_VALUES [[MV]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64), [[DEF1]](s64)
405 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s224) = G_TRUNC [[MV1]](s448)
406 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC]](s224)
407 %0:_(s32) = COPY $vgpr0
408 %1:_(s224) = G_ANYEXT %0
409 S_ENDPGM 0, implicit %1
413 name: test_anyext_s32_to_s1024
418 ; CHECK-LABEL: name: test_anyext_s32_to_s1024
419 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
420 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
421 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[DEF]](s32)
422 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
423 ; 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)
424 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV1]](s1024)
425 %0:_(s32) = COPY $vgpr0
426 %1:_(s1024) = G_ANYEXT %0
427 S_ENDPGM 0, implicit %1
431 name: test_anyext_s64_to_s128
434 liveins: $vgpr0_vgpr1
436 ; CHECK-LABEL: name: test_anyext_s64_to_s128
437 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
438 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
439 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[COPY]](s64), [[DEF]](s64)
440 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV]](s128)
441 %0:_(s64) = COPY $vgpr0_vgpr1
442 %1:_(s128) = G_ANYEXT %0
443 S_ENDPGM 0, implicit %1
447 name: test_anyext_s64_to_s192
450 liveins: $vgpr0_vgpr1
452 ; CHECK-LABEL: name: test_anyext_s64_to_s192
453 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
454 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
455 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s192) = G_MERGE_VALUES [[COPY]](s64), [[DEF]](s64), [[DEF]](s64)
456 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV]](s192)
457 %0:_(s64) = COPY $vgpr0_vgpr1
458 %1:_(s192) = G_ANYEXT %0
459 S_ENDPGM 0, implicit %1
463 name: test_anyext_s64_to_s256
466 liveins: $vgpr0_vgpr1
468 ; CHECK-LABEL: name: test_anyext_s64_to_s256
469 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
470 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
471 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s256) = G_MERGE_VALUES [[COPY]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64)
472 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV]](s256)
473 %0:_(s64) = COPY $vgpr0_vgpr1
474 %1:_(s256) = G_ANYEXT %0
475 S_ENDPGM 0, implicit %1
479 name: test_anyext_s64_to_s512
482 liveins: $vgpr0_vgpr1
484 ; CHECK-LABEL: name: test_anyext_s64_to_s512
485 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
486 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
487 ; 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)
488 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV]](s512)
489 %0:_(s64) = COPY $vgpr0_vgpr1
490 %1:_(s512) = G_ANYEXT %0
491 S_ENDPGM 0, implicit %1
495 name: test_anyext_s64_to_s1024
498 liveins: $vgpr0_vgpr1
500 ; CHECK-LABEL: name: test_anyext_s64_to_s1024
501 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
502 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
503 ; 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)
504 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV]](s1024)
505 %0:_(s64) = COPY $vgpr0_vgpr1
506 %1:_(s1024) = G_ANYEXT %0
507 S_ENDPGM 0, implicit %1
511 name: test_anyext_s96_to_s128
514 liveins: $vgpr0_vgpr1_vgpr2
516 ; CHECK-LABEL: name: test_anyext_s96_to_s128
517 ; CHECK: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2
518 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s96)
519 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
520 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[UV]](s32), [[UV1]](s32)
521 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[UV2]](s32), [[DEF]](s32)
522 ; CHECK-NEXT: [[MV2:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[MV]](s64), [[MV1]](s64)
523 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV2]](s128)
524 %0:_(s96) = COPY $vgpr0_vgpr1_vgpr2
525 %1:_(s128) = G_ANYEXT %0
526 S_ENDPGM 0, implicit %1
530 name: test_anyext_s128_to_s256
533 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
535 ; CHECK-LABEL: name: test_anyext_s128_to_s256
536 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
537 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](s128)
538 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
539 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s256) = G_MERGE_VALUES [[UV]](s64), [[UV1]](s64), [[DEF]](s64), [[DEF]](s64)
540 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV]](s256)
541 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
542 %1:_(s256) = G_ANYEXT %0
543 S_ENDPGM 0, implicit %1
547 name: test_anyext_s32_to_s88
552 ; CHECK-LABEL: name: test_anyext_s32_to_s88
553 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
554 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
555 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
556 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
557 ; CHECK-NEXT: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C1]](s32)
558 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
559 ; CHECK-NEXT: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C2]](s32)
560 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
561 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
562 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
563 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C3]]
564 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
565 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[C3]]
566 ; CHECK-NEXT: [[C4:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
567 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C4]](s16)
568 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]]
569 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR1]](s32)
570 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C3]]
571 ; CHECK-NEXT: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR2]](s32)
572 ; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s16) = G_AND [[TRUNC3]], [[C3]]
573 ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s16) = G_SHL [[AND3]], [[C4]](s16)
574 ; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND2]], [[SHL1]]
575 ; CHECK-NEXT: [[TRUNC4:%[0-9]+]]:_(s16) = G_TRUNC [[DEF]](s32)
576 ; CHECK-NEXT: [[AND4:%[0-9]+]]:_(s16) = G_AND [[TRUNC4]], [[C3]]
577 ; CHECK-NEXT: [[SHL2:%[0-9]+]]:_(s16) = G_SHL [[AND4]], [[C4]](s16)
578 ; CHECK-NEXT: [[OR2:%[0-9]+]]:_(s16) = G_OR [[AND4]], [[SHL2]]
579 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s16) = COPY [[OR2]](s16)
580 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[OR]](s16)
581 ; CHECK-NEXT: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[OR1]](s16)
582 ; CHECK-NEXT: [[SHL3:%[0-9]+]]:_(s32) = G_SHL [[ZEXT1]], [[C1]](s32)
583 ; CHECK-NEXT: [[OR3:%[0-9]+]]:_(s32) = G_OR [[ZEXT]], [[SHL3]]
584 ; CHECK-NEXT: [[ZEXT2:%[0-9]+]]:_(s32) = G_ZEXT [[OR2]](s16)
585 ; CHECK-NEXT: [[ZEXT3:%[0-9]+]]:_(s32) = G_ZEXT [[COPY1]](s16)
586 ; CHECK-NEXT: [[SHL4:%[0-9]+]]:_(s32) = G_SHL [[ZEXT3]], [[C1]](s32)
587 ; CHECK-NEXT: [[OR4:%[0-9]+]]:_(s32) = G_OR [[ZEXT2]], [[SHL4]]
588 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[OR3]](s32), [[OR4]](s32)
589 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
590 ; 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)
591 ; CHECK-NEXT: [[TRUNC5:%[0-9]+]]:_(s88) = G_TRUNC [[MV1]](s704)
592 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC5]](s88)
593 %0:_(s32) = COPY $vgpr0
594 %1:_(s88) = G_ANYEXT %0
595 S_ENDPGM 0, implicit %1
598 # The instruction count blows up for this and takes too long to
599 # generate checks. This fails on a G_MERGE_VALUES to s4160
602 # name: test_anyext_s32_to_s65
607 # %0:_(s32) = COPY $vgpr0
608 # %1:_(s65) = G_ANYEXT %0
609 # S_ENDPGM 0, implicit %1
613 name: test_anyext_s2_to_s112
618 ; CHECK-LABEL: name: test_anyext_s2_to_s112
619 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
620 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
621 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
622 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
623 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]]
624 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[LSHR]], [[C1]]
625 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C]](s32)
626 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
627 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
628 ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[C2]], [[C]](s32)
629 ; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s32) = G_OR [[C2]], [[SHL1]]
630 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[OR]](s32), [[OR1]](s32)
631 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
632 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s448) = G_MERGE_VALUES [[MV]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64), [[DEF]](s64)
633 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s112) = G_TRUNC [[MV1]](s448)
634 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC]](s112)
635 %0:_(s32) = COPY $vgpr0
636 %1:_(s2) = G_TRUNC %0
637 %2:_(s112) = G_ANYEXT %1
638 S_ENDPGM 0, implicit %2
642 name: test_anyext_s112_to_s128
645 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
646 ; CHECK-LABEL: name: test_anyext_s112_to_s128
647 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
648 ; CHECK-NEXT: S_ENDPGM 0, implicit [[COPY]](s128)
649 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
650 %1:_(s112) = G_TRUNC %0
651 %2:_(s128) = G_ANYEXT %1
652 S_ENDPGM 0, implicit %2