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 %ext = call <vscale x 2 x float> @llvm.vector.extract.nxv2f32.nxv4f32(<vscale x 4 x float> splat(float 1.0), i64 0)
1043 ret <vscale x 2 x float> %ext
1046 define <vscale x 4 x i32> @extract_nxv4i32_nxv8i32_splat_const() {
1047 ; CHECK-LABEL: extract_nxv4i32_nxv8i32_splat_const:
1049 ; CHECK-NEXT: mov z0.s, #1 // =0x1
1051 %ext = call <vscale x 4 x i32> @llvm.vector.extract.nxv4i32.nxv8i32(<vscale x 8 x i32> splat(i32 1), i64 0)
1052 ret <vscale x 4 x i32> %ext
1055 define <vscale x 2 x i1> @extract_nxv2i1_nxv16i1_all_ones() {
1056 ; CHECK-LABEL: extract_nxv2i1_nxv16i1_all_ones:
1058 ; CHECK-NEXT: ptrue p0.d
1060 %ext = call <vscale x 2 x i1> @llvm.vector.extract.nxv2i1.nxv16i1(<vscale x 16 x i1> splat(i1 true), i64 0)
1061 ret <vscale x 2 x i1> %ext
1064 define <vscale x 2 x i1> @extract_nxv2i1_nxv16i1_all_zero() {
1065 ; CHECK-LABEL: extract_nxv2i1_nxv16i1_all_zero:
1067 ; CHECK-NEXT: pfalse p0.b
1069 %ext = call <vscale x 2 x i1> @llvm.vector.extract.nxv2i1.nxv16i1(<vscale x 16 x i1> zeroinitializer, i64 0)
1070 ret <vscale x 2 x i1> %ext
1073 declare <vscale x 2 x float> @llvm.vector.extract.nxv2f32.nxv4f32(<vscale x 4 x float>, i64)
1074 declare <vscale x 4 x i32> @llvm.vector.extract.nxv4i32.nxv8i32(<vscale x 8 x i32>, i64)
1077 ; Extract nxv1i1 type from: nxv2i1
1080 define <vscale x 1 x i1> @extract_nxv1i1_nxv2i1_0(<vscale x 2 x i1> %in) {
1081 ; CHECK-LABEL: extract_nxv1i1_nxv2i1_0:
1083 ; CHECK-NEXT: punpklo p0.h, p0.b
1085 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv2i1(<vscale x 2 x i1> %in, i64 0)
1086 ret <vscale x 1 x i1> %res
1089 define <vscale x 1 x i1> @extract_nxv1i1_nxv2i1_1(<vscale x 2 x i1> %in) {
1090 ; CHECK-LABEL: extract_nxv1i1_nxv2i1_1:
1092 ; CHECK-NEXT: punpkhi p0.h, p0.b
1094 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv2i1(<vscale x 2 x i1> %in, i64 1)
1095 ret <vscale x 1 x i1> %res
1099 ; Extract nxv1i1 type from: nxv4i1
1102 define <vscale x 1 x i1> @extract_nxv1i1_nxv4i1_0(<vscale x 4 x i1> %in) {
1103 ; CHECK-LABEL: extract_nxv1i1_nxv4i1_0:
1105 ; CHECK-NEXT: punpklo p0.h, p0.b
1106 ; CHECK-NEXT: punpklo p0.h, p0.b
1108 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv4i1(<vscale x 4 x i1> %in, i64 0)
1109 ret <vscale x 1 x i1> %res
1112 define <vscale x 1 x i1> @extract_nxv1i1_nxv4i1_1(<vscale x 4 x i1> %in) {
1113 ; CHECK-LABEL: extract_nxv1i1_nxv4i1_1:
1115 ; CHECK-NEXT: punpklo p0.h, p0.b
1116 ; CHECK-NEXT: punpkhi p0.h, p0.b
1118 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv4i1(<vscale x 4 x i1> %in, i64 1)
1119 ret <vscale x 1 x i1> %res
1122 define <vscale x 1 x i1> @extract_nxv1i1_nxv4i1_2(<vscale x 4 x i1> %in) {
1123 ; CHECK-LABEL: extract_nxv1i1_nxv4i1_2:
1125 ; CHECK-NEXT: punpkhi p0.h, p0.b
1126 ; CHECK-NEXT: punpklo p0.h, p0.b
1128 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv4i1(<vscale x 4 x i1> %in, i64 2)
1129 ret <vscale x 1 x i1> %res
1132 define <vscale x 1 x i1> @extract_nxv1i1_nxv4i1_3(<vscale x 4 x i1> %in) {
1133 ; CHECK-LABEL: extract_nxv1i1_nxv4i1_3:
1135 ; CHECK-NEXT: punpkhi p0.h, p0.b
1136 ; CHECK-NEXT: punpkhi p0.h, p0.b
1138 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv4i1(<vscale x 4 x i1> %in, i64 3)
1139 ret <vscale x 1 x i1> %res
1143 ; Extract nxv1i1 type from: nxv8i1
1146 define <vscale x 1 x i1> @extract_nxv1i1_nxv8i1_0(<vscale x 8 x i1> %in) {
1147 ; CHECK-LABEL: extract_nxv1i1_nxv8i1_0:
1149 ; CHECK-NEXT: punpklo p0.h, p0.b
1150 ; CHECK-NEXT: punpklo p0.h, p0.b
1151 ; CHECK-NEXT: punpklo p0.h, p0.b
1153 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv8i1(<vscale x 8 x i1> %in, i64 0)
1154 ret <vscale x 1 x i1> %res
1157 define <vscale x 1 x i1> @extract_nxv1i1_nxv8i1_1(<vscale x 8 x i1> %in) {
1158 ; CHECK-LABEL: extract_nxv1i1_nxv8i1_1:
1160 ; CHECK-NEXT: punpklo p0.h, p0.b
1161 ; CHECK-NEXT: punpklo p0.h, p0.b
1162 ; CHECK-NEXT: punpkhi p0.h, p0.b
1164 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv8i1(<vscale x 8 x i1> %in, i64 1)
1165 ret <vscale x 1 x i1> %res
1168 define <vscale x 1 x i1> @extract_nxv1i1_nxv8i1_2(<vscale x 8 x i1> %in) {
1169 ; CHECK-LABEL: extract_nxv1i1_nxv8i1_2:
1171 ; CHECK-NEXT: punpklo p0.h, p0.b
1172 ; CHECK-NEXT: punpkhi p0.h, p0.b
1173 ; CHECK-NEXT: punpklo p0.h, p0.b
1175 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv8i1(<vscale x 8 x i1> %in, i64 2)
1176 ret <vscale x 1 x i1> %res
1179 define <vscale x 1 x i1> @extract_nxv1i1_nxv8i1_3(<vscale x 8 x i1> %in) {
1180 ; CHECK-LABEL: extract_nxv1i1_nxv8i1_3:
1182 ; CHECK-NEXT: punpklo p0.h, p0.b
1183 ; CHECK-NEXT: punpkhi p0.h, p0.b
1184 ; CHECK-NEXT: punpkhi p0.h, p0.b
1186 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv8i1(<vscale x 8 x i1> %in, i64 3)
1187 ret <vscale x 1 x i1> %res
1190 define <vscale x 1 x i1> @extract_nxv1i1_nxv8i1_4(<vscale x 8 x i1> %in) {
1191 ; CHECK-LABEL: extract_nxv1i1_nxv8i1_4:
1193 ; CHECK-NEXT: punpkhi p0.h, p0.b
1194 ; CHECK-NEXT: punpklo p0.h, p0.b
1195 ; CHECK-NEXT: punpklo p0.h, p0.b
1197 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv8i1(<vscale x 8 x i1> %in, i64 4)
1198 ret <vscale x 1 x i1> %res
1201 define <vscale x 1 x i1> @extract_nxv1i1_nxv8i1_5(<vscale x 8 x i1> %in) {
1202 ; CHECK-LABEL: extract_nxv1i1_nxv8i1_5:
1204 ; CHECK-NEXT: punpkhi p0.h, p0.b
1205 ; CHECK-NEXT: punpklo p0.h, p0.b
1206 ; CHECK-NEXT: punpkhi p0.h, p0.b
1208 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv8i1(<vscale x 8 x i1> %in, i64 5)
1209 ret <vscale x 1 x i1> %res
1212 define <vscale x 1 x i1> @extract_nxv1i1_nxv8i1_6(<vscale x 8 x i1> %in) {
1213 ; CHECK-LABEL: extract_nxv1i1_nxv8i1_6:
1215 ; CHECK-NEXT: punpkhi p0.h, p0.b
1216 ; CHECK-NEXT: punpkhi p0.h, p0.b
1217 ; CHECK-NEXT: punpklo p0.h, p0.b
1219 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv8i1(<vscale x 8 x i1> %in, i64 6)
1220 ret <vscale x 1 x i1> %res
1223 define <vscale x 1 x i1> @extract_nxv1i1_nxv8i1_7(<vscale x 8 x i1> %in) {
1224 ; CHECK-LABEL: extract_nxv1i1_nxv8i1_7:
1226 ; CHECK-NEXT: punpkhi p0.h, p0.b
1227 ; CHECK-NEXT: punpkhi p0.h, p0.b
1228 ; CHECK-NEXT: punpkhi p0.h, p0.b
1230 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv8i1(<vscale x 8 x i1> %in, i64 7)
1231 ret <vscale x 1 x i1> %res
1236 ; Extract nxv1i1 type from: nxv16i1
1239 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_0(<vscale x 16 x i1> %in) {
1240 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_0:
1242 ; CHECK-NEXT: punpklo p0.h, p0.b
1243 ; CHECK-NEXT: punpklo p0.h, p0.b
1244 ; CHECK-NEXT: punpklo p0.h, p0.b
1245 ; CHECK-NEXT: punpklo p0.h, p0.b
1247 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 0)
1248 ret <vscale x 1 x i1> %res
1251 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_1(<vscale x 16 x i1> %in) {
1252 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_1:
1254 ; CHECK-NEXT: punpklo p0.h, p0.b
1255 ; CHECK-NEXT: punpklo p0.h, p0.b
1256 ; CHECK-NEXT: punpklo p0.h, p0.b
1257 ; CHECK-NEXT: punpkhi p0.h, p0.b
1259 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 1)
1260 ret <vscale x 1 x i1> %res
1263 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_2(<vscale x 16 x i1> %in) {
1264 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_2:
1266 ; CHECK-NEXT: punpklo p0.h, p0.b
1267 ; CHECK-NEXT: punpklo p0.h, p0.b
1268 ; CHECK-NEXT: punpkhi p0.h, p0.b
1269 ; CHECK-NEXT: punpklo p0.h, p0.b
1271 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 2)
1272 ret <vscale x 1 x i1> %res
1275 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_3(<vscale x 16 x i1> %in) {
1276 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_3:
1278 ; CHECK-NEXT: punpklo p0.h, p0.b
1279 ; CHECK-NEXT: punpklo p0.h, p0.b
1280 ; CHECK-NEXT: punpkhi p0.h, p0.b
1281 ; CHECK-NEXT: punpkhi p0.h, p0.b
1283 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 3)
1284 ret <vscale x 1 x i1> %res
1287 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_4(<vscale x 16 x i1> %in) {
1288 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_4:
1290 ; CHECK-NEXT: punpklo p0.h, p0.b
1291 ; CHECK-NEXT: punpkhi p0.h, p0.b
1292 ; CHECK-NEXT: punpklo p0.h, p0.b
1293 ; CHECK-NEXT: punpklo p0.h, p0.b
1295 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 4)
1296 ret <vscale x 1 x i1> %res
1299 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_5(<vscale x 16 x i1> %in) {
1300 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_5:
1302 ; CHECK-NEXT: punpklo p0.h, p0.b
1303 ; CHECK-NEXT: punpkhi p0.h, p0.b
1304 ; CHECK-NEXT: punpklo p0.h, p0.b
1305 ; CHECK-NEXT: punpkhi p0.h, p0.b
1307 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 5)
1308 ret <vscale x 1 x i1> %res
1311 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_6(<vscale x 16 x i1> %in) {
1312 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_6:
1314 ; CHECK-NEXT: punpklo p0.h, p0.b
1315 ; CHECK-NEXT: punpkhi p0.h, p0.b
1316 ; CHECK-NEXT: punpkhi p0.h, p0.b
1317 ; CHECK-NEXT: punpklo p0.h, p0.b
1319 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 6)
1320 ret <vscale x 1 x i1> %res
1323 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_7(<vscale x 16 x i1> %in) {
1324 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_7:
1326 ; CHECK-NEXT: punpklo p0.h, p0.b
1327 ; CHECK-NEXT: punpkhi p0.h, p0.b
1328 ; CHECK-NEXT: punpkhi p0.h, p0.b
1329 ; CHECK-NEXT: punpkhi p0.h, p0.b
1331 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 7)
1332 ret <vscale x 1 x i1> %res
1335 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_8(<vscale x 16 x i1> %in) {
1336 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_8:
1338 ; CHECK-NEXT: punpkhi p0.h, p0.b
1339 ; CHECK-NEXT: punpklo p0.h, p0.b
1340 ; CHECK-NEXT: punpklo p0.h, p0.b
1341 ; CHECK-NEXT: punpklo p0.h, p0.b
1343 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 8)
1344 ret <vscale x 1 x i1> %res
1347 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_9(<vscale x 16 x i1> %in) {
1348 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_9:
1350 ; CHECK-NEXT: punpkhi p0.h, p0.b
1351 ; CHECK-NEXT: punpklo p0.h, p0.b
1352 ; CHECK-NEXT: punpklo p0.h, p0.b
1353 ; CHECK-NEXT: punpkhi p0.h, p0.b
1355 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 9)
1356 ret <vscale x 1 x i1> %res
1359 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_10(<vscale x 16 x i1> %in) {
1360 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_10:
1362 ; CHECK-NEXT: punpkhi p0.h, p0.b
1363 ; CHECK-NEXT: punpklo p0.h, p0.b
1364 ; CHECK-NEXT: punpkhi p0.h, p0.b
1365 ; CHECK-NEXT: punpklo p0.h, p0.b
1367 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 10)
1368 ret <vscale x 1 x i1> %res
1371 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_11(<vscale x 16 x i1> %in) {
1372 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_11:
1374 ; CHECK-NEXT: punpkhi p0.h, p0.b
1375 ; CHECK-NEXT: punpklo p0.h, p0.b
1376 ; CHECK-NEXT: punpkhi p0.h, p0.b
1377 ; CHECK-NEXT: punpkhi p0.h, p0.b
1379 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 11)
1380 ret <vscale x 1 x i1> %res
1383 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_12(<vscale x 16 x i1> %in) {
1384 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_12:
1386 ; CHECK-NEXT: punpkhi p0.h, p0.b
1387 ; CHECK-NEXT: punpkhi p0.h, p0.b
1388 ; CHECK-NEXT: punpklo p0.h, p0.b
1389 ; CHECK-NEXT: punpklo p0.h, p0.b
1391 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 12)
1392 ret <vscale x 1 x i1> %res
1395 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_13(<vscale x 16 x i1> %in) {
1396 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_13:
1398 ; CHECK-NEXT: punpkhi p0.h, p0.b
1399 ; CHECK-NEXT: punpkhi p0.h, p0.b
1400 ; CHECK-NEXT: punpklo p0.h, p0.b
1401 ; CHECK-NEXT: punpkhi p0.h, p0.b
1403 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 13)
1404 ret <vscale x 1 x i1> %res
1407 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_14(<vscale x 16 x i1> %in) {
1408 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_14:
1410 ; CHECK-NEXT: punpkhi p0.h, p0.b
1411 ; CHECK-NEXT: punpkhi p0.h, p0.b
1412 ; CHECK-NEXT: punpkhi p0.h, p0.b
1413 ; CHECK-NEXT: punpklo p0.h, p0.b
1415 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 14)
1416 ret <vscale x 1 x i1> %res
1419 define <vscale x 1 x i1> @extract_nxv1i1_nxv16i1_15(<vscale x 16 x i1> %in) {
1420 ; CHECK-LABEL: extract_nxv1i1_nxv16i1_15:
1422 ; CHECK-NEXT: punpkhi p0.h, p0.b
1423 ; CHECK-NEXT: punpkhi p0.h, p0.b
1424 ; CHECK-NEXT: punpkhi p0.h, p0.b
1425 ; CHECK-NEXT: punpkhi p0.h, p0.b
1427 %res = call <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1> %in, i64 15)
1428 ret <vscale x 1 x i1> %res
1431 declare <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv2i1(<vscale x 2 x i1>, i64)
1432 declare <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv4i1(<vscale x 4 x i1>, i64)
1433 declare <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv8i1(<vscale x 8 x i1>, i64)
1434 declare <vscale x 1 x i1> @llvm.vector.extract.nxv1i1.nxv16i1(<vscale x 16 x i1>, i64)