1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc -mtriple=aarch64 -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SD
3 ; RUN: llc -mtriple=aarch64 -global-isel -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-GI
5 define <2 x double> @insert_v2f64_0(<2 x double> %a, double %b, i32 %c) {
6 ; CHECK-LABEL: insert_v2f64_0:
7 ; CHECK: // %bb.0: // %entry
8 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $q1
9 ; CHECK-NEXT: mov v0.d[0], v1.d[0]
12 %d = insertelement <2 x double> %a, double %b, i32 0
16 define <2 x double> @insert_v2f64_1(<2 x double> %a, double %b, i32 %c) {
17 ; CHECK-LABEL: insert_v2f64_1:
18 ; CHECK: // %bb.0: // %entry
19 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $q1
20 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
23 %d = insertelement <2 x double> %a, double %b, i32 1
27 define <2 x double> @insert_v2f64_c(<2 x double> %a, double %b, i32 %c) {
28 ; CHECK-SD-LABEL: insert_v2f64_c:
29 ; CHECK-SD: // %bb.0: // %entry
30 ; CHECK-SD-NEXT: sub sp, sp, #16
31 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
32 ; CHECK-SD-NEXT: mov x8, sp
33 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
34 ; CHECK-SD-NEXT: str q0, [sp]
35 ; CHECK-SD-NEXT: bfi x8, x0, #3, #1
36 ; CHECK-SD-NEXT: str d1, [x8]
37 ; CHECK-SD-NEXT: ldr q0, [sp], #16
40 ; CHECK-GI-LABEL: insert_v2f64_c:
41 ; CHECK-GI: // %bb.0: // %entry
42 ; CHECK-GI-NEXT: sub sp, sp, #16
43 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
44 ; CHECK-GI-NEXT: mov w9, w0
45 ; CHECK-GI-NEXT: mov x8, sp
46 ; CHECK-GI-NEXT: str q0, [sp]
47 ; CHECK-GI-NEXT: and x9, x9, #0x1
48 ; CHECK-GI-NEXT: str d1, [x8, x9, lsl #3]
49 ; CHECK-GI-NEXT: ldr q0, [sp], #16
52 %d = insertelement <2 x double> %a, double %b, i32 %c
56 define <3 x double> @insert_v3f64_0(<3 x double> %a, double %b, i32 %c) {
57 ; CHECK-SD-LABEL: insert_v3f64_0:
58 ; CHECK-SD: // %bb.0: // %entry
59 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 def $q1
60 ; CHECK-SD-NEXT: mov v0.d[1], v1.d[0]
61 ; CHECK-SD-NEXT: // kill: def $d3 killed $d3 def $q3
62 ; CHECK-SD-NEXT: mov v0.d[0], v3.d[0]
63 ; CHECK-SD-NEXT: ext v1.16b, v0.16b, v0.16b, #8
64 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
65 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 killed $q1
68 ; CHECK-GI-LABEL: insert_v3f64_0:
69 ; CHECK-GI: // %bb.0: // %entry
70 ; CHECK-GI-NEXT: fmov d0, d3
73 %d = insertelement <3 x double> %a, double %b, i32 0
77 define <3 x double> @insert_v3f64_2(<3 x double> %a, double %b, i32 %c) {
78 ; CHECK-LABEL: insert_v3f64_2:
79 ; CHECK: // %bb.0: // %entry
80 ; CHECK-NEXT: fmov d2, d3
83 %d = insertelement <3 x double> %a, double %b, i32 2
87 define <3 x double> @insert_v3f64_c(<3 x double> %a, double %b, i32 %c) {
88 ; CHECK-SD-LABEL: insert_v3f64_c:
89 ; CHECK-SD: // %bb.0: // %entry
90 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
91 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 def $q1
92 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
93 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 def $q2
94 ; CHECK-SD-NEXT: mov v0.d[1], v1.d[0]
95 ; CHECK-SD-NEXT: stp q0, q2, [sp, #-32]!
96 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
97 ; CHECK-SD-NEXT: mov x8, sp
98 ; CHECK-SD-NEXT: and x9, x0, #0x3
99 ; CHECK-SD-NEXT: str d3, [x8, x9, lsl #3]
100 ; CHECK-SD-NEXT: ldr q0, [sp]
101 ; CHECK-SD-NEXT: ldr d2, [sp, #16]
102 ; CHECK-SD-NEXT: ext v1.16b, v0.16b, v0.16b, #8
103 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
104 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 killed $q1
105 ; CHECK-SD-NEXT: add sp, sp, #32
108 ; CHECK-GI-LABEL: insert_v3f64_c:
109 ; CHECK-GI: // %bb.0: // %entry
110 ; CHECK-GI-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
111 ; CHECK-GI-NEXT: sub x9, sp, #48
112 ; CHECK-GI-NEXT: mov x29, sp
113 ; CHECK-GI-NEXT: and sp, x9, #0xffffffffffffffe0
114 ; CHECK-GI-NEXT: .cfi_def_cfa w29, 16
115 ; CHECK-GI-NEXT: .cfi_offset w30, -8
116 ; CHECK-GI-NEXT: .cfi_offset w29, -16
117 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
118 ; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1
119 ; CHECK-GI-NEXT: mov w8, w0
120 ; CHECK-GI-NEXT: mov x9, sp
121 ; CHECK-GI-NEXT: // kill: def $d2 killed $d2 def $q2
122 ; CHECK-GI-NEXT: mov v0.d[1], v1.d[0]
123 ; CHECK-GI-NEXT: and x8, x8, #0x3
124 ; CHECK-GI-NEXT: stp q0, q2, [sp]
125 ; CHECK-GI-NEXT: str d3, [x9, x8, lsl #3]
126 ; CHECK-GI-NEXT: ldp q0, q2, [sp]
127 ; CHECK-GI-NEXT: // kill: def $d2 killed $d2 killed $q2
128 ; CHECK-GI-NEXT: mov d1, v0.d[1]
129 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
130 ; CHECK-GI-NEXT: mov sp, x29
131 ; CHECK-GI-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
134 %d = insertelement <3 x double> %a, double %b, i32 %c
138 define <4 x double> @insert_v4f64_0(<4 x double> %a, double %b, i32 %c) {
139 ; CHECK-LABEL: insert_v4f64_0:
140 ; CHECK: // %bb.0: // %entry
141 ; CHECK-NEXT: // kill: def $d2 killed $d2 def $q2
142 ; CHECK-NEXT: mov v0.d[0], v2.d[0]
145 %d = insertelement <4 x double> %a, double %b, i32 0
149 define <4 x double> @insert_v4f64_2(<4 x double> %a, double %b, i32 %c) {
150 ; CHECK-LABEL: insert_v4f64_2:
151 ; CHECK: // %bb.0: // %entry
152 ; CHECK-NEXT: // kill: def $d2 killed $d2 def $q2
153 ; CHECK-NEXT: mov v1.d[0], v2.d[0]
156 %d = insertelement <4 x double> %a, double %b, i32 2
160 define <4 x double> @insert_v4f64_c(<4 x double> %a, double %b, i32 %c) {
161 ; CHECK-SD-LABEL: insert_v4f64_c:
162 ; CHECK-SD: // %bb.0: // %entry
163 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
164 ; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
165 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
166 ; CHECK-SD-NEXT: and x8, x0, #0x3
167 ; CHECK-SD-NEXT: mov x9, sp
168 ; CHECK-SD-NEXT: str d2, [x9, x8, lsl #3]
169 ; CHECK-SD-NEXT: ldp q0, q1, [sp], #32
172 ; CHECK-GI-LABEL: insert_v4f64_c:
173 ; CHECK-GI: // %bb.0: // %entry
174 ; CHECK-GI-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
175 ; CHECK-GI-NEXT: sub x9, sp, #48
176 ; CHECK-GI-NEXT: mov x29, sp
177 ; CHECK-GI-NEXT: and sp, x9, #0xffffffffffffffe0
178 ; CHECK-GI-NEXT: .cfi_def_cfa w29, 16
179 ; CHECK-GI-NEXT: .cfi_offset w30, -8
180 ; CHECK-GI-NEXT: .cfi_offset w29, -16
181 ; CHECK-GI-NEXT: mov w8, w0
182 ; CHECK-GI-NEXT: mov x9, sp
183 ; CHECK-GI-NEXT: stp q0, q1, [sp]
184 ; CHECK-GI-NEXT: and x8, x8, #0x3
185 ; CHECK-GI-NEXT: str d2, [x9, x8, lsl #3]
186 ; CHECK-GI-NEXT: ldp q0, q1, [sp]
187 ; CHECK-GI-NEXT: mov sp, x29
188 ; CHECK-GI-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
191 %d = insertelement <4 x double> %a, double %b, i32 %c
195 define <2 x float> @insert_v2f32_0(<2 x float> %a, float %b, i32 %c) {
196 ; CHECK-LABEL: insert_v2f32_0:
197 ; CHECK: // %bb.0: // %entry
198 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
199 ; CHECK-NEXT: // kill: def $s1 killed $s1 def $q1
200 ; CHECK-NEXT: mov v0.s[0], v1.s[0]
201 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
204 %d = insertelement <2 x float> %a, float %b, i32 0
208 define <2 x float> @insert_v2f32_1(<2 x float> %a, float %b, i32 %c) {
209 ; CHECK-LABEL: insert_v2f32_1:
210 ; CHECK: // %bb.0: // %entry
211 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
212 ; CHECK-NEXT: // kill: def $s1 killed $s1 def $q1
213 ; CHECK-NEXT: mov v0.s[1], v1.s[0]
214 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
217 %d = insertelement <2 x float> %a, float %b, i32 1
221 define <2 x float> @insert_v2f32_c(<2 x float> %a, float %b, i32 %c) {
222 ; CHECK-SD-LABEL: insert_v2f32_c:
223 ; CHECK-SD: // %bb.0: // %entry
224 ; CHECK-SD-NEXT: sub sp, sp, #16
225 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
226 ; CHECK-SD-NEXT: add x8, sp, #8
227 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
228 ; CHECK-SD-NEXT: str d0, [sp, #8]
229 ; CHECK-SD-NEXT: bfi x8, x0, #2, #1
230 ; CHECK-SD-NEXT: str s1, [x8]
231 ; CHECK-SD-NEXT: ldr d0, [sp, #8]
232 ; CHECK-SD-NEXT: add sp, sp, #16
235 ; CHECK-GI-LABEL: insert_v2f32_c:
236 ; CHECK-GI: // %bb.0: // %entry
237 ; CHECK-GI-NEXT: sub sp, sp, #16
238 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
239 ; CHECK-GI-NEXT: mov w9, w0
240 ; CHECK-GI-NEXT: add x8, sp, #8
241 ; CHECK-GI-NEXT: str d0, [sp, #8]
242 ; CHECK-GI-NEXT: and x9, x9, #0x1
243 ; CHECK-GI-NEXT: str s1, [x8, x9, lsl #2]
244 ; CHECK-GI-NEXT: ldr d0, [sp, #8]
245 ; CHECK-GI-NEXT: add sp, sp, #16
248 %d = insertelement <2 x float> %a, float %b, i32 %c
252 define <3 x float> @insert_v3f32_0(<3 x float> %a, float %b, i32 %c) {
253 ; CHECK-SD-LABEL: insert_v3f32_0:
254 ; CHECK-SD: // %bb.0: // %entry
255 ; CHECK-SD-NEXT: // kill: def $s1 killed $s1 def $q1
256 ; CHECK-SD-NEXT: mov v1.s[1], v0.s[1]
257 ; CHECK-SD-NEXT: mov v1.s[2], v0.s[2]
258 ; CHECK-SD-NEXT: mov v0.16b, v1.16b
261 ; CHECK-GI-LABEL: insert_v3f32_0:
262 ; CHECK-GI: // %bb.0: // %entry
263 ; CHECK-GI-NEXT: mov s2, v0.s[1]
264 ; CHECK-GI-NEXT: // kill: def $s1 killed $s1 def $q1
265 ; CHECK-GI-NEXT: mov s0, v0.s[2]
266 ; CHECK-GI-NEXT: mov v1.s[1], v2.s[0]
267 ; CHECK-GI-NEXT: mov v1.s[2], v0.s[0]
268 ; CHECK-GI-NEXT: mov v0.16b, v1.16b
271 %d = insertelement <3 x float> %a, float %b, i32 0
275 define <3 x float> @insert_v3f32_2(<3 x float> %a, float %b, i32 %c) {
276 ; CHECK-SD-LABEL: insert_v3f32_2:
277 ; CHECK-SD: // %bb.0: // %entry
278 ; CHECK-SD-NEXT: // kill: def $s1 killed $s1 def $q1
279 ; CHECK-SD-NEXT: mov v0.s[2], v1.s[0]
282 ; CHECK-GI-LABEL: insert_v3f32_2:
283 ; CHECK-GI: // %bb.0: // %entry
284 ; CHECK-GI-NEXT: mov s2, v0.s[1]
285 ; CHECK-GI-NEXT: // kill: def $s1 killed $s1 def $q1
286 ; CHECK-GI-NEXT: mov v0.s[1], v2.s[0]
287 ; CHECK-GI-NEXT: mov v0.s[2], v1.s[0]
290 %d = insertelement <3 x float> %a, float %b, i32 2
294 define <3 x float> @insert_v3f32_c(<3 x float> %a, float %b, i32 %c) {
295 ; CHECK-SD-LABEL: insert_v3f32_c:
296 ; CHECK-SD: // %bb.0: // %entry
297 ; CHECK-SD-NEXT: sub sp, sp, #16
298 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
299 ; CHECK-SD-NEXT: mov x8, sp
300 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
301 ; CHECK-SD-NEXT: str q0, [sp]
302 ; CHECK-SD-NEXT: bfi x8, x0, #2, #2
303 ; CHECK-SD-NEXT: str s1, [x8]
304 ; CHECK-SD-NEXT: ldr q0, [sp], #16
307 ; CHECK-GI-LABEL: insert_v3f32_c:
308 ; CHECK-GI: // %bb.0: // %entry
309 ; CHECK-GI-NEXT: sub sp, sp, #16
310 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
311 ; CHECK-GI-NEXT: mov w9, w0
312 ; CHECK-GI-NEXT: mov x8, sp
313 ; CHECK-GI-NEXT: str q0, [sp]
314 ; CHECK-GI-NEXT: and x9, x9, #0x3
315 ; CHECK-GI-NEXT: str s1, [x8, x9, lsl #2]
316 ; CHECK-GI-NEXT: ldr q0, [sp], #16
319 %d = insertelement <3 x float> %a, float %b, i32 %c
323 define <4 x float> @insert_v4f32_0(<4 x float> %a, float %b, i32 %c) {
324 ; CHECK-LABEL: insert_v4f32_0:
325 ; CHECK: // %bb.0: // %entry
326 ; CHECK-NEXT: // kill: def $s1 killed $s1 def $q1
327 ; CHECK-NEXT: mov v0.s[0], v1.s[0]
330 %d = insertelement <4 x float> %a, float %b, i32 0
334 define <4 x float> @insert_v4f32_2(<4 x float> %a, float %b, i32 %c) {
335 ; CHECK-LABEL: insert_v4f32_2:
336 ; CHECK: // %bb.0: // %entry
337 ; CHECK-NEXT: // kill: def $s1 killed $s1 def $q1
338 ; CHECK-NEXT: mov v0.s[2], v1.s[0]
341 %d = insertelement <4 x float> %a, float %b, i32 2
345 define <4 x float> @insert_v4f32_c(<4 x float> %a, float %b, i32 %c) {
346 ; CHECK-SD-LABEL: insert_v4f32_c:
347 ; CHECK-SD: // %bb.0: // %entry
348 ; CHECK-SD-NEXT: sub sp, sp, #16
349 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
350 ; CHECK-SD-NEXT: mov x8, sp
351 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
352 ; CHECK-SD-NEXT: str q0, [sp]
353 ; CHECK-SD-NEXT: bfi x8, x0, #2, #2
354 ; CHECK-SD-NEXT: str s1, [x8]
355 ; CHECK-SD-NEXT: ldr q0, [sp], #16
358 ; CHECK-GI-LABEL: insert_v4f32_c:
359 ; CHECK-GI: // %bb.0: // %entry
360 ; CHECK-GI-NEXT: sub sp, sp, #16
361 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
362 ; CHECK-GI-NEXT: mov w9, w0
363 ; CHECK-GI-NEXT: mov x8, sp
364 ; CHECK-GI-NEXT: str q0, [sp]
365 ; CHECK-GI-NEXT: and x9, x9, #0x3
366 ; CHECK-GI-NEXT: str s1, [x8, x9, lsl #2]
367 ; CHECK-GI-NEXT: ldr q0, [sp], #16
370 %d = insertelement <4 x float> %a, float %b, i32 %c
374 define <8 x float> @insert_v8f32_0(<8 x float> %a, float %b, i32 %c) {
375 ; CHECK-LABEL: insert_v8f32_0:
376 ; CHECK: // %bb.0: // %entry
377 ; CHECK-NEXT: // kill: def $s2 killed $s2 def $q2
378 ; CHECK-NEXT: mov v0.s[0], v2.s[0]
381 %d = insertelement <8 x float> %a, float %b, i32 0
385 define <8 x float> @insert_v8f32_2(<8 x float> %a, float %b, i32 %c) {
386 ; CHECK-LABEL: insert_v8f32_2:
387 ; CHECK: // %bb.0: // %entry
388 ; CHECK-NEXT: // kill: def $s2 killed $s2 def $q2
389 ; CHECK-NEXT: mov v0.s[2], v2.s[0]
392 %d = insertelement <8 x float> %a, float %b, i32 2
396 define <8 x float> @insert_v8f32_c(<8 x float> %a, float %b, i32 %c) {
397 ; CHECK-SD-LABEL: insert_v8f32_c:
398 ; CHECK-SD: // %bb.0: // %entry
399 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
400 ; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
401 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
402 ; CHECK-SD-NEXT: and x8, x0, #0x7
403 ; CHECK-SD-NEXT: mov x9, sp
404 ; CHECK-SD-NEXT: str s2, [x9, x8, lsl #2]
405 ; CHECK-SD-NEXT: ldp q0, q1, [sp], #32
408 ; CHECK-GI-LABEL: insert_v8f32_c:
409 ; CHECK-GI: // %bb.0: // %entry
410 ; CHECK-GI-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
411 ; CHECK-GI-NEXT: sub x9, sp, #48
412 ; CHECK-GI-NEXT: mov x29, sp
413 ; CHECK-GI-NEXT: and sp, x9, #0xffffffffffffffe0
414 ; CHECK-GI-NEXT: .cfi_def_cfa w29, 16
415 ; CHECK-GI-NEXT: .cfi_offset w30, -8
416 ; CHECK-GI-NEXT: .cfi_offset w29, -16
417 ; CHECK-GI-NEXT: mov w8, w0
418 ; CHECK-GI-NEXT: mov x9, sp
419 ; CHECK-GI-NEXT: stp q0, q1, [sp]
420 ; CHECK-GI-NEXT: and x8, x8, #0x7
421 ; CHECK-GI-NEXT: str s2, [x9, x8, lsl #2]
422 ; CHECK-GI-NEXT: ldp q0, q1, [sp]
423 ; CHECK-GI-NEXT: mov sp, x29
424 ; CHECK-GI-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
427 %d = insertelement <8 x float> %a, float %b, i32 %c
431 define <4 x half> @insert_v4f16_0(<4 x half> %a, half %b, i32 %c) {
432 ; CHECK-LABEL: insert_v4f16_0:
433 ; CHECK: // %bb.0: // %entry
434 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
435 ; CHECK-NEXT: // kill: def $h1 killed $h1 def $q1
436 ; CHECK-NEXT: mov v0.h[0], v1.h[0]
437 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
440 %d = insertelement <4 x half> %a, half %b, i32 0
444 define <4 x half> @insert_v4f16_2(<4 x half> %a, half %b, i32 %c) {
445 ; CHECK-LABEL: insert_v4f16_2:
446 ; CHECK: // %bb.0: // %entry
447 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
448 ; CHECK-NEXT: // kill: def $h1 killed $h1 def $q1
449 ; CHECK-NEXT: mov v0.h[2], v1.h[0]
450 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
453 %d = insertelement <4 x half> %a, half %b, i32 2
457 define <4 x half> @insert_v4f16_c(<4 x half> %a, half %b, i32 %c) {
458 ; CHECK-SD-LABEL: insert_v4f16_c:
459 ; CHECK-SD: // %bb.0: // %entry
460 ; CHECK-SD-NEXT: sub sp, sp, #16
461 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
462 ; CHECK-SD-NEXT: add x8, sp, #8
463 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
464 ; CHECK-SD-NEXT: str d0, [sp, #8]
465 ; CHECK-SD-NEXT: bfi x8, x0, #1, #2
466 ; CHECK-SD-NEXT: str h1, [x8]
467 ; CHECK-SD-NEXT: ldr d0, [sp, #8]
468 ; CHECK-SD-NEXT: add sp, sp, #16
471 ; CHECK-GI-LABEL: insert_v4f16_c:
472 ; CHECK-GI: // %bb.0: // %entry
473 ; CHECK-GI-NEXT: sub sp, sp, #16
474 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
475 ; CHECK-GI-NEXT: mov w9, w0
476 ; CHECK-GI-NEXT: add x8, sp, #8
477 ; CHECK-GI-NEXT: str d0, [sp, #8]
478 ; CHECK-GI-NEXT: and x9, x9, #0x3
479 ; CHECK-GI-NEXT: str h1, [x8, x9, lsl #1]
480 ; CHECK-GI-NEXT: ldr d0, [sp, #8]
481 ; CHECK-GI-NEXT: add sp, sp, #16
484 %d = insertelement <4 x half> %a, half %b, i32 %c
488 define <8 x half> @insert_v8f16_0(<8 x half> %a, half %b, i32 %c) {
489 ; CHECK-LABEL: insert_v8f16_0:
490 ; CHECK: // %bb.0: // %entry
491 ; CHECK-NEXT: // kill: def $h1 killed $h1 def $q1
492 ; CHECK-NEXT: mov v0.h[0], v1.h[0]
495 %d = insertelement <8 x half> %a, half %b, i32 0
499 define <8 x half> @insert_v8f16_2(<8 x half> %a, half %b, i32 %c) {
500 ; CHECK-LABEL: insert_v8f16_2:
501 ; CHECK: // %bb.0: // %entry
502 ; CHECK-NEXT: // kill: def $h1 killed $h1 def $q1
503 ; CHECK-NEXT: mov v0.h[2], v1.h[0]
506 %d = insertelement <8 x half> %a, half %b, i32 2
510 define <8 x half> @insert_v8f16_c(<8 x half> %a, half %b, i32 %c) {
511 ; CHECK-SD-LABEL: insert_v8f16_c:
512 ; CHECK-SD: // %bb.0: // %entry
513 ; CHECK-SD-NEXT: sub sp, sp, #16
514 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
515 ; CHECK-SD-NEXT: mov x8, sp
516 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
517 ; CHECK-SD-NEXT: str q0, [sp]
518 ; CHECK-SD-NEXT: bfi x8, x0, #1, #3
519 ; CHECK-SD-NEXT: str h1, [x8]
520 ; CHECK-SD-NEXT: ldr q0, [sp], #16
523 ; CHECK-GI-LABEL: insert_v8f16_c:
524 ; CHECK-GI: // %bb.0: // %entry
525 ; CHECK-GI-NEXT: sub sp, sp, #16
526 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
527 ; CHECK-GI-NEXT: mov w9, w0
528 ; CHECK-GI-NEXT: mov x8, sp
529 ; CHECK-GI-NEXT: str q0, [sp]
530 ; CHECK-GI-NEXT: and x9, x9, #0x7
531 ; CHECK-GI-NEXT: str h1, [x8, x9, lsl #1]
532 ; CHECK-GI-NEXT: ldr q0, [sp], #16
535 %d = insertelement <8 x half> %a, half %b, i32 %c
539 define <16 x half> @insert_v16f16_0(<16 x half> %a, half %b, i32 %c) {
540 ; CHECK-LABEL: insert_v16f16_0:
541 ; CHECK: // %bb.0: // %entry
542 ; CHECK-NEXT: // kill: def $h2 killed $h2 def $q2
543 ; CHECK-NEXT: mov v0.h[0], v2.h[0]
546 %d = insertelement <16 x half> %a, half %b, i32 0
550 define <16 x half> @insert_v16f16_2(<16 x half> %a, half %b, i32 %c) {
551 ; CHECK-LABEL: insert_v16f16_2:
552 ; CHECK: // %bb.0: // %entry
553 ; CHECK-NEXT: // kill: def $h2 killed $h2 def $q2
554 ; CHECK-NEXT: mov v0.h[2], v2.h[0]
557 %d = insertelement <16 x half> %a, half %b, i32 2
561 define <16 x half> @insert_v16f16_c(<16 x half> %a, half %b, i32 %c) {
562 ; CHECK-SD-LABEL: insert_v16f16_c:
563 ; CHECK-SD: // %bb.0: // %entry
564 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
565 ; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
566 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
567 ; CHECK-SD-NEXT: and x8, x0, #0xf
568 ; CHECK-SD-NEXT: mov x9, sp
569 ; CHECK-SD-NEXT: str h2, [x9, x8, lsl #1]
570 ; CHECK-SD-NEXT: ldp q0, q1, [sp], #32
573 ; CHECK-GI-LABEL: insert_v16f16_c:
574 ; CHECK-GI: // %bb.0: // %entry
575 ; CHECK-GI-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
576 ; CHECK-GI-NEXT: sub x9, sp, #48
577 ; CHECK-GI-NEXT: mov x29, sp
578 ; CHECK-GI-NEXT: and sp, x9, #0xffffffffffffffe0
579 ; CHECK-GI-NEXT: .cfi_def_cfa w29, 16
580 ; CHECK-GI-NEXT: .cfi_offset w30, -8
581 ; CHECK-GI-NEXT: .cfi_offset w29, -16
582 ; CHECK-GI-NEXT: mov w8, w0
583 ; CHECK-GI-NEXT: mov x9, sp
584 ; CHECK-GI-NEXT: stp q0, q1, [sp]
585 ; CHECK-GI-NEXT: and x8, x8, #0xf
586 ; CHECK-GI-NEXT: str h2, [x9, x8, lsl #1]
587 ; CHECK-GI-NEXT: ldp q0, q1, [sp]
588 ; CHECK-GI-NEXT: mov sp, x29
589 ; CHECK-GI-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
592 %d = insertelement <16 x half> %a, half %b, i32 %c
596 define <8 x i8> @insert_v8i8_0(<8 x i8> %a, i8 %b, i32 %c) {
597 ; CHECK-LABEL: insert_v8i8_0:
598 ; CHECK: // %bb.0: // %entry
599 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
600 ; CHECK-NEXT: mov v0.b[0], w0
601 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
604 %d = insertelement <8 x i8> %a, i8 %b, i32 0
608 define <8 x i8> @insert_v8i8_2(<8 x i8> %a, i8 %b, i32 %c) {
609 ; CHECK-LABEL: insert_v8i8_2:
610 ; CHECK: // %bb.0: // %entry
611 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
612 ; CHECK-NEXT: mov v0.b[2], w0
613 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
616 %d = insertelement <8 x i8> %a, i8 %b, i32 2
620 define <8 x i8> @insert_v8i8_c(<8 x i8> %a, i8 %b, i32 %c) {
621 ; CHECK-SD-LABEL: insert_v8i8_c:
622 ; CHECK-SD: // %bb.0: // %entry
623 ; CHECK-SD-NEXT: sub sp, sp, #16
624 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
625 ; CHECK-SD-NEXT: add x8, sp, #8
626 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
627 ; CHECK-SD-NEXT: str d0, [sp, #8]
628 ; CHECK-SD-NEXT: bfxil x8, x1, #0, #3
629 ; CHECK-SD-NEXT: strb w0, [x8]
630 ; CHECK-SD-NEXT: ldr d0, [sp, #8]
631 ; CHECK-SD-NEXT: add sp, sp, #16
634 ; CHECK-GI-LABEL: insert_v8i8_c:
635 ; CHECK-GI: // %bb.0: // %entry
636 ; CHECK-GI-NEXT: sub sp, sp, #16
637 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
638 ; CHECK-GI-NEXT: mov w9, w1
639 ; CHECK-GI-NEXT: mov w8, #1 // =0x1
640 ; CHECK-GI-NEXT: str d0, [sp, #8]
641 ; CHECK-GI-NEXT: and x9, x9, #0x7
642 ; CHECK-GI-NEXT: mul x8, x9, x8
643 ; CHECK-GI-NEXT: add x9, sp, #8
644 ; CHECK-GI-NEXT: strb w0, [x9, x8]
645 ; CHECK-GI-NEXT: ldr d0, [sp, #8]
646 ; CHECK-GI-NEXT: add sp, sp, #16
649 %d = insertelement <8 x i8> %a, i8 %b, i32 %c
653 define <16 x i8> @insert_v16i8_0(<16 x i8> %a, i8 %b, i32 %c) {
654 ; CHECK-LABEL: insert_v16i8_0:
655 ; CHECK: // %bb.0: // %entry
656 ; CHECK-NEXT: mov v0.b[0], w0
659 %d = insertelement <16 x i8> %a, i8 %b, i32 0
663 define <16 x i8> @insert_v16i8_2(<16 x i8> %a, i8 %b, i32 %c) {
664 ; CHECK-LABEL: insert_v16i8_2:
665 ; CHECK: // %bb.0: // %entry
666 ; CHECK-NEXT: mov v0.b[2], w0
669 %d = insertelement <16 x i8> %a, i8 %b, i32 2
673 define <16 x i8> @insert_v16i8_c(<16 x i8> %a, i8 %b, i32 %c) {
674 ; CHECK-SD-LABEL: insert_v16i8_c:
675 ; CHECK-SD: // %bb.0: // %entry
676 ; CHECK-SD-NEXT: sub sp, sp, #16
677 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
678 ; CHECK-SD-NEXT: mov x8, sp
679 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
680 ; CHECK-SD-NEXT: str q0, [sp]
681 ; CHECK-SD-NEXT: bfxil x8, x1, #0, #4
682 ; CHECK-SD-NEXT: strb w0, [x8]
683 ; CHECK-SD-NEXT: ldr q0, [sp], #16
686 ; CHECK-GI-LABEL: insert_v16i8_c:
687 ; CHECK-GI: // %bb.0: // %entry
688 ; CHECK-GI-NEXT: sub sp, sp, #16
689 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
690 ; CHECK-GI-NEXT: mov w9, w1
691 ; CHECK-GI-NEXT: mov w8, #1 // =0x1
692 ; CHECK-GI-NEXT: str q0, [sp]
693 ; CHECK-GI-NEXT: and x9, x9, #0xf
694 ; CHECK-GI-NEXT: mul x8, x9, x8
695 ; CHECK-GI-NEXT: mov x9, sp
696 ; CHECK-GI-NEXT: strb w0, [x9, x8]
697 ; CHECK-GI-NEXT: ldr q0, [sp], #16
700 %d = insertelement <16 x i8> %a, i8 %b, i32 %c
704 define <32 x i8> @insert_v32i8_0(<32 x i8> %a, i8 %b, i32 %c) {
705 ; CHECK-LABEL: insert_v32i8_0:
706 ; CHECK: // %bb.0: // %entry
707 ; CHECK-NEXT: mov v0.b[0], w0
710 %d = insertelement <32 x i8> %a, i8 %b, i32 0
714 define <32 x i8> @insert_v32i8_2(<32 x i8> %a, i8 %b, i32 %c) {
715 ; CHECK-LABEL: insert_v32i8_2:
716 ; CHECK: // %bb.0: // %entry
717 ; CHECK-NEXT: mov v0.b[2], w0
720 %d = insertelement <32 x i8> %a, i8 %b, i32 2
724 define <32 x i8> @insert_v32i8_c(<32 x i8> %a, i8 %b, i32 %c) {
725 ; CHECK-SD-LABEL: insert_v32i8_c:
726 ; CHECK-SD: // %bb.0: // %entry
727 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
728 ; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
729 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
730 ; CHECK-SD-NEXT: and x8, x1, #0x1f
731 ; CHECK-SD-NEXT: mov x9, sp
732 ; CHECK-SD-NEXT: strb w0, [x9, x8]
733 ; CHECK-SD-NEXT: ldp q0, q1, [sp], #32
736 ; CHECK-GI-LABEL: insert_v32i8_c:
737 ; CHECK-GI: // %bb.0: // %entry
738 ; CHECK-GI-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
739 ; CHECK-GI-NEXT: sub x9, sp, #48
740 ; CHECK-GI-NEXT: mov x29, sp
741 ; CHECK-GI-NEXT: and sp, x9, #0xffffffffffffffe0
742 ; CHECK-GI-NEXT: .cfi_def_cfa w29, 16
743 ; CHECK-GI-NEXT: .cfi_offset w30, -8
744 ; CHECK-GI-NEXT: .cfi_offset w29, -16
745 ; CHECK-GI-NEXT: mov w8, w1
746 ; CHECK-GI-NEXT: mov x10, sp
747 ; CHECK-GI-NEXT: stp q0, q1, [sp]
748 ; CHECK-GI-NEXT: and x8, x8, #0x1f
749 ; CHECK-GI-NEXT: lsl x9, x8, #1
750 ; CHECK-GI-NEXT: sub x8, x9, x8
751 ; CHECK-GI-NEXT: strb w0, [x10, x8]
752 ; CHECK-GI-NEXT: ldp q0, q1, [sp]
753 ; CHECK-GI-NEXT: mov sp, x29
754 ; CHECK-GI-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
757 %d = insertelement <32 x i8> %a, i8 %b, i32 %c
761 define <4 x i16> @insert_v4i16_0(<4 x i16> %a, i16 %b, i32 %c) {
762 ; CHECK-LABEL: insert_v4i16_0:
763 ; CHECK: // %bb.0: // %entry
764 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
765 ; CHECK-NEXT: mov v0.h[0], w0
766 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
769 %d = insertelement <4 x i16> %a, i16 %b, i32 0
773 define <4 x i16> @insert_v4i16_2(<4 x i16> %a, i16 %b, i32 %c) {
774 ; CHECK-LABEL: insert_v4i16_2:
775 ; CHECK: // %bb.0: // %entry
776 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
777 ; CHECK-NEXT: mov v0.h[2], w0
778 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
781 %d = insertelement <4 x i16> %a, i16 %b, i32 2
785 define <4 x i16> @insert_v4i16_c(<4 x i16> %a, i16 %b, i32 %c) {
786 ; CHECK-SD-LABEL: insert_v4i16_c:
787 ; CHECK-SD: // %bb.0: // %entry
788 ; CHECK-SD-NEXT: sub sp, sp, #16
789 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
790 ; CHECK-SD-NEXT: add x8, sp, #8
791 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
792 ; CHECK-SD-NEXT: str d0, [sp, #8]
793 ; CHECK-SD-NEXT: bfi x8, x1, #1, #2
794 ; CHECK-SD-NEXT: strh w0, [x8]
795 ; CHECK-SD-NEXT: ldr d0, [sp, #8]
796 ; CHECK-SD-NEXT: add sp, sp, #16
799 ; CHECK-GI-LABEL: insert_v4i16_c:
800 ; CHECK-GI: // %bb.0: // %entry
801 ; CHECK-GI-NEXT: sub sp, sp, #16
802 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
803 ; CHECK-GI-NEXT: mov w9, w1
804 ; CHECK-GI-NEXT: add x8, sp, #8
805 ; CHECK-GI-NEXT: str d0, [sp, #8]
806 ; CHECK-GI-NEXT: and x9, x9, #0x3
807 ; CHECK-GI-NEXT: strh w0, [x8, x9, lsl #1]
808 ; CHECK-GI-NEXT: ldr d0, [sp, #8]
809 ; CHECK-GI-NEXT: add sp, sp, #16
812 %d = insertelement <4 x i16> %a, i16 %b, i32 %c
816 define <8 x i16> @insert_v8i16_0(<8 x i16> %a, i16 %b, i32 %c) {
817 ; CHECK-LABEL: insert_v8i16_0:
818 ; CHECK: // %bb.0: // %entry
819 ; CHECK-NEXT: mov v0.h[0], w0
822 %d = insertelement <8 x i16> %a, i16 %b, i32 0
826 define <8 x i16> @insert_v8i16_2(<8 x i16> %a, i16 %b, i32 %c) {
827 ; CHECK-LABEL: insert_v8i16_2:
828 ; CHECK: // %bb.0: // %entry
829 ; CHECK-NEXT: mov v0.h[2], w0
832 %d = insertelement <8 x i16> %a, i16 %b, i32 2
836 define <8 x i16> @insert_v8i16_c(<8 x i16> %a, i16 %b, i32 %c) {
837 ; CHECK-SD-LABEL: insert_v8i16_c:
838 ; CHECK-SD: // %bb.0: // %entry
839 ; CHECK-SD-NEXT: sub sp, sp, #16
840 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
841 ; CHECK-SD-NEXT: mov x8, sp
842 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
843 ; CHECK-SD-NEXT: str q0, [sp]
844 ; CHECK-SD-NEXT: bfi x8, x1, #1, #3
845 ; CHECK-SD-NEXT: strh w0, [x8]
846 ; CHECK-SD-NEXT: ldr q0, [sp], #16
849 ; CHECK-GI-LABEL: insert_v8i16_c:
850 ; CHECK-GI: // %bb.0: // %entry
851 ; CHECK-GI-NEXT: sub sp, sp, #16
852 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
853 ; CHECK-GI-NEXT: mov w9, w1
854 ; CHECK-GI-NEXT: mov x8, sp
855 ; CHECK-GI-NEXT: str q0, [sp]
856 ; CHECK-GI-NEXT: and x9, x9, #0x7
857 ; CHECK-GI-NEXT: strh w0, [x8, x9, lsl #1]
858 ; CHECK-GI-NEXT: ldr q0, [sp], #16
861 %d = insertelement <8 x i16> %a, i16 %b, i32 %c
865 define <16 x i16> @insert_v16i16_0(<16 x i16> %a, i16 %b, i32 %c) {
866 ; CHECK-LABEL: insert_v16i16_0:
867 ; CHECK: // %bb.0: // %entry
868 ; CHECK-NEXT: mov v0.h[0], w0
871 %d = insertelement <16 x i16> %a, i16 %b, i32 0
875 define <16 x i16> @insert_v16i16_2(<16 x i16> %a, i16 %b, i32 %c) {
876 ; CHECK-LABEL: insert_v16i16_2:
877 ; CHECK: // %bb.0: // %entry
878 ; CHECK-NEXT: mov v0.h[2], w0
881 %d = insertelement <16 x i16> %a, i16 %b, i32 2
885 define <16 x i16> @insert_v16i16_c(<16 x i16> %a, i16 %b, i32 %c) {
886 ; CHECK-SD-LABEL: insert_v16i16_c:
887 ; CHECK-SD: // %bb.0: // %entry
888 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
889 ; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
890 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
891 ; CHECK-SD-NEXT: and x8, x1, #0xf
892 ; CHECK-SD-NEXT: mov x9, sp
893 ; CHECK-SD-NEXT: strh w0, [x9, x8, lsl #1]
894 ; CHECK-SD-NEXT: ldp q0, q1, [sp], #32
897 ; CHECK-GI-LABEL: insert_v16i16_c:
898 ; CHECK-GI: // %bb.0: // %entry
899 ; CHECK-GI-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
900 ; CHECK-GI-NEXT: sub x9, sp, #48
901 ; CHECK-GI-NEXT: mov x29, sp
902 ; CHECK-GI-NEXT: and sp, x9, #0xffffffffffffffe0
903 ; CHECK-GI-NEXT: .cfi_def_cfa w29, 16
904 ; CHECK-GI-NEXT: .cfi_offset w30, -8
905 ; CHECK-GI-NEXT: .cfi_offset w29, -16
906 ; CHECK-GI-NEXT: mov w8, w1
907 ; CHECK-GI-NEXT: mov x9, sp
908 ; CHECK-GI-NEXT: stp q0, q1, [sp]
909 ; CHECK-GI-NEXT: and x8, x8, #0xf
910 ; CHECK-GI-NEXT: strh w0, [x9, x8, lsl #1]
911 ; CHECK-GI-NEXT: ldp q0, q1, [sp]
912 ; CHECK-GI-NEXT: mov sp, x29
913 ; CHECK-GI-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
916 %d = insertelement <16 x i16> %a, i16 %b, i32 %c
920 define <2 x i32> @insert_v2i32_0(<2 x i32> %a, i32 %b, i32 %c) {
921 ; CHECK-LABEL: insert_v2i32_0:
922 ; CHECK: // %bb.0: // %entry
923 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
924 ; CHECK-NEXT: mov v0.s[0], w0
925 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
928 %d = insertelement <2 x i32> %a, i32 %b, i32 0
932 define <2 x i32> @insert_v2i32_1(<2 x i32> %a, i32 %b, i32 %c) {
933 ; CHECK-LABEL: insert_v2i32_1:
934 ; CHECK: // %bb.0: // %entry
935 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
936 ; CHECK-NEXT: mov v0.s[1], w0
937 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
940 %d = insertelement <2 x i32> %a, i32 %b, i32 1
944 define <2 x i32> @insert_v2i32_c(<2 x i32> %a, i32 %b, i32 %c) {
945 ; CHECK-SD-LABEL: insert_v2i32_c:
946 ; CHECK-SD: // %bb.0: // %entry
947 ; CHECK-SD-NEXT: sub sp, sp, #16
948 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
949 ; CHECK-SD-NEXT: add x8, sp, #8
950 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
951 ; CHECK-SD-NEXT: str d0, [sp, #8]
952 ; CHECK-SD-NEXT: bfi x8, x1, #2, #1
953 ; CHECK-SD-NEXT: str w0, [x8]
954 ; CHECK-SD-NEXT: ldr d0, [sp, #8]
955 ; CHECK-SD-NEXT: add sp, sp, #16
958 ; CHECK-GI-LABEL: insert_v2i32_c:
959 ; CHECK-GI: // %bb.0: // %entry
960 ; CHECK-GI-NEXT: sub sp, sp, #16
961 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
962 ; CHECK-GI-NEXT: mov w9, w1
963 ; CHECK-GI-NEXT: add x8, sp, #8
964 ; CHECK-GI-NEXT: str d0, [sp, #8]
965 ; CHECK-GI-NEXT: and x9, x9, #0x1
966 ; CHECK-GI-NEXT: str w0, [x8, x9, lsl #2]
967 ; CHECK-GI-NEXT: ldr d0, [sp, #8]
968 ; CHECK-GI-NEXT: add sp, sp, #16
971 %d = insertelement <2 x i32> %a, i32 %b, i32 %c
975 define <3 x i32> @insert_v3i32_0(<3 x i32> %a, i32 %b, i32 %c) {
976 ; CHECK-SD-LABEL: insert_v3i32_0:
977 ; CHECK-SD: // %bb.0: // %entry
978 ; CHECK-SD-NEXT: fmov s1, w0
979 ; CHECK-SD-NEXT: mov v1.s[1], v0.s[1]
980 ; CHECK-SD-NEXT: mov v1.s[2], v0.s[2]
981 ; CHECK-SD-NEXT: mov v0.16b, v1.16b
984 ; CHECK-GI-LABEL: insert_v3i32_0:
985 ; CHECK-GI: // %bb.0: // %entry
986 ; CHECK-GI-NEXT: mov w8, v0.s[1]
987 ; CHECK-GI-NEXT: fmov s1, w0
988 ; CHECK-GI-NEXT: mov w9, v0.s[2]
989 ; CHECK-GI-NEXT: mov v1.s[1], w8
990 ; CHECK-GI-NEXT: mov v1.s[2], w9
991 ; CHECK-GI-NEXT: mov v0.16b, v1.16b
994 %d = insertelement <3 x i32> %a, i32 %b, i32 0
998 define <3 x i32> @insert_v3i32_2(<3 x i32> %a, i32 %b, i32 %c) {
999 ; CHECK-SD-LABEL: insert_v3i32_2:
1000 ; CHECK-SD: // %bb.0: // %entry
1001 ; CHECK-SD-NEXT: mov v0.s[2], w0
1002 ; CHECK-SD-NEXT: ret
1004 ; CHECK-GI-LABEL: insert_v3i32_2:
1005 ; CHECK-GI: // %bb.0: // %entry
1006 ; CHECK-GI-NEXT: mov s1, v0.s[1]
1007 ; CHECK-GI-NEXT: mov v0.s[1], v1.s[0]
1008 ; CHECK-GI-NEXT: fmov s1, w0
1009 ; CHECK-GI-NEXT: mov v0.s[2], v1.s[0]
1010 ; CHECK-GI-NEXT: ret
1012 %d = insertelement <3 x i32> %a, i32 %b, i32 2
1016 define <3 x i32> @insert_v3i32_c(<3 x i32> %a, i32 %b, i32 %c) {
1017 ; CHECK-SD-LABEL: insert_v3i32_c:
1018 ; CHECK-SD: // %bb.0: // %entry
1019 ; CHECK-SD-NEXT: sub sp, sp, #16
1020 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
1021 ; CHECK-SD-NEXT: mov x8, sp
1022 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1023 ; CHECK-SD-NEXT: str q0, [sp]
1024 ; CHECK-SD-NEXT: bfi x8, x1, #2, #2
1025 ; CHECK-SD-NEXT: str w0, [x8]
1026 ; CHECK-SD-NEXT: ldr q0, [sp], #16
1027 ; CHECK-SD-NEXT: ret
1029 ; CHECK-GI-LABEL: insert_v3i32_c:
1030 ; CHECK-GI: // %bb.0: // %entry
1031 ; CHECK-GI-NEXT: sub sp, sp, #16
1032 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
1033 ; CHECK-GI-NEXT: mov w9, w1
1034 ; CHECK-GI-NEXT: mov x8, sp
1035 ; CHECK-GI-NEXT: str q0, [sp]
1036 ; CHECK-GI-NEXT: and x9, x9, #0x3
1037 ; CHECK-GI-NEXT: str w0, [x8, x9, lsl #2]
1038 ; CHECK-GI-NEXT: ldr q0, [sp], #16
1039 ; CHECK-GI-NEXT: ret
1041 %d = insertelement <3 x i32> %a, i32 %b, i32 %c
1045 define <4 x i32> @insert_v4i32_0(<4 x i32> %a, i32 %b, i32 %c) {
1046 ; CHECK-LABEL: insert_v4i32_0:
1047 ; CHECK: // %bb.0: // %entry
1048 ; CHECK-NEXT: mov v0.s[0], w0
1051 %d = insertelement <4 x i32> %a, i32 %b, i32 0
1055 define <4 x i32> @insert_v4i32_2(<4 x i32> %a, i32 %b, i32 %c) {
1056 ; CHECK-LABEL: insert_v4i32_2:
1057 ; CHECK: // %bb.0: // %entry
1058 ; CHECK-NEXT: mov v0.s[2], w0
1061 %d = insertelement <4 x i32> %a, i32 %b, i32 2
1065 define <4 x i32> @insert_v4i32_c(<4 x i32> %a, i32 %b, i32 %c) {
1066 ; CHECK-SD-LABEL: insert_v4i32_c:
1067 ; CHECK-SD: // %bb.0: // %entry
1068 ; CHECK-SD-NEXT: sub sp, sp, #16
1069 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
1070 ; CHECK-SD-NEXT: mov x8, sp
1071 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1072 ; CHECK-SD-NEXT: str q0, [sp]
1073 ; CHECK-SD-NEXT: bfi x8, x1, #2, #2
1074 ; CHECK-SD-NEXT: str w0, [x8]
1075 ; CHECK-SD-NEXT: ldr q0, [sp], #16
1076 ; CHECK-SD-NEXT: ret
1078 ; CHECK-GI-LABEL: insert_v4i32_c:
1079 ; CHECK-GI: // %bb.0: // %entry
1080 ; CHECK-GI-NEXT: sub sp, sp, #16
1081 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
1082 ; CHECK-GI-NEXT: mov w9, w1
1083 ; CHECK-GI-NEXT: mov x8, sp
1084 ; CHECK-GI-NEXT: str q0, [sp]
1085 ; CHECK-GI-NEXT: and x9, x9, #0x3
1086 ; CHECK-GI-NEXT: str w0, [x8, x9, lsl #2]
1087 ; CHECK-GI-NEXT: ldr q0, [sp], #16
1088 ; CHECK-GI-NEXT: ret
1090 %d = insertelement <4 x i32> %a, i32 %b, i32 %c
1094 define <8 x i32> @insert_v8i32_0(<8 x i32> %a, i32 %b, i32 %c) {
1095 ; CHECK-LABEL: insert_v8i32_0:
1096 ; CHECK: // %bb.0: // %entry
1097 ; CHECK-NEXT: mov v0.s[0], w0
1100 %d = insertelement <8 x i32> %a, i32 %b, i32 0
1104 define <8 x i32> @insert_v8i32_2(<8 x i32> %a, i32 %b, i32 %c) {
1105 ; CHECK-LABEL: insert_v8i32_2:
1106 ; CHECK: // %bb.0: // %entry
1107 ; CHECK-NEXT: mov v0.s[2], w0
1110 %d = insertelement <8 x i32> %a, i32 %b, i32 2
1114 define <8 x i32> @insert_v8i32_c(<8 x i32> %a, i32 %b, i32 %c) {
1115 ; CHECK-SD-LABEL: insert_v8i32_c:
1116 ; CHECK-SD: // %bb.0: // %entry
1117 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1118 ; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
1119 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1120 ; CHECK-SD-NEXT: and x8, x1, #0x7
1121 ; CHECK-SD-NEXT: mov x9, sp
1122 ; CHECK-SD-NEXT: str w0, [x9, x8, lsl #2]
1123 ; CHECK-SD-NEXT: ldp q0, q1, [sp], #32
1124 ; CHECK-SD-NEXT: ret
1126 ; CHECK-GI-LABEL: insert_v8i32_c:
1127 ; CHECK-GI: // %bb.0: // %entry
1128 ; CHECK-GI-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
1129 ; CHECK-GI-NEXT: sub x9, sp, #48
1130 ; CHECK-GI-NEXT: mov x29, sp
1131 ; CHECK-GI-NEXT: and sp, x9, #0xffffffffffffffe0
1132 ; CHECK-GI-NEXT: .cfi_def_cfa w29, 16
1133 ; CHECK-GI-NEXT: .cfi_offset w30, -8
1134 ; CHECK-GI-NEXT: .cfi_offset w29, -16
1135 ; CHECK-GI-NEXT: mov w8, w1
1136 ; CHECK-GI-NEXT: mov x9, sp
1137 ; CHECK-GI-NEXT: stp q0, q1, [sp]
1138 ; CHECK-GI-NEXT: and x8, x8, #0x7
1139 ; CHECK-GI-NEXT: str w0, [x9, x8, lsl #2]
1140 ; CHECK-GI-NEXT: ldp q0, q1, [sp]
1141 ; CHECK-GI-NEXT: mov sp, x29
1142 ; CHECK-GI-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
1143 ; CHECK-GI-NEXT: ret
1145 %d = insertelement <8 x i32> %a, i32 %b, i32 %c
1149 define <2 x i64> @insert_v2i64_0(<2 x i64> %a, i64 %b, i32 %c) {
1150 ; CHECK-LABEL: insert_v2i64_0:
1151 ; CHECK: // %bb.0: // %entry
1152 ; CHECK-NEXT: mov v0.d[0], x0
1155 %d = insertelement <2 x i64> %a, i64 %b, i32 0
1159 define <2 x i64> @insert_v2i64_1(<2 x i64> %a, i64 %b, i32 %c) {
1160 ; CHECK-LABEL: insert_v2i64_1:
1161 ; CHECK: // %bb.0: // %entry
1162 ; CHECK-NEXT: mov v0.d[1], x0
1165 %d = insertelement <2 x i64> %a, i64 %b, i32 1
1169 define <2 x i64> @insert_v2i64_c(<2 x i64> %a, i64 %b, i32 %c) {
1170 ; CHECK-SD-LABEL: insert_v2i64_c:
1171 ; CHECK-SD: // %bb.0: // %entry
1172 ; CHECK-SD-NEXT: sub sp, sp, #16
1173 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
1174 ; CHECK-SD-NEXT: mov x8, sp
1175 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1176 ; CHECK-SD-NEXT: str q0, [sp]
1177 ; CHECK-SD-NEXT: bfi x8, x1, #3, #1
1178 ; CHECK-SD-NEXT: str x0, [x8]
1179 ; CHECK-SD-NEXT: ldr q0, [sp], #16
1180 ; CHECK-SD-NEXT: ret
1182 ; CHECK-GI-LABEL: insert_v2i64_c:
1183 ; CHECK-GI: // %bb.0: // %entry
1184 ; CHECK-GI-NEXT: sub sp, sp, #16
1185 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
1186 ; CHECK-GI-NEXT: mov w9, w1
1187 ; CHECK-GI-NEXT: mov x8, sp
1188 ; CHECK-GI-NEXT: str q0, [sp]
1189 ; CHECK-GI-NEXT: and x9, x9, #0x1
1190 ; CHECK-GI-NEXT: str x0, [x8, x9, lsl #3]
1191 ; CHECK-GI-NEXT: ldr q0, [sp], #16
1192 ; CHECK-GI-NEXT: ret
1194 %d = insertelement <2 x i64> %a, i64 %b, i32 %c
1198 define <3 x i64> @insert_v3i64_0(<3 x i64> %a, i64 %b, i32 %c) {
1199 ; CHECK-SD-LABEL: insert_v3i64_0:
1200 ; CHECK-SD: // %bb.0: // %entry
1201 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 def $q1
1202 ; CHECK-SD-NEXT: mov v0.d[1], v1.d[0]
1203 ; CHECK-SD-NEXT: mov v0.d[0], x0
1204 ; CHECK-SD-NEXT: ext v1.16b, v0.16b, v0.16b, #8
1205 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
1206 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 killed $q1
1207 ; CHECK-SD-NEXT: ret
1209 ; CHECK-GI-LABEL: insert_v3i64_0:
1210 ; CHECK-GI: // %bb.0: // %entry
1211 ; CHECK-GI-NEXT: fmov d0, x0
1212 ; CHECK-GI-NEXT: ret
1214 %d = insertelement <3 x i64> %a, i64 %b, i32 0
1218 define <3 x i64> @insert_v3i64_2(<3 x i64> %a, i64 %b, i32 %c) {
1219 ; CHECK-LABEL: insert_v3i64_2:
1220 ; CHECK: // %bb.0: // %entry
1221 ; CHECK-NEXT: fmov d2, x0
1224 %d = insertelement <3 x i64> %a, i64 %b, i32 2
1228 define <3 x i64> @insert_v3i64_c(<3 x i64> %a, i64 %b, i32 %c) {
1229 ; CHECK-SD-LABEL: insert_v3i64_c:
1230 ; CHECK-SD: // %bb.0: // %entry
1231 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
1232 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 def $q1
1233 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1234 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 def $q2
1235 ; CHECK-SD-NEXT: mov v0.d[1], v1.d[0]
1236 ; CHECK-SD-NEXT: stp q0, q2, [sp, #-32]!
1237 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1238 ; CHECK-SD-NEXT: mov x8, sp
1239 ; CHECK-SD-NEXT: and x9, x1, #0x3
1240 ; CHECK-SD-NEXT: str x0, [x8, x9, lsl #3]
1241 ; CHECK-SD-NEXT: ldr q0, [sp]
1242 ; CHECK-SD-NEXT: ldr d2, [sp, #16]
1243 ; CHECK-SD-NEXT: ext v1.16b, v0.16b, v0.16b, #8
1244 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
1245 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 killed $q1
1246 ; CHECK-SD-NEXT: add sp, sp, #32
1247 ; CHECK-SD-NEXT: ret
1249 ; CHECK-GI-LABEL: insert_v3i64_c:
1250 ; CHECK-GI: // %bb.0: // %entry
1251 ; CHECK-GI-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
1252 ; CHECK-GI-NEXT: sub x9, sp, #48
1253 ; CHECK-GI-NEXT: mov x29, sp
1254 ; CHECK-GI-NEXT: and sp, x9, #0xffffffffffffffe0
1255 ; CHECK-GI-NEXT: .cfi_def_cfa w29, 16
1256 ; CHECK-GI-NEXT: .cfi_offset w30, -8
1257 ; CHECK-GI-NEXT: .cfi_offset w29, -16
1258 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
1259 ; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1
1260 ; CHECK-GI-NEXT: mov w8, w1
1261 ; CHECK-GI-NEXT: mov x9, sp
1262 ; CHECK-GI-NEXT: // kill: def $d2 killed $d2 def $q2
1263 ; CHECK-GI-NEXT: mov v0.d[1], v1.d[0]
1264 ; CHECK-GI-NEXT: and x8, x8, #0x3
1265 ; CHECK-GI-NEXT: stp q0, q2, [sp]
1266 ; CHECK-GI-NEXT: str x0, [x9, x8, lsl #3]
1267 ; CHECK-GI-NEXT: ldp q0, q2, [sp]
1268 ; CHECK-GI-NEXT: // kill: def $d2 killed $d2 killed $q2
1269 ; CHECK-GI-NEXT: mov d1, v0.d[1]
1270 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
1271 ; CHECK-GI-NEXT: mov sp, x29
1272 ; CHECK-GI-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
1273 ; CHECK-GI-NEXT: ret
1275 %d = insertelement <3 x i64> %a, i64 %b, i32 %c
1279 define <4 x i64> @insert_v4i64_0(<4 x i64> %a, i64 %b, i32 %c) {
1280 ; CHECK-LABEL: insert_v4i64_0:
1281 ; CHECK: // %bb.0: // %entry
1282 ; CHECK-NEXT: mov v0.d[0], x0
1285 %d = insertelement <4 x i64> %a, i64 %b, i32 0
1289 define <4 x i64> @insert_v4i64_2(<4 x i64> %a, i64 %b, i32 %c) {
1290 ; CHECK-LABEL: insert_v4i64_2:
1291 ; CHECK: // %bb.0: // %entry
1292 ; CHECK-NEXT: mov v1.d[0], x0
1295 %d = insertelement <4 x i64> %a, i64 %b, i32 2
1299 define <4 x i64> @insert_v4i64_c(<4 x i64> %a, i64 %b, i32 %c) {
1300 ; CHECK-SD-LABEL: insert_v4i64_c:
1301 ; CHECK-SD: // %bb.0: // %entry
1302 ; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
1303 ; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
1304 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1305 ; CHECK-SD-NEXT: and x8, x1, #0x3
1306 ; CHECK-SD-NEXT: mov x9, sp
1307 ; CHECK-SD-NEXT: str x0, [x9, x8, lsl #3]
1308 ; CHECK-SD-NEXT: ldp q0, q1, [sp], #32
1309 ; CHECK-SD-NEXT: ret
1311 ; CHECK-GI-LABEL: insert_v4i64_c:
1312 ; CHECK-GI: // %bb.0: // %entry
1313 ; CHECK-GI-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
1314 ; CHECK-GI-NEXT: sub x9, sp, #48
1315 ; CHECK-GI-NEXT: mov x29, sp
1316 ; CHECK-GI-NEXT: and sp, x9, #0xffffffffffffffe0
1317 ; CHECK-GI-NEXT: .cfi_def_cfa w29, 16
1318 ; CHECK-GI-NEXT: .cfi_offset w30, -8
1319 ; CHECK-GI-NEXT: .cfi_offset w29, -16
1320 ; CHECK-GI-NEXT: mov w8, w1
1321 ; CHECK-GI-NEXT: mov x9, sp
1322 ; CHECK-GI-NEXT: stp q0, q1, [sp]
1323 ; CHECK-GI-NEXT: and x8, x8, #0x3
1324 ; CHECK-GI-NEXT: str x0, [x9, x8, lsl #3]
1325 ; CHECK-GI-NEXT: ldp q0, q1, [sp]
1326 ; CHECK-GI-NEXT: mov sp, x29
1327 ; CHECK-GI-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
1328 ; CHECK-GI-NEXT: ret
1330 %d = insertelement <4 x i64> %a, i64 %b, i32 %c
1334 define double @extract_v2f64_0(<2 x double> %a, i32 %c) {
1335 ; CHECK-LABEL: extract_v2f64_0:
1336 ; CHECK: // %bb.0: // %entry
1337 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1340 %d = extractelement <2 x double> %a, i32 0
1344 define double @extract_v2f64_1(<2 x double> %a, i32 %c) {
1345 ; CHECK-LABEL: extract_v2f64_1:
1346 ; CHECK: // %bb.0: // %entry
1347 ; CHECK-NEXT: mov d0, v0.d[1]
1350 %d = extractelement <2 x double> %a, i32 1
1354 define double @extract_v2f64_c(<2 x double> %a, i32 %c) {
1355 ; CHECK-SD-LABEL: extract_v2f64_c:
1356 ; CHECK-SD: // %bb.0: // %entry
1357 ; CHECK-SD-NEXT: sub sp, sp, #16
1358 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
1359 ; CHECK-SD-NEXT: mov x8, sp
1360 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
1361 ; CHECK-SD-NEXT: str q0, [sp]
1362 ; CHECK-SD-NEXT: bfi x8, x0, #3, #1
1363 ; CHECK-SD-NEXT: ldr d0, [x8]
1364 ; CHECK-SD-NEXT: add sp, sp, #16
1365 ; CHECK-SD-NEXT: ret
1367 ; CHECK-GI-LABEL: extract_v2f64_c:
1368 ; CHECK-GI: // %bb.0: // %entry
1369 ; CHECK-GI-NEXT: sub sp, sp, #16
1370 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
1371 ; CHECK-GI-NEXT: mov w9, w0
1372 ; CHECK-GI-NEXT: mov x8, sp
1373 ; CHECK-GI-NEXT: str q0, [sp]
1374 ; CHECK-GI-NEXT: and x9, x9, #0x1
1375 ; CHECK-GI-NEXT: ldr d0, [x8, x9, lsl #3]
1376 ; CHECK-GI-NEXT: add sp, sp, #16
1377 ; CHECK-GI-NEXT: ret
1379 %d = extractelement <2 x double> %a, i32 %c
1383 define double @extract_v3f64_0(<3 x double> %a, i32 %c) {
1384 ; CHECK-LABEL: extract_v3f64_0:
1385 ; CHECK: // %bb.0: // %entry
1388 %d = extractelement <3 x double> %a, i32 0
1392 define double @extract_v3f64_2(<3 x double> %a, i32 %c) {
1393 ; CHECK-LABEL: extract_v3f64_2:
1394 ; CHECK: // %bb.0: // %entry
1395 ; CHECK-NEXT: fmov d0, d2
1398 %d = extractelement <3 x double> %a, i32 2
1402 define double @extract_v3f64_c(<3 x double> %a, i32 %c) {
1403 ; CHECK-SD-LABEL: extract_v3f64_c:
1404 ; CHECK-SD: // %bb.0: // %entry
1405 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
1406 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 def $q1
1407 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
1408 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 def $q2
1409 ; CHECK-SD-NEXT: and x8, x0, #0x3
1410 ; CHECK-SD-NEXT: mov v0.d[1], v1.d[0]
1411 ; CHECK-SD-NEXT: stp q0, q2, [sp, #-32]!
1412 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1413 ; CHECK-SD-NEXT: mov x9, sp
1414 ; CHECK-SD-NEXT: ldr d0, [x9, x8, lsl #3]
1415 ; CHECK-SD-NEXT: add sp, sp, #32
1416 ; CHECK-SD-NEXT: ret
1418 ; CHECK-GI-LABEL: extract_v3f64_c:
1419 ; CHECK-GI: // %bb.0: // %entry
1420 ; CHECK-GI-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
1421 ; CHECK-GI-NEXT: sub x9, sp, #48
1422 ; CHECK-GI-NEXT: mov x29, sp
1423 ; CHECK-GI-NEXT: and sp, x9, #0xffffffffffffffe0
1424 ; CHECK-GI-NEXT: .cfi_def_cfa w29, 16
1425 ; CHECK-GI-NEXT: .cfi_offset w30, -8
1426 ; CHECK-GI-NEXT: .cfi_offset w29, -16
1427 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
1428 ; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1
1429 ; CHECK-GI-NEXT: mov w8, w0
1430 ; CHECK-GI-NEXT: // kill: def $d2 killed $d2 def $q2
1431 ; CHECK-GI-NEXT: mov x9, sp
1432 ; CHECK-GI-NEXT: mov v0.d[1], v1.d[0]
1433 ; CHECK-GI-NEXT: and x8, x8, #0x3
1434 ; CHECK-GI-NEXT: stp q0, q2, [sp]
1435 ; CHECK-GI-NEXT: ldr d0, [x9, x8, lsl #3]
1436 ; CHECK-GI-NEXT: mov sp, x29
1437 ; CHECK-GI-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
1438 ; CHECK-GI-NEXT: ret
1440 %d = extractelement <3 x double> %a, i32 %c
1444 define double @extract_v4f64_0(<4 x double> %a, i32 %c) {
1445 ; CHECK-LABEL: extract_v4f64_0:
1446 ; CHECK: // %bb.0: // %entry
1447 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1450 %d = extractelement <4 x double> %a, i32 0
1454 define double @extract_v4f64_2(<4 x double> %a, i32 %c) {
1455 ; CHECK-LABEL: extract_v4f64_2:
1456 ; CHECK: // %bb.0: // %entry
1457 ; CHECK-NEXT: mov v0.16b, v1.16b
1458 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
1461 %d = extractelement <4 x double> %a, i32 2
1465 define double @extract_v4f64_c(<4 x double> %a, i32 %c) {
1466 ; CHECK-SD-LABEL: extract_v4f64_c:
1467 ; CHECK-SD: // %bb.0: // %entry
1468 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
1469 ; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
1470 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1471 ; CHECK-SD-NEXT: and x8, x0, #0x3
1472 ; CHECK-SD-NEXT: mov x9, sp
1473 ; CHECK-SD-NEXT: ldr d0, [x9, x8, lsl #3]
1474 ; CHECK-SD-NEXT: add sp, sp, #32
1475 ; CHECK-SD-NEXT: ret
1477 ; CHECK-GI-LABEL: extract_v4f64_c:
1478 ; CHECK-GI: // %bb.0: // %entry
1479 ; CHECK-GI-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
1480 ; CHECK-GI-NEXT: sub x9, sp, #48
1481 ; CHECK-GI-NEXT: mov x29, sp
1482 ; CHECK-GI-NEXT: and sp, x9, #0xffffffffffffffe0
1483 ; CHECK-GI-NEXT: .cfi_def_cfa w29, 16
1484 ; CHECK-GI-NEXT: .cfi_offset w30, -8
1485 ; CHECK-GI-NEXT: .cfi_offset w29, -16
1486 ; CHECK-GI-NEXT: mov w8, w0
1487 ; CHECK-GI-NEXT: stp q0, q1, [sp]
1488 ; CHECK-GI-NEXT: mov x9, sp
1489 ; CHECK-GI-NEXT: and x8, x8, #0x3
1490 ; CHECK-GI-NEXT: ldr d0, [x9, x8, lsl #3]
1491 ; CHECK-GI-NEXT: mov sp, x29
1492 ; CHECK-GI-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
1493 ; CHECK-GI-NEXT: ret
1495 %d = extractelement <4 x double> %a, i32 %c
1499 define float @extract_v2f32_0(<2 x float> %a, i32 %c) {
1500 ; CHECK-SD-LABEL: extract_v2f32_0:
1501 ; CHECK-SD: // %bb.0: // %entry
1502 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
1503 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 killed $q0
1504 ; CHECK-SD-NEXT: ret
1506 ; CHECK-GI-LABEL: extract_v2f32_0:
1507 ; CHECK-GI: // %bb.0: // %entry
1508 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 killed $d0
1509 ; CHECK-GI-NEXT: ret
1511 %d = extractelement <2 x float> %a, i32 0
1515 define float @extract_v2f32_1(<2 x float> %a, i32 %c) {
1516 ; CHECK-LABEL: extract_v2f32_1:
1517 ; CHECK: // %bb.0: // %entry
1518 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
1519 ; CHECK-NEXT: mov s0, v0.s[1]
1522 %d = extractelement <2 x float> %a, i32 1
1526 define float @extract_v2f32_c(<2 x float> %a, i32 %c) {
1527 ; CHECK-SD-LABEL: extract_v2f32_c:
1528 ; CHECK-SD: // %bb.0: // %entry
1529 ; CHECK-SD-NEXT: sub sp, sp, #16
1530 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
1531 ; CHECK-SD-NEXT: add x8, sp, #8
1532 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
1533 ; CHECK-SD-NEXT: str d0, [sp, #8]
1534 ; CHECK-SD-NEXT: bfi x8, x0, #2, #1
1535 ; CHECK-SD-NEXT: ldr s0, [x8]
1536 ; CHECK-SD-NEXT: add sp, sp, #16
1537 ; CHECK-SD-NEXT: ret
1539 ; CHECK-GI-LABEL: extract_v2f32_c:
1540 ; CHECK-GI: // %bb.0: // %entry
1541 ; CHECK-GI-NEXT: sub sp, sp, #16
1542 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
1543 ; CHECK-GI-NEXT: mov w9, w0
1544 ; CHECK-GI-NEXT: add x8, sp, #8
1545 ; CHECK-GI-NEXT: str d0, [sp, #8]
1546 ; CHECK-GI-NEXT: and x9, x9, #0x1
1547 ; CHECK-GI-NEXT: ldr s0, [x8, x9, lsl #2]
1548 ; CHECK-GI-NEXT: add sp, sp, #16
1549 ; CHECK-GI-NEXT: ret
1551 %d = extractelement <2 x float> %a, i32 %c
1555 define float @extract_v3f32_0(<3 x float> %a, i32 %c) {
1556 ; CHECK-LABEL: extract_v3f32_0:
1557 ; CHECK: // %bb.0: // %entry
1558 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
1561 %d = extractelement <3 x float> %a, i32 0
1565 define float @extract_v3f32_2(<3 x float> %a, i32 %c) {
1566 ; CHECK-LABEL: extract_v3f32_2:
1567 ; CHECK: // %bb.0: // %entry
1568 ; CHECK-NEXT: mov s0, v0.s[2]
1571 %d = extractelement <3 x float> %a, i32 2
1575 define float @extract_v3f32_c(<3 x float> %a, i32 %c) {
1576 ; CHECK-SD-LABEL: extract_v3f32_c:
1577 ; CHECK-SD: // %bb.0: // %entry
1578 ; CHECK-SD-NEXT: sub sp, sp, #16
1579 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
1580 ; CHECK-SD-NEXT: mov x8, sp
1581 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
1582 ; CHECK-SD-NEXT: str q0, [sp]
1583 ; CHECK-SD-NEXT: bfi x8, x0, #2, #2
1584 ; CHECK-SD-NEXT: ldr s0, [x8]
1585 ; CHECK-SD-NEXT: add sp, sp, #16
1586 ; CHECK-SD-NEXT: ret
1588 ; CHECK-GI-LABEL: extract_v3f32_c:
1589 ; CHECK-GI: // %bb.0: // %entry
1590 ; CHECK-GI-NEXT: sub sp, sp, #16
1591 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
1592 ; CHECK-GI-NEXT: mov w9, w0
1593 ; CHECK-GI-NEXT: mov x8, sp
1594 ; CHECK-GI-NEXT: str q0, [sp]
1595 ; CHECK-GI-NEXT: and x9, x9, #0x3
1596 ; CHECK-GI-NEXT: ldr s0, [x8, x9, lsl #2]
1597 ; CHECK-GI-NEXT: add sp, sp, #16
1598 ; CHECK-GI-NEXT: ret
1600 %d = extractelement <3 x float> %a, i32 %c
1604 define float @extract_v4f32_0(<4 x float> %a, i32 %c) {
1605 ; CHECK-LABEL: extract_v4f32_0:
1606 ; CHECK: // %bb.0: // %entry
1607 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
1610 %d = extractelement <4 x float> %a, i32 0
1614 define float @extract_v4f32_2(<4 x float> %a, i32 %c) {
1615 ; CHECK-LABEL: extract_v4f32_2:
1616 ; CHECK: // %bb.0: // %entry
1617 ; CHECK-NEXT: mov s0, v0.s[2]
1620 %d = extractelement <4 x float> %a, i32 2
1624 define float @extract_v4f32_c(<4 x float> %a, i32 %c) {
1625 ; CHECK-SD-LABEL: extract_v4f32_c:
1626 ; CHECK-SD: // %bb.0: // %entry
1627 ; CHECK-SD-NEXT: sub sp, sp, #16
1628 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
1629 ; CHECK-SD-NEXT: mov x8, sp
1630 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
1631 ; CHECK-SD-NEXT: str q0, [sp]
1632 ; CHECK-SD-NEXT: bfi x8, x0, #2, #2
1633 ; CHECK-SD-NEXT: ldr s0, [x8]
1634 ; CHECK-SD-NEXT: add sp, sp, #16
1635 ; CHECK-SD-NEXT: ret
1637 ; CHECK-GI-LABEL: extract_v4f32_c:
1638 ; CHECK-GI: // %bb.0: // %entry
1639 ; CHECK-GI-NEXT: sub sp, sp, #16
1640 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
1641 ; CHECK-GI-NEXT: mov w9, w0
1642 ; CHECK-GI-NEXT: mov x8, sp
1643 ; CHECK-GI-NEXT: str q0, [sp]
1644 ; CHECK-GI-NEXT: and x9, x9, #0x3
1645 ; CHECK-GI-NEXT: ldr s0, [x8, x9, lsl #2]
1646 ; CHECK-GI-NEXT: add sp, sp, #16
1647 ; CHECK-GI-NEXT: ret
1649 %d = extractelement <4 x float> %a, i32 %c
1653 define float @extract_v8f32_0(<8 x float> %a, i32 %c) {
1654 ; CHECK-LABEL: extract_v8f32_0:
1655 ; CHECK: // %bb.0: // %entry
1656 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
1659 %d = extractelement <8 x float> %a, i32 0
1663 define float @extract_v8f32_2(<8 x float> %a, i32 %c) {
1664 ; CHECK-LABEL: extract_v8f32_2:
1665 ; CHECK: // %bb.0: // %entry
1666 ; CHECK-NEXT: mov s0, v0.s[2]
1669 %d = extractelement <8 x float> %a, i32 2
1673 define float @extract_v8f32_c(<8 x float> %a, i32 %c) {
1674 ; CHECK-SD-LABEL: extract_v8f32_c:
1675 ; CHECK-SD: // %bb.0: // %entry
1676 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
1677 ; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
1678 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1679 ; CHECK-SD-NEXT: and x8, x0, #0x7
1680 ; CHECK-SD-NEXT: mov x9, sp
1681 ; CHECK-SD-NEXT: ldr s0, [x9, x8, lsl #2]
1682 ; CHECK-SD-NEXT: add sp, sp, #32
1683 ; CHECK-SD-NEXT: ret
1685 ; CHECK-GI-LABEL: extract_v8f32_c:
1686 ; CHECK-GI: // %bb.0: // %entry
1687 ; CHECK-GI-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
1688 ; CHECK-GI-NEXT: sub x9, sp, #48
1689 ; CHECK-GI-NEXT: mov x29, sp
1690 ; CHECK-GI-NEXT: and sp, x9, #0xffffffffffffffe0
1691 ; CHECK-GI-NEXT: .cfi_def_cfa w29, 16
1692 ; CHECK-GI-NEXT: .cfi_offset w30, -8
1693 ; CHECK-GI-NEXT: .cfi_offset w29, -16
1694 ; CHECK-GI-NEXT: mov w8, w0
1695 ; CHECK-GI-NEXT: stp q0, q1, [sp]
1696 ; CHECK-GI-NEXT: mov x9, sp
1697 ; CHECK-GI-NEXT: and x8, x8, #0x7
1698 ; CHECK-GI-NEXT: ldr s0, [x9, x8, lsl #2]
1699 ; CHECK-GI-NEXT: mov sp, x29
1700 ; CHECK-GI-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
1701 ; CHECK-GI-NEXT: ret
1703 %d = extractelement <8 x float> %a, i32 %c
1707 define half @extract_v4f16_0(<4 x half> %a, i32 %c) {
1708 ; CHECK-SD-LABEL: extract_v4f16_0:
1709 ; CHECK-SD: // %bb.0: // %entry
1710 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
1711 ; CHECK-SD-NEXT: // kill: def $h0 killed $h0 killed $q0
1712 ; CHECK-SD-NEXT: ret
1714 ; CHECK-GI-LABEL: extract_v4f16_0:
1715 ; CHECK-GI: // %bb.0: // %entry
1716 ; CHECK-GI-NEXT: // kill: def $h0 killed $h0 killed $d0
1717 ; CHECK-GI-NEXT: ret
1719 %d = extractelement <4 x half> %a, i32 0
1723 define half @extract_v4f16_2(<4 x half> %a, i32 %c) {
1724 ; CHECK-LABEL: extract_v4f16_2:
1725 ; CHECK: // %bb.0: // %entry
1726 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
1727 ; CHECK-NEXT: mov h0, v0.h[2]
1730 %d = extractelement <4 x half> %a, i32 2
1734 define half @extract_v4f16_c(<4 x half> %a, i32 %c) {
1735 ; CHECK-SD-LABEL: extract_v4f16_c:
1736 ; CHECK-SD: // %bb.0: // %entry
1737 ; CHECK-SD-NEXT: sub sp, sp, #16
1738 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
1739 ; CHECK-SD-NEXT: add x8, sp, #8
1740 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
1741 ; CHECK-SD-NEXT: str d0, [sp, #8]
1742 ; CHECK-SD-NEXT: bfi x8, x0, #1, #2
1743 ; CHECK-SD-NEXT: ldr h0, [x8]
1744 ; CHECK-SD-NEXT: add sp, sp, #16
1745 ; CHECK-SD-NEXT: ret
1747 ; CHECK-GI-LABEL: extract_v4f16_c:
1748 ; CHECK-GI: // %bb.0: // %entry
1749 ; CHECK-GI-NEXT: sub sp, sp, #16
1750 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
1751 ; CHECK-GI-NEXT: mov w9, w0
1752 ; CHECK-GI-NEXT: add x8, sp, #8
1753 ; CHECK-GI-NEXT: str d0, [sp, #8]
1754 ; CHECK-GI-NEXT: and x9, x9, #0x3
1755 ; CHECK-GI-NEXT: ldr h0, [x8, x9, lsl #1]
1756 ; CHECK-GI-NEXT: add sp, sp, #16
1757 ; CHECK-GI-NEXT: ret
1759 %d = extractelement <4 x half> %a, i32 %c
1763 define half @extract_v8f16_0(<8 x half> %a, i32 %c) {
1764 ; CHECK-LABEL: extract_v8f16_0:
1765 ; CHECK: // %bb.0: // %entry
1766 ; CHECK-NEXT: // kill: def $h0 killed $h0 killed $q0
1769 %d = extractelement <8 x half> %a, i32 0
1773 define half @extract_v8f16_2(<8 x half> %a, i32 %c) {
1774 ; CHECK-LABEL: extract_v8f16_2:
1775 ; CHECK: // %bb.0: // %entry
1776 ; CHECK-NEXT: mov h0, v0.h[2]
1779 %d = extractelement <8 x half> %a, i32 2
1783 define half @extract_v8f16_c(<8 x half> %a, i32 %c) {
1784 ; CHECK-SD-LABEL: extract_v8f16_c:
1785 ; CHECK-SD: // %bb.0: // %entry
1786 ; CHECK-SD-NEXT: sub sp, sp, #16
1787 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
1788 ; CHECK-SD-NEXT: mov x8, sp
1789 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
1790 ; CHECK-SD-NEXT: str q0, [sp]
1791 ; CHECK-SD-NEXT: bfi x8, x0, #1, #3
1792 ; CHECK-SD-NEXT: ldr h0, [x8]
1793 ; CHECK-SD-NEXT: add sp, sp, #16
1794 ; CHECK-SD-NEXT: ret
1796 ; CHECK-GI-LABEL: extract_v8f16_c:
1797 ; CHECK-GI: // %bb.0: // %entry
1798 ; CHECK-GI-NEXT: sub sp, sp, #16
1799 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
1800 ; CHECK-GI-NEXT: mov w9, w0
1801 ; CHECK-GI-NEXT: mov x8, sp
1802 ; CHECK-GI-NEXT: str q0, [sp]
1803 ; CHECK-GI-NEXT: and x9, x9, #0x7
1804 ; CHECK-GI-NEXT: ldr h0, [x8, x9, lsl #1]
1805 ; CHECK-GI-NEXT: add sp, sp, #16
1806 ; CHECK-GI-NEXT: ret
1808 %d = extractelement <8 x half> %a, i32 %c
1812 define half @extract_v16f16_0(<16 x half> %a, i32 %c) {
1813 ; CHECK-LABEL: extract_v16f16_0:
1814 ; CHECK: // %bb.0: // %entry
1815 ; CHECK-NEXT: // kill: def $h0 killed $h0 killed $q0
1818 %d = extractelement <16 x half> %a, i32 0
1822 define half @extract_v16f16_2(<16 x half> %a, i32 %c) {
1823 ; CHECK-LABEL: extract_v16f16_2:
1824 ; CHECK: // %bb.0: // %entry
1825 ; CHECK-NEXT: mov h0, v0.h[2]
1828 %d = extractelement <16 x half> %a, i32 2
1832 define half @extract_v16f16_c(<16 x half> %a, i32 %c) {
1833 ; CHECK-SD-LABEL: extract_v16f16_c:
1834 ; CHECK-SD: // %bb.0: // %entry
1835 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
1836 ; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
1837 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1838 ; CHECK-SD-NEXT: and x8, x0, #0xf
1839 ; CHECK-SD-NEXT: mov x9, sp
1840 ; CHECK-SD-NEXT: ldr h0, [x9, x8, lsl #1]
1841 ; CHECK-SD-NEXT: add sp, sp, #32
1842 ; CHECK-SD-NEXT: ret
1844 ; CHECK-GI-LABEL: extract_v16f16_c:
1845 ; CHECK-GI: // %bb.0: // %entry
1846 ; CHECK-GI-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
1847 ; CHECK-GI-NEXT: sub x9, sp, #48
1848 ; CHECK-GI-NEXT: mov x29, sp
1849 ; CHECK-GI-NEXT: and sp, x9, #0xffffffffffffffe0
1850 ; CHECK-GI-NEXT: .cfi_def_cfa w29, 16
1851 ; CHECK-GI-NEXT: .cfi_offset w30, -8
1852 ; CHECK-GI-NEXT: .cfi_offset w29, -16
1853 ; CHECK-GI-NEXT: mov w8, w0
1854 ; CHECK-GI-NEXT: stp q0, q1, [sp]
1855 ; CHECK-GI-NEXT: mov x9, sp
1856 ; CHECK-GI-NEXT: and x8, x8, #0xf
1857 ; CHECK-GI-NEXT: ldr h0, [x9, x8, lsl #1]
1858 ; CHECK-GI-NEXT: mov sp, x29
1859 ; CHECK-GI-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
1860 ; CHECK-GI-NEXT: ret
1862 %d = extractelement <16 x half> %a, i32 %c
1866 define i8 @extract_v8i8_0(<8 x i8> %a, i32 %c) {
1867 ; CHECK-LABEL: extract_v8i8_0:
1868 ; CHECK: // %bb.0: // %entry
1869 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
1870 ; CHECK-NEXT: umov w0, v0.b[0]
1873 %d = extractelement <8 x i8> %a, i32 0
1877 define i8 @extract_v8i8_2(<8 x i8> %a, i32 %c) {
1878 ; CHECK-LABEL: extract_v8i8_2:
1879 ; CHECK: // %bb.0: // %entry
1880 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
1881 ; CHECK-NEXT: umov w0, v0.b[2]
1884 %d = extractelement <8 x i8> %a, i32 2
1888 define i8 @extract_v8i8_c(<8 x i8> %a, i32 %c) {
1889 ; CHECK-SD-LABEL: extract_v8i8_c:
1890 ; CHECK-SD: // %bb.0: // %entry
1891 ; CHECK-SD-NEXT: sub sp, sp, #16
1892 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
1893 ; CHECK-SD-NEXT: add x8, sp, #8
1894 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
1895 ; CHECK-SD-NEXT: str d0, [sp, #8]
1896 ; CHECK-SD-NEXT: bfxil x8, x0, #0, #3
1897 ; CHECK-SD-NEXT: ldrb w0, [x8]
1898 ; CHECK-SD-NEXT: add sp, sp, #16
1899 ; CHECK-SD-NEXT: ret
1901 ; CHECK-GI-LABEL: extract_v8i8_c:
1902 ; CHECK-GI: // %bb.0: // %entry
1903 ; CHECK-GI-NEXT: sub sp, sp, #16
1904 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
1905 ; CHECK-GI-NEXT: mov w9, w0
1906 ; CHECK-GI-NEXT: add x8, sp, #8
1907 ; CHECK-GI-NEXT: str d0, [sp, #8]
1908 ; CHECK-GI-NEXT: and x9, x9, #0x7
1909 ; CHECK-GI-NEXT: lsl x10, x9, #1
1910 ; CHECK-GI-NEXT: sub x9, x10, x9
1911 ; CHECK-GI-NEXT: ldrb w0, [x8, x9]
1912 ; CHECK-GI-NEXT: add sp, sp, #16
1913 ; CHECK-GI-NEXT: ret
1915 %d = extractelement <8 x i8> %a, i32 %c
1919 define i8 @extract_v16i8_0(<16 x i8> %a, i32 %c) {
1920 ; CHECK-LABEL: extract_v16i8_0:
1921 ; CHECK: // %bb.0: // %entry
1922 ; CHECK-NEXT: umov w0, v0.b[0]
1925 %d = extractelement <16 x i8> %a, i32 0
1929 define i8 @extract_v16i8_2(<16 x i8> %a, i32 %c) {
1930 ; CHECK-LABEL: extract_v16i8_2:
1931 ; CHECK: // %bb.0: // %entry
1932 ; CHECK-NEXT: umov w0, v0.b[2]
1935 %d = extractelement <16 x i8> %a, i32 2
1939 define i8 @extract_v16i8_c(<16 x i8> %a, i32 %c) {
1940 ; CHECK-SD-LABEL: extract_v16i8_c:
1941 ; CHECK-SD: // %bb.0: // %entry
1942 ; CHECK-SD-NEXT: sub sp, sp, #16
1943 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
1944 ; CHECK-SD-NEXT: mov x8, sp
1945 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
1946 ; CHECK-SD-NEXT: str q0, [sp]
1947 ; CHECK-SD-NEXT: bfxil x8, x0, #0, #4
1948 ; CHECK-SD-NEXT: ldrb w0, [x8]
1949 ; CHECK-SD-NEXT: add sp, sp, #16
1950 ; CHECK-SD-NEXT: ret
1952 ; CHECK-GI-LABEL: extract_v16i8_c:
1953 ; CHECK-GI: // %bb.0: // %entry
1954 ; CHECK-GI-NEXT: sub sp, sp, #16
1955 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
1956 ; CHECK-GI-NEXT: mov w9, w0
1957 ; CHECK-GI-NEXT: mov x8, sp
1958 ; CHECK-GI-NEXT: str q0, [sp]
1959 ; CHECK-GI-NEXT: and x9, x9, #0xf
1960 ; CHECK-GI-NEXT: lsl x10, x9, #1
1961 ; CHECK-GI-NEXT: sub x9, x10, x9
1962 ; CHECK-GI-NEXT: ldrb w0, [x8, x9]
1963 ; CHECK-GI-NEXT: add sp, sp, #16
1964 ; CHECK-GI-NEXT: ret
1966 %d = extractelement <16 x i8> %a, i32 %c
1970 define i8 @extract_v32i8_0(<32 x i8> %a, i32 %c) {
1971 ; CHECK-LABEL: extract_v32i8_0:
1972 ; CHECK: // %bb.0: // %entry
1973 ; CHECK-NEXT: umov w0, v0.b[0]
1976 %d = extractelement <32 x i8> %a, i32 0
1980 define i8 @extract_v32i8_2(<32 x i8> %a, i32 %c) {
1981 ; CHECK-LABEL: extract_v32i8_2:
1982 ; CHECK: // %bb.0: // %entry
1983 ; CHECK-NEXT: umov w0, v0.b[2]
1986 %d = extractelement <32 x i8> %a, i32 2
1990 define i8 @extract_v32i8_c(<32 x i8> %a, i32 %c) {
1991 ; CHECK-SD-LABEL: extract_v32i8_c:
1992 ; CHECK-SD: // %bb.0: // %entry
1993 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
1994 ; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
1995 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1996 ; CHECK-SD-NEXT: and x8, x0, #0x1f
1997 ; CHECK-SD-NEXT: mov x9, sp
1998 ; CHECK-SD-NEXT: ldrb w0, [x9, x8]
1999 ; CHECK-SD-NEXT: add sp, sp, #32
2000 ; CHECK-SD-NEXT: ret
2002 ; CHECK-GI-LABEL: extract_v32i8_c:
2003 ; CHECK-GI: // %bb.0: // %entry
2004 ; CHECK-GI-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
2005 ; CHECK-GI-NEXT: sub x9, sp, #48
2006 ; CHECK-GI-NEXT: mov x29, sp
2007 ; CHECK-GI-NEXT: and sp, x9, #0xffffffffffffffe0
2008 ; CHECK-GI-NEXT: .cfi_def_cfa w29, 16
2009 ; CHECK-GI-NEXT: .cfi_offset w30, -8
2010 ; CHECK-GI-NEXT: .cfi_offset w29, -16
2011 ; CHECK-GI-NEXT: mov w8, w0
2012 ; CHECK-GI-NEXT: stp q0, q1, [sp]
2013 ; CHECK-GI-NEXT: mov x10, sp
2014 ; CHECK-GI-NEXT: and x8, x8, #0x1f
2015 ; CHECK-GI-NEXT: lsl x9, x8, #1
2016 ; CHECK-GI-NEXT: sub x8, x9, x8
2017 ; CHECK-GI-NEXT: ldrb w0, [x10, x8]
2018 ; CHECK-GI-NEXT: mov sp, x29
2019 ; CHECK-GI-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
2020 ; CHECK-GI-NEXT: ret
2022 %d = extractelement <32 x i8> %a, i32 %c
2026 define i16 @extract_v4i16_0(<4 x i16> %a, i32 %c) {
2027 ; CHECK-LABEL: extract_v4i16_0:
2028 ; CHECK: // %bb.0: // %entry
2029 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
2030 ; CHECK-NEXT: umov w0, v0.h[0]
2033 %d = extractelement <4 x i16> %a, i32 0
2037 define i16 @extract_v4i16_2(<4 x i16> %a, i32 %c) {
2038 ; CHECK-LABEL: extract_v4i16_2:
2039 ; CHECK: // %bb.0: // %entry
2040 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
2041 ; CHECK-NEXT: umov w0, v0.h[2]
2044 %d = extractelement <4 x i16> %a, i32 2
2048 define i16 @extract_v4i16_c(<4 x i16> %a, i32 %c) {
2049 ; CHECK-SD-LABEL: extract_v4i16_c:
2050 ; CHECK-SD: // %bb.0: // %entry
2051 ; CHECK-SD-NEXT: sub sp, sp, #16
2052 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
2053 ; CHECK-SD-NEXT: add x8, sp, #8
2054 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
2055 ; CHECK-SD-NEXT: str d0, [sp, #8]
2056 ; CHECK-SD-NEXT: bfi x8, x0, #1, #2
2057 ; CHECK-SD-NEXT: ldrh w0, [x8]
2058 ; CHECK-SD-NEXT: add sp, sp, #16
2059 ; CHECK-SD-NEXT: ret
2061 ; CHECK-GI-LABEL: extract_v4i16_c:
2062 ; CHECK-GI: // %bb.0: // %entry
2063 ; CHECK-GI-NEXT: sub sp, sp, #16
2064 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
2065 ; CHECK-GI-NEXT: mov w9, w0
2066 ; CHECK-GI-NEXT: add x8, sp, #8
2067 ; CHECK-GI-NEXT: str d0, [sp, #8]
2068 ; CHECK-GI-NEXT: and x9, x9, #0x3
2069 ; CHECK-GI-NEXT: ldrh w0, [x8, x9, lsl #1]
2070 ; CHECK-GI-NEXT: add sp, sp, #16
2071 ; CHECK-GI-NEXT: ret
2073 %d = extractelement <4 x i16> %a, i32 %c
2077 define i16 @extract_v8i16_0(<8 x i16> %a, i32 %c) {
2078 ; CHECK-LABEL: extract_v8i16_0:
2079 ; CHECK: // %bb.0: // %entry
2080 ; CHECK-NEXT: umov w0, v0.h[0]
2083 %d = extractelement <8 x i16> %a, i32 0
2087 define i16 @extract_v8i16_2(<8 x i16> %a, i32 %c) {
2088 ; CHECK-LABEL: extract_v8i16_2:
2089 ; CHECK: // %bb.0: // %entry
2090 ; CHECK-NEXT: umov w0, v0.h[2]
2093 %d = extractelement <8 x i16> %a, i32 2
2097 define i16 @extract_v8i16_c(<8 x i16> %a, i32 %c) {
2098 ; CHECK-SD-LABEL: extract_v8i16_c:
2099 ; CHECK-SD: // %bb.0: // %entry
2100 ; CHECK-SD-NEXT: sub sp, sp, #16
2101 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
2102 ; CHECK-SD-NEXT: mov x8, sp
2103 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
2104 ; CHECK-SD-NEXT: str q0, [sp]
2105 ; CHECK-SD-NEXT: bfi x8, x0, #1, #3
2106 ; CHECK-SD-NEXT: ldrh w0, [x8]
2107 ; CHECK-SD-NEXT: add sp, sp, #16
2108 ; CHECK-SD-NEXT: ret
2110 ; CHECK-GI-LABEL: extract_v8i16_c:
2111 ; CHECK-GI: // %bb.0: // %entry
2112 ; CHECK-GI-NEXT: sub sp, sp, #16
2113 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
2114 ; CHECK-GI-NEXT: mov w9, w0
2115 ; CHECK-GI-NEXT: mov x8, sp
2116 ; CHECK-GI-NEXT: str q0, [sp]
2117 ; CHECK-GI-NEXT: and x9, x9, #0x7
2118 ; CHECK-GI-NEXT: ldrh w0, [x8, x9, lsl #1]
2119 ; CHECK-GI-NEXT: add sp, sp, #16
2120 ; CHECK-GI-NEXT: ret
2122 %d = extractelement <8 x i16> %a, i32 %c
2126 define i16 @extract_v16i16_0(<16 x i16> %a, i32 %c) {
2127 ; CHECK-LABEL: extract_v16i16_0:
2128 ; CHECK: // %bb.0: // %entry
2129 ; CHECK-NEXT: umov w0, v0.h[0]
2132 %d = extractelement <16 x i16> %a, i32 0
2136 define i16 @extract_v16i16_2(<16 x i16> %a, i32 %c) {
2137 ; CHECK-LABEL: extract_v16i16_2:
2138 ; CHECK: // %bb.0: // %entry
2139 ; CHECK-NEXT: umov w0, v0.h[2]
2142 %d = extractelement <16 x i16> %a, i32 2
2146 define i16 @extract_v16i16_c(<16 x i16> %a, i32 %c) {
2147 ; CHECK-SD-LABEL: extract_v16i16_c:
2148 ; CHECK-SD: // %bb.0: // %entry
2149 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
2150 ; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
2151 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
2152 ; CHECK-SD-NEXT: and x8, x0, #0xf
2153 ; CHECK-SD-NEXT: mov x9, sp
2154 ; CHECK-SD-NEXT: ldrh w0, [x9, x8, lsl #1]
2155 ; CHECK-SD-NEXT: add sp, sp, #32
2156 ; CHECK-SD-NEXT: ret
2158 ; CHECK-GI-LABEL: extract_v16i16_c:
2159 ; CHECK-GI: // %bb.0: // %entry
2160 ; CHECK-GI-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
2161 ; CHECK-GI-NEXT: sub x9, sp, #48
2162 ; CHECK-GI-NEXT: mov x29, sp
2163 ; CHECK-GI-NEXT: and sp, x9, #0xffffffffffffffe0
2164 ; CHECK-GI-NEXT: .cfi_def_cfa w29, 16
2165 ; CHECK-GI-NEXT: .cfi_offset w30, -8
2166 ; CHECK-GI-NEXT: .cfi_offset w29, -16
2167 ; CHECK-GI-NEXT: mov w8, w0
2168 ; CHECK-GI-NEXT: stp q0, q1, [sp]
2169 ; CHECK-GI-NEXT: mov x9, sp
2170 ; CHECK-GI-NEXT: and x8, x8, #0xf
2171 ; CHECK-GI-NEXT: ldrh w0, [x9, x8, lsl #1]
2172 ; CHECK-GI-NEXT: mov sp, x29
2173 ; CHECK-GI-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
2174 ; CHECK-GI-NEXT: ret
2176 %d = extractelement <16 x i16> %a, i32 %c
2180 define i32 @extract_v2i32_0(<2 x i32> %a, i32 %c) {
2181 ; CHECK-SD-LABEL: extract_v2i32_0:
2182 ; CHECK-SD: // %bb.0: // %entry
2183 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
2184 ; CHECK-SD-NEXT: fmov w0, s0
2185 ; CHECK-SD-NEXT: ret
2187 ; CHECK-GI-LABEL: extract_v2i32_0:
2188 ; CHECK-GI: // %bb.0: // %entry
2189 ; CHECK-GI-NEXT: fmov w0, s0
2190 ; CHECK-GI-NEXT: ret
2192 %d = extractelement <2 x i32> %a, i32 0
2196 define i32 @extract_v2i32_1(<2 x i32> %a, i32 %c) {
2197 ; CHECK-SD-LABEL: extract_v2i32_1:
2198 ; CHECK-SD: // %bb.0: // %entry
2199 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
2200 ; CHECK-SD-NEXT: mov w0, v0.s[1]
2201 ; CHECK-SD-NEXT: ret
2203 ; CHECK-GI-LABEL: extract_v2i32_1:
2204 ; CHECK-GI: // %bb.0: // %entry
2205 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
2206 ; CHECK-GI-NEXT: mov s0, v0.s[1]
2207 ; CHECK-GI-NEXT: fmov w0, s0
2208 ; CHECK-GI-NEXT: ret
2210 %d = extractelement <2 x i32> %a, i32 1
2214 define i32 @extract_v2i32_c(<2 x i32> %a, i32 %c) {
2215 ; CHECK-SD-LABEL: extract_v2i32_c:
2216 ; CHECK-SD: // %bb.0: // %entry
2217 ; CHECK-SD-NEXT: sub sp, sp, #16
2218 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
2219 ; CHECK-SD-NEXT: add x8, sp, #8
2220 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
2221 ; CHECK-SD-NEXT: str d0, [sp, #8]
2222 ; CHECK-SD-NEXT: bfi x8, x0, #2, #1
2223 ; CHECK-SD-NEXT: ldr w0, [x8]
2224 ; CHECK-SD-NEXT: add sp, sp, #16
2225 ; CHECK-SD-NEXT: ret
2227 ; CHECK-GI-LABEL: extract_v2i32_c:
2228 ; CHECK-GI: // %bb.0: // %entry
2229 ; CHECK-GI-NEXT: sub sp, sp, #16
2230 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
2231 ; CHECK-GI-NEXT: mov w9, w0
2232 ; CHECK-GI-NEXT: add x8, sp, #8
2233 ; CHECK-GI-NEXT: str d0, [sp, #8]
2234 ; CHECK-GI-NEXT: and x9, x9, #0x1
2235 ; CHECK-GI-NEXT: ldr w0, [x8, x9, lsl #2]
2236 ; CHECK-GI-NEXT: add sp, sp, #16
2237 ; CHECK-GI-NEXT: ret
2239 %d = extractelement <2 x i32> %a, i32 %c
2243 define i32 @extract_v3i32_0(<3 x i32> %a, i32 %c) {
2244 ; CHECK-LABEL: extract_v3i32_0:
2245 ; CHECK: // %bb.0: // %entry
2246 ; CHECK-NEXT: fmov w0, s0
2249 %d = extractelement <3 x i32> %a, i32 0
2253 define i32 @extract_v3i32_2(<3 x i32> %a, i32 %c) {
2254 ; CHECK-SD-LABEL: extract_v3i32_2:
2255 ; CHECK-SD: // %bb.0: // %entry
2256 ; CHECK-SD-NEXT: mov w0, v0.s[2]
2257 ; CHECK-SD-NEXT: ret
2259 ; CHECK-GI-LABEL: extract_v3i32_2:
2260 ; CHECK-GI: // %bb.0: // %entry
2261 ; CHECK-GI-NEXT: mov s0, v0.s[2]
2262 ; CHECK-GI-NEXT: fmov w0, s0
2263 ; CHECK-GI-NEXT: ret
2265 %d = extractelement <3 x i32> %a, i32 2
2269 define i32 @extract_v3i32_c(<3 x i32> %a, i32 %c) {
2270 ; CHECK-SD-LABEL: extract_v3i32_c:
2271 ; CHECK-SD: // %bb.0: // %entry
2272 ; CHECK-SD-NEXT: sub sp, sp, #16
2273 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
2274 ; CHECK-SD-NEXT: mov x8, sp
2275 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
2276 ; CHECK-SD-NEXT: str q0, [sp]
2277 ; CHECK-SD-NEXT: bfi x8, x0, #2, #2
2278 ; CHECK-SD-NEXT: ldr w0, [x8]
2279 ; CHECK-SD-NEXT: add sp, sp, #16
2280 ; CHECK-SD-NEXT: ret
2282 ; CHECK-GI-LABEL: extract_v3i32_c:
2283 ; CHECK-GI: // %bb.0: // %entry
2284 ; CHECK-GI-NEXT: sub sp, sp, #16
2285 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
2286 ; CHECK-GI-NEXT: mov w9, w0
2287 ; CHECK-GI-NEXT: mov x8, sp
2288 ; CHECK-GI-NEXT: str q0, [sp]
2289 ; CHECK-GI-NEXT: and x9, x9, #0x3
2290 ; CHECK-GI-NEXT: ldr w0, [x8, x9, lsl #2]
2291 ; CHECK-GI-NEXT: add sp, sp, #16
2292 ; CHECK-GI-NEXT: ret
2294 %d = extractelement <3 x i32> %a, i32 %c
2298 define i32 @extract_v4i32_0(<4 x i32> %a, i32 %c) {
2299 ; CHECK-LABEL: extract_v4i32_0:
2300 ; CHECK: // %bb.0: // %entry
2301 ; CHECK-NEXT: fmov w0, s0
2304 %d = extractelement <4 x i32> %a, i32 0
2308 define i32 @extract_v4i32_2(<4 x i32> %a, i32 %c) {
2309 ; CHECK-SD-LABEL: extract_v4i32_2:
2310 ; CHECK-SD: // %bb.0: // %entry
2311 ; CHECK-SD-NEXT: mov w0, v0.s[2]
2312 ; CHECK-SD-NEXT: ret
2314 ; CHECK-GI-LABEL: extract_v4i32_2:
2315 ; CHECK-GI: // %bb.0: // %entry
2316 ; CHECK-GI-NEXT: mov s0, v0.s[2]
2317 ; CHECK-GI-NEXT: fmov w0, s0
2318 ; CHECK-GI-NEXT: ret
2320 %d = extractelement <4 x i32> %a, i32 2
2324 define i32 @extract_v4i32_c(<4 x i32> %a, i32 %c) {
2325 ; CHECK-SD-LABEL: extract_v4i32_c:
2326 ; CHECK-SD: // %bb.0: // %entry
2327 ; CHECK-SD-NEXT: sub sp, sp, #16
2328 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
2329 ; CHECK-SD-NEXT: mov x8, sp
2330 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
2331 ; CHECK-SD-NEXT: str q0, [sp]
2332 ; CHECK-SD-NEXT: bfi x8, x0, #2, #2
2333 ; CHECK-SD-NEXT: ldr w0, [x8]
2334 ; CHECK-SD-NEXT: add sp, sp, #16
2335 ; CHECK-SD-NEXT: ret
2337 ; CHECK-GI-LABEL: extract_v4i32_c:
2338 ; CHECK-GI: // %bb.0: // %entry
2339 ; CHECK-GI-NEXT: sub sp, sp, #16
2340 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
2341 ; CHECK-GI-NEXT: mov w9, w0
2342 ; CHECK-GI-NEXT: mov x8, sp
2343 ; CHECK-GI-NEXT: str q0, [sp]
2344 ; CHECK-GI-NEXT: and x9, x9, #0x3
2345 ; CHECK-GI-NEXT: ldr w0, [x8, x9, lsl #2]
2346 ; CHECK-GI-NEXT: add sp, sp, #16
2347 ; CHECK-GI-NEXT: ret
2349 %d = extractelement <4 x i32> %a, i32 %c
2353 define i32 @extract_v8i32_0(<8 x i32> %a, i32 %c) {
2354 ; CHECK-LABEL: extract_v8i32_0:
2355 ; CHECK: // %bb.0: // %entry
2356 ; CHECK-NEXT: fmov w0, s0
2359 %d = extractelement <8 x i32> %a, i32 0
2363 define i32 @extract_v8i32_2(<8 x i32> %a, i32 %c) {
2364 ; CHECK-SD-LABEL: extract_v8i32_2:
2365 ; CHECK-SD: // %bb.0: // %entry
2366 ; CHECK-SD-NEXT: mov w0, v0.s[2]
2367 ; CHECK-SD-NEXT: ret
2369 ; CHECK-GI-LABEL: extract_v8i32_2:
2370 ; CHECK-GI: // %bb.0: // %entry
2371 ; CHECK-GI-NEXT: mov s0, v0.s[2]
2372 ; CHECK-GI-NEXT: fmov w0, s0
2373 ; CHECK-GI-NEXT: ret
2375 %d = extractelement <8 x i32> %a, i32 2
2379 define i32 @extract_v8i32_c(<8 x i32> %a, i32 %c) {
2380 ; CHECK-SD-LABEL: extract_v8i32_c:
2381 ; CHECK-SD: // %bb.0: // %entry
2382 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
2383 ; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
2384 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
2385 ; CHECK-SD-NEXT: and x8, x0, #0x7
2386 ; CHECK-SD-NEXT: mov x9, sp
2387 ; CHECK-SD-NEXT: ldr w0, [x9, x8, lsl #2]
2388 ; CHECK-SD-NEXT: add sp, sp, #32
2389 ; CHECK-SD-NEXT: ret
2391 ; CHECK-GI-LABEL: extract_v8i32_c:
2392 ; CHECK-GI: // %bb.0: // %entry
2393 ; CHECK-GI-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
2394 ; CHECK-GI-NEXT: sub x9, sp, #48
2395 ; CHECK-GI-NEXT: mov x29, sp
2396 ; CHECK-GI-NEXT: and sp, x9, #0xffffffffffffffe0
2397 ; CHECK-GI-NEXT: .cfi_def_cfa w29, 16
2398 ; CHECK-GI-NEXT: .cfi_offset w30, -8
2399 ; CHECK-GI-NEXT: .cfi_offset w29, -16
2400 ; CHECK-GI-NEXT: mov w8, w0
2401 ; CHECK-GI-NEXT: stp q0, q1, [sp]
2402 ; CHECK-GI-NEXT: mov x9, sp
2403 ; CHECK-GI-NEXT: and x8, x8, #0x7
2404 ; CHECK-GI-NEXT: ldr w0, [x9, x8, lsl #2]
2405 ; CHECK-GI-NEXT: mov sp, x29
2406 ; CHECK-GI-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
2407 ; CHECK-GI-NEXT: ret
2409 %d = extractelement <8 x i32> %a, i32 %c
2413 define i64 @extract_v2i64_0(<2 x i64> %a, i32 %c) {
2414 ; CHECK-LABEL: extract_v2i64_0:
2415 ; CHECK: // %bb.0: // %entry
2416 ; CHECK-NEXT: fmov x0, d0
2419 %d = extractelement <2 x i64> %a, i32 0
2423 define i64 @extract_v2i64_1(<2 x i64> %a, i32 %c) {
2424 ; CHECK-SD-LABEL: extract_v2i64_1:
2425 ; CHECK-SD: // %bb.0: // %entry
2426 ; CHECK-SD-NEXT: mov x0, v0.d[1]
2427 ; CHECK-SD-NEXT: ret
2429 ; CHECK-GI-LABEL: extract_v2i64_1:
2430 ; CHECK-GI: // %bb.0: // %entry
2431 ; CHECK-GI-NEXT: mov d0, v0.d[1]
2432 ; CHECK-GI-NEXT: fmov x0, d0
2433 ; CHECK-GI-NEXT: ret
2435 %d = extractelement <2 x i64> %a, i32 1
2439 define i64 @extract_v2i64_c(<2 x i64> %a, i32 %c) {
2440 ; CHECK-SD-LABEL: extract_v2i64_c:
2441 ; CHECK-SD: // %bb.0: // %entry
2442 ; CHECK-SD-NEXT: sub sp, sp, #16
2443 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 16
2444 ; CHECK-SD-NEXT: mov x8, sp
2445 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
2446 ; CHECK-SD-NEXT: str q0, [sp]
2447 ; CHECK-SD-NEXT: bfi x8, x0, #3, #1
2448 ; CHECK-SD-NEXT: ldr x0, [x8]
2449 ; CHECK-SD-NEXT: add sp, sp, #16
2450 ; CHECK-SD-NEXT: ret
2452 ; CHECK-GI-LABEL: extract_v2i64_c:
2453 ; CHECK-GI: // %bb.0: // %entry
2454 ; CHECK-GI-NEXT: sub sp, sp, #16
2455 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 16
2456 ; CHECK-GI-NEXT: mov w9, w0
2457 ; CHECK-GI-NEXT: mov x8, sp
2458 ; CHECK-GI-NEXT: str q0, [sp]
2459 ; CHECK-GI-NEXT: and x9, x9, #0x1
2460 ; CHECK-GI-NEXT: ldr x0, [x8, x9, lsl #3]
2461 ; CHECK-GI-NEXT: add sp, sp, #16
2462 ; CHECK-GI-NEXT: ret
2464 %d = extractelement <2 x i64> %a, i32 %c
2468 define i64 @extract_v3i64_0(<3 x i64> %a, i32 %c) {
2469 ; CHECK-SD-LABEL: extract_v3i64_0:
2470 ; CHECK-SD: // %bb.0: // %entry
2471 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
2472 ; CHECK-SD-NEXT: fmov x0, d0
2473 ; CHECK-SD-NEXT: ret
2475 ; CHECK-GI-LABEL: extract_v3i64_0:
2476 ; CHECK-GI: // %bb.0: // %entry
2477 ; CHECK-GI-NEXT: fmov x0, d0
2478 ; CHECK-GI-NEXT: ret
2480 %d = extractelement <3 x i64> %a, i32 0
2484 define i64 @extract_v3i64_2(<3 x i64> %a, i32 %c) {
2485 ; CHECK-SD-LABEL: extract_v3i64_2:
2486 ; CHECK-SD: // %bb.0: // %entry
2487 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 def $q2
2488 ; CHECK-SD-NEXT: fmov x0, d2
2489 ; CHECK-SD-NEXT: ret
2491 ; CHECK-GI-LABEL: extract_v3i64_2:
2492 ; CHECK-GI: // %bb.0: // %entry
2493 ; CHECK-GI-NEXT: fmov x0, d2
2494 ; CHECK-GI-NEXT: ret
2496 %d = extractelement <3 x i64> %a, i32 2
2500 define i64 @extract_v3i64_c(<3 x i64> %a, i32 %c) {
2501 ; CHECK-SD-LABEL: extract_v3i64_c:
2502 ; CHECK-SD: // %bb.0: // %entry
2503 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
2504 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 def $q1
2505 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
2506 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 def $q2
2507 ; CHECK-SD-NEXT: and x8, x0, #0x3
2508 ; CHECK-SD-NEXT: mov v0.d[1], v1.d[0]
2509 ; CHECK-SD-NEXT: stp q0, q2, [sp, #-32]!
2510 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
2511 ; CHECK-SD-NEXT: mov x9, sp
2512 ; CHECK-SD-NEXT: ldr x0, [x9, x8, lsl #3]
2513 ; CHECK-SD-NEXT: add sp, sp, #32
2514 ; CHECK-SD-NEXT: ret
2516 ; CHECK-GI-LABEL: extract_v3i64_c:
2517 ; CHECK-GI: // %bb.0: // %entry
2518 ; CHECK-GI-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
2519 ; CHECK-GI-NEXT: sub x9, sp, #48
2520 ; CHECK-GI-NEXT: mov x29, sp
2521 ; CHECK-GI-NEXT: and sp, x9, #0xffffffffffffffe0
2522 ; CHECK-GI-NEXT: .cfi_def_cfa w29, 16
2523 ; CHECK-GI-NEXT: .cfi_offset w30, -8
2524 ; CHECK-GI-NEXT: .cfi_offset w29, -16
2525 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
2526 ; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1
2527 ; CHECK-GI-NEXT: mov w8, w0
2528 ; CHECK-GI-NEXT: // kill: def $d2 killed $d2 def $q2
2529 ; CHECK-GI-NEXT: mov x9, sp
2530 ; CHECK-GI-NEXT: mov v0.d[1], v1.d[0]
2531 ; CHECK-GI-NEXT: and x8, x8, #0x3
2532 ; CHECK-GI-NEXT: stp q0, q2, [sp]
2533 ; CHECK-GI-NEXT: ldr x0, [x9, x8, lsl #3]
2534 ; CHECK-GI-NEXT: mov sp, x29
2535 ; CHECK-GI-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
2536 ; CHECK-GI-NEXT: ret
2538 %d = extractelement <3 x i64> %a, i32 %c
2542 define i64 @extract_v4i64_0(<4 x i64> %a, i32 %c) {
2543 ; CHECK-LABEL: extract_v4i64_0:
2544 ; CHECK: // %bb.0: // %entry
2545 ; CHECK-NEXT: fmov x0, d0
2548 %d = extractelement <4 x i64> %a, i32 0
2552 define i64 @extract_v4i64_2(<4 x i64> %a, i32 %c) {
2553 ; CHECK-LABEL: extract_v4i64_2:
2554 ; CHECK: // %bb.0: // %entry
2555 ; CHECK-NEXT: fmov x0, d1
2558 %d = extractelement <4 x i64> %a, i32 2
2562 define i64 @extract_v4i64_c(<4 x i64> %a, i32 %c) {
2563 ; CHECK-SD-LABEL: extract_v4i64_c:
2564 ; CHECK-SD: // %bb.0: // %entry
2565 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
2566 ; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
2567 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
2568 ; CHECK-SD-NEXT: and x8, x0, #0x3
2569 ; CHECK-SD-NEXT: mov x9, sp
2570 ; CHECK-SD-NEXT: ldr x0, [x9, x8, lsl #3]
2571 ; CHECK-SD-NEXT: add sp, sp, #32
2572 ; CHECK-SD-NEXT: ret
2574 ; CHECK-GI-LABEL: extract_v4i64_c:
2575 ; CHECK-GI: // %bb.0: // %entry
2576 ; CHECK-GI-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
2577 ; CHECK-GI-NEXT: sub x9, sp, #48
2578 ; CHECK-GI-NEXT: mov x29, sp
2579 ; CHECK-GI-NEXT: and sp, x9, #0xffffffffffffffe0
2580 ; CHECK-GI-NEXT: .cfi_def_cfa w29, 16
2581 ; CHECK-GI-NEXT: .cfi_offset w30, -8
2582 ; CHECK-GI-NEXT: .cfi_offset w29, -16
2583 ; CHECK-GI-NEXT: mov w8, w0
2584 ; CHECK-GI-NEXT: stp q0, q1, [sp]
2585 ; CHECK-GI-NEXT: mov x9, sp
2586 ; CHECK-GI-NEXT: and x8, x8, #0x3
2587 ; CHECK-GI-NEXT: ldr x0, [x9, x8, lsl #3]
2588 ; CHECK-GI-NEXT: mov sp, x29
2589 ; CHECK-GI-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
2590 ; CHECK-GI-NEXT: ret
2592 %d = extractelement <4 x i64> %a, i32 %c