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: liveins: $vgpr0_vgpr1
13 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
14 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s64), 0
15 ; CHECK-NEXT: $vgpr0 = COPY [[EXTRACT]](s32)
16 %0:_(s64) = COPY $vgpr0_vgpr1
17 %1:_(s32) = G_EXTRACT %0, 0
21 name: test_extract_s32_s64_offset32
26 ; CHECK-LABEL: name: test_extract_s32_s64_offset32
27 ; CHECK: liveins: $vgpr0_vgpr1
29 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
30 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s64), 32
31 ; CHECK-NEXT: $vgpr0 = COPY [[EXTRACT]](s32)
32 %0:_(s64) = COPY $vgpr0_vgpr1
33 %1:_(s32) = G_EXTRACT %0, 32
38 name: test_extract_s8_s15_offset0
43 ; CHECK-LABEL: name: test_extract_s8_s15_offset0
44 ; CHECK: liveins: $vgpr0_vgpr1
46 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
47 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
48 ; CHECK-NEXT: $vgpr0 = COPY [[TRUNC]](s32)
49 %0:_(s64) = COPY $vgpr0_vgpr1
50 %1:_(s31) = G_TRUNC %0
51 %2:_(s8) = G_EXTRACT %1, 0
52 %3:_(s32) = G_ANYEXT %2
57 name: test_extract_s16_s31_offset0
62 ; CHECK-LABEL: name: test_extract_s16_s31_offset0
63 ; CHECK: liveins: $vgpr0_vgpr1
65 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
66 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
67 ; CHECK-NEXT: $vgpr0 = COPY [[TRUNC]](s32)
68 %0:_(s64) = COPY $vgpr0_vgpr1
69 %1:_(s31) = G_TRUNC %0
70 %2:_(s16) = G_EXTRACT %1, 0
71 %3:_(s32) = G_ANYEXT %2
76 name: test_extract_s32_s48_offset0
81 ; CHECK-LABEL: name: test_extract_s32_s48_offset0
82 ; CHECK: liveins: $vgpr0_vgpr1
84 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
85 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s64), 0
86 ; CHECK-NEXT: $vgpr0 = COPY [[EXTRACT]](s32)
87 %0:_(s64) = COPY $vgpr0_vgpr1
88 %1:_(s48) = G_TRUNC %0
89 %2:_(s32) = G_EXTRACT %1, 0
94 name: test_extract_s32_s96_offset0
97 liveins: $vgpr0_vgpr1_vgpr2
99 ; CHECK-LABEL: name: test_extract_s32_s96_offset0
100 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2
102 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2
103 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s96), 0
104 ; CHECK-NEXT: $vgpr0 = COPY [[EXTRACT]](s32)
105 %0:_(s96) = COPY $vgpr0_vgpr1_vgpr2
106 %1:_(s32) = G_EXTRACT %0, 0
110 name: test_extract_s32_s96_offset32
113 liveins: $vgpr0_vgpr1_vgpr2
115 ; CHECK-LABEL: name: test_extract_s32_s96_offset32
116 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2
118 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2
119 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s96), 32
120 ; CHECK-NEXT: $vgpr0 = COPY [[EXTRACT]](s32)
121 %0:_(s96) = COPY $vgpr0_vgpr1_vgpr2
122 %1:_(s32) = G_EXTRACT %0, 32
126 name: test_extract_s32_s96_offset64
129 liveins: $vgpr0_vgpr1_vgpr2
131 ; CHECK-LABEL: name: test_extract_s32_s96_offset64
132 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2
134 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2
135 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s96), 64
136 ; CHECK-NEXT: $vgpr0 = COPY [[EXTRACT]](s32)
137 %0:_(s96) = COPY $vgpr0_vgpr1_vgpr2
138 %1:_(s32) = G_EXTRACT %0, 64
142 name: test_extract_s32_s128_offset0
145 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
147 ; CHECK-LABEL: name: test_extract_s32_s128_offset0
148 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
150 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
151 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 0
152 ; CHECK-NEXT: $vgpr0 = COPY [[EXTRACT]](s32)
153 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
154 %1:_(s32) = G_EXTRACT %0, 0
158 name: test_extract_s32_s128_offset32
161 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
163 ; CHECK-LABEL: name: test_extract_s32_s128_offset32
164 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
166 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
167 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 32
168 ; CHECK-NEXT: $vgpr0 = COPY [[EXTRACT]](s32)
169 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
170 %1:_(s32) = G_EXTRACT %0, 32
174 name: test_extract_s32_s128_offset64
177 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
179 ; CHECK-LABEL: name: test_extract_s32_s128_offset64
180 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
182 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
183 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 64
184 ; CHECK-NEXT: $vgpr0 = COPY [[EXTRACT]](s32)
185 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
186 %1:_(s32) = G_EXTRACT %0, 64
190 name: test_extract_s32_s128_offset96
193 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
195 ; CHECK-LABEL: name: test_extract_s32_s128_offset96
196 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
198 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
199 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 96
200 ; CHECK-NEXT: $vgpr0 = COPY [[EXTRACT]](s32)
201 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
202 %1:_(s32) = G_EXTRACT %0, 96
207 name: test_extract_s32_v2s32_offset0
210 liveins: $vgpr0_vgpr1
212 ; CHECK-LABEL: name: test_extract_s32_v2s32_offset0
213 ; CHECK: liveins: $vgpr0_vgpr1
215 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
216 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
217 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
218 ; CHECK-NEXT: $vgpr0 = COPY [[COPY1]](s32)
219 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
220 %1:_(s32) = G_EXTRACT %0, 0
224 name: test_extract_s32_v2s32_offset32
227 liveins: $vgpr0_vgpr1
229 ; CHECK-LABEL: name: test_extract_s32_v2s32_offset32
230 ; CHECK: liveins: $vgpr0_vgpr1
232 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
233 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
234 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
235 ; CHECK-NEXT: $vgpr0 = COPY [[COPY1]](s32)
236 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
237 %1:_(s32) = G_EXTRACT %0, 32
241 name: test_extract_s32_v3s32_offset0
244 liveins: $vgpr0_vgpr1_vgpr2
246 ; CHECK-LABEL: name: test_extract_s32_v3s32_offset0
247 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2
249 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
250 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<3 x s32>)
251 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
252 ; CHECK-NEXT: $vgpr0 = COPY [[COPY1]](s32)
253 %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
254 %1:_(s32) = G_EXTRACT %0, 0
258 name: test_extract_s32_v3s32_offset32
261 liveins: $vgpr0_vgpr1_vgpr2
263 ; CHECK-LABEL: name: test_extract_s32_v3s32_offset32
264 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2
266 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
267 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<3 x s32>)
268 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY [[UV1]](s32)
269 ; CHECK-NEXT: $vgpr0 = COPY [[COPY1]](s32)
270 %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
271 %1:_(s32) = G_EXTRACT %0, 32
275 name: test_extract_s32_v3s32_offset64
278 liveins: $vgpr0_vgpr1_vgpr2
280 ; CHECK-LABEL: name: test_extract_s32_v3s32_offset64
281 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2
283 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
284 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<3 x s32>)
285 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY [[UV2]](s32)
286 ; CHECK-NEXT: $vgpr0 = COPY [[COPY1]](s32)
287 %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
288 %1:_(s32) = G_EXTRACT %0, 64
292 name: test_extract_s32_v4s32_offset0
295 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
297 ; CHECK-LABEL: name: test_extract_s32_v4s32_offset0
298 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
300 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
301 ; 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>)
302 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY [[UV]](s32)
303 ; CHECK-NEXT: $vgpr0 = COPY [[COPY1]](s32)
304 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
305 %1:_(s32) = G_EXTRACT %0, 0
309 name: test_extract_s32_v4s32_offset32
312 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
314 ; CHECK-LABEL: name: test_extract_s32_v4s32_offset32
315 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
317 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
318 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 32
319 ; CHECK-NEXT: $vgpr0 = COPY [[EXTRACT]](s32)
320 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
321 %1:_(s32) = G_EXTRACT %0, 32
325 name: test_extract_s32_v4s32_offset64
328 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
330 ; CHECK-LABEL: name: test_extract_s32_v4s32_offset64
331 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
333 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
334 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 64
335 ; CHECK-NEXT: $vgpr0 = COPY [[EXTRACT]](s32)
336 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
337 %1:_(s32) = G_EXTRACT %0, 64
341 name: test_extract_s32_v4s32_offset96
344 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
346 ; CHECK-LABEL: name: test_extract_s32_v4s32_offset96
347 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
349 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
350 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 96
351 ; CHECK-NEXT: $vgpr0 = COPY [[EXTRACT]](s32)
352 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
353 %1:_(s32) = G_EXTRACT %0, 96
357 name: test_extract_v2s32_v4s32_offset0
360 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
362 ; CHECK-LABEL: name: test_extract_v2s32_v4s32_offset0
363 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
365 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
366 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(<2 x s32>), [[UV1:%[0-9]+]]:_(<2 x s32>) = G_UNMERGE_VALUES [[COPY]](<4 x s32>)
367 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[UV]](<2 x s32>)
368 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
369 %1:_(<2 x s32>) = G_EXTRACT %0, 0
370 $vgpr0_vgpr1 = COPY %1
374 name: test_extract_v2s32_v4s32_offset32
377 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
379 ; CHECK-LABEL: name: test_extract_v2s32_v4s32_offset32
380 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
382 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
383 ; 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>)
384 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[UV1]](s32), [[UV2]](s32)
385 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
386 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
387 %1:_(<2 x s32>) = G_EXTRACT %0, 32
388 $vgpr0_vgpr1 = COPY %1
392 name: test_extract_v2s32_v4s32_offset64
395 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
397 ; CHECK-LABEL: name: test_extract_v2s32_v4s32_offset64
398 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
400 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
401 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(<2 x s32>), [[UV1:%[0-9]+]]:_(<2 x s32>) = G_UNMERGE_VALUES [[COPY]](<4 x s32>)
402 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[UV1]](<2 x s32>)
403 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
404 %1:_(<2 x s32>) = G_EXTRACT %0, 64
405 $vgpr0_vgpr1 = COPY %1
408 name: test_extract_s64_v4s32_offset0
411 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
413 ; CHECK-LABEL: name: test_extract_s64_v4s32_offset0
414 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
416 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
417 ; 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>)
418 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[UV]](s32), [[UV1]](s32)
419 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[MV]](s64)
420 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
421 %1:_(s64) = G_EXTRACT %0, 0
422 $vgpr0_vgpr1 = COPY %1
426 name: test_extract_s64_v4s32_offset32
429 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
431 ; CHECK-LABEL: name: test_extract_s64_v4s32_offset32
432 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
434 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
435 ; 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>)
436 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[UV1]](s32), [[UV2]](s32)
437 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[MV]](s64)
438 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
439 %1:_(s64) = G_EXTRACT %0, 32
440 $vgpr0_vgpr1 = COPY %1
444 name: test_extract_s64_v4s32_offset64
447 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
449 ; CHECK-LABEL: name: test_extract_s64_v4s32_offset64
450 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
452 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
453 ; 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>)
454 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[UV2]](s32), [[UV3]](s32)
455 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[MV]](s64)
456 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
457 %1:_(s64) = G_EXTRACT %0, 64
458 $vgpr0_vgpr1 = COPY %1
461 name: test_extract_p0_v4s32_offset0
464 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
466 ; CHECK-LABEL: name: test_extract_p0_v4s32_offset0
467 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
469 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
470 ; 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>)
471 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(p0) = G_MERGE_VALUES [[UV]](s32), [[UV1]](s32)
472 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[MV]](p0)
473 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
474 %1:_(p0) = G_EXTRACT %0, 0
475 $vgpr0_vgpr1 = COPY %1
479 name: test_extract_p0_v4s32_offset32
482 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
484 ; CHECK-LABEL: name: test_extract_p0_v4s32_offset32
485 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
487 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
488 ; 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>)
489 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(p0) = G_MERGE_VALUES [[UV1]](s32), [[UV2]](s32)
490 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[MV]](p0)
491 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
492 %1:_(p0) = G_EXTRACT %0, 32
493 $vgpr0_vgpr1 = COPY %1
497 name: test_extract_p0_v4s32_offset64
500 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
502 ; CHECK-LABEL: name: test_extract_p0_v4s32_offset64
503 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
505 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
506 ; 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>)
507 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(p0) = G_MERGE_VALUES [[UV2]](s32), [[UV3]](s32)
508 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[MV]](p0)
509 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
510 %1:_(p0) = G_EXTRACT %0, 64
511 $vgpr0_vgpr1 = COPY %1
515 name: extract_s8_v4s8_offset0
518 ; CHECK-LABEL: name: extract_s8_v4s8_offset0
519 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
520 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<4 x s32>)
521 ; CHECK-NEXT: $vgpr0 = COPY [[UV]](s32)
522 %0:_(<4 x s8>) = G_IMPLICIT_DEF
523 %1:_(s8) = G_EXTRACT %0, 0
524 %2:_(s32) = G_ANYEXT %1
529 name: extract_s8_v4s8_offset8
532 ; CHECK-LABEL: name: extract_s8_v4s8_offset8
533 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
534 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<4 x s32>)
535 ; CHECK-NEXT: $vgpr0 = COPY [[UV1]](s32)
536 %0:_(<4 x s8>) = G_IMPLICIT_DEF
537 %1:_(s8) = G_EXTRACT %0, 8
538 %2:_(s32) = G_ANYEXT %1
543 name: extract_s8_v4s8_offset16
546 ; CHECK-LABEL: name: extract_s8_v4s8_offset16
547 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
548 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<4 x s32>)
549 ; CHECK-NEXT: $vgpr0 = COPY [[UV2]](s32)
550 %0:_(<4 x s8>) = G_IMPLICIT_DEF
551 %1:_(s8) = G_EXTRACT %0, 16
552 %2:_(s32) = G_ANYEXT %1
557 name: extract_s8_v4s8_offset24
560 ; CHECK-LABEL: name: extract_s8_v4s8_offset24
561 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
562 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<4 x s32>)
563 ; CHECK-NEXT: $vgpr0 = COPY [[UV3]](s32)
564 %0:_(<4 x s8>) = G_IMPLICIT_DEF
565 %1:_(s8) = G_EXTRACT %0, 24
566 %2:_(s32) = G_ANYEXT %1
570 # FIXME: Leaves behind dead G_TRUNC
572 name: extract_s8_v3s8_offset16
575 ; CHECK-LABEL: name: extract_s8_v3s8_offset16
576 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
577 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<4 x s32>)
578 ; CHECK-NEXT: $vgpr0 = COPY [[UV2]](s32)
579 %0:_(<3 x s8>) = G_IMPLICIT_DEF
580 %1:_(s8) = G_EXTRACT %0, 16
581 %2:_(s32) = G_ANYEXT %1
586 name: extract_s8_v5s1_offset4
589 ; CHECK-LABEL: name: extract_s8_v5s1_offset4
590 ; CHECK: [[DEF:%[0-9]+]]:_(<5 x s32>) = G_IMPLICIT_DEF
591 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32), [[UV4:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<5 x s32>)
592 ; CHECK-NEXT: $vgpr0 = COPY [[UV4]](s32)
593 %0:_(<5 x s1>) = G_IMPLICIT_DEF
594 %1:_(s1) = G_EXTRACT %0, 4
595 %2:_(s32) = G_ANYEXT %1
600 name: extract_v2s16_v4s16_offset32
603 ; CHECK-LABEL: name: extract_v2s16_v4s16_offset32
604 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
605 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[DEF]](<4 x s16>)
606 ; CHECK-NEXT: $vgpr0 = COPY [[UV1]](<2 x s16>)
607 %0:_(<4 x s16>) = G_IMPLICIT_DEF
608 %1:_(<2 x s16>) = G_EXTRACT %0, 32
613 name: extract_v2s16_v6s16_offset32
616 ; CHECK-LABEL: name: extract_v2s16_v6s16_offset32
617 ; CHECK: [[DEF:%[0-9]+]]:_(<6 x s16>) = G_IMPLICIT_DEF
618 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>), [[UV2:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[DEF]](<6 x s16>)
619 ; CHECK-NEXT: $vgpr0 = COPY [[UV1]](<2 x s16>)
620 %0:_(<6 x s16>) = G_IMPLICIT_DEF
621 %1:_(<2 x s16>) = G_EXTRACT %0, 32
626 name: test_extract_s8_s16_offset0
630 ; CHECK-LABEL: name: test_extract_s8_s16_offset0
631 ; CHECK: liveins: $vgpr0
633 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
634 ; CHECK-NEXT: $vgpr0 = COPY [[COPY]](s32)
635 %0:_(s32) = COPY $vgpr0
636 %1:_(s16) = G_TRUNC %0
637 %2:_(s8) = G_EXTRACT %1, 0
638 %3:_(s32) = G_ANYEXT %2
643 name: test_extract_s8_s16_offset1
647 ; CHECK-LABEL: name: test_extract_s8_s16_offset1
648 ; CHECK: liveins: $vgpr0
650 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
651 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
652 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 1
653 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC]], [[C]](s16)
654 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR]](s16)
655 ; CHECK-NEXT: $vgpr0 = COPY [[ANYEXT]](s32)
656 %0:_(s32) = COPY $vgpr0
657 %1:_(s16) = G_TRUNC %0
658 %2:_(s8) = G_EXTRACT %1, 1
659 %3:_(s32) = G_ANYEXT %2
664 name: test_extract_s8_s16_offset8
668 ; CHECK-LABEL: name: test_extract_s8_s16_offset8
669 ; CHECK: liveins: $vgpr0
671 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
672 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
673 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
674 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC]], [[C]](s16)
675 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR]](s16)
676 ; CHECK-NEXT: $vgpr0 = COPY [[ANYEXT]](s32)
677 %0:_(s32) = COPY $vgpr0
678 %1:_(s16) = G_TRUNC %0
679 %2:_(s8) = G_EXTRACT %1, 8
680 %3:_(s32) = G_ANYEXT %2
685 name: test_extract_s8_s32_offset0
689 ; CHECK-LABEL: name: test_extract_s8_s32_offset0
690 ; CHECK: liveins: $vgpr0
692 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
693 ; CHECK-NEXT: $vgpr0 = COPY [[COPY]](s32)
694 %0:_(s32) = COPY $vgpr0
695 %1:_(s8) = G_EXTRACT %0, 0
696 %2:_(s32) = G_ANYEXT %1
701 name: test_extract_s8_s32_offset1
705 ; CHECK-LABEL: name: test_extract_s8_s32_offset1
706 ; CHECK: liveins: $vgpr0
708 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
709 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
710 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
711 ; CHECK-NEXT: $vgpr0 = COPY [[LSHR]](s32)
712 %0:_(s32) = COPY $vgpr0
713 %1:_(s8) = G_EXTRACT %0, 1
714 %2:_(s32) = G_ANYEXT %1
719 name: test_extract_s8_s32_offset8
723 ; CHECK-LABEL: name: test_extract_s8_s32_offset8
724 ; CHECK: liveins: $vgpr0
726 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
727 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
728 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
729 ; CHECK-NEXT: $vgpr0 = COPY [[LSHR]](s32)
730 %0:_(s32) = COPY $vgpr0
731 %1:_(s8) = G_EXTRACT %0, 8
732 %2:_(s32) = G_ANYEXT %1
737 name: test_extract_s8_s32_offset16
741 ; CHECK-LABEL: name: test_extract_s8_s32_offset16
742 ; CHECK: liveins: $vgpr0
744 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
745 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
746 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
747 ; CHECK-NEXT: $vgpr0 = COPY [[LSHR]](s32)
748 %0:_(s32) = COPY $vgpr0
749 %1:_(s8) = G_EXTRACT %0, 16
750 %2:_(s32) = G_ANYEXT %1
755 name: test_extract_s8_s32_offset24
759 ; CHECK-LABEL: name: test_extract_s8_s32_offset24
760 ; CHECK: liveins: $vgpr0
762 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
763 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
764 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
765 ; CHECK-NEXT: $vgpr0 = COPY [[LSHR]](s32)
766 %0:_(s32) = COPY $vgpr0
767 %1:_(s8) = G_EXTRACT %0, 16
768 %2:_(s32) = G_ANYEXT %1
773 name: test_extract_s8_p3_offset0
777 ; CHECK-LABEL: name: test_extract_s8_p3_offset0
778 ; CHECK: liveins: $vgpr0
780 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
781 ; CHECK-NEXT: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p3)
782 ; CHECK-NEXT: $vgpr0 = COPY [[PTRTOINT]](s32)
783 %0:_(p3) = COPY $vgpr0
784 %1:_(s8) = G_EXTRACT %0, 0
785 %2:_(s32) = G_ANYEXT %1
790 name: test_extract_s8_p3_offset8
794 ; CHECK-LABEL: name: test_extract_s8_p3_offset8
795 ; CHECK: liveins: $vgpr0
797 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
798 ; CHECK-NEXT: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p3)
799 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
800 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[PTRTOINT]], [[C]](s32)
801 ; CHECK-NEXT: $vgpr0 = COPY [[LSHR]](s32)
802 %0:_(p3) = COPY $vgpr0
803 %1:_(s8) = G_EXTRACT %0, 8
804 %2:_(s32) = G_ANYEXT %1
809 name: test_extract_s1_s8_offset0
813 ; CHECK-LABEL: name: test_extract_s1_s8_offset0
814 ; CHECK: liveins: $vgpr0
816 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
817 ; CHECK-NEXT: $vgpr0 = COPY [[COPY]](s32)
818 %0:_(s32) = COPY $vgpr0
819 %1:_(s8) = G_TRUNC %0
820 %2:_(s1) = G_EXTRACT %1, 0
821 %3:_(s32) = G_ANYEXT %2
826 name: test_extract_s1_s8_offset2
830 ; CHECK-LABEL: name: test_extract_s1_s8_offset2
831 ; CHECK: liveins: $vgpr0
833 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
834 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
835 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 2
836 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC]], [[C]](s16)
837 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR]](s16)
838 ; CHECK-NEXT: $vgpr0 = COPY [[ANYEXT]](s32)
839 %0:_(s32) = COPY $vgpr0
840 %1:_(s8) = G_TRUNC %0
841 %2:_(s1) = G_EXTRACT %1, 2
842 %3:_(s32) = G_ANYEXT %2
847 name: test_extract_s8_s64_offset2
850 liveins: $vgpr0_vgpr1
851 ; CHECK-LABEL: name: test_extract_s8_s64_offset2
852 ; CHECK: liveins: $vgpr0_vgpr1
854 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
855 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
856 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY]], [[C]](s32)
857 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[LSHR]](s64)
858 ; CHECK-NEXT: $vgpr0 = COPY [[TRUNC]](s32)
859 %0:_(s64) = COPY $vgpr0_vgpr1
860 %1:_(s8) = G_EXTRACT %0, 2
861 %2:_(s32) = G_ANYEXT %1
866 name: extract_s16_v3s16_offset0
870 ; CHECK-LABEL: name: extract_s16_v3s16_offset0
871 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
872 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[DEF]](<4 x s16>)
873 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[UV]](<2 x s16>)
874 ; CHECK-NEXT: $vgpr0 = COPY [[BITCAST]](s32)
875 %0:_(<3 x s16>) = G_IMPLICIT_DEF
876 %1:_(s16) = G_EXTRACT %0, 0
877 %2:_(s32) = G_ANYEXT %1
882 name: test_extract_s8_s64_offset16
885 liveins: $vgpr0_vgpr1
886 ; CHECK-LABEL: name: test_extract_s8_s64_offset16
887 ; CHECK: liveins: $vgpr0_vgpr1
889 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
890 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
891 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY]], [[C]](s32)
892 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[LSHR]](s64)
893 ; CHECK-NEXT: $vgpr0 = COPY [[TRUNC]](s32)
894 %0:_(s64) = COPY $vgpr0_vgpr1
895 %1:_(s8) = G_EXTRACT %0, 16
896 %2:_(s32) = G_ANYEXT %1
901 name: test_extract_s16_s64_offset16
904 liveins: $vgpr0_vgpr1
905 ; CHECK-LABEL: name: test_extract_s16_s64_offset16
906 ; CHECK: liveins: $vgpr0_vgpr1
908 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
909 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[COPY]](s64), 16
910 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16)
911 ; CHECK-NEXT: $vgpr0 = COPY [[ANYEXT]](s32)
912 %0:_(s64) = COPY $vgpr0_vgpr1
913 %1:_(s16) = G_EXTRACT %0, 16
914 %2:_(s32) = G_ANYEXT %1
919 name: test_extract_s16_s64_offset32
922 liveins: $vgpr0_vgpr1
923 ; CHECK-LABEL: name: test_extract_s16_s64_offset32
924 ; CHECK: liveins: $vgpr0_vgpr1
926 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
927 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[COPY]](s64), 32
928 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16)
929 ; CHECK-NEXT: $vgpr0 = COPY [[ANYEXT]](s32)
930 %0:_(s64) = COPY $vgpr0_vgpr1
931 %1:_(s16) = G_EXTRACT %0, 32
932 %2:_(s32) = G_ANYEXT %1
937 name: test_extract_s16_s64_offset48
940 liveins: $vgpr0_vgpr1
941 ; CHECK-LABEL: name: test_extract_s16_s64_offset48
942 ; CHECK: liveins: $vgpr0_vgpr1
944 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
945 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[COPY]](s64), 48
946 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16)
947 ; CHECK-NEXT: $vgpr0 = COPY [[ANYEXT]](s32)
948 %0:_(s64) = COPY $vgpr0_vgpr1
949 %1:_(s16) = G_EXTRACT %0, 48
950 %2:_(s32) = G_ANYEXT %1
955 name: extract_v2s16_v3s16_offset0
959 ; CHECK-LABEL: name: extract_v2s16_v3s16_offset0
960 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
961 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[DEF]](<4 x s16>)
962 ; CHECK-NEXT: $vgpr0 = COPY [[UV]](<2 x s16>)
963 %0:_(<3 x s16>) = G_IMPLICIT_DEF
964 %1:_(<2 x s16>) = G_EXTRACT %0, 0
969 name: extract_v2s16_v5s16_offset0
973 ; CHECK-LABEL: name: extract_v2s16_v5s16_offset0
974 ; CHECK: [[DEF:%[0-9]+]]:_(<6 x s16>) = G_IMPLICIT_DEF
975 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>), [[UV2:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[DEF]](<6 x s16>)
976 ; CHECK-NEXT: $vgpr0 = COPY [[UV]](<2 x s16>)
977 %0:_(<5 x s16>) = G_IMPLICIT_DEF
978 %1:_(<2 x s16>) = G_EXTRACT %0, 0
983 name: extract_s16_v2s16_offset0
988 ; CHECK-LABEL: name: extract_s16_v2s16_offset0
989 ; CHECK: liveins: $vgpr0
991 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
992 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
993 ; CHECK-NEXT: $vgpr0 = COPY [[BITCAST]](s32)
994 %0:_(<2 x s16>) = COPY $vgpr0
995 %1:_(s16) = G_EXTRACT %0, 0
996 %2:_(s32) = G_ANYEXT %1
1001 name: extract_s16_v2s16_offset1
1006 ; CHECK-LABEL: name: extract_s16_v2s16_offset1
1007 ; CHECK: liveins: $vgpr0
1008 ; CHECK-NEXT: {{ $}}
1009 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
1010 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
1011 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
1012 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
1013 ; CHECK-NEXT: $vgpr0 = COPY [[LSHR]](s32)
1014 %0:_(<2 x s16>) = COPY $vgpr0
1015 %1:_(s16) = G_EXTRACT %0, 1
1016 %2:_(s32) = G_ANYEXT %1
1021 name: extract_s16_v2s16_offset8
1026 ; CHECK-LABEL: name: extract_s16_v2s16_offset8
1027 ; CHECK: liveins: $vgpr0
1028 ; CHECK-NEXT: {{ $}}
1029 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
1030 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
1031 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
1032 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
1033 ; CHECK-NEXT: $vgpr0 = COPY [[LSHR]](s32)
1034 %0:_(<2 x s16>) = COPY $vgpr0
1035 %1:_(s16) = G_EXTRACT %0, 8
1036 %2:_(s32) = G_ANYEXT %1
1041 name: extract_s16_v2s16_offset16
1046 ; CHECK-LABEL: name: extract_s16_v2s16_offset16
1047 ; CHECK: liveins: $vgpr0
1048 ; CHECK-NEXT: {{ $}}
1049 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
1050 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
1051 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
1052 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
1053 ; CHECK-NEXT: $vgpr0 = COPY [[LSHR]](s32)
1054 %0:_(<2 x s16>) = COPY $vgpr0
1055 %1:_(s16) = G_EXTRACT %0, 16
1056 %2:_(s32) = G_ANYEXT %1
1061 name: extract_s16_s32_offset0
1066 ; CHECK-LABEL: name: extract_s16_s32_offset0
1067 ; CHECK: liveins: $vgpr0
1068 ; CHECK-NEXT: {{ $}}
1069 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
1070 ; CHECK-NEXT: $vgpr0 = COPY [[COPY]](s32)
1071 %0:_(s32) = COPY $vgpr0
1072 %1:_(s16) = G_EXTRACT %0, 0
1073 %2:_(s32) = G_ANYEXT %1
1078 name: extract_s16_s32_offset1
1083 ; CHECK-LABEL: name: extract_s16_s32_offset1
1084 ; CHECK: liveins: $vgpr0
1085 ; CHECK-NEXT: {{ $}}
1086 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
1087 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
1088 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
1089 ; CHECK-NEXT: $vgpr0 = COPY [[LSHR]](s32)
1090 %0:_(s32) = COPY $vgpr0
1091 %1:_(s16) = G_EXTRACT %0, 1
1092 %2:_(s32) = G_ANYEXT %1
1097 name: extract_s16_s32_offset8
1102 ; CHECK-LABEL: name: extract_s16_s32_offset8
1103 ; CHECK: liveins: $vgpr0
1104 ; CHECK-NEXT: {{ $}}
1105 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
1106 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
1107 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
1108 ; CHECK-NEXT: $vgpr0 = COPY [[LSHR]](s32)
1109 %0:_(s32) = COPY $vgpr0
1110 %1:_(s16) = G_EXTRACT %0, 8
1111 %2:_(s32) = G_ANYEXT %1
1116 name: extract_s16_s32_offset16
1121 ; CHECK-LABEL: name: extract_s16_s32_offset16
1122 ; CHECK: liveins: $vgpr0
1123 ; CHECK-NEXT: {{ $}}
1124 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
1125 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
1126 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
1127 ; CHECK-NEXT: $vgpr0 = COPY [[LSHR]](s32)
1128 %0:_(s32) = COPY $vgpr0
1129 %1:_(s16) = G_EXTRACT %0, 16
1130 %2:_(s32) = G_ANYEXT %1
1135 name: extract_s16_p3_offset0
1140 ; CHECK-LABEL: name: extract_s16_p3_offset0
1141 ; CHECK: liveins: $vgpr0
1142 ; CHECK-NEXT: {{ $}}
1143 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
1144 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[COPY]](p3), 0
1145 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16)
1146 ; CHECK-NEXT: $vgpr0 = COPY [[ANYEXT]](s32)
1147 %0:_(p3) = COPY $vgpr0
1148 %1:_(s16) = G_EXTRACT %0, 0
1149 %2:_(s32) = G_ANYEXT %1
1154 name: extract_s16_p3_offset1
1159 ; CHECK-LABEL: name: extract_s16_p3_offset1
1160 ; CHECK: liveins: $vgpr0
1161 ; CHECK-NEXT: {{ $}}
1162 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
1163 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[COPY]](p3), 1
1164 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16)
1165 ; CHECK-NEXT: $vgpr0 = COPY [[ANYEXT]](s32)
1166 %0:_(p3) = COPY $vgpr0
1167 %1:_(s16) = G_EXTRACT %0, 1
1168 %2:_(s32) = G_ANYEXT %1