1 ; RUN: llc -mtriple=aarch64-linux-gnu -stop-after=instruction-select < %s | FileCheck %s
3 declare void @llvm.aarch64.neon.st2.v4f32.p0f32(<4 x float>, <4 x float>, float*)
4 declare void @llvm.aarch64.neon.st3.v4f32.p0f32(<4 x float>, <4 x float>, <4 x float>, float*)
5 declare void @llvm.aarch64.neon.st4.v4f32.p0f32(<4 x float>, <4 x float>, <4 x float>, <4 x float>, float*)
7 declare void @llvm.aarch64.neon.st1x2.v4f32.p0f32(<4 x float>, <4 x float>, float*)
8 declare void @llvm.aarch64.neon.st1x3.v4f32.p0f32(<4 x float>, <4 x float>, <4 x float>, float*)
9 declare void @llvm.aarch64.neon.st1x4.v4f32.p0f32(<4 x float>, <4 x float>, <4 x float>, <4 x float>, float*)
11 declare void @llvm.aarch64.neon.st2lane.v4f32.p0f32(<4 x float>, <4 x float>, i64, float*)
12 declare void @llvm.aarch64.neon.st3lane.v4f32.p0f32(<4 x float>, <4 x float>, <4 x float>, i64, float*)
13 declare void @llvm.aarch64.neon.st4lane.v4f32.p0f32(<4 x float>, <4 x float>, <4 x float>, <4 x float>, i64, float*)
15 define void @addstx(float* %res, <4 x float>* %a, <4 x float>* %b, <4 x float>* %c, <4 x float>* %d) {
16 %al = load <4 x float>, <4 x float>* %a
17 %bl = load <4 x float>, <4 x float>* %b
18 %cl = load <4 x float>, <4 x float>* %c
19 %dl = load <4 x float>, <4 x float>* %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 ; The sizes below are conservative. AArch64TargetLowering
27 ; conservatively assumes the entire vector is stored.
28 tail call void @llvm.aarch64.neon.st2.v4f32.p0f32(<4 x float> %ar, <4 x float> %br, float* %res)
29 ; CHECK: ST2Twov4s {{.*}} :: (store 32 {{.*}})
30 tail call void @llvm.aarch64.neon.st3.v4f32.p0f32(<4 x float> %ar, <4 x float> %br, <4 x float> %cr, float* %res)
31 ; CHECK: ST3Threev4s {{.*}} :: (store 48 {{.*}})
32 tail call void @llvm.aarch64.neon.st4.v4f32.p0f32(<4 x float> %ar, <4 x float> %br, <4 x float> %cr, <4 x float> %dr, float* %res)
33 ; CHECK: ST4Fourv4s {{.*}} :: (store 64 {{.*}})
38 define void @addst1x(float* %res, <4 x float>* %a, <4 x float>* %b, <4 x float>* %c, <4 x float>* %d) {
39 %al = load <4 x float>, <4 x float>* %a
40 %bl = load <4 x float>, <4 x float>* %b
41 %cl = load <4 x float>, <4 x float>* %c
42 %dl = load <4 x float>, <4 x float>* %d
44 %ar = fadd <4 x float> %al, %bl
45 %br = fadd <4 x float> %bl, %cl
46 %cr = fadd <4 x float> %cl, %dl
47 %dr = fadd <4 x float> %dl, %al
49 ; The sizes below are conservative. AArch64TargetLowering
50 ; conservatively assumes the entire vector is stored.
51 tail call void @llvm.aarch64.neon.st1x2.v4f32.p0f32(<4 x float> %ar, <4 x float> %br, float* %res)
52 ; CHECK: ST1Twov4s {{.*}} :: (store 32 {{.*}})
53 tail call void @llvm.aarch64.neon.st1x3.v4f32.p0f32(<4 x float> %ar, <4 x float> %br, <4 x float> %cr, float* %res)
54 ; CHECK: ST1Threev4s {{.*}} :: (store 48 {{.*}})
55 tail call void @llvm.aarch64.neon.st1x4.v4f32.p0f32(<4 x float> %ar, <4 x float> %br, <4 x float> %cr, <4 x float> %dr, float* %res)
56 ; CHECK: ST1Fourv4s {{.*}} :: (store 64 {{.*}})
61 define void @addstxlane(float* %res, <4 x float>* %a, <4 x float>* %b, <4 x float>* %c, <4 x float>* %d) {
62 %al = load <4 x float>, <4 x float>* %a
63 %bl = load <4 x float>, <4 x float>* %b
64 %cl = load <4 x float>, <4 x float>* %c
65 %dl = load <4 x float>, <4 x float>* %d
67 %ar = fadd <4 x float> %al, %bl
68 %br = fadd <4 x float> %bl, %cl
69 %cr = fadd <4 x float> %cl, %dl
70 %dr = fadd <4 x float> %dl, %al
72 ; The sizes below are conservative. AArch64TargetLowering
73 ; conservatively assumes the entire vector is stored.
74 tail call void @llvm.aarch64.neon.st2lane.v4f32.p0f32(<4 x float> %ar, <4 x float> %br, i64 1, float* %res)
75 ; CHECK: ST2i32 {{.*}} :: (store 32 {{.*}})
76 tail call void @llvm.aarch64.neon.st3lane.v4f32.p0f32(<4 x float> %ar, <4 x float> %br, <4 x float> %cr, i64 1, float* %res)
77 ; CHECK: ST3i32 {{.*}} :: (store 48 {{.*}})
78 tail call void @llvm.aarch64.neon.st4lane.v4f32.p0f32(<4 x float> %ar, <4 x float> %br, <4 x float> %cr, <4 x float> %dr, i64 1, float* %res)
79 ; CHECK: ST4i32 {{.*}} :: (store 64 {{.*}})