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 -global-isel-abort=0 %s -o - | FileCheck %s
5 name: test_extract_s32_s64_offset0
10 ; CHECK-LABEL: name: test_extract_s32_s64_offset0
11 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
12 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s64), 0
13 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
14 %0:_(s64) = COPY $vgpr0_vgpr1
15 %1:_(s32) = G_EXTRACT %0, 0
19 name: test_extract_s32_s64_offset32
24 ; CHECK-LABEL: name: test_extract_s32_s64_offset32
25 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
26 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s64), 32
27 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
28 %0:_(s64) = COPY $vgpr0_vgpr1
29 %1:_(s32) = G_EXTRACT %0, 32
34 name: test_extract_s8_s15_offset0
39 ; CHECK-LABEL: name: test_extract_s8_s15_offset0
40 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
41 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
42 ; CHECK: $vgpr0 = COPY [[TRUNC]](s32)
43 %0:_(s64) = COPY $vgpr0_vgpr1
44 %1:_(s31) = G_TRUNC %0
45 %2:_(s8) = G_EXTRACT %1, 0
46 %3:_(s32) = G_ANYEXT %2
51 name: test_extract_s16_s31_offset0
56 ; CHECK-LABEL: name: test_extract_s16_s31_offset0
57 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
58 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
59 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[TRUNC]](s32)
60 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
61 %0:_(s64) = COPY $vgpr0_vgpr1
62 %1:_(s31) = G_TRUNC %0
63 %2:_(s16) = G_EXTRACT %1, 0
64 %3:_(s32) = G_ANYEXT %2
69 name: test_extract_s32_s48_offset0
74 ; CHECK-LABEL: name: test_extract_s32_s48_offset0
75 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
76 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY [[COPY]](s64)
77 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY1]](s64), 0
78 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
79 %0:_(s64) = COPY $vgpr0_vgpr1
80 %1:_(s48) = G_TRUNC %0
81 %2:_(s32) = G_EXTRACT %1, 0
86 name: test_extract_s32_s96_offset0
89 liveins: $vgpr0_vgpr1_vgpr2
91 ; CHECK-LABEL: name: test_extract_s32_s96_offset0
92 ; CHECK: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2
93 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s96), 0
94 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
95 %0:_(s96) = COPY $vgpr0_vgpr1_vgpr2
96 %1:_(s32) = G_EXTRACT %0, 0
100 name: test_extract_s32_s96_offset32
103 liveins: $vgpr0_vgpr1_vgpr2
105 ; CHECK-LABEL: name: test_extract_s32_s96_offset32
106 ; CHECK: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2
107 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s96), 32
108 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
109 %0:_(s96) = COPY $vgpr0_vgpr1_vgpr2
110 %1:_(s32) = G_EXTRACT %0, 32
114 name: test_extract_s32_s96_offset64
117 liveins: $vgpr0_vgpr1_vgpr2
119 ; CHECK-LABEL: name: test_extract_s32_s96_offset64
120 ; CHECK: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2
121 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s96), 64
122 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
123 %0:_(s96) = COPY $vgpr0_vgpr1_vgpr2
124 %1:_(s32) = G_EXTRACT %0, 64
128 name: test_extract_s32_s128_offset0
131 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
133 ; CHECK-LABEL: name: test_extract_s32_s128_offset0
134 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
135 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 0
136 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
137 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
138 %1:_(s32) = G_EXTRACT %0, 0
142 name: test_extract_s32_s128_offset32
145 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
147 ; CHECK-LABEL: name: test_extract_s32_s128_offset32
148 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
149 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 32
150 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
151 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
152 %1:_(s32) = G_EXTRACT %0, 32
156 name: test_extract_s32_s128_offset64
159 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
161 ; CHECK-LABEL: name: test_extract_s32_s128_offset64
162 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
163 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 64
164 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
165 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
166 %1:_(s32) = G_EXTRACT %0, 64
170 name: test_extract_s32_s128_offset96
173 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
175 ; CHECK-LABEL: name: test_extract_s32_s128_offset96
176 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
177 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 96
178 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
179 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
180 %1:_(s32) = G_EXTRACT %0, 96
185 name: test_extract_s32_v2s32_offset0
188 liveins: $vgpr0_vgpr1
190 ; CHECK-LABEL: name: test_extract_s32_v2s32_offset0
191 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
192 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](<2 x s32>), 0
193 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
194 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
195 %1:_(s32) = G_EXTRACT %0, 0
199 name: test_extract_s32_v2s32_offset32
202 liveins: $vgpr0_vgpr1
204 ; CHECK-LABEL: name: test_extract_s32_v2s32_offset32
205 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
206 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](<2 x s32>), 32
207 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
208 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
209 %1:_(s32) = G_EXTRACT %0, 32
213 name: test_extract_s32_v3s32_offset0
216 liveins: $vgpr0_vgpr1_vgpr2
218 ; CHECK-LABEL: name: test_extract_s32_v3s32_offset0
219 ; CHECK: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
220 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](<3 x s32>), 0
221 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
222 %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
223 %1:_(s32) = G_EXTRACT %0, 0
227 name: test_extract_s32_v3s32_offset32
230 liveins: $vgpr0_vgpr1_vgpr2
232 ; CHECK-LABEL: name: test_extract_s32_v3s32_offset32
233 ; CHECK: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
234 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](<3 x s32>), 32
235 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
236 %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
237 %1:_(s32) = G_EXTRACT %0, 32
241 name: test_extract_s32_v3s32_offset64
244 liveins: $vgpr0_vgpr1_vgpr2
246 ; CHECK-LABEL: name: test_extract_s32_v3s32_offset64
247 ; CHECK: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
248 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](<3 x s32>), 64
249 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
250 %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
251 %1:_(s32) = G_EXTRACT %0, 64
255 name: test_extract_s32_v4s32_offset0
258 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
260 ; CHECK-LABEL: name: test_extract_s32_v4s32_offset0
261 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
262 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](<4 x s32>), 0
263 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
264 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
265 %1:_(s32) = G_EXTRACT %0, 0
269 name: test_extract_s32_v4s32_offset32
272 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
274 ; CHECK-LABEL: name: test_extract_s32_v4s32_offset32
275 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
276 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 32
277 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
278 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
279 %1:_(s32) = G_EXTRACT %0, 32
283 name: test_extract_s32_v4s32_offset64
286 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
288 ; CHECK-LABEL: name: test_extract_s32_v4s32_offset64
289 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
290 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 64
291 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
292 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
293 %1:_(s32) = G_EXTRACT %0, 64
297 name: test_extract_s32_v4s32_offset96
300 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
302 ; CHECK-LABEL: name: test_extract_s32_v4s32_offset96
303 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
304 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 96
305 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32)
306 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
307 %1:_(s32) = G_EXTRACT %0, 96
311 name: test_extract_v2s32_v4s32_offset0
314 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
316 ; CHECK-LABEL: name: test_extract_v2s32_v4s32_offset0
317 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
318 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<2 x s32>) = G_EXTRACT [[COPY]](<4 x s32>), 0
319 ; CHECK: $vgpr0_vgpr1 = COPY [[EXTRACT]](<2 x s32>)
320 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
321 %1:_(<2 x s32>) = G_EXTRACT %0, 0
322 $vgpr0_vgpr1 = COPY %1
326 name: test_extract_v2s32_v4s32_offset32
329 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
331 ; CHECK-LABEL: name: test_extract_v2s32_v4s32_offset32
332 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
333 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<2 x s32>) = G_EXTRACT [[COPY]](<4 x s32>), 32
334 ; CHECK: $vgpr0_vgpr1 = COPY [[EXTRACT]](<2 x s32>)
335 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
336 %1:_(<2 x s32>) = G_EXTRACT %0, 32
337 $vgpr0_vgpr1 = COPY %1
341 name: test_extract_v2s32_v4s32_offset64
344 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
346 ; CHECK-LABEL: name: test_extract_v2s32_v4s32_offset64
347 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
348 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<2 x s32>) = G_EXTRACT [[COPY]](<4 x s32>), 64
349 ; CHECK: $vgpr0_vgpr1 = COPY [[EXTRACT]](<2 x s32>)
350 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
351 %1:_(<2 x s32>) = G_EXTRACT %0, 64
352 $vgpr0_vgpr1 = COPY %1
355 name: test_extract_s64_v4s32_offset0
358 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
360 ; CHECK-LABEL: name: test_extract_s64_v4s32_offset0
361 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
362 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s64) = G_EXTRACT [[COPY]](<4 x s32>), 0
363 ; CHECK: $vgpr0_vgpr1 = COPY [[EXTRACT]](s64)
364 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
365 %1:_(s64) = G_EXTRACT %0, 0
366 $vgpr0_vgpr1 = COPY %1
370 name: test_extract_s64_v4s32_offset32
373 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
375 ; CHECK-LABEL: name: test_extract_s64_v4s32_offset32
376 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
377 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s64) = G_EXTRACT [[COPY]](<4 x s32>), 32
378 ; CHECK: $vgpr0_vgpr1 = COPY [[EXTRACT]](s64)
379 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
380 %1:_(s64) = G_EXTRACT %0, 32
381 $vgpr0_vgpr1 = COPY %1
385 name: test_extract_s64_v4s32_offset64
388 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
390 ; CHECK-LABEL: name: test_extract_s64_v4s32_offset64
391 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
392 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s64) = G_EXTRACT [[COPY]](<4 x s32>), 64
393 ; CHECK: $vgpr0_vgpr1 = COPY [[EXTRACT]](s64)
394 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
395 %1:_(s64) = G_EXTRACT %0, 64
396 $vgpr0_vgpr1 = COPY %1
399 name: test_extract_p0_v4s32_offset0
402 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
404 ; CHECK-LABEL: name: test_extract_p0_v4s32_offset0
405 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
406 ; CHECK: [[EXTRACT:%[0-9]+]]:_(p0) = G_EXTRACT [[COPY]](<4 x s32>), 0
407 ; CHECK: $vgpr0_vgpr1 = COPY [[EXTRACT]](p0)
408 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
409 %1:_(p0) = G_EXTRACT %0, 0
410 $vgpr0_vgpr1 = COPY %1
414 name: test_extract_p0_v4s32_offset32
417 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
419 ; CHECK-LABEL: name: test_extract_p0_v4s32_offset32
420 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
421 ; CHECK: [[EXTRACT:%[0-9]+]]:_(p0) = G_EXTRACT [[COPY]](<4 x s32>), 32
422 ; CHECK: $vgpr0_vgpr1 = COPY [[EXTRACT]](p0)
423 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
424 %1:_(p0) = G_EXTRACT %0, 32
425 $vgpr0_vgpr1 = COPY %1
429 name: test_extract_p0_v4s32_offset64
432 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
434 ; CHECK-LABEL: name: test_extract_p0_v4s32_offset64
435 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
436 ; CHECK: [[EXTRACT:%[0-9]+]]:_(p0) = G_EXTRACT [[COPY]](<4 x s32>), 64
437 ; CHECK: $vgpr0_vgpr1 = COPY [[EXTRACT]](p0)
438 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
439 %1:_(p0) = G_EXTRACT %0, 64
440 $vgpr0_vgpr1 = COPY %1
444 name: extract_s8_v4s8_offset0
447 ; CHECK-LABEL: name: extract_s8_v4s8_offset0
448 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
449 ; CHECK: [[TRUNC:%[0-9]+]]:_(<4 x s16>) = G_TRUNC [[DEF]](<4 x s32>)
450 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[TRUNC]](<4 x s16>), 0
451 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16)
452 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
453 %0:_(<4 x s8>) = G_IMPLICIT_DEF
454 %1:_(s8) = G_EXTRACT %0, 0
455 %2:_(s32) = G_ANYEXT %1
460 name: extract_s8_v4s8_offset8
463 ; CHECK-LABEL: name: extract_s8_v4s8_offset8
464 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
465 ; CHECK: [[TRUNC:%[0-9]+]]:_(<4 x s16>) = G_TRUNC [[DEF]](<4 x s32>)
466 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[TRUNC]](<4 x s16>), 16
467 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16)
468 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
469 %0:_(<4 x s8>) = G_IMPLICIT_DEF
470 %1:_(s8) = G_EXTRACT %0, 8
471 %2:_(s32) = G_ANYEXT %1
476 name: extract_s8_v4s8_offset16
479 ; CHECK-LABEL: name: extract_s8_v4s8_offset16
480 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
481 ; CHECK: [[TRUNC:%[0-9]+]]:_(<4 x s16>) = G_TRUNC [[DEF]](<4 x s32>)
482 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[TRUNC]](<4 x s16>), 32
483 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16)
484 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
485 %0:_(<4 x s8>) = G_IMPLICIT_DEF
486 %1:_(s8) = G_EXTRACT %0, 16
487 %2:_(s32) = G_ANYEXT %1
492 name: extract_s8_v4s8_offset24
495 ; CHECK-LABEL: name: extract_s8_v4s8_offset24
496 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
497 ; CHECK: [[TRUNC:%[0-9]+]]:_(<4 x s16>) = G_TRUNC [[DEF]](<4 x s32>)
498 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[TRUNC]](<4 x s16>), 48
499 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16)
500 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
501 %0:_(<4 x s8>) = G_IMPLICIT_DEF
502 %1:_(s8) = G_EXTRACT %0, 24
503 %2:_(s32) = G_ANYEXT %1
508 name: extract_s8_v3s8_offset16
511 ; CHECK-LABEL: name: extract_s8_v3s8_offset16
512 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
513 ; CHECK: [[TRUNC:%[0-9]+]]:_(<4 x s8>) = G_TRUNC [[DEF]](<4 x s32>)
514 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<3 x s8>) = G_EXTRACT [[TRUNC]](<4 x s8>), 0
515 ; CHECK: [[UV:%[0-9]+]]:_(s8), [[UV1:%[0-9]+]]:_(s8), [[UV2:%[0-9]+]]:_(s8) = G_UNMERGE_VALUES [[EXTRACT]](<3 x s8>)
516 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s16) = G_ANYEXT [[UV]](s8)
517 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s16) = G_ANYEXT [[UV1]](s8)
518 ; CHECK: [[ANYEXT2:%[0-9]+]]:_(s16) = G_ANYEXT [[UV2]](s8)
519 ; CHECK: [[DEF1:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
520 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR [[ANYEXT]](s16), [[ANYEXT1]](s16)
521 ; CHECK: [[BUILD_VECTOR1:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR [[ANYEXT2]](s16), [[DEF1]](s16)
522 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s16>) = G_CONCAT_VECTORS [[BUILD_VECTOR]](<2 x s16>), [[BUILD_VECTOR1]](<2 x s16>)
523 ; CHECK: [[EXTRACT1:%[0-9]+]]:_(<3 x s16>) = G_EXTRACT [[CONCAT_VECTORS]](<4 x s16>), 0
524 ; CHECK: [[DEF2:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
525 ; CHECK: [[INSERT:%[0-9]+]]:_(<4 x s16>) = G_INSERT [[DEF2]], [[EXTRACT1]](<3 x s16>), 0
526 ; CHECK: [[EXTRACT2:%[0-9]+]]:_(s16) = G_EXTRACT [[INSERT]](<4 x s16>), 32
527 ; CHECK: [[ANYEXT3:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT2]](s16)
528 ; CHECK: $vgpr0 = COPY [[ANYEXT3]](s32)
529 %0:_(<3 x s8>) = G_IMPLICIT_DEF
530 %1:_(s8) = G_EXTRACT %0, 16
531 %2:_(s32) = G_ANYEXT %1
536 name: extract_s8_v5s1_offset4
539 ; CHECK-LABEL: name: extract_s8_v5s1_offset4
540 ; CHECK: [[DEF:%[0-9]+]]:_(<6 x s32>) = G_IMPLICIT_DEF
541 ; CHECK: [[TRUNC:%[0-9]+]]:_(<6 x s1>) = G_TRUNC [[DEF]](<6 x s32>)
542 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<5 x s1>) = G_EXTRACT [[TRUNC]](<6 x s1>), 0
543 ; CHECK: [[UV:%[0-9]+]]:_(s1), [[UV1:%[0-9]+]]:_(s1), [[UV2:%[0-9]+]]:_(s1), [[UV3:%[0-9]+]]:_(s1), [[UV4:%[0-9]+]]:_(s1) = G_UNMERGE_VALUES [[EXTRACT]](<5 x s1>)
544 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s16) = G_ANYEXT [[UV]](s1)
545 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s16) = G_ANYEXT [[UV1]](s1)
546 ; CHECK: [[ANYEXT2:%[0-9]+]]:_(s16) = G_ANYEXT [[UV2]](s1)
547 ; CHECK: [[ANYEXT3:%[0-9]+]]:_(s16) = G_ANYEXT [[UV3]](s1)
548 ; CHECK: [[ANYEXT4:%[0-9]+]]:_(s16) = G_ANYEXT [[UV4]](s1)
549 ; CHECK: [[DEF1:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
550 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR [[ANYEXT]](s16), [[ANYEXT1]](s16)
551 ; CHECK: [[BUILD_VECTOR1:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR [[ANYEXT2]](s16), [[ANYEXT3]](s16)
552 ; CHECK: [[BUILD_VECTOR2:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR [[ANYEXT4]](s16), [[DEF1]](s16)
553 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<6 x s16>) = G_CONCAT_VECTORS [[BUILD_VECTOR]](<2 x s16>), [[BUILD_VECTOR1]](<2 x s16>), [[BUILD_VECTOR2]](<2 x s16>)
554 ; CHECK: [[EXTRACT1:%[0-9]+]]:_(<5 x s16>) = G_EXTRACT [[CONCAT_VECTORS]](<6 x s16>), 0
555 ; CHECK: [[DEF2:%[0-9]+]]:_(<6 x s32>) = G_IMPLICIT_DEF
556 ; CHECK: [[TRUNC1:%[0-9]+]]:_(<6 x s16>) = G_TRUNC [[DEF2]](<6 x s32>)
557 ; CHECK: [[INSERT:%[0-9]+]]:_(<6 x s16>) = G_INSERT [[TRUNC1]], [[EXTRACT1]](<5 x s16>), 0
558 ; CHECK: [[EXTRACT2:%[0-9]+]]:_(s16) = G_EXTRACT [[INSERT]](<6 x s16>), 64
559 ; CHECK: [[ANYEXT5:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT2]](s16)
560 ; CHECK: $vgpr0 = COPY [[ANYEXT5]](s32)
561 %0:_(<5 x s1>) = G_IMPLICIT_DEF
562 %1:_(s1) = G_EXTRACT %0, 4
563 %2:_(s32) = G_ANYEXT %1
568 name: extract_v2s16_v4s16_offset32
571 ; CHECK-LABEL: name: extract_v2s16_v4s16_offset32
572 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
573 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<2 x s16>) = G_EXTRACT [[DEF]](<4 x s16>), 32
574 ; CHECK: $vgpr0 = COPY [[EXTRACT]](<2 x s16>)
575 %0:_(<4 x s16>) = G_IMPLICIT_DEF
576 %1:_(<2 x s16>) = G_EXTRACT %0, 32
581 name: extract_v2s16_v6s16_offset32
584 ; CHECK-LABEL: name: extract_v2s16_v6s16_offset32
585 ; CHECK: [[DEF:%[0-9]+]]:_(<6 x s32>) = G_IMPLICIT_DEF
586 ; CHECK: [[TRUNC:%[0-9]+]]:_(<6 x s16>) = G_TRUNC [[DEF]](<6 x s32>)
587 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<2 x s16>) = G_EXTRACT [[TRUNC]](<6 x s16>), 32
588 ; CHECK: $vgpr0 = COPY [[EXTRACT]](<2 x s16>)
589 %0:_(<6 x s16>) = G_IMPLICIT_DEF
590 %1:_(<2 x s16>) = G_EXTRACT %0, 32
595 name: test_extract_s8_s16_offset0
599 ; CHECK-LABEL: name: test_extract_s8_s16_offset0
600 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
601 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
602 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
603 %0:_(s32) = COPY $vgpr0
604 %1:_(s16) = G_TRUNC %0
605 %2:_(s8) = G_EXTRACT %1, 0
606 %3:_(s32) = G_ANYEXT %2
611 name: test_extract_s8_s16_offset1
615 ; CHECK-LABEL: name: test_extract_s8_s16_offset1
616 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
617 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
618 ; CHECK: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 1
619 ; CHECK: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC]], [[C]](s16)
620 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR]](s16)
621 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
622 %0:_(s32) = COPY $vgpr0
623 %1:_(s16) = G_TRUNC %0
624 %2:_(s8) = G_EXTRACT %1, 1
625 %3:_(s32) = G_ANYEXT %2
630 name: test_extract_s8_s16_offset8
634 ; CHECK-LABEL: name: test_extract_s8_s16_offset8
635 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
636 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
637 ; CHECK: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
638 ; CHECK: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC]], [[C]](s16)
639 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR]](s16)
640 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
641 %0:_(s32) = COPY $vgpr0
642 %1:_(s16) = G_TRUNC %0
643 %2:_(s8) = G_EXTRACT %1, 8
644 %3:_(s32) = G_ANYEXT %2
649 name: test_extract_s8_s32_offset0
653 ; CHECK-LABEL: name: test_extract_s8_s32_offset0
654 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
655 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
656 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
657 %0:_(s32) = COPY $vgpr0
658 %1:_(s8) = G_EXTRACT %0, 0
659 %2:_(s32) = G_ANYEXT %1
664 name: test_extract_s8_s32_offset1
668 ; CHECK-LABEL: name: test_extract_s8_s32_offset1
669 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
670 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
671 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
672 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
673 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
674 %0:_(s32) = COPY $vgpr0
675 %1:_(s8) = G_EXTRACT %0, 1
676 %2:_(s32) = G_ANYEXT %1
681 name: test_extract_s8_s32_offset8
685 ; CHECK-LABEL: name: test_extract_s8_s32_offset8
686 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
687 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
688 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
689 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
690 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
691 %0:_(s32) = COPY $vgpr0
692 %1:_(s8) = G_EXTRACT %0, 8
693 %2:_(s32) = G_ANYEXT %1
698 name: test_extract_s8_s32_offset16
702 ; CHECK-LABEL: name: test_extract_s8_s32_offset16
703 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
704 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
705 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
706 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
707 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
708 %0:_(s32) = COPY $vgpr0
709 %1:_(s8) = G_EXTRACT %0, 16
710 %2:_(s32) = G_ANYEXT %1
715 name: test_extract_s8_s32_offset24
719 ; CHECK-LABEL: name: test_extract_s8_s32_offset24
720 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
721 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
722 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
723 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
724 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
725 %0:_(s32) = COPY $vgpr0
726 %1:_(s8) = G_EXTRACT %0, 16
727 %2:_(s32) = G_ANYEXT %1
732 name: test_extract_s8_p3_offset0
736 ; CHECK-LABEL: name: test_extract_s8_p3_offset0
737 ; CHECK: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
738 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p3)
739 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[PTRTOINT]](s32)
740 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
741 %0:_(p3) = COPY $vgpr0
742 %1:_(s8) = G_EXTRACT %0, 0
743 %2:_(s32) = G_ANYEXT %1
748 name: test_extract_s8_p3_offset8
752 ; CHECK-LABEL: name: test_extract_s8_p3_offset8
753 ; CHECK: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
754 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p3)
755 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
756 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[PTRTOINT]], [[C]](s32)
757 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
758 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
759 %0:_(p3) = COPY $vgpr0
760 %1:_(s8) = G_EXTRACT %0, 8
761 %2:_(s32) = G_ANYEXT %1
766 name: test_extract_s1_s8_offset0
770 ; CHECK-LABEL: name: test_extract_s1_s8_offset0
771 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
772 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
773 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
774 %0:_(s32) = COPY $vgpr0
775 %1:_(s8) = G_TRUNC %0
776 %2:_(s1) = G_EXTRACT %1, 0
777 %3:_(s32) = G_ANYEXT %2
782 name: test_extract_s1_s8_offset2
786 ; CHECK-LABEL: name: test_extract_s1_s8_offset2
787 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
788 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
789 ; CHECK: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 2
790 ; CHECK: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC]], [[C]](s16)
791 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR]](s16)
792 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
793 %0:_(s32) = COPY $vgpr0
794 %1:_(s8) = G_TRUNC %0
795 %2:_(s1) = G_EXTRACT %1, 2
796 %3:_(s32) = G_ANYEXT %2
801 name: test_extract_s8_s64_offset2
804 liveins: $vgpr0_vgpr1
805 ; CHECK-LABEL: name: test_extract_s8_s64_offset2
806 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
807 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
808 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[C]](s64)
809 ; CHECK: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY]], [[TRUNC]](s32)
810 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[LSHR]](s64)
811 ; CHECK: $vgpr0 = COPY [[TRUNC1]](s32)
812 %0:_(s64) = COPY $vgpr0_vgpr1
813 %1:_(s8) = G_EXTRACT %0, 2
814 %2:_(s32) = G_ANYEXT %1
819 name: extract_s16_v3s16_offset0
823 ; CHECK-LABEL: name: extract_s16_v3s16_offset0
824 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
825 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<3 x s16>) = G_EXTRACT [[DEF]](<4 x s16>), 0
826 ; CHECK: [[DEF1:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
827 ; CHECK: [[INSERT:%[0-9]+]]:_(<4 x s16>) = G_INSERT [[DEF1]], [[EXTRACT]](<3 x s16>), 0
828 ; CHECK: [[EXTRACT1:%[0-9]+]]:_(s16) = G_EXTRACT [[INSERT]](<4 x s16>), 0
829 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT1]](s16)
830 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
831 %0:_(<3 x s16>) = G_IMPLICIT_DEF
832 %1:_(s16) = G_EXTRACT %0, 0
833 %2:_(s32) = G_ANYEXT %1
838 name: test_extract_s8_s64_offset16
841 liveins: $vgpr0_vgpr1
842 ; CHECK-LABEL: name: test_extract_s8_s64_offset16
843 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
844 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
845 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[C]](s64)
846 ; CHECK: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY]], [[TRUNC]](s32)
847 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[LSHR]](s64)
848 ; CHECK: $vgpr0 = COPY [[TRUNC1]](s32)
849 %0:_(s64) = COPY $vgpr0_vgpr1
850 %1:_(s8) = G_EXTRACT %0, 16
851 %2:_(s32) = G_ANYEXT %1
856 name: test_extract_s16_s64_offset16
859 liveins: $vgpr0_vgpr1
860 ; CHECK-LABEL: name: test_extract_s16_s64_offset16
861 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
862 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[COPY]](s64), 16
863 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16)
864 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
865 %0:_(s64) = COPY $vgpr0_vgpr1
866 %1:_(s16) = G_EXTRACT %0, 16
867 %2:_(s32) = G_ANYEXT %1
872 name: test_extract_s16_s64_offset32
875 liveins: $vgpr0_vgpr1
876 ; CHECK-LABEL: name: test_extract_s16_s64_offset32
877 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
878 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[COPY]](s64), 32
879 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16)
880 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
881 %0:_(s64) = COPY $vgpr0_vgpr1
882 %1:_(s16) = G_EXTRACT %0, 32
883 %2:_(s32) = G_ANYEXT %1
888 name: test_extract_s16_s64_offset48
891 liveins: $vgpr0_vgpr1
892 ; CHECK-LABEL: name: test_extract_s16_s64_offset48
893 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
894 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[COPY]](s64), 48
895 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16)
896 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
897 %0:_(s64) = COPY $vgpr0_vgpr1
898 %1:_(s16) = G_EXTRACT %0, 48
899 %2:_(s32) = G_ANYEXT %1
904 name: extract_v2s16_v3s16_offset0
908 ; CHECK-LABEL: name: extract_v2s16_v3s16_offset0
909 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
910 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<3 x s16>) = G_EXTRACT [[DEF]](<4 x s16>), 0
911 ; CHECK: [[DEF1:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
912 ; CHECK: [[INSERT:%[0-9]+]]:_(<4 x s16>) = G_INSERT [[DEF1]], [[EXTRACT]](<3 x s16>), 0
913 ; CHECK: [[EXTRACT1:%[0-9]+]]:_(<2 x s16>) = G_EXTRACT [[INSERT]](<4 x s16>), 0
914 ; CHECK: $vgpr0 = COPY [[EXTRACT1]](<2 x s16>)
915 %0:_(<3 x s16>) = G_IMPLICIT_DEF
916 %1:_(<2 x s16>) = G_EXTRACT %0, 0
921 name: extract_v2s16_v5s16_offset0
925 ; CHECK-LABEL: name: extract_v2s16_v5s16_offset0
926 ; CHECK: [[DEF:%[0-9]+]]:_(<6 x s32>) = G_IMPLICIT_DEF
927 ; CHECK: [[TRUNC:%[0-9]+]]:_(<6 x s16>) = G_TRUNC [[DEF]](<6 x s32>)
928 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<5 x s16>) = G_EXTRACT [[TRUNC]](<6 x s16>), 0
929 ; CHECK: [[DEF1:%[0-9]+]]:_(<6 x s32>) = G_IMPLICIT_DEF
930 ; CHECK: [[TRUNC1:%[0-9]+]]:_(<6 x s16>) = G_TRUNC [[DEF1]](<6 x s32>)
931 ; CHECK: [[INSERT:%[0-9]+]]:_(<6 x s16>) = G_INSERT [[TRUNC1]], [[EXTRACT]](<5 x s16>), 0
932 ; CHECK: [[EXTRACT1:%[0-9]+]]:_(<2 x s16>) = G_EXTRACT [[INSERT]](<6 x s16>), 0
933 ; CHECK: $vgpr0 = COPY [[EXTRACT1]](<2 x s16>)
934 %0:_(<5 x s16>) = G_IMPLICIT_DEF
935 %1:_(<2 x s16>) = G_EXTRACT %0, 0
940 name: extract_s16_v2s16_offset0
945 ; CHECK-LABEL: name: extract_s16_v2s16_offset0
946 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
947 ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
948 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32)
949 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
950 %0:_(<2 x s16>) = COPY $vgpr0
951 %1:_(s16) = G_EXTRACT %0, 0
952 %2:_(s32) = G_ANYEXT %1
957 name: extract_s16_v2s16_offset1
962 ; CHECK-LABEL: name: extract_s16_v2s16_offset1
963 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
964 ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
965 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
966 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
967 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
968 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
969 %0:_(<2 x s16>) = COPY $vgpr0
970 %1:_(s16) = G_EXTRACT %0, 1
971 %2:_(s32) = G_ANYEXT %1
976 name: extract_s16_v2s16_offset8
981 ; CHECK-LABEL: name: extract_s16_v2s16_offset8
982 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
983 ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
984 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
985 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
986 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
987 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
988 %0:_(<2 x s16>) = COPY $vgpr0
989 %1:_(s16) = G_EXTRACT %0, 8
990 %2:_(s32) = G_ANYEXT %1
995 name: extract_s16_v2s16_offset16
1000 ; CHECK-LABEL: name: extract_s16_v2s16_offset16
1001 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
1002 ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
1003 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
1004 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
1005 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
1006 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
1007 %0:_(<2 x s16>) = COPY $vgpr0
1008 %1:_(s16) = G_EXTRACT %0, 16
1009 %2:_(s32) = G_ANYEXT %1
1014 name: extract_s16_s32_offset0
1019 ; CHECK-LABEL: name: extract_s16_s32_offset0
1020 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
1021 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
1022 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
1023 %0:_(s32) = COPY $vgpr0
1024 %1:_(s16) = G_EXTRACT %0, 0
1025 %2:_(s32) = G_ANYEXT %1
1030 name: extract_s16_s32_offset1
1035 ; CHECK-LABEL: name: extract_s16_s32_offset1
1036 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
1037 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
1038 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
1039 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
1040 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
1041 %0:_(s32) = COPY $vgpr0
1042 %1:_(s16) = G_EXTRACT %0, 1
1043 %2:_(s32) = G_ANYEXT %1
1048 name: extract_s16_s32_offset8
1053 ; CHECK-LABEL: name: extract_s16_s32_offset8
1054 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
1055 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
1056 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
1057 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
1058 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
1059 %0:_(s32) = COPY $vgpr0
1060 %1:_(s16) = G_EXTRACT %0, 8
1061 %2:_(s32) = G_ANYEXT %1
1066 name: extract_s16_s32_offset16
1071 ; CHECK-LABEL: name: extract_s16_s32_offset16
1072 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
1073 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
1074 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
1075 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
1076 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
1077 %0:_(s32) = COPY $vgpr0
1078 %1:_(s16) = G_EXTRACT %0, 16
1079 %2:_(s32) = G_ANYEXT %1
1084 name: extract_s16_p3_offset0
1089 ; CHECK-LABEL: name: extract_s16_p3_offset0
1090 ; CHECK: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
1091 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[COPY]](p3), 0
1092 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16)
1093 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
1094 %0:_(p3) = COPY $vgpr0
1095 %1:_(s16) = G_EXTRACT %0, 0
1096 %2:_(s32) = G_ANYEXT %1
1101 name: extract_s16_p3_offset1
1106 ; CHECK-LABEL: name: extract_s16_p3_offset1
1107 ; CHECK: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
1108 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[COPY]](p3), 1
1109 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16)
1110 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
1111 %0:_(p3) = COPY $vgpr0
1112 %1:_(s16) = G_EXTRACT %0, 1
1113 %2:_(s32) = G_ANYEXT %1