1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple aarch64-apple-darwin | FileCheck %s
4 define void @test_stnp_v4i64(ptr %p, <4 x i64> %v) #0 {
5 ; CHECK-LABEL: test_stnp_v4i64:
7 ; CHECK-NEXT: stnp q0, q1, [x0]
9 store <4 x i64> %v, ptr %p, align 1, !nontemporal !0
13 define void @test_stnp_v4i32(ptr %p, <4 x i32> %v) #0 {
14 ; CHECK-LABEL: test_stnp_v4i32:
16 ; CHECK-NEXT: mov d1, v0[1]
17 ; CHECK-NEXT: stnp d0, d1, [x0]
19 store <4 x i32> %v, ptr %p, align 1, !nontemporal !0
23 define void @test_stnp_v8i16(ptr %p, <8 x i16> %v) #0 {
24 ; CHECK-LABEL: test_stnp_v8i16:
26 ; CHECK-NEXT: mov d1, v0[1]
27 ; CHECK-NEXT: stnp d0, d1, [x0]
29 store <8 x i16> %v, ptr %p, align 1, !nontemporal !0
33 define void @test_stnp_v16i8(ptr %p, <16 x i8> %v) #0 {
34 ; CHECK-LABEL: test_stnp_v16i8:
36 ; CHECK-NEXT: mov d1, v0[1]
37 ; CHECK-NEXT: stnp d0, d1, [x0]
39 store <16 x i8> %v, ptr %p, align 1, !nontemporal !0
43 define void @test_stnp_v2i32(ptr %p, <2 x i32> %v) #0 {
44 ; CHECK-LABEL: test_stnp_v2i32:
46 ; CHECK-NEXT: ; kill: def $d0 killed $d0 def $q0
47 ; CHECK-NEXT: mov s1, v0[1]
48 ; CHECK-NEXT: stnp s0, s1, [x0]
50 store <2 x i32> %v, ptr %p, align 1, !nontemporal !0
54 define void @test_stnp_v4i16(ptr %p, <4 x i16> %v) #0 {
55 ; CHECK-LABEL: test_stnp_v4i16:
57 ; CHECK-NEXT: ; kill: def $d0 killed $d0 def $q0
58 ; CHECK-NEXT: mov s1, v0[1]
59 ; CHECK-NEXT: stnp s0, s1, [x0]
61 store <4 x i16> %v, ptr %p, align 1, !nontemporal !0
65 define void @test_stnp_v8i8(ptr %p, <8 x i8> %v) #0 {
66 ; CHECK-LABEL: test_stnp_v8i8:
68 ; CHECK-NEXT: ; kill: def $d0 killed $d0 def $q0
69 ; CHECK-NEXT: mov s1, v0[1]
70 ; CHECK-NEXT: stnp s0, s1, [x0]
72 store <8 x i8> %v, ptr %p, align 1, !nontemporal !0
76 define void @test_stnp_v2f64(ptr %p, <2 x double> %v) #0 {
77 ; CHECK-LABEL: test_stnp_v2f64:
79 ; CHECK-NEXT: mov d1, v0[1]
80 ; CHECK-NEXT: stnp d0, d1, [x0]
82 store <2 x double> %v, ptr %p, align 1, !nontemporal !0
86 define void @test_stnp_v4f32(ptr %p, <4 x float> %v) #0 {
87 ; CHECK-LABEL: test_stnp_v4f32:
89 ; CHECK-NEXT: mov d1, v0[1]
90 ; CHECK-NEXT: stnp d0, d1, [x0]
92 store <4 x float> %v, ptr %p, align 1, !nontemporal !0
96 define void @test_stnp_v2f32(ptr %p, <2 x float> %v) #0 {
97 ; CHECK-LABEL: test_stnp_v2f32:
99 ; CHECK-NEXT: ; kill: def $d0 killed $d0 def $q0
100 ; CHECK-NEXT: mov s1, v0[1]
101 ; CHECK-NEXT: stnp s0, s1, [x0]
103 store <2 x float> %v, ptr %p, align 1, !nontemporal !0
107 define void @test_stnp_v1f64(ptr %p, <1 x double> %v) #0 {
108 ; CHECK-LABEL: test_stnp_v1f64:
110 ; CHECK-NEXT: ; kill: def $d0 killed $d0 def $q0
111 ; CHECK-NEXT: mov s1, v0[1]
112 ; CHECK-NEXT: stnp s0, s1, [x0]
114 store <1 x double> %v, ptr %p, align 1, !nontemporal !0
118 define void @test_stnp_v1i64(ptr %p, <1 x i64> %v) #0 {
119 ; CHECK-LABEL: test_stnp_v1i64:
121 ; CHECK-NEXT: ; kill: def $d0 killed $d0 def $q0
122 ; CHECK-NEXT: mov s1, v0[1]
123 ; CHECK-NEXT: stnp s0, s1, [x0]
125 store <1 x i64> %v, ptr %p, align 1, !nontemporal !0
129 define void @test_stnp_i64(ptr %p, i64 %v) #0 {
130 ; CHECK-LABEL: test_stnp_i64:
132 ; CHECK-NEXT: lsr x8, x1, #32
133 ; CHECK-NEXT: stnp w1, w8, [x0]
135 store i64 %v, ptr %p, align 1, !nontemporal !0
140 define void @test_stnp_v2f64_offset(ptr %p, <2 x double> %v) #0 {
141 ; CHECK-LABEL: test_stnp_v2f64_offset:
143 ; CHECK-NEXT: mov d1, v0[1]
144 ; CHECK-NEXT: stnp d0, d1, [x0, #16]
146 %tmp0 = getelementptr <2 x double>, ptr %p, i32 1
147 store <2 x double> %v, ptr %tmp0, align 1, !nontemporal !0
151 define void @test_stnp_v2f64_offset_neg(ptr %p, <2 x double> %v) #0 {
152 ; CHECK-LABEL: test_stnp_v2f64_offset_neg:
154 ; CHECK-NEXT: mov d1, v0[1]
155 ; CHECK-NEXT: stnp d0, d1, [x0, #-16]
157 %tmp0 = getelementptr <2 x double>, ptr %p, i32 -1
158 store <2 x double> %v, ptr %tmp0, align 1, !nontemporal !0
162 define void @test_stnp_v2f32_offset(ptr %p, <2 x float> %v) #0 {
163 ; CHECK-LABEL: test_stnp_v2f32_offset:
165 ; CHECK-NEXT: ; kill: def $d0 killed $d0 def $q0
166 ; CHECK-NEXT: mov s1, v0[1]
167 ; CHECK-NEXT: stnp s0, s1, [x0, #8]
169 %tmp0 = getelementptr <2 x float>, ptr %p, i32 1
170 store <2 x float> %v, ptr %tmp0, align 1, !nontemporal !0
174 define void @test_stnp_v2f32_offset_neg(ptr %p, <2 x float> %v) #0 {
175 ; CHECK-LABEL: test_stnp_v2f32_offset_neg:
177 ; CHECK-NEXT: ; kill: def $d0 killed $d0 def $q0
178 ; CHECK-NEXT: mov s1, v0[1]
179 ; CHECK-NEXT: stnp s0, s1, [x0, #-8]
181 %tmp0 = getelementptr <2 x float>, ptr %p, i32 -1
182 store <2 x float> %v, ptr %tmp0, align 1, !nontemporal !0
186 define void @test_stnp_i64_offset(ptr %p, i64 %v) #0 {
187 ; CHECK-LABEL: test_stnp_i64_offset:
189 ; CHECK-NEXT: lsr x8, x1, #32
190 ; CHECK-NEXT: stnp w1, w8, [x0, #8]
192 %tmp0 = getelementptr i64, ptr %p, i32 1
193 store i64 %v, ptr %tmp0, align 1, !nontemporal !0
197 define void @test_stnp_i64_offset_neg(ptr %p, i64 %v) #0 {
198 ; CHECK-LABEL: test_stnp_i64_offset_neg:
200 ; CHECK-NEXT: lsr x8, x1, #32
201 ; CHECK-NEXT: stnp w1, w8, [x0, #-8]
203 %tmp0 = getelementptr i64, ptr %p, i32 -1
204 store i64 %v, ptr %tmp0, align 1, !nontemporal !0
208 define void @test_stnp_v4f32_invalid_offset_4(ptr %p, <4 x float> %v) #0 {
209 ; CHECK-LABEL: test_stnp_v4f32_invalid_offset_4:
211 ; CHECK-NEXT: mov d1, v0[1]
212 ; CHECK-NEXT: add x8, x0, #4
213 ; CHECK-NEXT: stnp d0, d1, [x8]
215 %tmp0 = getelementptr i8, ptr %p, i32 4
216 store <4 x float> %v, ptr %tmp0, align 1, !nontemporal !0
220 define void @test_stnp_v4f32_invalid_offset_neg_4(ptr %p, <4 x float> %v) #0 {
221 ; CHECK-LABEL: test_stnp_v4f32_invalid_offset_neg_4:
223 ; CHECK-NEXT: mov d1, v0[1]
224 ; CHECK-NEXT: sub x8, x0, #4
225 ; CHECK-NEXT: stnp d0, d1, [x8]
227 %tmp0 = getelementptr i8, ptr %p, i32 -4
228 store <4 x float> %v, ptr %tmp0, align 1, !nontemporal !0
232 define void @test_stnp_v4f32_invalid_offset_512(ptr %p, <4 x float> %v) #0 {
233 ; CHECK-LABEL: test_stnp_v4f32_invalid_offset_512:
235 ; CHECK-NEXT: mov d1, v0[1]
236 ; CHECK-NEXT: add x8, x0, #512
237 ; CHECK-NEXT: stnp d0, d1, [x8]
239 %tmp0 = getelementptr i8, ptr %p, i32 512
240 store <4 x float> %v, ptr %tmp0, align 1, !nontemporal !0
244 define void @test_stnp_v4f32_offset_504(ptr %p, <4 x float> %v) #0 {
245 ; CHECK-LABEL: test_stnp_v4f32_offset_504:
247 ; CHECK-NEXT: mov d1, v0[1]
248 ; CHECK-NEXT: stnp d0, d1, [x0, #504]
250 %tmp0 = getelementptr i8, ptr %p, i32 504
251 store <4 x float> %v, ptr %tmp0, align 1, !nontemporal !0
255 define void @test_stnp_v4f32_invalid_offset_508(ptr %p, <4 x float> %v) #0 {
256 ; CHECK-LABEL: test_stnp_v4f32_invalid_offset_508:
258 ; CHECK-NEXT: mov d1, v0[1]
259 ; CHECK-NEXT: add x8, x0, #508
260 ; CHECK-NEXT: stnp d0, d1, [x8]
262 %tmp0 = getelementptr i8, ptr %p, i32 508
263 store <4 x float> %v, ptr %tmp0, align 1, !nontemporal !0
267 define void @test_stnp_v4f32_invalid_offset_neg_520(ptr %p, <4 x float> %v) #0 {
268 ; CHECK-LABEL: test_stnp_v4f32_invalid_offset_neg_520:
270 ; CHECK-NEXT: mov d1, v0[1]
271 ; CHECK-NEXT: sub x8, x0, #520
272 ; CHECK-NEXT: stnp d0, d1, [x8]
274 %tmp0 = getelementptr i8, ptr %p, i32 -520
275 store <4 x float> %v, ptr %tmp0, align 1, !nontemporal !0
279 define void @test_stnp_v4f32_offset_neg_512(ptr %p, <4 x float> %v) #0 {
280 ; CHECK-LABEL: test_stnp_v4f32_offset_neg_512:
282 ; CHECK-NEXT: mov d1, v0[1]
283 ; CHECK-NEXT: stnp d0, d1, [x0, #-512]
285 %tmp0 = getelementptr i8, ptr %p, i32 -512
286 store <4 x float> %v, ptr %tmp0, align 1, !nontemporal !0
291 define void @test_stnp_v2f32_invalid_offset_256(ptr %p, <2 x float> %v) #0 {
292 ; CHECK-LABEL: test_stnp_v2f32_invalid_offset_256:
294 ; CHECK-NEXT: ; kill: def $d0 killed $d0 def $q0
295 ; CHECK-NEXT: mov s1, v0[1]
296 ; CHECK-NEXT: add x8, x0, #256
297 ; CHECK-NEXT: stnp s0, s1, [x8]
299 %tmp0 = getelementptr i8, ptr %p, i32 256
300 store <2 x float> %v, ptr %tmp0, align 1, !nontemporal !0
304 define void @test_stnp_v2f32_offset_252(ptr %p, <2 x float> %v) #0 {
305 ; CHECK-LABEL: test_stnp_v2f32_offset_252:
307 ; CHECK-NEXT: ; kill: def $d0 killed $d0 def $q0
308 ; CHECK-NEXT: mov s1, v0[1]
309 ; CHECK-NEXT: stnp s0, s1, [x0, #252]
311 %tmp0 = getelementptr i8, ptr %p, i32 252
312 store <2 x float> %v, ptr %tmp0, align 1, !nontemporal !0
316 define void @test_stnp_v2f32_invalid_offset_neg_260(ptr %p, <2 x float> %v) #0 {
317 ; CHECK-LABEL: test_stnp_v2f32_invalid_offset_neg_260:
319 ; CHECK-NEXT: ; kill: def $d0 killed $d0 def $q0
320 ; CHECK-NEXT: mov s1, v0[1]
321 ; CHECK-NEXT: sub x8, x0, #260
322 ; CHECK-NEXT: stnp s0, s1, [x8]
324 %tmp0 = getelementptr i8, ptr %p, i32 -260
325 store <2 x float> %v, ptr %tmp0, align 1, !nontemporal !0
329 define void @test_stnp_v2f32_offset_neg_256(ptr %p, <2 x float> %v) #0 {
330 ; CHECK-LABEL: test_stnp_v2f32_offset_neg_256:
332 ; CHECK-NEXT: ; kill: def $d0 killed $d0 def $q0
333 ; CHECK-NEXT: mov s1, v0[1]
334 ; CHECK-NEXT: stnp s0, s1, [x0, #-256]
336 %tmp0 = getelementptr i8, ptr %p, i32 -256
337 store <2 x float> %v, ptr %tmp0, align 1, !nontemporal !0
341 declare void @dummy(ptr)
343 define void @test_stnp_v4f32_offset_alloca(<4 x float> %v) #0 {
344 ; CHECK-LABEL: test_stnp_v4f32_offset_alloca:
346 ; CHECK-NEXT: sub sp, sp, #32
347 ; CHECK-NEXT: mov d1, v0[1]
348 ; CHECK-NEXT: mov x0, sp
349 ; CHECK-NEXT: stp x29, x30, [sp, #16] ; 16-byte Folded Spill
350 ; CHECK-NEXT: stnp d0, d1, [sp]
351 ; CHECK-NEXT: bl _dummy
352 ; CHECK-NEXT: ldp x29, x30, [sp, #16] ; 16-byte Folded Reload
353 ; CHECK-NEXT: add sp, sp, #32
355 %tmp0 = alloca <4 x float>
356 store <4 x float> %v, ptr %tmp0, align 1, !nontemporal !0
357 call void @dummy(ptr %tmp0)
361 define void @test_stnp_v4f32_offset_alloca_2(<4 x float> %v) #0 {
362 ; CHECK-LABEL: test_stnp_v4f32_offset_alloca_2:
364 ; CHECK-NEXT: sub sp, sp, #48
365 ; CHECK-NEXT: mov d1, v0[1]
366 ; CHECK-NEXT: mov x0, sp
367 ; CHECK-NEXT: stp x29, x30, [sp, #32] ; 16-byte Folded Spill
368 ; CHECK-NEXT: stnp d0, d1, [sp, #16]
369 ; CHECK-NEXT: bl _dummy
370 ; CHECK-NEXT: ldp x29, x30, [sp, #32] ; 16-byte Folded Reload
371 ; CHECK-NEXT: add sp, sp, #48
373 %tmp0 = alloca <4 x float>, i32 2
374 %tmp1 = getelementptr <4 x float>, ptr %tmp0, i32 1
375 store <4 x float> %v, ptr %tmp1, align 1, !nontemporal !0
376 call void @dummy(ptr %tmp0)
380 define void @test_stnp_v32i8(<32 x i8> %v, ptr %ptr) {
381 ; CHECK-LABEL: test_stnp_v32i8:
382 ; CHECK: ; %bb.0: ; %entry
383 ; CHECK-NEXT: stnp q0, q1, [x0]
387 store <32 x i8> %v, ptr %ptr, align 4, !nontemporal !0
391 define void @test_stnp_v32i16(<32 x i16> %v, ptr %ptr) {
392 ; CHECK-LABEL: test_stnp_v32i16:
393 ; CHECK: ; %bb.0: ; %entry
394 ; CHECK-NEXT: stnp q2, q3, [x0, #32]
395 ; CHECK-NEXT: stnp q0, q1, [x0]
399 store <32 x i16> %v, ptr %ptr, align 4, !nontemporal !0
403 define void @test_stnp_v32f16(<32 x half> %v, ptr %ptr) {
404 ; CHECK-LABEL: test_stnp_v32f16:
405 ; CHECK: ; %bb.0: ; %entry
406 ; CHECK-NEXT: stnp q2, q3, [x0, #32]
407 ; CHECK-NEXT: stnp q0, q1, [x0]
411 store <32 x half> %v, ptr %ptr, align 4, !nontemporal !0
415 define void @test_stnp_v16i32(<16 x i32> %v, ptr %ptr) {
416 ; CHECK-LABEL: test_stnp_v16i32:
417 ; CHECK: ; %bb.0: ; %entry
418 ; CHECK-NEXT: stnp q2, q3, [x0, #32]
419 ; CHECK-NEXT: stnp q0, q1, [x0]
423 store <16 x i32> %v, ptr %ptr, align 4, !nontemporal !0
427 define void @test_stnp_v16f32(<16 x float> %v, ptr %ptr) {
428 ; CHECK-LABEL: test_stnp_v16f32:
429 ; CHECK: ; %bb.0: ; %entry
430 ; CHECK-NEXT: stnp q2, q3, [x0, #32]
431 ; CHECK-NEXT: stnp q0, q1, [x0]
435 store <16 x float> %v, ptr %ptr, align 4, !nontemporal !0
439 define void @test_stnp_v17f32(<17 x float> %v, ptr %ptr) {
440 ; CHECK-LABEL: test_stnp_v17f32:
441 ; CHECK: ; %bb.0: ; %entry
442 ; CHECK-NEXT: ; kill: def $s4 killed $s4 def $q4
443 ; CHECK-NEXT: ; kill: def $s0 killed $s0 def $q0
444 ; CHECK-NEXT: ldr s16, [sp, #16]
445 ; CHECK-NEXT: ; kill: def $s5 killed $s5 def $q5
446 ; CHECK-NEXT: ; kill: def $s1 killed $s1 def $q1
447 ; CHECK-NEXT: add x8, sp, #20
448 ; CHECK-NEXT: ; kill: def $s6 killed $s6 def $q6
449 ; CHECK-NEXT: ; kill: def $s2 killed $s2 def $q2
450 ; CHECK-NEXT: ; kill: def $s7 killed $s7 def $q7
451 ; CHECK-NEXT: ; kill: def $s3 killed $s3 def $q3
452 ; CHECK-NEXT: mov.s v4[1], v5[0]
453 ; CHECK-NEXT: mov.s v0[1], v1[0]
454 ; CHECK-NEXT: ldr s5, [sp]
455 ; CHECK-NEXT: ld1.s { v16 }[1], [x8]
456 ; CHECK-NEXT: add x8, sp, #4
457 ; CHECK-NEXT: ld1.s { v5 }[1], [x8]
458 ; CHECK-NEXT: add x8, sp, #24
459 ; CHECK-NEXT: mov.s v4[2], v6[0]
460 ; CHECK-NEXT: ld1.s { v16 }[2], [x8]
461 ; CHECK-NEXT: mov.s v0[2], v2[0]
462 ; CHECK-NEXT: add x8, sp, #8
463 ; CHECK-NEXT: ld1.s { v5 }[2], [x8]
464 ; CHECK-NEXT: add x8, sp, #28
465 ; CHECK-NEXT: ld1.s { v16 }[3], [x8]
466 ; CHECK-NEXT: add x8, sp, #12
467 ; CHECK-NEXT: mov.s v4[3], v7[0]
468 ; CHECK-NEXT: mov.s v0[3], v3[0]
469 ; CHECK-NEXT: ld1.s { v5 }[3], [x8]
470 ; CHECK-NEXT: mov d1, v16[1]
471 ; CHECK-NEXT: mov d2, v5[1]
472 ; CHECK-NEXT: mov d3, v4[1]
473 ; CHECK-NEXT: mov d6, v0[1]
474 ; CHECK-NEXT: stnp d16, d1, [x0, #48]
475 ; CHECK-NEXT: ldr s1, [sp, #32]
476 ; CHECK-NEXT: stnp d5, d2, [x0, #32]
477 ; CHECK-NEXT: stnp d4, d3, [x0, #16]
478 ; CHECK-NEXT: stnp d0, d6, [x0]
479 ; CHECK-NEXT: str s1, [x0, #64]
483 store <17 x float> %v, ptr %ptr, align 4, !nontemporal !0
486 define void @test_stnp_v16i32_invalid_offset(<16 x i32> %v, ptr %ptr) {
487 ; CHECK-LABEL: test_stnp_v16i32_invalid_offset:
488 ; CHECK: ; %bb.0: ; %entry
489 ; CHECK-NEXT: mov w8, #32032 ; =0x7d20
490 ; CHECK-NEXT: mov w9, #32000 ; =0x7d00
491 ; CHECK-NEXT: add x8, x0, x8
492 ; CHECK-NEXT: add x9, x0, x9
493 ; CHECK-NEXT: stnp q2, q3, [x8]
494 ; CHECK-NEXT: stnp q0, q1, [x9]
498 %gep = getelementptr <16 x i32>, ptr %ptr, i32 500
499 store <16 x i32> %v, ptr %gep, align 4, !nontemporal !0
503 define void @test_stnp_v16f64(<16 x double> %v, ptr %ptr) {
504 ; CHECK-LABEL: test_stnp_v16f64:
505 ; CHECK: ; %bb.0: ; %entry
506 ; CHECK-NEXT: stnp q6, q7, [x0, #96]
507 ; CHECK-NEXT: stnp q4, q5, [x0, #64]
508 ; CHECK-NEXT: stnp q2, q3, [x0, #32]
509 ; CHECK-NEXT: stnp q0, q1, [x0]
513 store <16 x double> %v, ptr %ptr, align 4, !nontemporal !0
517 define void @test_stnp_v16i64(<16 x i64> %v, ptr %ptr) {
518 ; CHECK-LABEL: test_stnp_v16i64:
519 ; CHECK: ; %bb.0: ; %entry
520 ; CHECK-NEXT: stnp q6, q7, [x0, #96]
521 ; CHECK-NEXT: stnp q4, q5, [x0, #64]
522 ; CHECK-NEXT: stnp q2, q3, [x0, #32]
523 ; CHECK-NEXT: stnp q0, q1, [x0]
527 store <16 x i64> %v, ptr %ptr, align 4, !nontemporal !0
533 attributes #0 = { nounwind }