1 ; RUN: llc -mtriple=aarch64-linux-gnu -stop-after=instruction-select < %s | FileCheck %s
3 declare void @llvm.aarch64.neon.st2.v4f32.p0(<4 x float>, <4 x float>, ptr)
4 declare void @llvm.aarch64.neon.st3.v4f32.p0(<4 x float>, <4 x float>, <4 x float>, ptr)
5 declare void @llvm.aarch64.neon.st4.v4f32.p0(<4 x float>, <4 x float>, <4 x float>, <4 x float>, ptr)
7 declare void @llvm.aarch64.neon.st1x2.v4f32.p0(<4 x float>, <4 x float>, ptr)
8 declare void @llvm.aarch64.neon.st1x3.v4f32.p0(<4 x float>, <4 x float>, <4 x float>, ptr)
9 declare void @llvm.aarch64.neon.st1x4.v4f32.p0(<4 x float>, <4 x float>, <4 x float>, <4 x float>, ptr)
11 declare void @llvm.aarch64.neon.st2lane.v4f32.p0(<4 x float>, <4 x float>, i64, ptr)
12 declare void @llvm.aarch64.neon.st3lane.v4f32.p0(<4 x float>, <4 x float>, <4 x float>, i64, ptr)
13 declare void @llvm.aarch64.neon.st4lane.v4f32.p0(<4 x float>, <4 x float>, <4 x float>, <4 x float>, i64, ptr)
15 define void @addstx(ptr %res, ptr %a, ptr %b, ptr %c, ptr %d) {
16 %al = load <4 x float>, ptr %a
17 %bl = load <4 x float>, ptr %b
18 %cl = load <4 x float>, ptr %c
19 %dl = load <4 x float>, ptr %d
21 %ar = fadd <4 x float> %al, %bl
22 %br = fadd <4 x float> %bl, %cl
23 %cr = fadd <4 x float> %cl, %dl
24 %dr = fadd <4 x float> %dl, %al
26 tail call void @llvm.aarch64.neon.st2.v4f32.p0(<4 x float> %ar, <4 x float> %br, ptr %res)
27 ; CHECK: ST2Twov4s {{.*}} :: (store (s256) {{.*}})
28 tail call void @llvm.aarch64.neon.st3.v4f32.p0(<4 x float> %ar, <4 x float> %br, <4 x float> %cr, ptr %res)
29 ; CHECK: ST3Threev4s {{.*}} :: (store (s384) {{.*}})
30 tail call void @llvm.aarch64.neon.st4.v4f32.p0(<4 x float> %ar, <4 x float> %br, <4 x float> %cr, <4 x float> %dr, ptr %res)
31 ; CHECK: ST4Fourv4s {{.*}} :: (store (s512) {{.*}})
36 define void @addst1x(ptr %res, ptr %a, ptr %b, ptr %c, ptr %d) {
37 %al = load <4 x float>, ptr %a
38 %bl = load <4 x float>, ptr %b
39 %cl = load <4 x float>, ptr %c
40 %dl = load <4 x float>, ptr %d
42 %ar = fadd <4 x float> %al, %bl
43 %br = fadd <4 x float> %bl, %cl
44 %cr = fadd <4 x float> %cl, %dl
45 %dr = fadd <4 x float> %dl, %al
47 tail call void @llvm.aarch64.neon.st1x2.v4f32.p0(<4 x float> %ar, <4 x float> %br, ptr %res)
48 ; CHECK: ST1Twov4s {{.*}} :: (store (s256) {{.*}})
49 tail call void @llvm.aarch64.neon.st1x3.v4f32.p0(<4 x float> %ar, <4 x float> %br, <4 x float> %cr, ptr %res)
50 ; CHECK: ST1Threev4s {{.*}} :: (store (s384) {{.*}})
51 tail call void @llvm.aarch64.neon.st1x4.v4f32.p0(<4 x float> %ar, <4 x float> %br, <4 x float> %cr, <4 x float> %dr, ptr %res)
52 ; CHECK: ST1Fourv4s {{.*}} :: (store (s512) {{.*}})
57 define void @addstxlane(ptr %res, ptr %a, ptr %b, ptr %c, ptr %d) {
58 %al = load <4 x float>, ptr %a
59 %bl = load <4 x float>, ptr %b
60 %cl = load <4 x float>, ptr %c
61 %dl = load <4 x float>, ptr %d
63 %ar = fadd <4 x float> %al, %bl
64 %br = fadd <4 x float> %bl, %cl
65 %cr = fadd <4 x float> %cl, %dl
66 %dr = fadd <4 x float> %dl, %al
68 tail call void @llvm.aarch64.neon.st2lane.v4f32.p0(<4 x float> %ar, <4 x float> %br, i64 1, ptr %res)
69 ; CHECK: ST2i32 {{.*}} :: (store (s64) {{.*}})
70 tail call void @llvm.aarch64.neon.st3lane.v4f32.p0(<4 x float> %ar, <4 x float> %br, <4 x float> %cr, i64 1, ptr %res)
71 ; CHECK: ST3i32 {{.*}} :: (store (s96) {{.*}})
72 tail call void @llvm.aarch64.neon.st4lane.v4f32.p0(<4 x float> %ar, <4 x float> %br, <4 x float> %cr, <4 x float> %dr, i64 1, ptr %res)
73 ; CHECK: ST4i32 {{.*}} :: (store (s128) {{.*}})