1 ; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s
3 %struct.__builtin_neon_v8qi2 = type { <8 x i8>, <8 x i8> }
4 %struct.__builtin_neon_v4hi2 = type { <4 x i16>, <4 x i16> }
5 %struct.__builtin_neon_v2si2 = type { <2 x i32>, <2 x i32> }
6 %struct.__builtin_neon_v2sf2 = type { <2 x float>, <2 x float> }
8 define <8 x i8> @vld2lanei8(i8* %A, <8 x i8>* %B) nounwind {
11 %tmp1 = load <8 x i8>* %B
12 %tmp2 = call %struct.__builtin_neon_v8qi2 @llvm.arm.neon.vld2lane.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1)
13 %tmp3 = extractvalue %struct.__builtin_neon_v8qi2 %tmp2, 0
14 %tmp4 = extractvalue %struct.__builtin_neon_v8qi2 %tmp2, 1
15 %tmp5 = add <8 x i8> %tmp3, %tmp4
19 define <4 x i16> @vld2lanei16(i16* %A, <4 x i16>* %B) nounwind {
22 %tmp1 = load <4 x i16>* %B
23 %tmp2 = call %struct.__builtin_neon_v4hi2 @llvm.arm.neon.vld2lane.v4i16(i16* %A, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1)
24 %tmp3 = extractvalue %struct.__builtin_neon_v4hi2 %tmp2, 0
25 %tmp4 = extractvalue %struct.__builtin_neon_v4hi2 %tmp2, 1
26 %tmp5 = add <4 x i16> %tmp3, %tmp4
30 define <2 x i32> @vld2lanei32(i32* %A, <2 x i32>* %B) nounwind {
33 %tmp1 = load <2 x i32>* %B
34 %tmp2 = call %struct.__builtin_neon_v2si2 @llvm.arm.neon.vld2lane.v2i32(i32* %A, <2 x i32> %tmp1, <2 x i32> %tmp1, i32 1)
35 %tmp3 = extractvalue %struct.__builtin_neon_v2si2 %tmp2, 0
36 %tmp4 = extractvalue %struct.__builtin_neon_v2si2 %tmp2, 1
37 %tmp5 = add <2 x i32> %tmp3, %tmp4
41 define <2 x float> @vld2lanef(float* %A, <2 x float>* %B) nounwind {
44 %tmp1 = load <2 x float>* %B
45 %tmp2 = call %struct.__builtin_neon_v2sf2 @llvm.arm.neon.vld2lane.v2f32(float* %A, <2 x float> %tmp1, <2 x float> %tmp1, i32 1)
46 %tmp3 = extractvalue %struct.__builtin_neon_v2sf2 %tmp2, 0
47 %tmp4 = extractvalue %struct.__builtin_neon_v2sf2 %tmp2, 1
48 %tmp5 = add <2 x float> %tmp3, %tmp4
52 declare %struct.__builtin_neon_v8qi2 @llvm.arm.neon.vld2lane.v8i8(i8*, <8 x i8>, <8 x i8>, i32) nounwind readonly
53 declare %struct.__builtin_neon_v4hi2 @llvm.arm.neon.vld2lane.v4i16(i8*, <4 x i16>, <4 x i16>, i32) nounwind readonly
54 declare %struct.__builtin_neon_v2si2 @llvm.arm.neon.vld2lane.v2i32(i8*, <2 x i32>, <2 x i32>, i32) nounwind readonly
55 declare %struct.__builtin_neon_v2sf2 @llvm.arm.neon.vld2lane.v2f32(i8*, <2 x float>, <2 x float>, i32) nounwind readonly
57 %struct.__builtin_neon_v8qi3 = type { <8 x i8>, <8 x i8>, <8 x i8> }
58 %struct.__builtin_neon_v4hi3 = type { <4 x i16>, <4 x i16>, <4 x i16> }
59 %struct.__builtin_neon_v2si3 = type { <2 x i32>, <2 x i32>, <2 x i32> }
60 %struct.__builtin_neon_v2sf3 = type { <2 x float>, <2 x float>, <2 x float> }
62 define <8 x i8> @vld3lanei8(i8* %A, <8 x i8>* %B) nounwind {
65 %tmp1 = load <8 x i8>* %B
66 %tmp2 = call %struct.__builtin_neon_v8qi3 @llvm.arm.neon.vld3lane.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1)
67 %tmp3 = extractvalue %struct.__builtin_neon_v8qi3 %tmp2, 0
68 %tmp4 = extractvalue %struct.__builtin_neon_v8qi3 %tmp2, 1
69 %tmp5 = extractvalue %struct.__builtin_neon_v8qi3 %tmp2, 2
70 %tmp6 = add <8 x i8> %tmp3, %tmp4
71 %tmp7 = add <8 x i8> %tmp5, %tmp6
75 define <4 x i16> @vld3lanei16(i16* %A, <4 x i16>* %B) nounwind {
78 %tmp1 = load <4 x i16>* %B
79 %tmp2 = call %struct.__builtin_neon_v4hi3 @llvm.arm.neon.vld3lane.v4i16(i16* %A, <4 x i16> %tmp1, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1)
80 %tmp3 = extractvalue %struct.__builtin_neon_v4hi3 %tmp2, 0
81 %tmp4 = extractvalue %struct.__builtin_neon_v4hi3 %tmp2, 1
82 %tmp5 = extractvalue %struct.__builtin_neon_v4hi3 %tmp2, 2
83 %tmp6 = add <4 x i16> %tmp3, %tmp4
84 %tmp7 = add <4 x i16> %tmp5, %tmp6
88 define <2 x i32> @vld3lanei32(i32* %A, <2 x i32>* %B) nounwind {
91 %tmp1 = load <2 x i32>* %B
92 %tmp2 = call %struct.__builtin_neon_v2si3 @llvm.arm.neon.vld3lane.v2i32(i32* %A, <2 x i32> %tmp1, <2 x i32> %tmp1, <2 x i32> %tmp1, i32 1)
93 %tmp3 = extractvalue %struct.__builtin_neon_v2si3 %tmp2, 0
94 %tmp4 = extractvalue %struct.__builtin_neon_v2si3 %tmp2, 1
95 %tmp5 = extractvalue %struct.__builtin_neon_v2si3 %tmp2, 2
96 %tmp6 = add <2 x i32> %tmp3, %tmp4
97 %tmp7 = add <2 x i32> %tmp5, %tmp6
101 define <2 x float> @vld3lanef(float* %A, <2 x float>* %B) nounwind {
104 %tmp1 = load <2 x float>* %B
105 %tmp2 = call %struct.__builtin_neon_v2sf3 @llvm.arm.neon.vld3lane.v2f32(float* %A, <2 x float> %tmp1, <2 x float> %tmp1, <2 x float> %tmp1, i32 1)
106 %tmp3 = extractvalue %struct.__builtin_neon_v2sf3 %tmp2, 0
107 %tmp4 = extractvalue %struct.__builtin_neon_v2sf3 %tmp2, 1
108 %tmp5 = extractvalue %struct.__builtin_neon_v2sf3 %tmp2, 2
109 %tmp6 = add <2 x float> %tmp3, %tmp4
110 %tmp7 = add <2 x float> %tmp5, %tmp6
111 ret <2 x float> %tmp7
114 declare %struct.__builtin_neon_v8qi3 @llvm.arm.neon.vld3lane.v8i8(i8*, <8 x i8>, <8 x i8>, <8 x i8>, i32) nounwind readonly
115 declare %struct.__builtin_neon_v4hi3 @llvm.arm.neon.vld3lane.v4i16(i8*, <4 x i16>, <4 x i16>, <4 x i16>, i32) nounwind readonly
116 declare %struct.__builtin_neon_v2si3 @llvm.arm.neon.vld3lane.v2i32(i8*, <2 x i32>, <2 x i32>, <2 x i32>, i32) nounwind readonly
117 declare %struct.__builtin_neon_v2sf3 @llvm.arm.neon.vld3lane.v2f32(i8*, <2 x float>, <2 x float>, <2 x float>, i32) nounwind readonly
119 %struct.__builtin_neon_v8qi4 = type { <8 x i8>, <8 x i8>, <8 x i8>, <8 x i8> }
120 %struct.__builtin_neon_v4hi4 = type { <4 x i16>, <4 x i16>, <4 x i16>, <4 x i16> }
121 %struct.__builtin_neon_v2si4 = type { <2 x i32>, <2 x i32>, <2 x i32>, <2 x i32> }
122 %struct.__builtin_neon_v2sf4 = type { <2 x float>, <2 x float>, <2 x float>, <2 x float> }
124 define <8 x i8> @vld4lanei8(i8* %A, <8 x i8>* %B) nounwind {
127 %tmp1 = load <8 x i8>* %B
128 %tmp2 = call %struct.__builtin_neon_v8qi4 @llvm.arm.neon.vld4lane.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1)
129 %tmp3 = extractvalue %struct.__builtin_neon_v8qi4 %tmp2, 0
130 %tmp4 = extractvalue %struct.__builtin_neon_v8qi4 %tmp2, 1
131 %tmp5 = extractvalue %struct.__builtin_neon_v8qi4 %tmp2, 2
132 %tmp6 = extractvalue %struct.__builtin_neon_v8qi4 %tmp2, 3
133 %tmp7 = add <8 x i8> %tmp3, %tmp4
134 %tmp8 = add <8 x i8> %tmp5, %tmp6
135 %tmp9 = add <8 x i8> %tmp7, %tmp8
139 define <4 x i16> @vld4lanei16(i16* %A, <4 x i16>* %B) nounwind {
142 %tmp1 = load <4 x i16>* %B
143 %tmp2 = call %struct.__builtin_neon_v4hi4 @llvm.arm.neon.vld4lane.v4i16(i16* %A, <4 x i16> %tmp1, <4 x i16> %tmp1, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1)
144 %tmp3 = extractvalue %struct.__builtin_neon_v4hi4 %tmp2, 0
145 %tmp4 = extractvalue %struct.__builtin_neon_v4hi4 %tmp2, 1
146 %tmp5 = extractvalue %struct.__builtin_neon_v4hi4 %tmp2, 2
147 %tmp6 = extractvalue %struct.__builtin_neon_v4hi4 %tmp2, 3
148 %tmp7 = add <4 x i16> %tmp3, %tmp4
149 %tmp8 = add <4 x i16> %tmp5, %tmp6
150 %tmp9 = add <4 x i16> %tmp7, %tmp8
154 define <2 x i32> @vld4lanei32(i32* %A, <2 x i32>* %B) nounwind {
157 %tmp1 = load <2 x i32>* %B
158 %tmp2 = call %struct.__builtin_neon_v2si4 @llvm.arm.neon.vld4lane.v2i32(i32* %A, <2 x i32> %tmp1, <2 x i32> %tmp1, <2 x i32> %tmp1, <2 x i32> %tmp1, i32 1)
159 %tmp3 = extractvalue %struct.__builtin_neon_v2si4 %tmp2, 0
160 %tmp4 = extractvalue %struct.__builtin_neon_v2si4 %tmp2, 1
161 %tmp5 = extractvalue %struct.__builtin_neon_v2si4 %tmp2, 2
162 %tmp6 = extractvalue %struct.__builtin_neon_v2si4 %tmp2, 3
163 %tmp7 = add <2 x i32> %tmp3, %tmp4
164 %tmp8 = add <2 x i32> %tmp5, %tmp6
165 %tmp9 = add <2 x i32> %tmp7, %tmp8
169 define <2 x float> @vld4lanef(float* %A, <2 x float>* %B) nounwind {
172 %tmp1 = load <2 x float>* %B
173 %tmp2 = call %struct.__builtin_neon_v2sf4 @llvm.arm.neon.vld4lane.v2f32(float* %A, <2 x float> %tmp1, <2 x float> %tmp1, <2 x float> %tmp1, <2 x float> %tmp1, i32 1)
174 %tmp3 = extractvalue %struct.__builtin_neon_v2sf4 %tmp2, 0
175 %tmp4 = extractvalue %struct.__builtin_neon_v2sf4 %tmp2, 1
176 %tmp5 = extractvalue %struct.__builtin_neon_v2sf4 %tmp2, 2
177 %tmp6 = extractvalue %struct.__builtin_neon_v2sf4 %tmp2, 3
178 %tmp7 = add <2 x float> %tmp3, %tmp4
179 %tmp8 = add <2 x float> %tmp5, %tmp6
180 %tmp9 = add <2 x float> %tmp7, %tmp8
181 ret <2 x float> %tmp9
184 declare %struct.__builtin_neon_v8qi4 @llvm.arm.neon.vld4lane.v8i8(i8*, <8 x i8>, <8 x i8>, <8 x i8>, <8 x i8>, i32) nounwind readonly
185 declare %struct.__builtin_neon_v4hi4 @llvm.arm.neon.vld4lane.v4i16(i8*, <4 x i16>, <4 x i16>, <4 x i16>, <4 x i16>, i32) nounwind readonly
186 declare %struct.__builtin_neon_v2si4 @llvm.arm.neon.vld4lane.v2i32(i8*, <2 x i32>, <2 x i32>, <2 x i32>, <2 x i32>, i32) nounwind readonly
187 declare %struct.__builtin_neon_v2sf4 @llvm.arm.neon.vld4lane.v2f32(i8*, <2 x float>, <2 x float>, <2 x float>, <2 x float>, i32) nounwind readonly