1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve,+bf16 < %s | FileCheck %s --check-prefixes=CHECK
4 ; Extracting illegal subvectors
6 define <vscale x 1 x i32> @extract_nxv1i32_nxv4i32(<vscale x 4 x i32> %vec) nounwind {
7 ; CHECK-LABEL: extract_nxv1i32_nxv4i32:
10 %retval = call <vscale x 1 x i32> @llvm.vector.extract.nxv1i32.nxv4i32(<vscale x 4 x i32> %vec, i64 0)
11 ret <vscale x 1 x i32> %retval
14 define <vscale x 1 x i16> @extract_nxv1i16_nxv6i16(<vscale x 6 x i16> %vec) nounwind {
15 ; CHECK-LABEL: extract_nxv1i16_nxv6i16:
18 %retval = call <vscale x 1 x i16> @llvm.vector.extract.nxv1i16.nxv6i16(<vscale x 6 x i16> %vec, i64 0)
19 ret <vscale x 1 x i16> %retval
22 declare <vscale x 1 x i32> @llvm.vector.extract.nxv1i32.nxv4i32(<vscale x 4 x i32>, i64)
23 declare <vscale x 1 x i16> @llvm.vector.extract.nxv1i16.nxv6i16(<vscale x 6 x i16>, i64)
26 ; Extract half i1 vector that needs promotion from legal type.
28 define <vscale x 8 x i1> @extract_nxv8i1_nxv16i1_0(<vscale x 16 x i1> %in) {
29 ; CHECK-LABEL: extract_nxv8i1_nxv16i1_0:
31 ; CHECK-NEXT: punpklo p0.h, p0.b
33 %res = call <vscale x 8 x i1> @llvm.vector.extract.nxv8i1.nxv16i1(<vscale x 16 x i1> %in, i64 0)
34 ret <vscale x 8 x i1> %res
37 define <vscale x 8 x i1> @extract_nxv8i1_nxv16i1_8(<vscale x 16 x i1> %in) {
38 ; CHECK-LABEL: extract_nxv8i1_nxv16i1_8:
40 ; CHECK-NEXT: punpkhi p0.h, p0.b
42 %res = call <vscale x 8 x i1> @llvm.vector.extract.nxv8i1.nxv16i1(<vscale x 16 x i1> %in, i64 8)
43 ret <vscale x 8 x i1> %res
46 declare <vscale x 8 x i1> @llvm.vector.extract.nxv8i1.nxv16i1(<vscale x 16 x i1>, i64)
49 ; Extract i1 vector that needs widening from one that needs widening.
51 define <vscale x 14 x i1> @extract_nxv14i1_nxv28i1_0(<vscale x 28 x i1> %in) {
52 ; CHECK-LABEL: extract_nxv14i1_nxv28i1_0:
55 %res = call <vscale x 14 x i1> @llvm.vector.extract.nxv14i1.nxv28i1(<vscale x 28 x i1> %in, i64 0)
56 ret <vscale x 14 x i1> %res
59 define <vscale x 14 x i1> @extract_nxv14i1_nxv28i1_14(<vscale x 28 x i1> %in) uwtable {
60 ; CHECK-LABEL: extract_nxv14i1_nxv28i1_14:
62 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
63 ; CHECK-NEXT: .cfi_def_cfa_offset 16
64 ; CHECK-NEXT: .cfi_offset w29, -16
65 ; CHECK-NEXT: addvl sp, sp, #-1
66 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0c, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x08, 0x92, 0x2e, 0x00, 0x1e, 0x22 // sp + 16 + 8 * VG
67 ; CHECK-NEXT: punpkhi p2.h, p1.b
68 ; CHECK-NEXT: str p4, [sp, #7, mul vl] // 2-byte Folded Spill
69 ; CHECK-NEXT: punpklo p1.h, p1.b
70 ; CHECK-NEXT: str p5, [sp, #6, mul vl] // 2-byte Folded Spill
71 ; CHECK-NEXT: punpklo p2.h, p2.b
72 ; CHECK-NEXT: punpkhi p3.h, p1.b
73 ; CHECK-NEXT: punpkhi p4.h, p2.b
74 ; CHECK-NEXT: punpklo p2.h, p2.b
75 ; CHECK-NEXT: uzp1 p4.s, p4.s, p0.s
76 ; CHECK-NEXT: punpkhi p0.h, p0.b
77 ; CHECK-NEXT: punpkhi p5.h, p3.b
78 ; CHECK-NEXT: punpklo p1.h, p1.b
79 ; CHECK-NEXT: punpkhi p0.h, p0.b
80 ; CHECK-NEXT: uzp1 p2.s, p5.s, p2.s
81 ; CHECK-NEXT: punpklo p3.h, p3.b
82 ; CHECK-NEXT: punpkhi p5.h, p1.b
83 ; CHECK-NEXT: punpklo p1.h, p1.b
84 ; CHECK-NEXT: punpkhi p0.h, p0.b
85 ; CHECK-NEXT: uzp1 p3.s, p5.s, p3.s
86 ; CHECK-NEXT: ldr p5, [sp, #6, mul vl] // 2-byte Folded Reload
87 ; CHECK-NEXT: uzp1 p0.s, p0.s, p1.s
88 ; CHECK-NEXT: uzp1 p1.h, p2.h, p4.h
89 ; CHECK-NEXT: ldr p4, [sp, #7, mul vl] // 2-byte Folded Reload
90 ; CHECK-NEXT: uzp1 p0.h, p0.h, p3.h
91 ; CHECK-NEXT: uzp1 p0.b, p0.b, p1.b
92 ; CHECK-NEXT: addvl sp, sp, #1
93 ; CHECK-NEXT: .cfi_def_cfa wsp, 16
94 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
95 ; CHECK-NEXT: .cfi_def_cfa_offset 0
96 ; CHECK-NEXT: .cfi_restore w29
98 %res = call <vscale x 14 x i1> @llvm.vector.extract.nxv14i1.nxv28i1(<vscale x 28 x i1> %in, i64 14)
99 ret <vscale x 14 x i1> %res
102 declare <vscale x 14 x i1> @llvm.vector.extract.nxv14i1.nxv28i1(<vscale x 28 x i1>, i64)
105 ; Extract half i1 vector that needs promotion from one that needs splitting.
107 define <vscale x 8 x i1> @extract_nxv8i1_nxv32i1_0(<vscale x 32 x i1> %in) {
108 ; CHECK-LABEL: extract_nxv8i1_nxv32i1_0:
110 ; CHECK-NEXT: punpklo p0.h, p0.b
112 %res = call <vscale x 8 x i1> @llvm.vector.extract.nxv8i1.nxv32i1(<vscale x 32 x i1> %in, i64 0)
113 ret <vscale x 8 x i1> %res
116 define <vscale x 8 x i1> @extract_nxv8i1_nxv32i1_8(<vscale x 32 x i1> %in) {
117 ; CHECK-LABEL: extract_nxv8i1_nxv32i1_8:
119 ; CHECK-NEXT: punpkhi p0.h, p0.b
121 %res = call <vscale x 8 x i1> @llvm.vector.extract.nxv8i1.nxv32i1(<vscale x 32 x i1> %in, i64 8)
122 ret <vscale x 8 x i1> %res
125 define <vscale x 8 x i1> @extract_nxv8i1_nxv32i1_16(<vscale x 32 x i1> %in) {
126 ; CHECK-LABEL: extract_nxv8i1_nxv32i1_16:
128 ; CHECK-NEXT: punpklo p0.h, p1.b
130 %res = call <vscale x 8 x i1> @llvm.vector.extract.nxv8i1.nxv32i1(<vscale x 32 x i1> %in, i64 16)
131 ret <vscale x 8 x i1> %res
134 define <vscale x 8 x i1> @extract_nxv8i1_nxv32i1_24(<vscale x 32 x i1> %in) {
135 ; CHECK-LABEL: extract_nxv8i1_nxv32i1_24:
137 ; CHECK-NEXT: punpkhi p0.h, p1.b
139 %res = call <vscale x 8 x i1> @llvm.vector.extract.nxv8i1.nxv32i1(<vscale x 32 x i1> %in, i64 24)
140 ret <vscale x 8 x i1> %res
143 declare <vscale x 8 x i1> @llvm.vector.extract.nxv8i1.nxv32i1(<vscale x 32 x i1>, i64)
146 ; Extract 1/4th i1 vector that needs promotion from legal type.
148 define <vscale x 4 x i1> @extract_nxv4i1_nxv16i1_0(<vscale x 16 x i1> %in) {
149 ; CHECK-LABEL: extract_nxv4i1_nxv16i1_0:
151 ; CHECK-NEXT: punpklo p0.h, p0.b
152 ; CHECK-NEXT: punpklo p0.h, p0.b
154 %res = call <vscale x 4 x i1> @llvm.vector.extract.nxv4i1.nxv16i1(<vscale x 16 x i1> %in, i64 0)
155 ret <vscale x 4 x i1> %res
158 define <vscale x 4 x i1> @extract_nxv4i1_nxv16i1_4(<vscale x 16 x i1> %in) {
159 ; CHECK-LABEL: extract_nxv4i1_nxv16i1_4:
161 ; CHECK-NEXT: punpklo p0.h, p0.b
162 ; CHECK-NEXT: punpkhi p0.h, p0.b
164 %res = call <vscale x 4 x i1> @llvm.vector.extract.nxv4i1.nxv16i1(<vscale x 16 x i1> %in, i64 4)
165 ret <vscale x 4 x i1> %res
168 define <vscale x 4 x i1> @extract_nxv4i1_nxv16i1_8(<vscale x 16 x i1> %in) {
169 ; CHECK-LABEL: extract_nxv4i1_nxv16i1_8:
171 ; CHECK-NEXT: punpkhi p0.h, p0.b
172 ; CHECK-NEXT: punpklo p0.h, p0.b
174 %res = call <vscale x 4 x i1> @llvm.vector.extract.nxv4i1.nxv16i1(<vscale x 16 x i1> %in, i64 8)
175 ret <vscale x 4 x i1> %res
178 define <vscale x 4 x i1> @extract_nxv4i1_nxv16i1_12(<vscale x 16 x i1> %in) {
179 ; CHECK-LABEL: extract_nxv4i1_nxv16i1_12:
181 ; CHECK-NEXT: punpkhi p0.h, p0.b
182 ; CHECK-NEXT: punpkhi p0.h, p0.b
184 %res = call <vscale x 4 x i1> @llvm.vector.extract.nxv4i1.nxv16i1(<vscale x 16 x i1> %in, i64 12)
185 ret <vscale x 4 x i1> %res
188 declare <vscale x 4 x i1> @llvm.vector.extract.nxv4i1.nxv16i1(<vscale x 16 x i1>, i64)
191 ; Extract 1/8th i1 vector that needs promotion from legal type.
193 define <vscale x 2 x i1> @extract_nxv2i1_nxv16i1_0(<vscale x 16 x i1> %in) {
194 ; CHECK-LABEL: extract_nxv2i1_nxv16i1_0:
196 ; CHECK-NEXT: punpklo p0.h, p0.b
197 ; CHECK-NEXT: punpklo p0.h, p0.b
198 ; CHECK-NEXT: punpklo p0.h, p0.b
200 %res = call <vscale x 2 x i1> @llvm.vector.extract.nxv2i1.nxv16i1(<vscale x 16 x i1> %in, i64 0)
201 ret <vscale x 2 x i1> %res
204 define <vscale x 2 x i1> @extract_nxv2i1_nxv16i1_2(<vscale x 16 x i1> %in) {
205 ; CHECK-LABEL: extract_nxv2i1_nxv16i1_2:
207 ; CHECK-NEXT: punpklo p0.h, p0.b
208 ; CHECK-NEXT: punpklo p0.h, p0.b
209 ; CHECK-NEXT: punpkhi p0.h, p0.b
211 %res = call <vscale x 2 x i1> @llvm.vector.extract.nxv2i1.nxv16i1(<vscale x 16 x i1> %in, i64 2)
212 ret <vscale x 2 x i1> %res
215 define <vscale x 2 x i1> @extract_nxv2i1_nxv16i1_4(<vscale x 16 x i1> %in) {
216 ; CHECK-LABEL: extract_nxv2i1_nxv16i1_4:
218 ; CHECK-NEXT: punpklo p0.h, p0.b
219 ; CHECK-NEXT: punpkhi p0.h, p0.b
220 ; CHECK-NEXT: punpklo p0.h, p0.b
222 %res = call <vscale x 2 x i1> @llvm.vector.extract.nxv2i1.nxv16i1(<vscale x 16 x i1> %in, i64 4)
223 ret <vscale x 2 x i1> %res
226 define <vscale x 2 x i1> @extract_nxv2i1_nxv16i1_6(<vscale x 16 x i1> %in) {
227 ; CHECK-LABEL: extract_nxv2i1_nxv16i1_6:
229 ; CHECK-NEXT: punpklo p0.h, p0.b
230 ; CHECK-NEXT: punpkhi p0.h, p0.b
231 ; CHECK-NEXT: punpkhi p0.h, p0.b
233 %res = call <vscale x 2 x i1> @llvm.vector.extract.nxv2i1.nxv16i1(<vscale x 16 x i1> %in, i64 6)
234 ret <vscale x 2 x i1> %res
237 define <vscale x 2 x i1> @extract_nxv2i1_nxv16i1_8(<vscale x 16 x i1> %in) {
238 ; CHECK-LABEL: extract_nxv2i1_nxv16i1_8:
240 ; CHECK-NEXT: punpkhi p0.h, p0.b
241 ; CHECK-NEXT: punpklo p0.h, p0.b
242 ; CHECK-NEXT: punpklo p0.h, p0.b
244 %res = call <vscale x 2 x i1> @llvm.vector.extract.nxv2i1.nxv16i1(<vscale x 16 x i1> %in, i64 8)
245 ret <vscale x 2 x i1> %res
248 define <vscale x 2 x i1> @extract_nxv2i1_nxv16i1_10(<vscale x 16 x i1> %in) {
249 ; CHECK-LABEL: extract_nxv2i1_nxv16i1_10:
251 ; CHECK-NEXT: punpkhi p0.h, p0.b
252 ; CHECK-NEXT: punpklo p0.h, p0.b
253 ; CHECK-NEXT: punpkhi p0.h, p0.b
255 %res = call <vscale x 2 x i1> @llvm.vector.extract.nxv2i1.nxv16i1(<vscale x 16 x i1> %in, i64 10)
256 ret <vscale x 2 x i1> %res
259 define <vscale x 2 x i1> @extract_nxv2i1_nxv16i1_12(<vscale x 16 x i1> %in) {
260 ; CHECK-LABEL: extract_nxv2i1_nxv16i1_12:
262 ; CHECK-NEXT: punpkhi p0.h, p0.b
263 ; CHECK-NEXT: punpkhi p0.h, p0.b
264 ; CHECK-NEXT: punpklo p0.h, p0.b
266 %res = call <vscale x 2 x i1> @llvm.vector.extract.nxv2i1.nxv16i1(<vscale x 16 x i1> %in, i64 12)
267 ret <vscale x 2 x i1> %res
270 define <vscale x 2 x i1> @extract_nxv2i1_nxv16i1_14(<vscale x 16 x i1> %in) {
271 ; CHECK-LABEL: extract_nxv2i1_nxv16i1_14:
273 ; CHECK-NEXT: punpkhi p0.h, p0.b
274 ; CHECK-NEXT: punpkhi p0.h, p0.b
275 ; CHECK-NEXT: punpkhi p0.h, p0.b
277 %res = call <vscale x 2 x i1> @llvm.vector.extract.nxv2i1.nxv16i1(<vscale x 16 x i1> %in, i64 14)
278 ret <vscale x 2 x i1> %res
281 declare <vscale x 2 x i1> @llvm.vector.extract.nxv2i1.nxv16i1(<vscale x 16 x i1>, i64)
284 ; Extract i1 vector that needs promotion from one that needs widening.
286 define <vscale x 4 x i1> @extract_nxv4i1_nxv12i1_0(<vscale x 12 x i1> %in) {
287 ; CHECK-LABEL: extract_nxv4i1_nxv12i1_0:
289 ; CHECK-NEXT: punpklo p0.h, p0.b
290 ; CHECK-NEXT: punpklo p0.h, p0.b
292 %res = call <vscale x 4 x i1> @llvm.vector.extract.nxv4i1.nxv12i1(<vscale x 12 x i1> %in, i64 0)
293 ret <vscale x 4 x i1> %res
296 define <vscale x 4 x i1> @extract_nxv4i1_nxv12i1_4(<vscale x 12 x i1> %in) {
297 ; CHECK-LABEL: extract_nxv4i1_nxv12i1_4:
299 ; CHECK-NEXT: punpklo p0.h, p0.b
300 ; CHECK-NEXT: punpkhi p0.h, p0.b
302 %res = call <vscale x 4 x i1> @llvm.vector.extract.nxv4i1.nxv12i1(<vscale x 12 x i1> %in, i64 4)
303 ret <vscale x 4 x i1> %res
306 define <vscale x 4 x i1> @extract_nxv4i1_nxv12i1_8(<vscale x 12 x i1> %in) {
307 ; CHECK-LABEL: extract_nxv4i1_nxv12i1_8:
309 ; CHECK-NEXT: punpkhi p0.h, p0.b
310 ; CHECK-NEXT: punpklo p0.h, p0.b
312 %res = call <vscale x 4 x i1> @llvm.vector.extract.nxv4i1.nxv12i1(<vscale x 12 x i1> %in, i64 8)
313 ret <vscale x 4 x i1> %res
316 declare <vscale x 4 x i1> @llvm.vector.extract.nxv4i1.nxv12i1(<vscale x 12 x i1>, i64)
319 ; Extract 1/8th i8 vector that needs promotion from legal type.
321 define <vscale x 2 x i8> @extract_nxv2i8_nxv16i8_0(<vscale x 16 x i8> %in) {
322 ; CHECK-LABEL: extract_nxv2i8_nxv16i8_0:
324 ; CHECK-NEXT: uunpklo z0.h, z0.b
325 ; CHECK-NEXT: uunpklo z0.s, z0.h
326 ; CHECK-NEXT: uunpklo z0.d, z0.s
328 %res = call <vscale x 2 x i8> @llvm.vector.extract.nxv2i8.nxv16i8(<vscale x 16 x i8> %in, i64 0)
329 ret <vscale x 2 x i8> %res
332 define <vscale x 2 x i8> @extract_nxv2i8_nxv16i8_2(<vscale x 16 x i8> %in) {
333 ; CHECK-LABEL: extract_nxv2i8_nxv16i8_2:
335 ; CHECK-NEXT: uunpklo z0.h, z0.b
336 ; CHECK-NEXT: uunpklo z0.s, z0.h
337 ; CHECK-NEXT: uunpkhi z0.d, z0.s
339 %res = call <vscale x 2 x i8> @llvm.vector.extract.nxv2i8.nxv16i8(<vscale x 16 x i8> %in, i64 2)
340 ret <vscale x 2 x i8> %res
343 define <vscale x 2 x i8> @extract_nxv2i8_nxv16i8_4(<vscale x 16 x i8> %in) {
344 ; CHECK-LABEL: extract_nxv2i8_nxv16i8_4:
346 ; CHECK-NEXT: uunpklo z0.h, z0.b
347 ; CHECK-NEXT: uunpkhi z0.s, z0.h
348 ; CHECK-NEXT: uunpklo z0.d, z0.s
350 %res = call <vscale x 2 x i8> @llvm.vector.extract.nxv2i8.nxv16i8(<vscale x 16 x i8> %in, i64 4)
351 ret <vscale x 2 x i8> %res
354 define <vscale x 2 x i8> @extract_nxv2i8_nxv16i8_6(<vscale x 16 x i8> %in) {
355 ; CHECK-LABEL: extract_nxv2i8_nxv16i8_6:
357 ; CHECK-NEXT: uunpklo z0.h, z0.b
358 ; CHECK-NEXT: uunpkhi z0.s, z0.h
359 ; CHECK-NEXT: uunpkhi z0.d, z0.s
361 %res = call <vscale x 2 x i8> @llvm.vector.extract.nxv2i8.nxv16i8(<vscale x 16 x i8> %in, i64 6)
362 ret <vscale x 2 x i8> %res
365 define <vscale x 2 x i8> @extract_nxv2i8_nxv16i8_8(<vscale x 16 x i8> %in) {
366 ; CHECK-LABEL: extract_nxv2i8_nxv16i8_8:
368 ; CHECK-NEXT: uunpkhi z0.h, z0.b
369 ; CHECK-NEXT: uunpklo z0.s, z0.h
370 ; CHECK-NEXT: uunpklo z0.d, z0.s
372 %res = call <vscale x 2 x i8> @llvm.vector.extract.nxv2i8.nxv16i8(<vscale x 16 x i8> %in, i64 8)
373 ret <vscale x 2 x i8> %res
376 define <vscale x 2 x i8> @extract_nxv2i8_nxv16i8_10(<vscale x 16 x i8> %in) {
377 ; CHECK-LABEL: extract_nxv2i8_nxv16i8_10:
379 ; CHECK-NEXT: uunpkhi z0.h, z0.b
380 ; CHECK-NEXT: uunpklo z0.s, z0.h
381 ; CHECK-NEXT: uunpkhi z0.d, z0.s
383 %res = call <vscale x 2 x i8> @llvm.vector.extract.nxv2i8.nxv16i8(<vscale x 16 x i8> %in, i64 10)
384 ret <vscale x 2 x i8> %res
387 define <vscale x 2 x i8> @extract_nxv2i8_nxv16i8_12(<vscale x 16 x i8> %in) {
388 ; CHECK-LABEL: extract_nxv2i8_nxv16i8_12:
390 ; CHECK-NEXT: uunpkhi z0.h, z0.b
391 ; CHECK-NEXT: uunpkhi z0.s, z0.h
392 ; CHECK-NEXT: uunpklo z0.d, z0.s
394 %res = call <vscale x 2 x i8> @llvm.vector.extract.nxv2i8.nxv16i8(<vscale x 16 x i8> %in, i64 12)
395 ret <vscale x 2 x i8> %res
398 define <vscale x 2 x i8> @extract_nxv2i8_nxv16i8_14(<vscale x 16 x i8> %in) {
399 ; CHECK-LABEL: extract_nxv2i8_nxv16i8_14:
401 ; CHECK-NEXT: uunpkhi z0.h, z0.b
402 ; CHECK-NEXT: uunpkhi z0.s, z0.h
403 ; CHECK-NEXT: uunpkhi z0.d, z0.s
405 %res = call <vscale x 2 x i8> @llvm.vector.extract.nxv2i8.nxv16i8(<vscale x 16 x i8> %in, i64 14)
406 ret <vscale x 2 x i8> %res
409 declare <vscale x 2 x i8> @llvm.vector.extract.nxv2i8.nxv16i8(<vscale x 16 x i8>, i64)
412 ; Extract i8 vector that needs promotion from one that needs widening.
414 define <vscale x 4 x i8> @extract_nxv4i8_nxv12i8_0(<vscale x 12 x i8> %in) {
415 ; CHECK-LABEL: extract_nxv4i8_nxv12i8_0:
417 ; CHECK-NEXT: uunpklo z0.h, z0.b
418 ; CHECK-NEXT: uunpklo z0.s, z0.h
420 %res = call <vscale x 4 x i8> @llvm.vector.extract.nxv4i8.nxv12i8(<vscale x 12 x i8> %in, i64 0)
421 ret <vscale x 4 x i8> %res
424 define <vscale x 4 x i8> @extract_nxv4i8_nxv12i8_4(<vscale x 12 x i8> %in) {
425 ; CHECK-LABEL: extract_nxv4i8_nxv12i8_4:
427 ; CHECK-NEXT: uunpklo z0.h, z0.b
428 ; CHECK-NEXT: uunpkhi z0.s, z0.h
430 %res = call <vscale x 4 x i8> @llvm.vector.extract.nxv4i8.nxv12i8(<vscale x 12 x i8> %in, i64 4)
431 ret <vscale x 4 x i8> %res
434 define <vscale x 4 x i8> @extract_nxv4i8_nxv12i8_8(<vscale x 12 x i8> %in) {
435 ; CHECK-LABEL: extract_nxv4i8_nxv12i8_8:
437 ; CHECK-NEXT: uunpkhi z0.h, z0.b
438 ; CHECK-NEXT: uunpklo z0.s, z0.h
440 %res = call <vscale x 4 x i8> @llvm.vector.extract.nxv4i8.nxv12i8(<vscale x 12 x i8> %in, i64 8)
441 ret <vscale x 4 x i8> %res
444 declare <vscale x 4 x i8> @llvm.vector.extract.nxv4i8.nxv12i8(<vscale x 12 x i8>, i64)
447 ; Extract i8 vector that needs both widening + promotion from one that needs widening.
448 ; (nxv6i8 -> nxv8i8 -> nxv8i16)
450 define <vscale x 6 x i8> @extract_nxv6i8_nxv12i8_0(<vscale x 12 x i8> %in) {
451 ; CHECK-LABEL: extract_nxv6i8_nxv12i8_0:
453 ; CHECK-NEXT: uunpklo z0.h, z0.b
455 %res = call <vscale x 6 x i8> @llvm.vector.extract.nxv6i8.nxv12i8(<vscale x 12 x i8> %in, i64 0)
456 ret <vscale x 6 x i8> %res
459 define <vscale x 6 x i8> @extract_nxv6i8_nxv12i8_6(<vscale x 12 x i8> %in) {
460 ; CHECK-LABEL: extract_nxv6i8_nxv12i8_6:
462 ; CHECK-NEXT: uunpkhi z1.h, z0.b
463 ; CHECK-NEXT: uunpklo z0.h, z0.b
464 ; CHECK-NEXT: uunpklo z1.s, z1.h
465 ; CHECK-NEXT: uunpkhi z0.s, z0.h
466 ; CHECK-NEXT: uunpkhi z2.d, z1.s
467 ; CHECK-NEXT: uunpklo z1.d, z1.s
468 ; CHECK-NEXT: uunpkhi z0.d, z0.s
469 ; CHECK-NEXT: uzp1 z2.s, z2.s, z0.s
470 ; CHECK-NEXT: uzp1 z0.s, z0.s, z1.s
471 ; CHECK-NEXT: uzp1 z0.h, z0.h, z2.h
473 %res = call <vscale x 6 x i8> @llvm.vector.extract.nxv6i8.nxv12i8(<vscale x 12 x i8> %in, i64 6)
474 ret <vscale x 6 x i8> %res
477 declare <vscale x 6 x i8> @llvm.vector.extract.nxv6i8.nxv12i8(<vscale x 12 x i8>, i64)
480 ; Extract half i8 vector that needs promotion from one that needs splitting.
482 define <vscale x 8 x i8> @extract_nxv8i8_nxv32i8_0(<vscale x 32 x i8> %in) {
483 ; CHECK-LABEL: extract_nxv8i8_nxv32i8_0:
485 ; CHECK-NEXT: uunpklo z0.h, z0.b
487 %res = call <vscale x 8 x i8> @llvm.vector.extract.nxv8i8.nxv32i8(<vscale x 32 x i8> %in, i64 0)
488 ret <vscale x 8 x i8> %res
491 define <vscale x 8 x i8> @extract_nxv8i8_nxv32i8_8(<vscale x 32 x i8> %in) {
492 ; CHECK-LABEL: extract_nxv8i8_nxv32i8_8:
494 ; CHECK-NEXT: uunpkhi z0.h, z0.b
496 %res = call <vscale x 8 x i8> @llvm.vector.extract.nxv8i8.nxv32i8(<vscale x 32 x i8> %in, i64 8)
497 ret <vscale x 8 x i8> %res
500 define <vscale x 8 x i8> @extract_nxv8i8_nxv32i8_16(<vscale x 32 x i8> %in) {
501 ; CHECK-LABEL: extract_nxv8i8_nxv32i8_16:
503 ; CHECK-NEXT: uunpklo z0.h, z1.b
505 %res = call <vscale x 8 x i8> @llvm.vector.extract.nxv8i8.nxv32i8(<vscale x 32 x i8> %in, i64 16)
506 ret <vscale x 8 x i8> %res
509 define <vscale x 8 x i8> @extract_nxv8i8_nxv32i8_24(<vscale x 32 x i8> %in) {
510 ; CHECK-LABEL: extract_nxv8i8_nxv32i8_24:
512 ; CHECK-NEXT: uunpkhi z0.h, z1.b
514 %res = call <vscale x 8 x i8> @llvm.vector.extract.nxv8i8.nxv32i8(<vscale x 32 x i8> %in, i64 24)
515 ret <vscale x 8 x i8> %res
518 declare <vscale x 8 x i8> @llvm.vector.extract.nxv8i8.nxv32i8(<vscale x 32 x i8>, i64)
521 ; Extract half i8 vector that needs promotion from legal type.
523 define <vscale x 8 x i8> @extract_nxv8i8_nxv16i8_0(<vscale x 16 x i8> %in) {
524 ; CHECK-LABEL: extract_nxv8i8_nxv16i8_0:
526 ; CHECK-NEXT: uunpklo z0.h, z0.b
528 %res = call <vscale x 8 x i8> @llvm.vector.extract.nxv8i8.nxv16i8(<vscale x 16 x i8> %in, i64 0)
529 ret <vscale x 8 x i8> %res
532 define <vscale x 8 x i8> @extract_nxv8i8_nxv16i8_8(<vscale x 16 x i8> %in) {
533 ; CHECK-LABEL: extract_nxv8i8_nxv16i8_8:
535 ; CHECK-NEXT: uunpkhi z0.h, z0.b
537 %res = call <vscale x 8 x i8> @llvm.vector.extract.nxv8i8.nxv16i8(<vscale x 16 x i8> %in, i64 8)
538 ret <vscale x 8 x i8> %res
541 declare <vscale x 8 x i8> @llvm.vector.extract.nxv8i8.nxv16i8(<vscale x 16 x i8>, i64)
544 ; Extract i8 vector that needs widening from one that needs widening.
546 define <vscale x 14 x i8> @extract_nxv14i8_nxv28i8_0(<vscale x 28 x i8> %in) {
547 ; CHECK-LABEL: extract_nxv14i8_nxv28i8_0:
550 %res = call <vscale x 14 x i8> @llvm.vector.extract.nxv14i8.nxv28i8(<vscale x 28 x i8> %in, i64 0)
551 ret <vscale x 14 x i8> %res
554 define <vscale x 14 x i8> @extract_nxv14i8_nxv28i8_14(<vscale x 28 x i8> %in) {
555 ; CHECK-LABEL: extract_nxv14i8_nxv28i8_14:
557 ; CHECK-NEXT: uunpkhi z0.h, z0.b
558 ; CHECK-NEXT: uunpklo z2.h, z1.b
559 ; CHECK-NEXT: uunpkhi z1.h, z1.b
560 ; CHECK-NEXT: uunpkhi z0.s, z0.h
561 ; CHECK-NEXT: uunpklo z4.s, z2.h
562 ; CHECK-NEXT: uunpkhi z2.s, z2.h
563 ; CHECK-NEXT: uunpklo z1.s, z1.h
564 ; CHECK-NEXT: uunpkhi z0.d, z0.s
565 ; CHECK-NEXT: uunpklo z5.d, z4.s
566 ; CHECK-NEXT: uunpkhi z4.d, z4.s
567 ; CHECK-NEXT: uzp1 z0.s, z0.s, z0.s
568 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
569 ; CHECK-NEXT: uzp1 z0.b, z0.b, z0.b
570 ; CHECK-NEXT: uunpklo z0.h, z0.b
571 ; CHECK-NEXT: uunpklo z3.s, z0.h
572 ; CHECK-NEXT: uunpkhi z0.s, z0.h
573 ; CHECK-NEXT: uunpklo z3.d, z3.s
574 ; CHECK-NEXT: uzp1 z3.s, z3.s, z5.s
575 ; CHECK-NEXT: uzp1 z0.h, z3.h, z0.h
576 ; CHECK-NEXT: uzp1 z0.b, z0.b, z0.b
577 ; CHECK-NEXT: uunpklo z0.h, z0.b
578 ; CHECK-NEXT: uunpkhi z3.s, z0.h
579 ; CHECK-NEXT: uunpklo z0.s, z0.h
580 ; CHECK-NEXT: uunpkhi z3.d, z3.s
581 ; CHECK-NEXT: uzp1 z3.s, z4.s, z3.s
582 ; CHECK-NEXT: uunpklo z4.d, z2.s
583 ; CHECK-NEXT: uunpkhi z2.d, z2.s
584 ; CHECK-NEXT: uzp1 z0.h, z0.h, z3.h
585 ; CHECK-NEXT: uzp1 z0.b, z0.b, z0.b
586 ; CHECK-NEXT: uunpklo z0.h, z0.b
587 ; CHECK-NEXT: uunpkhi z3.s, z0.h
588 ; CHECK-NEXT: uunpklo z0.s, z0.h
589 ; CHECK-NEXT: uunpklo z3.d, z3.s
590 ; CHECK-NEXT: uzp1 z3.s, z3.s, z4.s
591 ; CHECK-NEXT: uzp1 z0.h, z0.h, z3.h
592 ; CHECK-NEXT: uzp1 z3.b, z0.b, z0.b
593 ; CHECK-NEXT: uunpkhi z3.h, z3.b
594 ; CHECK-NEXT: uunpklo z4.s, z3.h
595 ; CHECK-NEXT: uunpkhi z3.s, z3.h
596 ; CHECK-NEXT: uunpkhi z4.d, z4.s
597 ; CHECK-NEXT: uzp1 z2.s, z2.s, z4.s
598 ; CHECK-NEXT: uunpklo z4.d, z1.s
599 ; CHECK-NEXT: uunpkhi z1.d, z1.s
600 ; CHECK-NEXT: uzp1 z2.h, z2.h, z3.h
601 ; CHECK-NEXT: uzp1 z2.b, z0.b, z2.b
602 ; CHECK-NEXT: uunpkhi z2.h, z2.b
603 ; CHECK-NEXT: uunpklo z3.s, z2.h
604 ; CHECK-NEXT: uunpkhi z2.s, z2.h
605 ; CHECK-NEXT: uunpklo z3.d, z3.s
606 ; CHECK-NEXT: uzp1 z3.s, z3.s, z4.s
607 ; CHECK-NEXT: uzp1 z2.h, z3.h, z2.h
608 ; CHECK-NEXT: uzp1 z2.b, z0.b, z2.b
609 ; CHECK-NEXT: uunpkhi z2.h, z2.b
610 ; CHECK-NEXT: uunpkhi z3.s, z2.h
611 ; CHECK-NEXT: uunpklo z2.s, z2.h
612 ; CHECK-NEXT: uunpkhi z3.d, z3.s
613 ; CHECK-NEXT: uzp1 z1.s, z1.s, z3.s
614 ; CHECK-NEXT: uzp1 z1.h, z2.h, z1.h
615 ; CHECK-NEXT: uzp1 z1.b, z0.b, z1.b
616 ; CHECK-NEXT: uunpkhi z1.h, z1.b
617 ; CHECK-NEXT: uunpkhi z2.s, z1.h
618 ; CHECK-NEXT: uunpklo z1.s, z1.h
619 ; CHECK-NEXT: uunpklo z2.d, z2.s
620 ; CHECK-NEXT: uzp1 z2.s, z2.s, z0.s
621 ; CHECK-NEXT: uzp1 z1.h, z1.h, z2.h
622 ; CHECK-NEXT: uzp1 z0.b, z0.b, z1.b
624 %res = call <vscale x 14 x i8> @llvm.vector.extract.nxv14i8.nxv28i8(<vscale x 28 x i8> %in, i64 14)
625 ret <vscale x 14 x i8> %res
628 declare <vscale x 14 x i8> @llvm.vector.extract.nxv14i8.nxv28i8(<vscale x 28 x i8>, i64)
631 ; Extract 1/4th i8 vector that needs promotion from legal type.
633 define <vscale x 4 x i8> @extract_nxv4i8_nxv16i8_0(<vscale x 16 x i8> %in) {
634 ; CHECK-LABEL: extract_nxv4i8_nxv16i8_0:
636 ; CHECK-NEXT: uunpklo z0.h, z0.b
637 ; CHECK-NEXT: uunpklo z0.s, z0.h
639 %res = call <vscale x 4 x i8> @llvm.vector.extract.nxv4i8.nxv16i8(<vscale x 16 x i8> %in, i64 0)
640 ret <vscale x 4 x i8> %res
643 define <vscale x 4 x i8> @extract_nxv4i8_nxv16i8_4(<vscale x 16 x i8> %in) {
644 ; CHECK-LABEL: extract_nxv4i8_nxv16i8_4:
646 ; CHECK-NEXT: uunpklo z0.h, z0.b
647 ; CHECK-NEXT: uunpkhi z0.s, z0.h
649 %res = call <vscale x 4 x i8> @llvm.vector.extract.nxv4i8.nxv16i8(<vscale x 16 x i8> %in, i64 4)
650 ret <vscale x 4 x i8> %res
653 define <vscale x 4 x i8> @extract_nxv4i8_nxv16i8_8(<vscale x 16 x i8> %in) {
654 ; CHECK-LABEL: extract_nxv4i8_nxv16i8_8:
656 ; CHECK-NEXT: uunpkhi z0.h, z0.b
657 ; CHECK-NEXT: uunpklo z0.s, z0.h
659 %res = call <vscale x 4 x i8> @llvm.vector.extract.nxv4i8.nxv16i8(<vscale x 16 x i8> %in, i64 8)
660 ret <vscale x 4 x i8> %res
663 define <vscale x 4 x i8> @extract_nxv4i8_nxv16i8_12(<vscale x 16 x i8> %in) {
664 ; CHECK-LABEL: extract_nxv4i8_nxv16i8_12:
666 ; CHECK-NEXT: uunpkhi z0.h, z0.b
667 ; CHECK-NEXT: uunpkhi z0.s, z0.h
669 %res = call <vscale x 4 x i8> @llvm.vector.extract.nxv4i8.nxv16i8(<vscale x 16 x i8> %in, i64 12)
670 ret <vscale x 4 x i8> %res
673 declare <vscale x 4 x i8> @llvm.vector.extract.nxv4i8.nxv16i8(<vscale x 16 x i8>, i64)
676 ; Extract f16 vector that needs promotion from one that needs widening.
678 define <vscale x 2 x half> @extract_nxv2f16_nxv6f16_0(<vscale x 6 x half> %in) {
679 ; CHECK-LABEL: extract_nxv2f16_nxv6f16_0:
681 ; CHECK-NEXT: uunpklo z0.s, z0.h
682 ; CHECK-NEXT: uunpklo z0.d, z0.s
684 %res = call <vscale x 2 x half> @llvm.vector.extract.nxv2f16.nxv6f16(<vscale x 6 x half> %in, i64 0)
685 ret <vscale x 2 x half> %res
688 define <vscale x 2 x half> @extract_nxv2f16_nxv6f16_2(<vscale x 6 x half> %in) {
689 ; CHECK-LABEL: extract_nxv2f16_nxv6f16_2:
691 ; CHECK-NEXT: uunpklo z0.s, z0.h
692 ; CHECK-NEXT: uunpkhi z0.d, z0.s
694 %res = call <vscale x 2 x half> @llvm.vector.extract.nxv2f16.nxv6f16(<vscale x 6 x half> %in, i64 2)
695 ret <vscale x 2 x half> %res
698 define <vscale x 2 x half> @extract_nxv2f16_nxv6f16_4(<vscale x 6 x half> %in) {
699 ; CHECK-LABEL: extract_nxv2f16_nxv6f16_4:
701 ; CHECK-NEXT: uunpkhi z0.s, z0.h
702 ; CHECK-NEXT: uunpklo z0.d, z0.s
704 %res = call <vscale x 2 x half> @llvm.vector.extract.nxv2f16.nxv6f16(<vscale x 6 x half> %in, i64 4)
705 ret <vscale x 2 x half> %res
708 declare <vscale x 2 x half> @llvm.vector.extract.nxv2f16.nxv6f16(<vscale x 6 x half>, i64)
711 ; Extract half f16 vector that needs promotion from legal type.
713 define <vscale x 4 x half> @extract_nxv4f16_nxv8f16_0(<vscale x 8 x half> %in) {
714 ; CHECK-LABEL: extract_nxv4f16_nxv8f16_0:
716 ; CHECK-NEXT: uunpklo z0.s, z0.h
718 %res = call <vscale x 4 x half> @llvm.vector.extract.nxv4f16.nxv8f16(<vscale x 8 x half> %in, i64 0)
719 ret <vscale x 4 x half> %res
722 define <vscale x 4 x half> @extract_nxv4f16_nxv8f16_4(<vscale x 8 x half> %in) {
723 ; CHECK-LABEL: extract_nxv4f16_nxv8f16_4:
725 ; CHECK-NEXT: uunpkhi z0.s, z0.h
727 %res = call <vscale x 4 x half> @llvm.vector.extract.nxv4f16.nxv8f16(<vscale x 8 x half> %in, i64 4)
728 ret <vscale x 4 x half> %res
731 declare <vscale x 4 x half> @llvm.vector.extract.nxv4f16.nxv8f16(<vscale x 8 x half>, i64)
734 ; Extract f16 vector that needs widening from one that needs widening.
736 define <vscale x 6 x half> @extract_nxv6f16_nxv12f16_0(<vscale x 12 x half> %in) {
737 ; CHECK-LABEL: extract_nxv6f16_nxv12f16_0:
740 %res = call <vscale x 6 x half> @llvm.vector.extract.nxv6f16.nxv12f16(<vscale x 12 x half> %in, i64 0)
741 ret <vscale x 6 x half> %res
744 define <vscale x 6 x half> @extract_nxv6f16_nxv12f16_6(<vscale x 12 x half> %in) {
745 ; CHECK-LABEL: extract_nxv6f16_nxv12f16_6:
747 ; CHECK-NEXT: uunpklo z1.s, z1.h
748 ; CHECK-NEXT: uunpkhi z0.s, z0.h
749 ; CHECK-NEXT: uunpkhi z2.d, z1.s
750 ; CHECK-NEXT: uunpklo z1.d, z1.s
751 ; CHECK-NEXT: uunpkhi z0.d, z0.s
752 ; CHECK-NEXT: uzp1 z2.s, z2.s, z0.s
753 ; CHECK-NEXT: uzp1 z0.s, z0.s, z1.s
754 ; CHECK-NEXT: uzp1 z0.h, z0.h, z2.h
756 %res = call <vscale x 6 x half> @llvm.vector.extract.nxv6f16.nxv12f16(<vscale x 12 x half> %in, i64 6)
757 ret <vscale x 6 x half> %res
760 declare <vscale x 6 x half> @llvm.vector.extract.nxv6f16.nxv12f16(<vscale x 12 x half>, i64)
763 ; Extract half f16 vector that needs promotion from one that needs splitting.
765 define <vscale x 4 x half> @extract_nxv4f16_nxv16f16_0(<vscale x 16 x half> %in) {
766 ; CHECK-LABEL: extract_nxv4f16_nxv16f16_0:
768 ; CHECK-NEXT: uunpklo z0.s, z0.h
770 %res = call <vscale x 4 x half> @llvm.vector.extract.nxv4f16.nxv16f16(<vscale x 16 x half> %in, i64 0)
771 ret <vscale x 4 x half> %res
774 define <vscale x 4 x half> @extract_nxv4f16_nxv16f16_4(<vscale x 16 x half> %in) {
775 ; CHECK-LABEL: extract_nxv4f16_nxv16f16_4:
777 ; CHECK-NEXT: uunpkhi z0.s, z0.h
779 %res = call <vscale x 4 x half> @llvm.vector.extract.nxv4f16.nxv16f16(<vscale x 16 x half> %in, i64 4)
780 ret <vscale x 4 x half> %res
783 define <vscale x 4 x half> @extract_nxv4f16_nxv16f16_8(<vscale x 16 x half> %in) {
784 ; CHECK-LABEL: extract_nxv4f16_nxv16f16_8:
786 ; CHECK-NEXT: uunpklo z0.s, z1.h
788 %res = call <vscale x 4 x half> @llvm.vector.extract.nxv4f16.nxv16f16(<vscale x 16 x half> %in, i64 8)
789 ret <vscale x 4 x half> %res
792 define <vscale x 4 x half> @extract_nxv4f16_nxv16f16_12(<vscale x 16 x half> %in) {
793 ; CHECK-LABEL: extract_nxv4f16_nxv16f16_12:
795 ; CHECK-NEXT: uunpkhi z0.s, z1.h
797 %res = call <vscale x 4 x half> @llvm.vector.extract.nxv4f16.nxv16f16(<vscale x 16 x half> %in, i64 12)
798 ret <vscale x 4 x half> %res
801 declare <vscale x 4 x half> @llvm.vector.extract.nxv4f16.nxv16f16(<vscale x 16 x half>, i64)
804 ; Extract 1/4th f16 vector that needs promotion from legal type.
806 define <vscale x 2 x half> @extract_nxv2f16_nxv8f16_0(<vscale x 8 x half> %in) {
807 ; CHECK-LABEL: extract_nxv2f16_nxv8f16_0:
809 ; CHECK-NEXT: uunpklo z0.s, z0.h
810 ; CHECK-NEXT: uunpklo z0.d, z0.s
812 %res = call <vscale x 2 x half> @llvm.vector.extract.nxv2f16.nxv8f16(<vscale x 8 x half> %in, i64 0)
813 ret <vscale x 2 x half> %res
816 define <vscale x 2 x half> @extract_nxv2f16_nxv8f16_2(<vscale x 8 x half> %in) {
817 ; CHECK-LABEL: extract_nxv2f16_nxv8f16_2:
819 ; CHECK-NEXT: uunpklo z0.s, z0.h
820 ; CHECK-NEXT: uunpkhi z0.d, z0.s
822 %res = call <vscale x 2 x half> @llvm.vector.extract.nxv2f16.nxv8f16(<vscale x 8 x half> %in, i64 2)
823 ret <vscale x 2 x half> %res
826 define <vscale x 2 x half> @extract_nxv2f16_nxv8f16_4(<vscale x 8 x half> %in) {
827 ; CHECK-LABEL: extract_nxv2f16_nxv8f16_4:
829 ; CHECK-NEXT: uunpkhi z0.s, z0.h
830 ; CHECK-NEXT: uunpklo z0.d, z0.s
832 %res = call <vscale x 2 x half> @llvm.vector.extract.nxv2f16.nxv8f16(<vscale x 8 x half> %in, i64 4)
833 ret <vscale x 2 x half> %res
836 define <vscale x 2 x half> @extract_nxv2f16_nxv8f16_6(<vscale x 8 x half> %in) {
837 ; CHECK-LABEL: extract_nxv2f16_nxv8f16_6:
839 ; CHECK-NEXT: uunpkhi z0.s, z0.h
840 ; CHECK-NEXT: uunpkhi z0.d, z0.s
842 %res = call <vscale x 2 x half> @llvm.vector.extract.nxv2f16.nxv8f16(<vscale x 8 x half> %in, i64 6)
843 ret <vscale x 2 x half> %res
846 declare <vscale x 2 x half> @llvm.vector.extract.nxv2f16.nxv8f16(<vscale x 8 x half>, i64)
849 ; Extract half bf16 vector that needs promotion from legal type.
851 define <vscale x 4 x bfloat> @extract_nxv4bf16_nxv8bf16_0(<vscale x 8 x bfloat> %in) {
852 ; CHECK-LABEL: extract_nxv4bf16_nxv8bf16_0:
854 ; CHECK-NEXT: uunpklo z0.s, z0.h
856 %res = call <vscale x 4 x bfloat> @llvm.vector.extract.nxv4bf16.nxv8bf16(<vscale x 8 x bfloat> %in, i64 0)
857 ret <vscale x 4 x bfloat> %res
860 define <vscale x 4 x bfloat> @extract_nxv4bf16_nxv8bf16_4(<vscale x 8 x bfloat> %in) {
861 ; CHECK-LABEL: extract_nxv4bf16_nxv8bf16_4:
863 ; CHECK-NEXT: uunpkhi z0.s, z0.h
865 %res = call <vscale x 4 x bfloat> @llvm.vector.extract.nxv4bf16.nxv8bf16(<vscale x 8 x bfloat> %in, i64 4)
866 ret <vscale x 4 x bfloat> %res
869 declare <vscale x 4 x bfloat> @llvm.vector.extract.nxv4bf16.nxv8bf16(<vscale x 8 x bfloat>, i64)
872 ; Extract bf16 vector that needs widening from one that needs widening.
874 define <vscale x 6 x bfloat> @extract_nxv6bf16_nxv12bf16_0(<vscale x 12 x bfloat> %in) {
875 ; CHECK-LABEL: extract_nxv6bf16_nxv12bf16_0:
878 %res = call <vscale x 6 x bfloat> @llvm.vector.extract.nxv6bf16.nxv12bf16(<vscale x 12 x bfloat> %in, i64 0)
879 ret <vscale x 6 x bfloat> %res
882 define <vscale x 6 x bfloat> @extract_nxv6bf16_nxv12bf16_6(<vscale x 12 x bfloat> %in) {
883 ; CHECK-LABEL: extract_nxv6bf16_nxv12bf16_6:
885 ; CHECK-NEXT: uunpklo z1.s, z1.h
886 ; CHECK-NEXT: uunpkhi z0.s, z0.h
887 ; CHECK-NEXT: uunpkhi z2.d, z1.s
888 ; CHECK-NEXT: uunpklo z1.d, z1.s
889 ; CHECK-NEXT: uunpkhi z0.d, z0.s
890 ; CHECK-NEXT: uzp1 z2.s, z2.s, z0.s
891 ; CHECK-NEXT: uzp1 z0.s, z0.s, z1.s
892 ; CHECK-NEXT: uzp1 z0.h, z0.h, z2.h
894 %res = call <vscale x 6 x bfloat> @llvm.vector.extract.nxv6bf16.nxv12bf16(<vscale x 12 x bfloat> %in, i64 6)
895 ret <vscale x 6 x bfloat> %res
898 declare <vscale x 6 x bfloat> @llvm.vector.extract.nxv6bf16.nxv12bf16(<vscale x 12 x bfloat>, i64)
901 ; Extract bf16 vector that needs promotion from one that needs widening.
903 define <vscale x 2 x bfloat> @extract_nxv2bf16_nxv6bf16_0(<vscale x 6 x bfloat> %in) {
904 ; CHECK-LABEL: extract_nxv2bf16_nxv6bf16_0:
906 ; CHECK-NEXT: uunpklo z0.s, z0.h
907 ; CHECK-NEXT: uunpklo z0.d, z0.s
909 %res = call <vscale x 2 x bfloat> @llvm.vector.extract.nxv2bf16.nxv6bf16(<vscale x 6 x bfloat> %in, i64 0)
910 ret <vscale x 2 x bfloat> %res
913 define <vscale x 2 x bfloat> @extract_nxv2bf16_nxv6bf16_2(<vscale x 6 x bfloat> %in) {
914 ; CHECK-LABEL: extract_nxv2bf16_nxv6bf16_2:
916 ; CHECK-NEXT: uunpklo z0.s, z0.h
917 ; CHECK-NEXT: uunpkhi z0.d, z0.s
919 %res = call <vscale x 2 x bfloat> @llvm.vector.extract.nxv2bf16.nxv6bf16(<vscale x 6 x bfloat> %in, i64 2)
920 ret <vscale x 2 x bfloat> %res
923 define <vscale x 2 x bfloat> @extract_nxv2bf16_nxv6bf16_4(<vscale x 6 x bfloat> %in) {
924 ; CHECK-LABEL: extract_nxv2bf16_nxv6bf16_4:
926 ; CHECK-NEXT: uunpkhi z0.s, z0.h
927 ; CHECK-NEXT: uunpklo z0.d, z0.s
929 %res = call <vscale x 2 x bfloat> @llvm.vector.extract.nxv2bf16.nxv6bf16(<vscale x 6 x bfloat> %in, i64 4)
930 ret <vscale x 2 x bfloat> %res
933 declare <vscale x 2 x bfloat> @llvm.vector.extract.nxv2bf16.nxv6bf16(<vscale x 6 x bfloat>, i64)
936 ; Extract 1/4th bf16 vector that needs promotion from legal type.
938 define <vscale x 2 x bfloat> @extract_nxv2bf16_nxv8bf16_0(<vscale x 8 x bfloat> %in) {
939 ; CHECK-LABEL: extract_nxv2bf16_nxv8bf16_0:
941 ; CHECK-NEXT: uunpklo z0.s, z0.h
942 ; CHECK-NEXT: uunpklo z0.d, z0.s
944 %res = call <vscale x 2 x bfloat> @llvm.vector.extract.nxv2bf16.nxv8bf16(<vscale x 8 x bfloat> %in, i64 0)
945 ret <vscale x 2 x bfloat> %res
948 define <vscale x 2 x bfloat> @extract_nxv2bf16_nxv8bf16_2(<vscale x 8 x bfloat> %in) {
949 ; CHECK-LABEL: extract_nxv2bf16_nxv8bf16_2:
951 ; CHECK-NEXT: uunpklo z0.s, z0.h
952 ; CHECK-NEXT: uunpkhi z0.d, z0.s
954 %res = call <vscale x 2 x bfloat> @llvm.vector.extract.nxv2bf16.nxv8bf16(<vscale x 8 x bfloat> %in, i64 2)
955 ret <vscale x 2 x bfloat> %res
958 define <vscale x 2 x bfloat> @extract_nxv2bf16_nxv8bf16_4(<vscale x 8 x bfloat> %in) {
959 ; CHECK-LABEL: extract_nxv2bf16_nxv8bf16_4:
961 ; CHECK-NEXT: uunpkhi z0.s, z0.h
962 ; CHECK-NEXT: uunpklo z0.d, z0.s
964 %res = call <vscale x 2 x bfloat> @llvm.vector.extract.nxv2bf16.nxv8bf16(<vscale x 8 x bfloat> %in, i64 4)
965 ret <vscale x 2 x bfloat> %res
968 define <vscale x 2 x bfloat> @extract_nxv2bf16_nxv8bf16_6(<vscale x 8 x bfloat> %in) {
969 ; CHECK-LABEL: extract_nxv2bf16_nxv8bf16_6:
971 ; CHECK-NEXT: uunpkhi z0.s, z0.h
972 ; CHECK-NEXT: uunpkhi z0.d, z0.s
974 %res = call <vscale x 2 x bfloat> @llvm.vector.extract.nxv2bf16.nxv8bf16(<vscale x 8 x bfloat> %in, i64 6)
975 ret <vscale x 2 x bfloat> %res
978 declare <vscale x 2 x bfloat> @llvm.vector.extract.nxv2bf16.nxv8bf16(<vscale x 8 x bfloat>, i64)
981 ; Extract half bf16 vector that needs promotion from one that needs splitting.
983 define <vscale x 4 x bfloat> @extract_nxv4bf16_nxv16bf16_0(<vscale x 16 x bfloat> %in) {
984 ; CHECK-LABEL: extract_nxv4bf16_nxv16bf16_0:
986 ; CHECK-NEXT: uunpklo z0.s, z0.h
988 %res = call <vscale x 4 x bfloat> @llvm.vector.extract.nxv4bf16.nxv16bf16(<vscale x 16 x bfloat> %in, i64 0)
989 ret <vscale x 4 x bfloat> %res
992 define <vscale x 4 x bfloat> @extract_nxv4bf16_nxv16bf16_4(<vscale x 16 x bfloat> %in) {
993 ; CHECK-LABEL: extract_nxv4bf16_nxv16bf16_4:
995 ; CHECK-NEXT: uunpkhi z0.s, z0.h
997 %res = call <vscale x 4 x bfloat> @llvm.vector.extract.nxv4bf16.nxv16bf16(<vscale x 16 x bfloat> %in, i64 4)
998 ret <vscale x 4 x bfloat> %res
1001 define <vscale x 4 x bfloat> @extract_nxv4bf16_nxv16bf16_8(<vscale x 16 x bfloat> %in) {
1002 ; CHECK-LABEL: extract_nxv4bf16_nxv16bf16_8:
1004 ; CHECK-NEXT: uunpklo z0.s, z1.h
1006 %res = call <vscale x 4 x bfloat> @llvm.vector.extract.nxv4bf16.nxv16bf16(<vscale x 16 x bfloat> %in, i64 8)
1007 ret <vscale x 4 x bfloat> %res
1010 define <vscale x 4 x bfloat> @extract_nxv4bf16_nxv16bf16_12(<vscale x 16 x bfloat> %in) {
1011 ; CHECK-LABEL: extract_nxv4bf16_nxv16bf16_12:
1013 ; CHECK-NEXT: uunpkhi z0.s, z1.h
1015 %res = call <vscale x 4 x bfloat> @llvm.vector.extract.nxv4bf16.nxv16bf16(<vscale x 16 x bfloat> %in, i64 12)
1016 ret <vscale x 4 x bfloat> %res
1019 declare <vscale x 4 x bfloat> @llvm.vector.extract.nxv4bf16.nxv16bf16(<vscale x 16 x bfloat>, i64)
1023 ; Extract from a splat
1025 define <vscale x 2 x float> @extract_nxv2f32_nxv4f32_splat(float %f) {
1026 ; CHECK-LABEL: extract_nxv2f32_nxv4f32_splat:
1028 ; CHECK-NEXT: // kill: def $s0 killed $s0 def $z0
1029 ; CHECK-NEXT: mov z0.s, s0
1031 %ins = insertelement <vscale x 4 x float> poison, float %f, i32 0
1032 %splat = shufflevector <vscale x 4 x float> %ins, <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer
1033 %ext = call <vscale x 2 x float> @llvm.vector.extract.nxv2f32.nxv4f32(<vscale x 4 x float> %splat, i64 0)
1034 ret <vscale x 2 x float> %ext
1037 define <vscale x 2 x float> @extract_nxv2f32_nxv4f32_splat_const() {
1038 ; CHECK-LABEL: extract_nxv2f32_nxv4f32_splat_const:
1040 ; CHECK-NEXT: fmov z0.s, #1.00000000
1042 %ins = insertelement <vscale x 4 x float> poison, float 1.0, i32 0
1043 %splat = shufflevector <vscale x 4 x float> %ins, <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer
1044 %ext = call <vscale x 2 x float> @llvm.vector.extract.nxv2f32.nxv4f32(<vscale x 4 x float> %splat, i64 0)
1045 ret <vscale x 2 x float> %ext
1048 define <vscale x 4 x i32> @extract_nxv4i32_nxv8i32_splat_const() {
1049 ; CHECK-LABEL: extract_nxv4i32_nxv8i32_splat_const:
1051 ; CHECK-NEXT: mov z0.s, #1 // =0x1
1053 %ins = insertelement <vscale x 8 x i32> poison, i32 1, i32 0
1054 %splat = shufflevector <vscale x 8 x i32> %ins, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
1055 %ext = call <vscale x 4 x i32> @llvm.vector.extract.nxv4i32.nxv8i32(<vscale x 8 x i32> %splat, i64 0)
1056 ret <vscale x 4 x i32> %ext
1059 define <vscale x 2 x i1> @extract_nxv2i1_nxv16i1_all_ones() {
1060 ; CHECK-LABEL: extract_nxv2i1_nxv16i1_all_ones:
1062 ; CHECK-NEXT: ptrue p0.d
1064 %ins = insertelement <vscale x 16 x i1> poison, i1 1, i32 0
1065 %splat = shufflevector <vscale x 16 x i1> %ins, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
1066 %ext = call <vscale x 2 x i1> @llvm.vector.extract.nxv2i1.nxv16i1(<vscale x 16 x i1> %splat, i64 0)
1067 ret <vscale x 2 x i1> %ext
1070 define <vscale x 2 x i1> @extract_nxv2i1_nxv16i1_all_zero() {
1071 ; CHECK-LABEL: extract_nxv2i1_nxv16i1_all_zero:
1073 ; CHECK-NEXT: pfalse p0.b
1075 %ext = call <vscale x 2 x i1> @llvm.vector.extract.nxv2i1.nxv16i1(<vscale x 16 x i1> zeroinitializer, i64 0)
1076 ret <vscale x 2 x i1> %ext
1079 declare <vscale x 2 x float> @llvm.vector.extract.nxv2f32.nxv4f32(<vscale x 4 x float>, i64)
1080 declare <vscale x 4 x i32> @llvm.vector.extract.nxv4i32.nxv8i32(<vscale x 8 x i32>, i64)
1083 ; Extract nxv1i1 type from: nxv2i1
1086 define <vscale x 1 x i1> @extract_nxv1i1_nxv2i1_0(<vscale x 2 x i1> %in) {
1087 ; CHECK-LABEL: extract_nxv1i1_nxv2i1_0:
1089 ; CHECK-NEXT: punpklo p0.h, p0.b
1091 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv2i1(<vscale x 2 x i1> %in, i64 0)
1092 ret <vscale x 1 x i1> %res
1095 define <vscale x 1 x i1> @extract_nxv1i1_nxv2i1_1(<vscale x 2 x i1> %in) {
1096 ; CHECK-LABEL: extract_nxv1i1_nxv2i1_1:
1098 ; CHECK-NEXT: punpkhi p0.h, p0.b
1100 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv2i1(<vscale x 2 x i1> %in, i64 1)
1101 ret <vscale x 1 x i1> %res
1105 ; Extract nxv1i1 type from: nxv4i1
1108 define <vscale x 1 x i1> @extract_nxv1i1_nxv4i1_0(<vscale x 4 x i1> %in) {
1109 ; CHECK-LABEL: extract_nxv1i1_nxv4i1_0:
1111 ; CHECK-NEXT: punpklo p0.h, p0.b
1112 ; CHECK-NEXT: punpklo p0.h, p0.b
1114 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv4i1(<vscale x 4 x i1> %in, i64 0)
1115 ret <vscale x 1 x i1> %res
1118 define <vscale x 1 x i1> @extract_nxv1i1_nxv4i1_1(<vscale x 4 x i1> %in) {
1119 ; CHECK-LABEL: extract_nxv1i1_nxv4i1_1:
1121 ; CHECK-NEXT: punpklo p0.h, p0.b
1122 ; CHECK-NEXT: punpkhi p0.h, p0.b
1124 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv4i1(<vscale x 4 x i1> %in, i64 1)
1125 ret <vscale x 1 x i1> %res
1128 define <vscale x 1 x i1> @extract_nxv1i1_nxv4i1_2(<vscale x 4 x i1> %in) {
1129 ; CHECK-LABEL: extract_nxv1i1_nxv4i1_2:
1131 ; CHECK-NEXT: punpkhi p0.h, p0.b
1132 ; CHECK-NEXT: punpklo p0.h, p0.b
1134 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv4i1(<vscale x 4 x i1> %in, i64 2)
1135 ret <vscale x 1 x i1> %res
1138 define <vscale x 1 x i1> @extract_nxv1i1_nxv4i1_3(<vscale x 4 x i1> %in) {
1139 ; CHECK-LABEL: extract_nxv1i1_nxv4i1_3:
1141 ; CHECK-NEXT: punpkhi p0.h, p0.b
1142 ; CHECK-NEXT: punpkhi p0.h, p0.b
1144 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv4i1(<vscale x 4 x i1> %in, i64 3)
1145 ret <vscale x 1 x i1> %res
1149 ; Extract nxv1i1 type from: nxv8i1
1152 define <vscale x 1 x i1> @extract_nxv1i1_nxv8i1_0(<vscale x 8 x i1> %in) {
1153 ; CHECK-LABEL: extract_nxv1i1_nxv8i1_0:
1155 ; CHECK-NEXT: punpklo p0.h, p0.b
1156 ; CHECK-NEXT: punpklo p0.h, p0.b
1157 ; CHECK-NEXT: punpklo p0.h, p0.b
1159 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv8i1(<vscale x 8 x i1> %in, i64 0)
1160 ret <vscale x 1 x i1> %res
1163 define <vscale x 1 x i1> @extract_nxv1i1_nxv8i1_1(<vscale x 8 x i1> %in) {
1164 ; CHECK-LABEL: extract_nxv1i1_nxv8i1_1:
1166 ; CHECK-NEXT: punpklo p0.h, p0.b
1167 ; CHECK-NEXT: punpklo p0.h, p0.b
1168 ; CHECK-NEXT: punpkhi p0.h, p0.b
1170 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv8i1(<vscale x 8 x i1> %in, i64 1)
1171 ret <vscale x 1 x i1> %res
1174 define <vscale x 1 x i1> @extract_nxv1i1_nxv8i1_2(<vscale x 8 x i1> %in) {
1175 ; CHECK-LABEL: extract_nxv1i1_nxv8i1_2:
1177 ; CHECK-NEXT: punpklo p0.h, p0.b
1178 ; CHECK-NEXT: punpkhi p0.h, p0.b
1179 ; CHECK-NEXT: punpklo p0.h, p0.b
1181 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv8i1(<vscale x 8 x i1> %in, i64 2)
1182 ret <vscale x 1 x i1> %res
1185 define <vscale x 1 x i1> @extract_nxv1i1_nxv8i1_3(<vscale x 8 x i1> %in) {
1186 ; CHECK-LABEL: extract_nxv1i1_nxv8i1_3:
1188 ; CHECK-NEXT: punpklo p0.h, p0.b
1189 ; CHECK-NEXT: punpkhi p0.h, p0.b
1190 ; CHECK-NEXT: punpkhi p0.h, p0.b
1192 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv8i1(<vscale x 8 x i1> %in, i64 3)
1193 ret <vscale x 1 x i1> %res
1196 define <vscale x 1 x i1> @extract_nxv1i1_nxv8i1_4(<vscale x 8 x i1> %in) {
1197 ; CHECK-LABEL: extract_nxv1i1_nxv8i1_4:
1199 ; CHECK-NEXT: punpkhi p0.h, p0.b
1200 ; CHECK-NEXT: punpklo p0.h, p0.b
1201 ; CHECK-NEXT: punpklo p0.h, p0.b
1203 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv8i1(<vscale x 8 x i1> %in, i64 4)
1204 ret <vscale x 1 x i1> %res
1207 define <vscale x 1 x i1> @extract_nxv1i1_nxv8i1_5(<vscale x 8 x i1> %in) {
1208 ; CHECK-LABEL: extract_nxv1i1_nxv8i1_5:
1210 ; CHECK-NEXT: punpkhi p0.h, p0.b
1211 ; CHECK-NEXT: punpklo p0.h, p0.b
1212 ; CHECK-NEXT: punpkhi p0.h, p0.b
1214 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv8i1(<vscale x 8 x i1> %in, i64 5)
1215 ret <vscale x 1 x i1> %res
1218 define <vscale x 1 x i1> @extract_nxv1i1_nxv8i1_6(<vscale x 8 x i1> %in) {
1219 ; CHECK-LABEL: extract_nxv1i1_nxv8i1_6:
1221 ; CHECK-NEXT: punpkhi p0.h, p0.b
1222 ; CHECK-NEXT: punpkhi p0.h, p0.b
1223 ; CHECK-NEXT: punpklo p0.h, p0.b
1225 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv8i1(<vscale x 8 x i1> %in, i64 6)
1226 ret <vscale x 1 x i1> %res
1229 define <vscale x 1 x i1> @extract_nxv1i1_nxv8i1_7(<vscale x 8 x i1> %in) {
1230 ; CHECK-LABEL: extract_nxv1i1_nxv8i1_7:
1232 ; CHECK-NEXT: punpkhi p0.h, p0.b
1233 ; CHECK-NEXT: punpkhi p0.h, p0.b
1234 ; CHECK-NEXT: punpkhi p0.h, p0.b
1236 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv8i1(<vscale x 8 x i1> %in, i64 7)
1237 ret <vscale x 1 x i1> %res
1242 ; Extract nxv1i1 type from: nxv16i1
1245 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_0(<vscale x 16 x i1> %in) {
1246 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_0:
1248 ; CHECK-NEXT: punpklo p0.h, p0.b
1249 ; CHECK-NEXT: punpklo p0.h, p0.b
1250 ; CHECK-NEXT: punpklo p0.h, p0.b
1251 ; CHECK-NEXT: punpklo p0.h, p0.b
1253 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 0)
1254 ret <vscale x 1 x i1> %res
1257 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_1(<vscale x 16 x i1> %in) {
1258 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_1:
1260 ; CHECK-NEXT: punpklo p0.h, p0.b
1261 ; CHECK-NEXT: punpklo p0.h, p0.b
1262 ; CHECK-NEXT: punpklo p0.h, p0.b
1263 ; CHECK-NEXT: punpkhi p0.h, p0.b
1265 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 1)
1266 ret <vscale x 1 x i1> %res
1269 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_2(<vscale x 16 x i1> %in) {
1270 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_2:
1272 ; CHECK-NEXT: punpklo p0.h, p0.b
1273 ; CHECK-NEXT: punpklo p0.h, p0.b
1274 ; CHECK-NEXT: punpkhi p0.h, p0.b
1275 ; CHECK-NEXT: punpklo p0.h, p0.b
1277 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 2)
1278 ret <vscale x 1 x i1> %res
1281 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_3(<vscale x 16 x i1> %in) {
1282 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_3:
1284 ; CHECK-NEXT: punpklo p0.h, p0.b
1285 ; CHECK-NEXT: punpklo p0.h, p0.b
1286 ; CHECK-NEXT: punpkhi p0.h, p0.b
1287 ; CHECK-NEXT: punpkhi p0.h, p0.b
1289 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 3)
1290 ret <vscale x 1 x i1> %res
1293 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_4(<vscale x 16 x i1> %in) {
1294 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_4:
1296 ; CHECK-NEXT: punpklo p0.h, p0.b
1297 ; CHECK-NEXT: punpkhi p0.h, p0.b
1298 ; CHECK-NEXT: punpklo p0.h, p0.b
1299 ; CHECK-NEXT: punpklo p0.h, p0.b
1301 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 4)
1302 ret <vscale x 1 x i1> %res
1305 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_5(<vscale x 16 x i1> %in) {
1306 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_5:
1308 ; CHECK-NEXT: punpklo p0.h, p0.b
1309 ; CHECK-NEXT: punpkhi p0.h, p0.b
1310 ; CHECK-NEXT: punpklo p0.h, p0.b
1311 ; CHECK-NEXT: punpkhi p0.h, p0.b
1313 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 5)
1314 ret <vscale x 1 x i1> %res
1317 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_6(<vscale x 16 x i1> %in) {
1318 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_6:
1320 ; CHECK-NEXT: punpklo p0.h, p0.b
1321 ; CHECK-NEXT: punpkhi p0.h, p0.b
1322 ; CHECK-NEXT: punpkhi p0.h, p0.b
1323 ; CHECK-NEXT: punpklo p0.h, p0.b
1325 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 6)
1326 ret <vscale x 1 x i1> %res
1329 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_7(<vscale x 16 x i1> %in) {
1330 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_7:
1332 ; CHECK-NEXT: punpklo p0.h, p0.b
1333 ; CHECK-NEXT: punpkhi p0.h, p0.b
1334 ; CHECK-NEXT: punpkhi p0.h, p0.b
1335 ; CHECK-NEXT: punpkhi p0.h, p0.b
1337 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 7)
1338 ret <vscale x 1 x i1> %res
1341 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_8(<vscale x 16 x i1> %in) {
1342 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_8:
1344 ; CHECK-NEXT: punpkhi p0.h, p0.b
1345 ; CHECK-NEXT: punpklo p0.h, p0.b
1346 ; CHECK-NEXT: punpklo p0.h, p0.b
1347 ; CHECK-NEXT: punpklo p0.h, p0.b
1349 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 8)
1350 ret <vscale x 1 x i1> %res
1353 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_9(<vscale x 16 x i1> %in) {
1354 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_9:
1356 ; CHECK-NEXT: punpkhi p0.h, p0.b
1357 ; CHECK-NEXT: punpklo p0.h, p0.b
1358 ; CHECK-NEXT: punpklo p0.h, p0.b
1359 ; CHECK-NEXT: punpkhi p0.h, p0.b
1361 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 9)
1362 ret <vscale x 1 x i1> %res
1365 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_10(<vscale x 16 x i1> %in) {
1366 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_10:
1368 ; CHECK-NEXT: punpkhi p0.h, p0.b
1369 ; CHECK-NEXT: punpklo p0.h, p0.b
1370 ; CHECK-NEXT: punpkhi p0.h, p0.b
1371 ; CHECK-NEXT: punpklo p0.h, p0.b
1373 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 10)
1374 ret <vscale x 1 x i1> %res
1377 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_11(<vscale x 16 x i1> %in) {
1378 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_11:
1380 ; CHECK-NEXT: punpkhi p0.h, p0.b
1381 ; CHECK-NEXT: punpklo p0.h, p0.b
1382 ; CHECK-NEXT: punpkhi p0.h, p0.b
1383 ; CHECK-NEXT: punpkhi p0.h, p0.b
1385 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 11)
1386 ret <vscale x 1 x i1> %res
1389 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_12(<vscale x 16 x i1> %in) {
1390 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_12:
1392 ; CHECK-NEXT: punpkhi p0.h, p0.b
1393 ; CHECK-NEXT: punpkhi p0.h, p0.b
1394 ; CHECK-NEXT: punpklo p0.h, p0.b
1395 ; CHECK-NEXT: punpklo p0.h, p0.b
1397 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 12)
1398 ret <vscale x 1 x i1> %res
1401 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_13(<vscale x 16 x i1> %in) {
1402 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_13:
1404 ; CHECK-NEXT: punpkhi p0.h, p0.b
1405 ; CHECK-NEXT: punpkhi p0.h, p0.b
1406 ; CHECK-NEXT: punpklo p0.h, p0.b
1407 ; CHECK-NEXT: punpkhi p0.h, p0.b
1409 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 13)
1410 ret <vscale x 1 x i1> %res
1413 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_14(<vscale x 16 x i1> %in) {
1414 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_14:
1416 ; CHECK-NEXT: punpkhi p0.h, p0.b
1417 ; CHECK-NEXT: punpkhi p0.h, p0.b
1418 ; CHECK-NEXT: punpkhi p0.h, p0.b
1419 ; CHECK-NEXT: punpklo p0.h, p0.b
1421 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 14)
1422 ret <vscale x 1 x i1> %res
1425 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_15(<vscale x 16 x i1> %in) {
1426 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_15:
1428 ; CHECK-NEXT: punpkhi p0.h, p0.b
1429 ; CHECK-NEXT: punpkhi p0.h, p0.b
1430 ; CHECK-NEXT: punpkhi p0.h, p0.b
1431 ; CHECK-NEXT: punpkhi p0.h, p0.b
1433 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 15)
1434 ret <vscale x 1 x i1> %res
1437 declare <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv2i1(<vscale x 2 x i1>, i64)
1438 declare <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv4i1(<vscale x 4 x i1>, i64)
1439 declare <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv8i1(<vscale x 8 x i1>, i64)
1440 declare <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1>, i64)