1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple aarch64-none-linux-gnu -mattr=+sve | FileCheck %s
4 define <vscale x 16 x i8> @dup_extract_nxv16i8_nxv16i8(<vscale x 16 x i8> %data) {
5 ; CHECK-LABEL: dup_extract_nxv16i8_nxv16i8:
7 ; CHECK-NEXT: mov z0.b, z0.b[1]
9 %1 = extractelement <vscale x 16 x i8> %data, i8 1
10 %.splatinsert = insertelement <vscale x 16 x i8> poison, i8 %1, i32 0
11 %.splat = shufflevector <vscale x 16 x i8> %.splatinsert, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
12 ret <vscale x 16 x i8> %.splat
15 define <vscale x 16 x i8> @dup_extract_nxv16i8_v16i8(<16 x i8> %data) {
16 ; CHECK-LABEL: dup_extract_nxv16i8_v16i8:
18 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
19 ; CHECK-NEXT: mov z0.b, z0.b[1]
21 %1 = extractelement <16 x i8> %data, i8 1
22 %.splatinsert = insertelement <vscale x 16 x i8> poison, i8 %1, i32 0
23 %.splat = shufflevector <vscale x 16 x i8> %.splatinsert, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
24 ret <vscale x 16 x i8> %.splat
27 define <vscale x 16 x i8> @dup_extract_nxv16i8_v8i8(<8 x i8> %data) {
28 ; CHECK-LABEL: dup_extract_nxv16i8_v8i8:
30 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
31 ; CHECK-NEXT: mov z0.b, z0.b[1]
33 %1 = extractelement <8 x i8> %data, i8 1
34 %.splatinsert = insertelement <vscale x 16 x i8> poison, i8 %1, i32 0
35 %.splat = shufflevector <vscale x 16 x i8> %.splatinsert, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
36 ret <vscale x 16 x i8> %.splat
39 define <vscale x 8 x i16> @dup_extract_nxv8i16_nxv8i16(<vscale x 8 x i16> %data) {
40 ; CHECK-LABEL: dup_extract_nxv8i16_nxv8i16:
42 ; CHECK-NEXT: mov z0.h, z0.h[1]
44 %1 = extractelement <vscale x 8 x i16> %data, i16 1
45 %.splatinsert = insertelement <vscale x 8 x i16> poison, i16 %1, i32 0
46 %.splat = shufflevector <vscale x 8 x i16> %.splatinsert, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
47 ret <vscale x 8 x i16> %.splat
50 define <vscale x 8 x i16> @dup_extract_nxv8i16_v8i16(<8 x i16> %data) {
51 ; CHECK-LABEL: dup_extract_nxv8i16_v8i16:
53 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
54 ; CHECK-NEXT: mov z0.h, z0.h[1]
56 %1 = extractelement <8 x i16> %data, i16 1
57 %.splatinsert = insertelement <vscale x 8 x i16> poison, i16 %1, i32 0
58 %.splat = shufflevector <vscale x 8 x i16> %.splatinsert, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
59 ret <vscale x 8 x i16> %.splat
62 define <vscale x 8 x i16> @dup_extract_nxv8i16_v4i16(<4 x i16> %data) {
63 ; CHECK-LABEL: dup_extract_nxv8i16_v4i16:
65 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
66 ; CHECK-NEXT: mov z0.h, z0.h[1]
68 %1 = extractelement <4 x i16> %data, i16 1
69 %.splatinsert = insertelement <vscale x 8 x i16> poison, i16 %1, i32 0
70 %.splat = shufflevector <vscale x 8 x i16> %.splatinsert, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
71 ret <vscale x 8 x i16> %.splat
74 define <vscale x 4 x i32> @dup_extract_nxv4i32_nxv4i32(<vscale x 4 x i32> %data) {
75 ; CHECK-LABEL: dup_extract_nxv4i32_nxv4i32:
77 ; CHECK-NEXT: mov z0.s, z0.s[1]
79 %1 = extractelement <vscale x 4 x i32> %data, i32 1
80 %.splatinsert = insertelement <vscale x 4 x i32> poison, i32 %1, i32 0
81 %.splat = shufflevector <vscale x 4 x i32> %.splatinsert, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
82 ret <vscale x 4 x i32> %.splat
85 define <vscale x 4 x i32> @dup_extract_nxv4i32_v4i32(<4 x i32> %data) {
86 ; CHECK-LABEL: dup_extract_nxv4i32_v4i32:
88 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
89 ; CHECK-NEXT: mov z0.s, z0.s[1]
91 %1 = extractelement <4 x i32> %data, i32 1
92 %.splatinsert = insertelement <vscale x 4 x i32> poison, i32 %1, i32 0
93 %.splat = shufflevector <vscale x 4 x i32> %.splatinsert, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
94 ret <vscale x 4 x i32> %.splat
97 define <vscale x 4 x i32> @dup_extract_nxv4i32_v2i32(<2 x i32> %data) {
98 ; CHECK-LABEL: dup_extract_nxv4i32_v2i32:
100 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
101 ; CHECK-NEXT: mov z0.s, z0.s[1]
103 %1 = extractelement <2 x i32> %data, i32 1
104 %.splatinsert = insertelement <vscale x 4 x i32> poison, i32 %1, i32 0
105 %.splat = shufflevector <vscale x 4 x i32> %.splatinsert, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
106 ret <vscale x 4 x i32> %.splat
109 define <vscale x 2 x i64> @dup_extract_nxv2i64_nxv2i64(<vscale x 2 x i64> %data) {
110 ; CHECK-LABEL: dup_extract_nxv2i64_nxv2i64:
112 ; CHECK-NEXT: mov z0.d, z0.d[1]
114 %1 = extractelement <vscale x 2 x i64> %data, i64 1
115 %.splatinsert = insertelement <vscale x 2 x i64> poison, i64 %1, i32 0
116 %.splat = shufflevector <vscale x 2 x i64> %.splatinsert, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
117 ret <vscale x 2 x i64> %.splat
120 define <vscale x 2 x i64> @dup_extract_nxv2i64_v2i64(<2 x i64> %data) {
121 ; CHECK-LABEL: dup_extract_nxv2i64_v2i64:
123 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
124 ; CHECK-NEXT: mov z0.d, z0.d[1]
126 %1 = extractelement <2 x i64> %data, i64 1
127 %.splatinsert = insertelement <vscale x 2 x i64> poison, i64 %1, i32 0
128 %.splat = shufflevector <vscale x 2 x i64> %.splatinsert, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
129 ret <vscale x 2 x i64> %.splat
132 define <vscale x 2 x i64> @dup_extract_nxv2i64_v1i64(<1 x i64> %data) {
133 ; CHECK-LABEL: dup_extract_nxv2i64_v1i64:
135 ; CHECK-NEXT: mov z0.d, x8
137 %1 = extractelement <1 x i64> %data, i64 1
138 %.splatinsert = insertelement <vscale x 2 x i64> poison, i64 %1, i32 0
139 %.splat = shufflevector <vscale x 2 x i64> %.splatinsert, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
140 ret <vscale x 2 x i64> %.splat
143 define <vscale x 8 x half> @dup_extract_nxv8f16_nxv8f16(<vscale x 8 x half> %data) {
144 ; CHECK-LABEL: dup_extract_nxv8f16_nxv8f16:
146 ; CHECK-NEXT: mov z0.h, z0.h[1]
148 %1 = extractelement <vscale x 8 x half> %data, i16 1
149 %.splatinsert = insertelement <vscale x 8 x half> poison, half %1, i32 0
150 %.splat = shufflevector <vscale x 8 x half> %.splatinsert, <vscale x 8 x half> poison, <vscale x 8 x i32> zeroinitializer
151 ret <vscale x 8 x half> %.splat
154 define <vscale x 8 x half> @dup_extract_nxv8f16_nxv4f16(<vscale x 4 x half> %data) {
155 ; CHECK-LABEL: dup_extract_nxv8f16_nxv4f16:
157 ; CHECK-NEXT: mov z0.s, z0.s[1]
158 ; CHECK-NEXT: mov z0.h, h0
160 %1 = extractelement <vscale x 4 x half> %data, i16 1
161 %.splatinsert = insertelement <vscale x 8 x half> poison, half %1, i32 0
162 %.splat = shufflevector <vscale x 8 x half> %.splatinsert, <vscale x 8 x half> poison, <vscale x 8 x i32> zeroinitializer
163 ret <vscale x 8 x half> %.splat
166 define <vscale x 8 x half> @dup_extract_nxv8f16_nxv2f16(<vscale x 2 x half> %data) {
167 ; CHECK-LABEL: dup_extract_nxv8f16_nxv2f16:
169 ; CHECK-NEXT: mov z0.d, z0.d[1]
170 ; CHECK-NEXT: mov z0.h, h0
172 %1 = extractelement <vscale x 2 x half> %data, i16 1
173 %.splatinsert = insertelement <vscale x 8 x half> poison, half %1, i32 0
174 %.splat = shufflevector <vscale x 8 x half> %.splatinsert, <vscale x 8 x half> poison, <vscale x 8 x i32> zeroinitializer
175 ret <vscale x 8 x half> %.splat
178 define <vscale x 8 x half> @dup_extract_nxv8f16_v8f16(<8 x half> %data) {
179 ; CHECK-LABEL: dup_extract_nxv8f16_v8f16:
181 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
182 ; CHECK-NEXT: mov z0.h, z0.h[1]
184 %1 = extractelement <8 x half> %data, i16 1
185 %.splatinsert = insertelement <vscale x 8 x half> poison, half %1, i32 0
186 %.splat = shufflevector <vscale x 8 x half> %.splatinsert, <vscale x 8 x half> poison, <vscale x 8 x i32> zeroinitializer
187 ret <vscale x 8 x half> %.splat
190 define <vscale x 8 x half> @dup_extract_nxv8f16_v4f16(<4 x half> %data) {
191 ; CHECK-LABEL: dup_extract_nxv8f16_v4f16:
193 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
194 ; CHECK-NEXT: mov z0.h, z0.h[1]
196 %1 = extractelement <4 x half> %data, i16 1
197 %.splatinsert = insertelement <vscale x 8 x half> poison, half %1, i32 0
198 %.splat = shufflevector <vscale x 8 x half> %.splatinsert, <vscale x 8 x half> poison, <vscale x 8 x i32> zeroinitializer
199 ret <vscale x 8 x half> %.splat
202 define <vscale x 4 x half> @dup_extract_nxv4f16_nxv8f16(<vscale x 8 x half> %data) {
203 ; CHECK-LABEL: dup_extract_nxv4f16_nxv8f16:
205 ; CHECK-NEXT: mov z0.h, z0.h[1]
207 %1 = extractelement <vscale x 8 x half> %data, i16 1
208 %.splatinsert = insertelement <vscale x 4 x half> poison, half %1, i32 0
209 %.splat = shufflevector <vscale x 4 x half> %.splatinsert, <vscale x 4 x half> poison, <vscale x 4 x i32> zeroinitializer
210 ret <vscale x 4 x half> %.splat
213 define <vscale x 4 x half> @dup_extract_nxv4f16_nxv4f16(<vscale x 4 x half> %data) {
214 ; CHECK-LABEL: dup_extract_nxv4f16_nxv4f16:
216 ; CHECK-NEXT: mov z0.s, z0.s[1]
218 %1 = extractelement <vscale x 4 x half> %data, i16 1
219 %.splatinsert = insertelement <vscale x 4 x half> poison, half %1, i32 0
220 %.splat = shufflevector <vscale x 4 x half> %.splatinsert, <vscale x 4 x half> poison, <vscale x 4 x i32> zeroinitializer
221 ret <vscale x 4 x half> %.splat
224 define <vscale x 4 x half> @dup_extract_nxv4f16_nxv2f16(<vscale x 2 x half> %data) {
225 ; CHECK-LABEL: dup_extract_nxv4f16_nxv2f16:
227 ; CHECK-NEXT: mov z0.d, z0.d[1]
228 ; CHECK-NEXT: mov z0.h, h0
230 %1 = extractelement <vscale x 2 x half> %data, i16 1
231 %.splatinsert = insertelement <vscale x 4 x half> poison, half %1, i32 0
232 %.splat = shufflevector <vscale x 4 x half> %.splatinsert, <vscale x 4 x half> poison, <vscale x 4 x i32> zeroinitializer
233 ret <vscale x 4 x half> %.splat
236 define <vscale x 4 x half> @dup_extract_nxv4f16_v8f16(<8 x half> %data) {
237 ; CHECK-LABEL: dup_extract_nxv4f16_v8f16:
239 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
240 ; CHECK-NEXT: mov z0.h, z0.h[1]
242 %1 = extractelement <8 x half> %data, i16 1
243 %.splatinsert = insertelement <vscale x 4 x half> poison, half %1, i32 0
244 %.splat = shufflevector <vscale x 4 x half> %.splatinsert, <vscale x 4 x half> poison, <vscale x 4 x i32> zeroinitializer
245 ret <vscale x 4 x half> %.splat
248 define <vscale x 4 x half> @dup_extract_nxv4f16_v4f16(<4 x half> %data) {
249 ; CHECK-LABEL: dup_extract_nxv4f16_v4f16:
251 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
252 ; CHECK-NEXT: mov z0.h, z0.h[1]
254 %1 = extractelement <4 x half> %data, i16 1
255 %.splatinsert = insertelement <vscale x 4 x half> poison, half %1, i32 0
256 %.splat = shufflevector <vscale x 4 x half> %.splatinsert, <vscale x 4 x half> poison, <vscale x 4 x i32> zeroinitializer
257 ret <vscale x 4 x half> %.splat
260 define <vscale x 2 x half> @dup_extract_nxv2f16_nxv8f16(<vscale x 8 x half> %data) {
261 ; CHECK-LABEL: dup_extract_nxv2f16_nxv8f16:
263 ; CHECK-NEXT: mov z0.h, z0.h[1]
265 %1 = extractelement <vscale x 8 x half> %data, i16 1
266 %.splatinsert = insertelement <vscale x 2 x half> poison, half %1, i32 0
267 %.splat = shufflevector <vscale x 2 x half> %.splatinsert, <vscale x 2 x half> poison, <vscale x 2 x i32> zeroinitializer
268 ret <vscale x 2 x half> %.splat
271 define <vscale x 2 x half> @dup_extract_nxv2f16_nxv4f16(<vscale x 4 x half> %data) {
272 ; CHECK-LABEL: dup_extract_nxv2f16_nxv4f16:
274 ; CHECK-NEXT: mov z0.s, z0.s[1]
276 %1 = extractelement <vscale x 4 x half> %data, i16 1
277 %.splatinsert = insertelement <vscale x 2 x half> poison, half %1, i32 0
278 %.splat = shufflevector <vscale x 2 x half> %.splatinsert, <vscale x 2 x half> poison, <vscale x 2 x i32> zeroinitializer
279 ret <vscale x 2 x half> %.splat
282 define <vscale x 2 x half> @dup_extract_nxv2f16_nxv2f16(<vscale x 2 x half> %data) {
283 ; CHECK-LABEL: dup_extract_nxv2f16_nxv2f16:
285 ; CHECK-NEXT: mov z0.d, z0.d[1]
287 %1 = extractelement <vscale x 2 x half> %data, i16 1
288 %.splatinsert = insertelement <vscale x 2 x half> poison, half %1, i32 0
289 %.splat = shufflevector <vscale x 2 x half> %.splatinsert, <vscale x 2 x half> poison, <vscale x 2 x i32> zeroinitializer
290 ret <vscale x 2 x half> %.splat
293 define <vscale x 2 x half> @dup_extract_nxv2f16_v8f16(<8 x half> %data) {
294 ; CHECK-LABEL: dup_extract_nxv2f16_v8f16:
296 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
297 ; CHECK-NEXT: mov z0.h, z0.h[1]
299 %1 = extractelement <8 x half> %data, i16 1
300 %.splatinsert = insertelement <vscale x 2 x half> poison, half %1, i32 0
301 %.splat = shufflevector <vscale x 2 x half> %.splatinsert, <vscale x 2 x half> poison, <vscale x 2 x i32> zeroinitializer
302 ret <vscale x 2 x half> %.splat
305 define <vscale x 2 x half> @dup_extract_nxv2f16_v4f16(<4 x half> %data) {
306 ; CHECK-LABEL: dup_extract_nxv2f16_v4f16:
308 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
309 ; CHECK-NEXT: mov z0.h, z0.h[1]
311 %1 = extractelement <4 x half> %data, i16 1
312 %.splatinsert = insertelement <vscale x 2 x half> poison, half %1, i32 0
313 %.splat = shufflevector <vscale x 2 x half> %.splatinsert, <vscale x 2 x half> poison, <vscale x 2 x i32> zeroinitializer
314 ret <vscale x 2 x half> %.splat
317 define <vscale x 4 x float> @dup_extract_nxv4f32_nxv4f32(<vscale x 4 x float> %data) {
318 ; CHECK-LABEL: dup_extract_nxv4f32_nxv4f32:
320 ; CHECK-NEXT: mov z0.s, z0.s[1]
322 %1 = extractelement <vscale x 4 x float> %data, i32 1
323 %.splatinsert = insertelement <vscale x 4 x float> poison, float %1, i32 0
324 %.splat = shufflevector <vscale x 4 x float> %.splatinsert, <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer
325 ret <vscale x 4 x float> %.splat
328 define <vscale x 4 x float> @dup_extract_nxv4f32_nxv2f32(<vscale x 2 x float> %data) {
329 ; CHECK-LABEL: dup_extract_nxv4f32_nxv2f32:
331 ; CHECK-NEXT: mov z0.d, z0.d[1]
332 ; CHECK-NEXT: mov z0.s, s0
334 %1 = extractelement <vscale x 2 x float> %data, i32 1
335 %.splatinsert = insertelement <vscale x 4 x float> poison, float %1, i32 0
336 %.splat = shufflevector <vscale x 4 x float> %.splatinsert, <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer
337 ret <vscale x 4 x float> %.splat
340 define <vscale x 4 x float> @dup_extract_nxv4f32_v4f32(<4 x float> %data) {
341 ; CHECK-LABEL: dup_extract_nxv4f32_v4f32:
343 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
344 ; CHECK-NEXT: mov z0.s, z0.s[1]
346 %1 = extractelement <4 x float> %data, i32 1
347 %.splatinsert = insertelement <vscale x 4 x float> poison, float %1, i32 0
348 %.splat = shufflevector <vscale x 4 x float> %.splatinsert, <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer
349 ret <vscale x 4 x float> %.splat
352 define <vscale x 4 x float> @dup_extract_nxv4f32_v2f32(<2 x float> %data) {
353 ; CHECK-LABEL: dup_extract_nxv4f32_v2f32:
355 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
356 ; CHECK-NEXT: mov z0.s, z0.s[1]
358 %1 = extractelement <2 x float> %data, i32 1
359 %.splatinsert = insertelement <vscale x 4 x float> poison, float %1, i32 0
360 %.splat = shufflevector <vscale x 4 x float> %.splatinsert, <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer
361 ret <vscale x 4 x float> %.splat
364 define <vscale x 2 x float> @dup_extract_nxv2f32_nxv4f32(<vscale x 4 x float> %data) {
365 ; CHECK-LABEL: dup_extract_nxv2f32_nxv4f32:
367 ; CHECK-NEXT: mov z0.s, z0.s[1]
369 %1 = extractelement <vscale x 4 x float> %data, i32 1
370 %.splatinsert = insertelement <vscale x 2 x float> poison, float %1, i32 0
371 %.splat = shufflevector <vscale x 2 x float> %.splatinsert, <vscale x 2 x float> poison, <vscale x 2 x i32> zeroinitializer
372 ret <vscale x 2 x float> %.splat
375 define <vscale x 2 x float> @dup_extract_nxv2f32_nxv2f32(<vscale x 2 x float> %data) {
376 ; CHECK-LABEL: dup_extract_nxv2f32_nxv2f32:
378 ; CHECK-NEXT: mov z0.d, z0.d[1]
380 %1 = extractelement <vscale x 2 x float> %data, i32 1
381 %.splatinsert = insertelement <vscale x 2 x float> poison, float %1, i32 0
382 %.splat = shufflevector <vscale x 2 x float> %.splatinsert, <vscale x 2 x float> poison, <vscale x 2 x i32> zeroinitializer
383 ret <vscale x 2 x float> %.splat
386 define <vscale x 2 x float> @dup_extract_nxv2f32_v4f32(<4 x float> %data) {
387 ; CHECK-LABEL: dup_extract_nxv2f32_v4f32:
389 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
390 ; CHECK-NEXT: mov z0.s, z0.s[1]
392 %1 = extractelement <4 x float> %data, i32 1
393 %.splatinsert = insertelement <vscale x 2 x float> poison, float %1, i32 0
394 %.splat = shufflevector <vscale x 2 x float> %.splatinsert, <vscale x 2 x float> poison, <vscale x 2 x i32> zeroinitializer
395 ret <vscale x 2 x float> %.splat
398 define <vscale x 2 x float> @dup_extract_nxv2f32_v2f32(<2 x float> %data) {
399 ; CHECK-LABEL: dup_extract_nxv2f32_v2f32:
401 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
402 ; CHECK-NEXT: mov z0.s, z0.s[1]
404 %1 = extractelement <2 x float> %data, i32 1
405 %.splatinsert = insertelement <vscale x 2 x float> poison, float %1, i32 0
406 %.splat = shufflevector <vscale x 2 x float> %.splatinsert, <vscale x 2 x float> poison, <vscale x 2 x i32> zeroinitializer
407 ret <vscale x 2 x float> %.splat
410 define <vscale x 2 x double> @dup_extract_nxv2f64_nxv2f64(<vscale x 2 x double> %data) {
411 ; CHECK-LABEL: dup_extract_nxv2f64_nxv2f64:
413 ; CHECK-NEXT: mov z0.d, z0.d[1]
415 %1 = extractelement <vscale x 2 x double> %data, i64 1
416 %.splatinsert = insertelement <vscale x 2 x double> poison, double %1, i32 0
417 %.splat = shufflevector <vscale x 2 x double> %.splatinsert, <vscale x 2 x double> poison, <vscale x 2 x i32> zeroinitializer
418 ret <vscale x 2 x double> %.splat
421 define <vscale x 2 x double> @dup_extract_nxv2f64_v2f64(<2 x double> %data) {
422 ; CHECK-LABEL: dup_extract_nxv2f64_v2f64:
424 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
425 ; CHECK-NEXT: mov z0.d, z0.d[1]
427 %1 = extractelement <2 x double> %data, i64 1
428 %.splatinsert = insertelement <vscale x 2 x double> poison, double %1, i32 0
429 %.splat = shufflevector <vscale x 2 x double> %.splatinsert, <vscale x 2 x double> poison, <vscale x 2 x i32> zeroinitializer
430 ret <vscale x 2 x double> %.splat
433 define <vscale x 2 x double> @dup_extract_nxv2f64_v1f64(<1 x double> %data) {
434 ; CHECK-LABEL: dup_extract_nxv2f64_v1f64:
436 ; CHECK-NEXT: mov z0.d, d0
438 %1 = extractelement <1 x double> %data, i64 1
439 %.splatinsert = insertelement <vscale x 2 x double> poison, double %1, i32 0
440 %.splat = shufflevector <vscale x 2 x double> %.splatinsert, <vscale x 2 x double> poison, <vscale x 2 x i32> zeroinitializer
441 ret <vscale x 2 x double> %.splat
444 define <vscale x 8 x bfloat> @dup_extract_nxv8bf16_nxv8bf16(<vscale x 8 x bfloat> %data) {
445 ; CHECK-LABEL: dup_extract_nxv8bf16_nxv8bf16:
447 ; CHECK-NEXT: mov z0.h, z0.h[1]
449 %1 = extractelement <vscale x 8 x bfloat> %data, i16 1
450 %.splatinsert = insertelement <vscale x 8 x bfloat> poison, bfloat %1, i32 0
451 %.splat = shufflevector <vscale x 8 x bfloat> %.splatinsert, <vscale x 8 x bfloat> poison, <vscale x 8 x i32> zeroinitializer
452 ret <vscale x 8 x bfloat> %.splat
455 define <vscale x 8 x bfloat> @dup_extract_nxv8bf16_nxv4bf16(<vscale x 4 x bfloat> %data) {
456 ; CHECK-LABEL: dup_extract_nxv8bf16_nxv4bf16:
458 ; CHECK-NEXT: mov z0.s, z0.s[1]
459 ; CHECK-NEXT: mov z0.h, h0
461 %1 = extractelement <vscale x 4 x bfloat> %data, i16 1
462 %.splatinsert = insertelement <vscale x 8 x bfloat> poison, bfloat %1, i32 0
463 %.splat = shufflevector <vscale x 8 x bfloat> %.splatinsert, <vscale x 8 x bfloat> poison, <vscale x 8 x i32> zeroinitializer
464 ret <vscale x 8 x bfloat> %.splat
467 define <vscale x 8 x bfloat> @dup_extract_nxv8bf16_nxv2bf16(<vscale x 2 x bfloat> %data) {
468 ; CHECK-LABEL: dup_extract_nxv8bf16_nxv2bf16:
470 ; CHECK-NEXT: mov z0.d, z0.d[1]
471 ; CHECK-NEXT: mov z0.h, h0
473 %1 = extractelement <vscale x 2 x bfloat> %data, i16 1
474 %.splatinsert = insertelement <vscale x 8 x bfloat> poison, bfloat %1, i32 0
475 %.splat = shufflevector <vscale x 8 x bfloat> %.splatinsert, <vscale x 8 x bfloat> poison, <vscale x 8 x i32> zeroinitializer
476 ret <vscale x 8 x bfloat> %.splat
479 define <vscale x 8 x bfloat> @dup_extract_nxv8bf16_v8bf16(<8 x bfloat> %data) {
480 ; CHECK-LABEL: dup_extract_nxv8bf16_v8bf16:
482 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
483 ; CHECK-NEXT: mov z0.h, z0.h[1]
485 %1 = extractelement <8 x bfloat> %data, i16 1
486 %.splatinsert = insertelement <vscale x 8 x bfloat> poison, bfloat %1, i32 0
487 %.splat = shufflevector <vscale x 8 x bfloat> %.splatinsert, <vscale x 8 x bfloat> poison, <vscale x 8 x i32> zeroinitializer
488 ret <vscale x 8 x bfloat> %.splat
491 define <vscale x 8 x bfloat> @dup_extract_nxv8bf16_v4bf16(<4 x bfloat> %data) {
492 ; CHECK-LABEL: dup_extract_nxv8bf16_v4bf16:
494 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
495 ; CHECK-NEXT: mov z0.h, z0.h[1]
497 %1 = extractelement <4 x bfloat> %data, i16 1
498 %.splatinsert = insertelement <vscale x 8 x bfloat> poison, bfloat %1, i32 0
499 %.splat = shufflevector <vscale x 8 x bfloat> %.splatinsert, <vscale x 8 x bfloat> poison, <vscale x 8 x i32> zeroinitializer
500 ret <vscale x 8 x bfloat> %.splat
503 define <vscale x 4 x bfloat> @dup_extract_nxv4bf16_nxv8bf16(<vscale x 8 x bfloat> %data) {
504 ; CHECK-LABEL: dup_extract_nxv4bf16_nxv8bf16:
506 ; CHECK-NEXT: mov z0.h, z0.h[1]
508 %1 = extractelement <vscale x 8 x bfloat> %data, i16 1
509 %.splatinsert = insertelement <vscale x 4 x bfloat> poison, bfloat %1, i32 0
510 %.splat = shufflevector <vscale x 4 x bfloat> %.splatinsert, <vscale x 4 x bfloat> poison, <vscale x 4 x i32> zeroinitializer
511 ret <vscale x 4 x bfloat> %.splat
514 define <vscale x 4 x bfloat> @dup_extract_nxv4bf16_nxv4bf16(<vscale x 4 x bfloat> %data) {
515 ; CHECK-LABEL: dup_extract_nxv4bf16_nxv4bf16:
517 ; CHECK-NEXT: mov z0.s, z0.s[1]
519 %1 = extractelement <vscale x 4 x bfloat> %data, i16 1
520 %.splatinsert = insertelement <vscale x 4 x bfloat> poison, bfloat %1, i32 0
521 %.splat = shufflevector <vscale x 4 x bfloat> %.splatinsert, <vscale x 4 x bfloat> poison, <vscale x 4 x i32> zeroinitializer
522 ret <vscale x 4 x bfloat> %.splat
525 define <vscale x 4 x bfloat> @dup_extract_nxv4bf16_nxv2bf16(<vscale x 2 x bfloat> %data) {
526 ; CHECK-LABEL: dup_extract_nxv4bf16_nxv2bf16:
528 ; CHECK-NEXT: mov z0.d, z0.d[1]
529 ; CHECK-NEXT: mov z0.h, h0
531 %1 = extractelement <vscale x 2 x bfloat> %data, i16 1
532 %.splatinsert = insertelement <vscale x 4 x bfloat> poison, bfloat %1, i32 0
533 %.splat = shufflevector <vscale x 4 x bfloat> %.splatinsert, <vscale x 4 x bfloat> poison, <vscale x 4 x i32> zeroinitializer
534 ret <vscale x 4 x bfloat> %.splat
537 define <vscale x 4 x bfloat> @dup_extract_nxv4bf16_v8bf16(<8 x bfloat> %data) {
538 ; CHECK-LABEL: dup_extract_nxv4bf16_v8bf16:
540 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
541 ; CHECK-NEXT: mov z0.h, z0.h[1]
543 %1 = extractelement <8 x bfloat> %data, i16 1
544 %.splatinsert = insertelement <vscale x 4 x bfloat> poison, bfloat %1, i32 0
545 %.splat = shufflevector <vscale x 4 x bfloat> %.splatinsert, <vscale x 4 x bfloat> poison, <vscale x 4 x i32> zeroinitializer
546 ret <vscale x 4 x bfloat> %.splat
549 define <vscale x 4 x bfloat> @dup_extract_nxv4bf16_v4bf16(<4 x bfloat> %data) {
550 ; CHECK-LABEL: dup_extract_nxv4bf16_v4bf16:
552 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
553 ; CHECK-NEXT: mov z0.h, z0.h[1]
555 %1 = extractelement <4 x bfloat> %data, i16 1
556 %.splatinsert = insertelement <vscale x 4 x bfloat> poison, bfloat %1, i32 0
557 %.splat = shufflevector <vscale x 4 x bfloat> %.splatinsert, <vscale x 4 x bfloat> poison, <vscale x 4 x i32> zeroinitializer
558 ret <vscale x 4 x bfloat> %.splat
561 define <vscale x 2 x bfloat> @dup_extract_nxv2bf16_nxv8bf16(<vscale x 8 x bfloat> %data) {
562 ; CHECK-LABEL: dup_extract_nxv2bf16_nxv8bf16:
564 ; CHECK-NEXT: mov z0.h, z0.h[1]
566 %1 = extractelement <vscale x 8 x bfloat> %data, i16 1
567 %.splatinsert = insertelement <vscale x 2 x bfloat> poison, bfloat %1, i32 0
568 %.splat = shufflevector <vscale x 2 x bfloat> %.splatinsert, <vscale x 2 x bfloat> poison, <vscale x 2 x i32> zeroinitializer
569 ret <vscale x 2 x bfloat> %.splat
572 define <vscale x 2 x bfloat> @dup_extract_nxv2bf16_nxv4bf16(<vscale x 4 x bfloat> %data) {
573 ; CHECK-LABEL: dup_extract_nxv2bf16_nxv4bf16:
575 ; CHECK-NEXT: mov z0.s, z0.s[1]
577 %1 = extractelement <vscale x 4 x bfloat> %data, i16 1
578 %.splatinsert = insertelement <vscale x 2 x bfloat> poison, bfloat %1, i32 0
579 %.splat = shufflevector <vscale x 2 x bfloat> %.splatinsert, <vscale x 2 x bfloat> poison, <vscale x 2 x i32> zeroinitializer
580 ret <vscale x 2 x bfloat> %.splat
583 define <vscale x 2 x bfloat> @dup_extract_nxv2bf16_nxv2bf16(<vscale x 2 x bfloat> %data) {
584 ; CHECK-LABEL: dup_extract_nxv2bf16_nxv2bf16:
586 ; CHECK-NEXT: mov z0.d, z0.d[1]
588 %1 = extractelement <vscale x 2 x bfloat> %data, i16 1
589 %.splatinsert = insertelement <vscale x 2 x bfloat> poison, bfloat %1, i32 0
590 %.splat = shufflevector <vscale x 2 x bfloat> %.splatinsert, <vscale x 2 x bfloat> poison, <vscale x 2 x i32> zeroinitializer
591 ret <vscale x 2 x bfloat> %.splat
594 define <vscale x 2 x bfloat> @dup_extract_nxv2bf16_v8bf16(<8 x bfloat> %data) {
595 ; CHECK-LABEL: dup_extract_nxv2bf16_v8bf16:
597 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
598 ; CHECK-NEXT: mov z0.h, z0.h[1]
600 %1 = extractelement <8 x bfloat> %data, i16 1
601 %.splatinsert = insertelement <vscale x 2 x bfloat> poison, bfloat %1, i32 0
602 %.splat = shufflevector <vscale x 2 x bfloat> %.splatinsert, <vscale x 2 x bfloat> poison, <vscale x 2 x i32> zeroinitializer
603 ret <vscale x 2 x bfloat> %.splat
606 define <vscale x 2 x bfloat> @dup_extract_nxv2bf16_v4bf16(<4 x bfloat> %data) {
607 ; CHECK-LABEL: dup_extract_nxv2bf16_v4bf16:
609 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
610 ; CHECK-NEXT: mov z0.h, z0.h[1]
612 %1 = extractelement <4 x bfloat> %data, i16 1
613 %.splatinsert = insertelement <vscale x 2 x bfloat> poison, bfloat %1, i32 0
614 %.splat = shufflevector <vscale x 2 x bfloat> %.splatinsert, <vscale x 2 x bfloat> poison, <vscale x 2 x i32> zeroinitializer
615 ret <vscale x 2 x bfloat> %.splat
618 attributes #0 = { "target-features"="+sve" }