blob: 3a7bafe4d658c0941c4ac964fce3591abffe2f54 [file] [log] [blame]
Dan Gohmanfce288f2009-09-09 00:09:15 +00001; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s
Bob Wilsonc0110052009-09-01 04:27:10 +00002
Bob Wilsonec1d81c2009-10-06 21:16:19 +00003%struct.__neon_int8x8x2_t = type { <8 x i8>, <8 x i8> }
4%struct.__neon_int16x4x2_t = type { <4 x i16>, <4 x i16> }
5%struct.__neon_int32x2x2_t = type { <2 x i32>, <2 x i32> }
6%struct.__neon_float32x2x2_t = type { <2 x float>, <2 x float> }
Bob Wilsonc0110052009-09-01 04:27:10 +00007
Bob Wilson30aea9d2009-10-08 18:56:10 +00008%struct.__neon_int16x8x2_t = type { <8 x i16>, <8 x i16> }
9%struct.__neon_int32x4x2_t = type { <4 x i32>, <4 x i32> }
10%struct.__neon_float32x4x2_t = type { <4 x float>, <4 x float> }
11
Bob Wilsonc0110052009-09-01 04:27:10 +000012define <8 x i8> @vld2lanei8(i8* %A, <8 x i8>* %B) nounwind {
13;CHECK: vld2lanei8:
Bob Wilson3454ed92010-10-19 00:16:32 +000014;Check the alignment value. Max for this instruction is 16 bits:
15;CHECK: vld2.8 {d16[1], d17[1]}, [r0, :16]
Bob Wilsonc0110052009-09-01 04:27:10 +000016 %tmp1 = load <8 x i8>* %B
Bob Wilson3454ed92010-10-19 00:16:32 +000017 %tmp2 = call %struct.__neon_int8x8x2_t @llvm.arm.neon.vld2lane.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1, i32 4)
Bob Wilsonec1d81c2009-10-06 21:16:19 +000018 %tmp3 = extractvalue %struct.__neon_int8x8x2_t %tmp2, 0
19 %tmp4 = extractvalue %struct.__neon_int8x8x2_t %tmp2, 1
Bob Wilsonc0110052009-09-01 04:27:10 +000020 %tmp5 = add <8 x i8> %tmp3, %tmp4
21 ret <8 x i8> %tmp5
22}
23
24define <4 x i16> @vld2lanei16(i16* %A, <4 x i16>* %B) nounwind {
25;CHECK: vld2lanei16:
Bob Wilson3454ed92010-10-19 00:16:32 +000026;Check the alignment value. Max for this instruction is 32 bits:
27;CHECK: vld2.16 {d16[1], d17[1]}, [r0, :32]
Bob Wilson02170c02010-04-20 00:17:16 +000028 %tmp0 = bitcast i16* %A to i8*
Bob Wilsonc0110052009-09-01 04:27:10 +000029 %tmp1 = load <4 x i16>* %B
Bob Wilson3454ed92010-10-19 00:16:32 +000030 %tmp2 = call %struct.__neon_int16x4x2_t @llvm.arm.neon.vld2lane.v4i16(i8* %tmp0, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1, i32 8)
Bob Wilsonec1d81c2009-10-06 21:16:19 +000031 %tmp3 = extractvalue %struct.__neon_int16x4x2_t %tmp2, 0
32 %tmp4 = extractvalue %struct.__neon_int16x4x2_t %tmp2, 1
Bob Wilsonc0110052009-09-01 04:27:10 +000033 %tmp5 = add <4 x i16> %tmp3, %tmp4
34 ret <4 x i16> %tmp5
35}
36
37define <2 x i32> @vld2lanei32(i32* %A, <2 x i32>* %B) nounwind {
38;CHECK: vld2lanei32:
39;CHECK: vld2.32
Bob Wilson02170c02010-04-20 00:17:16 +000040 %tmp0 = bitcast i32* %A to i8*
Bob Wilsonc0110052009-09-01 04:27:10 +000041 %tmp1 = load <2 x i32>* %B
Bob Wilson7a9ef442010-08-27 17:13:24 +000042 %tmp2 = call %struct.__neon_int32x2x2_t @llvm.arm.neon.vld2lane.v2i32(i8* %tmp0, <2 x i32> %tmp1, <2 x i32> %tmp1, i32 1, i32 1)
Bob Wilsonec1d81c2009-10-06 21:16:19 +000043 %tmp3 = extractvalue %struct.__neon_int32x2x2_t %tmp2, 0
44 %tmp4 = extractvalue %struct.__neon_int32x2x2_t %tmp2, 1
Bob Wilsonc0110052009-09-01 04:27:10 +000045 %tmp5 = add <2 x i32> %tmp3, %tmp4
46 ret <2 x i32> %tmp5
47}
48
49define <2 x float> @vld2lanef(float* %A, <2 x float>* %B) nounwind {
50;CHECK: vld2lanef:
51;CHECK: vld2.32
Bob Wilson02170c02010-04-20 00:17:16 +000052 %tmp0 = bitcast float* %A to i8*
Bob Wilsonc0110052009-09-01 04:27:10 +000053 %tmp1 = load <2 x float>* %B
Bob Wilson7a9ef442010-08-27 17:13:24 +000054 %tmp2 = call %struct.__neon_float32x2x2_t @llvm.arm.neon.vld2lane.v2f32(i8* %tmp0, <2 x float> %tmp1, <2 x float> %tmp1, i32 1, i32 1)
Bob Wilsonec1d81c2009-10-06 21:16:19 +000055 %tmp3 = extractvalue %struct.__neon_float32x2x2_t %tmp2, 0
56 %tmp4 = extractvalue %struct.__neon_float32x2x2_t %tmp2, 1
Dan Gohmand4d01152010-05-03 22:36:46 +000057 %tmp5 = fadd <2 x float> %tmp3, %tmp4
Bob Wilsonc0110052009-09-01 04:27:10 +000058 ret <2 x float> %tmp5
59}
60
Bob Wilson30aea9d2009-10-08 18:56:10 +000061define <8 x i16> @vld2laneQi16(i16* %A, <8 x i16>* %B) nounwind {
62;CHECK: vld2laneQi16:
Bob Wilson3454ed92010-10-19 00:16:32 +000063;Check the (default) alignment.
64;CHECK: vld2.16 {d17[1], d19[1]}, [r0]
Bob Wilson02170c02010-04-20 00:17:16 +000065 %tmp0 = bitcast i16* %A to i8*
Bob Wilson30aea9d2009-10-08 18:56:10 +000066 %tmp1 = load <8 x i16>* %B
Bob Wilson3454ed92010-10-19 00:16:32 +000067 %tmp2 = call %struct.__neon_int16x8x2_t @llvm.arm.neon.vld2lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 5, i32 1)
Bob Wilson30aea9d2009-10-08 18:56:10 +000068 %tmp3 = extractvalue %struct.__neon_int16x8x2_t %tmp2, 0
69 %tmp4 = extractvalue %struct.__neon_int16x8x2_t %tmp2, 1
70 %tmp5 = add <8 x i16> %tmp3, %tmp4
71 ret <8 x i16> %tmp5
72}
73
74define <4 x i32> @vld2laneQi32(i32* %A, <4 x i32>* %B) nounwind {
75;CHECK: vld2laneQi32:
Bob Wilson3454ed92010-10-19 00:16:32 +000076;Check the alignment value. Max for this instruction is 64 bits:
77;CHECK: vld2.32 {d17[0], d19[0]}, [r0, :64]
Bob Wilson02170c02010-04-20 00:17:16 +000078 %tmp0 = bitcast i32* %A to i8*
Bob Wilson30aea9d2009-10-08 18:56:10 +000079 %tmp1 = load <4 x i32>* %B
Bob Wilson3454ed92010-10-19 00:16:32 +000080 %tmp2 = call %struct.__neon_int32x4x2_t @llvm.arm.neon.vld2lane.v4i32(i8* %tmp0, <4 x i32> %tmp1, <4 x i32> %tmp1, i32 2, i32 16)
Bob Wilson30aea9d2009-10-08 18:56:10 +000081 %tmp3 = extractvalue %struct.__neon_int32x4x2_t %tmp2, 0
82 %tmp4 = extractvalue %struct.__neon_int32x4x2_t %tmp2, 1
83 %tmp5 = add <4 x i32> %tmp3, %tmp4
84 ret <4 x i32> %tmp5
85}
86
87define <4 x float> @vld2laneQf(float* %A, <4 x float>* %B) nounwind {
88;CHECK: vld2laneQf:
89;CHECK: vld2.32
Bob Wilson02170c02010-04-20 00:17:16 +000090 %tmp0 = bitcast float* %A to i8*
Bob Wilson30aea9d2009-10-08 18:56:10 +000091 %tmp1 = load <4 x float>* %B
Bob Wilson7a9ef442010-08-27 17:13:24 +000092 %tmp2 = call %struct.__neon_float32x4x2_t @llvm.arm.neon.vld2lane.v4f32(i8* %tmp0, <4 x float> %tmp1, <4 x float> %tmp1, i32 1, i32 1)
Bob Wilson30aea9d2009-10-08 18:56:10 +000093 %tmp3 = extractvalue %struct.__neon_float32x4x2_t %tmp2, 0
94 %tmp4 = extractvalue %struct.__neon_float32x4x2_t %tmp2, 1
Dan Gohmand4d01152010-05-03 22:36:46 +000095 %tmp5 = fadd <4 x float> %tmp3, %tmp4
Bob Wilson30aea9d2009-10-08 18:56:10 +000096 ret <4 x float> %tmp5
97}
98
Bob Wilson7a9ef442010-08-27 17:13:24 +000099declare %struct.__neon_int8x8x2_t @llvm.arm.neon.vld2lane.v8i8(i8*, <8 x i8>, <8 x i8>, i32, i32) nounwind readonly
100declare %struct.__neon_int16x4x2_t @llvm.arm.neon.vld2lane.v4i16(i8*, <4 x i16>, <4 x i16>, i32, i32) nounwind readonly
101declare %struct.__neon_int32x2x2_t @llvm.arm.neon.vld2lane.v2i32(i8*, <2 x i32>, <2 x i32>, i32, i32) nounwind readonly
102declare %struct.__neon_float32x2x2_t @llvm.arm.neon.vld2lane.v2f32(i8*, <2 x float>, <2 x float>, i32, i32) nounwind readonly
Bob Wilsonc0110052009-09-01 04:27:10 +0000103
Bob Wilson7a9ef442010-08-27 17:13:24 +0000104declare %struct.__neon_int16x8x2_t @llvm.arm.neon.vld2lane.v8i16(i8*, <8 x i16>, <8 x i16>, i32, i32) nounwind readonly
105declare %struct.__neon_int32x4x2_t @llvm.arm.neon.vld2lane.v4i32(i8*, <4 x i32>, <4 x i32>, i32, i32) nounwind readonly
106declare %struct.__neon_float32x4x2_t @llvm.arm.neon.vld2lane.v4f32(i8*, <4 x float>, <4 x float>, i32, i32) nounwind readonly
Bob Wilson30aea9d2009-10-08 18:56:10 +0000107
Bob Wilsonec1d81c2009-10-06 21:16:19 +0000108%struct.__neon_int8x8x3_t = type { <8 x i8>, <8 x i8>, <8 x i8> }
109%struct.__neon_int16x4x3_t = type { <4 x i16>, <4 x i16>, <4 x i16> }
110%struct.__neon_int32x2x3_t = type { <2 x i32>, <2 x i32>, <2 x i32> }
111%struct.__neon_float32x2x3_t = type { <2 x float>, <2 x float>, <2 x float> }
Bob Wilsonc0110052009-09-01 04:27:10 +0000112
Bob Wilson0bf7d992009-10-08 22:27:33 +0000113%struct.__neon_int16x8x3_t = type { <8 x i16>, <8 x i16>, <8 x i16> }
114%struct.__neon_int32x4x3_t = type { <4 x i32>, <4 x i32>, <4 x i32> }
115%struct.__neon_float32x4x3_t = type { <4 x float>, <4 x float>, <4 x float> }
116
Bob Wilsonc0110052009-09-01 04:27:10 +0000117define <8 x i8> @vld3lanei8(i8* %A, <8 x i8>* %B) nounwind {
118;CHECK: vld3lanei8:
119;CHECK: vld3.8
120 %tmp1 = load <8 x i8>* %B
Bob Wilson7a9ef442010-08-27 17:13:24 +0000121 %tmp2 = call %struct.__neon_int8x8x3_t @llvm.arm.neon.vld3lane.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1, i32 1)
Bob Wilsonec1d81c2009-10-06 21:16:19 +0000122 %tmp3 = extractvalue %struct.__neon_int8x8x3_t %tmp2, 0
123 %tmp4 = extractvalue %struct.__neon_int8x8x3_t %tmp2, 1
124 %tmp5 = extractvalue %struct.__neon_int8x8x3_t %tmp2, 2
Bob Wilsonc0110052009-09-01 04:27:10 +0000125 %tmp6 = add <8 x i8> %tmp3, %tmp4
126 %tmp7 = add <8 x i8> %tmp5, %tmp6
127 ret <8 x i8> %tmp7
128}
129
130define <4 x i16> @vld3lanei16(i16* %A, <4 x i16>* %B) nounwind {
131;CHECK: vld3lanei16:
Bob Wilson3454ed92010-10-19 00:16:32 +0000132;Check the (default) alignment value. VLD3 does not support alignment.
133;CHECK: vld3.16 {d16[1], d17[1], d18[1]}, [r0]
Bob Wilson02170c02010-04-20 00:17:16 +0000134 %tmp0 = bitcast i16* %A to i8*
Bob Wilsonc0110052009-09-01 04:27:10 +0000135 %tmp1 = load <4 x i16>* %B
Bob Wilson3454ed92010-10-19 00:16:32 +0000136 %tmp2 = call %struct.__neon_int16x4x3_t @llvm.arm.neon.vld3lane.v4i16(i8* %tmp0, <4 x i16> %tmp1, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1, i32 8)
Bob Wilsonec1d81c2009-10-06 21:16:19 +0000137 %tmp3 = extractvalue %struct.__neon_int16x4x3_t %tmp2, 0
138 %tmp4 = extractvalue %struct.__neon_int16x4x3_t %tmp2, 1
139 %tmp5 = extractvalue %struct.__neon_int16x4x3_t %tmp2, 2
Bob Wilsonc0110052009-09-01 04:27:10 +0000140 %tmp6 = add <4 x i16> %tmp3, %tmp4
141 %tmp7 = add <4 x i16> %tmp5, %tmp6
142 ret <4 x i16> %tmp7
143}
144
145define <2 x i32> @vld3lanei32(i32* %A, <2 x i32>* %B) nounwind {
146;CHECK: vld3lanei32:
147;CHECK: vld3.32
Bob Wilson02170c02010-04-20 00:17:16 +0000148 %tmp0 = bitcast i32* %A to i8*
Bob Wilsonc0110052009-09-01 04:27:10 +0000149 %tmp1 = load <2 x i32>* %B
Bob Wilson7a9ef442010-08-27 17:13:24 +0000150 %tmp2 = call %struct.__neon_int32x2x3_t @llvm.arm.neon.vld3lane.v2i32(i8* %tmp0, <2 x i32> %tmp1, <2 x i32> %tmp1, <2 x i32> %tmp1, i32 1, i32 1)
Bob Wilsonec1d81c2009-10-06 21:16:19 +0000151 %tmp3 = extractvalue %struct.__neon_int32x2x3_t %tmp2, 0
152 %tmp4 = extractvalue %struct.__neon_int32x2x3_t %tmp2, 1
153 %tmp5 = extractvalue %struct.__neon_int32x2x3_t %tmp2, 2
Bob Wilsonc0110052009-09-01 04:27:10 +0000154 %tmp6 = add <2 x i32> %tmp3, %tmp4
155 %tmp7 = add <2 x i32> %tmp5, %tmp6
156 ret <2 x i32> %tmp7
157}
158
159define <2 x float> @vld3lanef(float* %A, <2 x float>* %B) nounwind {
160;CHECK: vld3lanef:
161;CHECK: vld3.32
Bob Wilson02170c02010-04-20 00:17:16 +0000162 %tmp0 = bitcast float* %A to i8*
Bob Wilsonc0110052009-09-01 04:27:10 +0000163 %tmp1 = load <2 x float>* %B
Bob Wilson7a9ef442010-08-27 17:13:24 +0000164 %tmp2 = call %struct.__neon_float32x2x3_t @llvm.arm.neon.vld3lane.v2f32(i8* %tmp0, <2 x float> %tmp1, <2 x float> %tmp1, <2 x float> %tmp1, i32 1, i32 1)
Bob Wilsonec1d81c2009-10-06 21:16:19 +0000165 %tmp3 = extractvalue %struct.__neon_float32x2x3_t %tmp2, 0
166 %tmp4 = extractvalue %struct.__neon_float32x2x3_t %tmp2, 1
167 %tmp5 = extractvalue %struct.__neon_float32x2x3_t %tmp2, 2
Dan Gohmand4d01152010-05-03 22:36:46 +0000168 %tmp6 = fadd <2 x float> %tmp3, %tmp4
169 %tmp7 = fadd <2 x float> %tmp5, %tmp6
Bob Wilsonc0110052009-09-01 04:27:10 +0000170 ret <2 x float> %tmp7
171}
172
Bob Wilson0bf7d992009-10-08 22:27:33 +0000173define <8 x i16> @vld3laneQi16(i16* %A, <8 x i16>* %B) nounwind {
174;CHECK: vld3laneQi16:
Bob Wilson3454ed92010-10-19 00:16:32 +0000175;Check the (default) alignment value. VLD3 does not support alignment.
176;CHECK: vld3.16 {d16[1], d18[1], d20[1]}, [r0]
Bob Wilson02170c02010-04-20 00:17:16 +0000177 %tmp0 = bitcast i16* %A to i8*
Bob Wilson0bf7d992009-10-08 22:27:33 +0000178 %tmp1 = load <8 x i16>* %B
Bob Wilson3454ed92010-10-19 00:16:32 +0000179 %tmp2 = call %struct.__neon_int16x8x3_t @llvm.arm.neon.vld3lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 1, i32 8)
Bob Wilson0bf7d992009-10-08 22:27:33 +0000180 %tmp3 = extractvalue %struct.__neon_int16x8x3_t %tmp2, 0
181 %tmp4 = extractvalue %struct.__neon_int16x8x3_t %tmp2, 1
182 %tmp5 = extractvalue %struct.__neon_int16x8x3_t %tmp2, 2
183 %tmp6 = add <8 x i16> %tmp3, %tmp4
184 %tmp7 = add <8 x i16> %tmp5, %tmp6
185 ret <8 x i16> %tmp7
186}
187
188define <4 x i32> @vld3laneQi32(i32* %A, <4 x i32>* %B) nounwind {
189;CHECK: vld3laneQi32:
190;CHECK: vld3.32
Bob Wilson02170c02010-04-20 00:17:16 +0000191 %tmp0 = bitcast i32* %A to i8*
Bob Wilson0bf7d992009-10-08 22:27:33 +0000192 %tmp1 = load <4 x i32>* %B
Bob Wilson7a9ef442010-08-27 17:13:24 +0000193 %tmp2 = call %struct.__neon_int32x4x3_t @llvm.arm.neon.vld3lane.v4i32(i8* %tmp0, <4 x i32> %tmp1, <4 x i32> %tmp1, <4 x i32> %tmp1, i32 3, i32 1)
Bob Wilson0bf7d992009-10-08 22:27:33 +0000194 %tmp3 = extractvalue %struct.__neon_int32x4x3_t %tmp2, 0
195 %tmp4 = extractvalue %struct.__neon_int32x4x3_t %tmp2, 1
196 %tmp5 = extractvalue %struct.__neon_int32x4x3_t %tmp2, 2
197 %tmp6 = add <4 x i32> %tmp3, %tmp4
198 %tmp7 = add <4 x i32> %tmp5, %tmp6
199 ret <4 x i32> %tmp7
200}
201
202define <4 x float> @vld3laneQf(float* %A, <4 x float>* %B) nounwind {
203;CHECK: vld3laneQf:
204;CHECK: vld3.32
Bob Wilson02170c02010-04-20 00:17:16 +0000205 %tmp0 = bitcast float* %A to i8*
Bob Wilson0bf7d992009-10-08 22:27:33 +0000206 %tmp1 = load <4 x float>* %B
Bob Wilson7a9ef442010-08-27 17:13:24 +0000207 %tmp2 = call %struct.__neon_float32x4x3_t @llvm.arm.neon.vld3lane.v4f32(i8* %tmp0, <4 x float> %tmp1, <4 x float> %tmp1, <4 x float> %tmp1, i32 1, i32 1)
Bob Wilson0bf7d992009-10-08 22:27:33 +0000208 %tmp3 = extractvalue %struct.__neon_float32x4x3_t %tmp2, 0
209 %tmp4 = extractvalue %struct.__neon_float32x4x3_t %tmp2, 1
210 %tmp5 = extractvalue %struct.__neon_float32x4x3_t %tmp2, 2
Dan Gohmand4d01152010-05-03 22:36:46 +0000211 %tmp6 = fadd <4 x float> %tmp3, %tmp4
212 %tmp7 = fadd <4 x float> %tmp5, %tmp6
Bob Wilson0bf7d992009-10-08 22:27:33 +0000213 ret <4 x float> %tmp7
214}
215
Bob Wilson7a9ef442010-08-27 17:13:24 +0000216declare %struct.__neon_int8x8x3_t @llvm.arm.neon.vld3lane.v8i8(i8*, <8 x i8>, <8 x i8>, <8 x i8>, i32, i32) nounwind readonly
217declare %struct.__neon_int16x4x3_t @llvm.arm.neon.vld3lane.v4i16(i8*, <4 x i16>, <4 x i16>, <4 x i16>, i32, i32) nounwind readonly
218declare %struct.__neon_int32x2x3_t @llvm.arm.neon.vld3lane.v2i32(i8*, <2 x i32>, <2 x i32>, <2 x i32>, i32, i32) nounwind readonly
219declare %struct.__neon_float32x2x3_t @llvm.arm.neon.vld3lane.v2f32(i8*, <2 x float>, <2 x float>, <2 x float>, i32, i32) nounwind readonly
Bob Wilsonc0110052009-09-01 04:27:10 +0000220
Bob Wilson7a9ef442010-08-27 17:13:24 +0000221declare %struct.__neon_int16x8x3_t @llvm.arm.neon.vld3lane.v8i16(i8*, <8 x i16>, <8 x i16>, <8 x i16>, i32, i32) nounwind readonly
222declare %struct.__neon_int32x4x3_t @llvm.arm.neon.vld3lane.v4i32(i8*, <4 x i32>, <4 x i32>, <4 x i32>, i32, i32) nounwind readonly
223declare %struct.__neon_float32x4x3_t @llvm.arm.neon.vld3lane.v4f32(i8*, <4 x float>, <4 x float>, <4 x float>, i32, i32) nounwind readonly
Bob Wilson0bf7d992009-10-08 22:27:33 +0000224
Bob Wilsonec1d81c2009-10-06 21:16:19 +0000225%struct.__neon_int8x8x4_t = type { <8 x i8>, <8 x i8>, <8 x i8>, <8 x i8> }
226%struct.__neon_int16x4x4_t = type { <4 x i16>, <4 x i16>, <4 x i16>, <4 x i16> }
227%struct.__neon_int32x2x4_t = type { <2 x i32>, <2 x i32>, <2 x i32>, <2 x i32> }
228%struct.__neon_float32x2x4_t = type { <2 x float>, <2 x float>, <2 x float>, <2 x float> }
Bob Wilsonc0110052009-09-01 04:27:10 +0000229
Bob Wilson62e053e2009-10-08 22:53:57 +0000230%struct.__neon_int16x8x4_t = type { <8 x i16>, <8 x i16>, <8 x i16>, <8 x i16> }
231%struct.__neon_int32x4x4_t = type { <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32> }
232%struct.__neon_float32x4x4_t = type { <4 x float>, <4 x float>, <4 x float>, <4 x float> }
233
Bob Wilsonc0110052009-09-01 04:27:10 +0000234define <8 x i8> @vld4lanei8(i8* %A, <8 x i8>* %B) nounwind {
235;CHECK: vld4lanei8:
Bob Wilson3454ed92010-10-19 00:16:32 +0000236;Check the alignment value. Max for this instruction is 32 bits:
237;CHECK: vld4.8 {d16[1], d17[1], d18[1], d19[1]}, [r0, :32]
Bob Wilsonc0110052009-09-01 04:27:10 +0000238 %tmp1 = load <8 x i8>* %B
Bob Wilson3454ed92010-10-19 00:16:32 +0000239 %tmp2 = call %struct.__neon_int8x8x4_t @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, i32 8)
Bob Wilsonec1d81c2009-10-06 21:16:19 +0000240 %tmp3 = extractvalue %struct.__neon_int8x8x4_t %tmp2, 0
241 %tmp4 = extractvalue %struct.__neon_int8x8x4_t %tmp2, 1
242 %tmp5 = extractvalue %struct.__neon_int8x8x4_t %tmp2, 2
243 %tmp6 = extractvalue %struct.__neon_int8x8x4_t %tmp2, 3
Bob Wilsonc0110052009-09-01 04:27:10 +0000244 %tmp7 = add <8 x i8> %tmp3, %tmp4
245 %tmp8 = add <8 x i8> %tmp5, %tmp6
246 %tmp9 = add <8 x i8> %tmp7, %tmp8
247 ret <8 x i8> %tmp9
248}
249
250define <4 x i16> @vld4lanei16(i16* %A, <4 x i16>* %B) nounwind {
251;CHECK: vld4lanei16:
252;CHECK: vld4.16
Bob Wilson02170c02010-04-20 00:17:16 +0000253 %tmp0 = bitcast i16* %A to i8*
Bob Wilsonc0110052009-09-01 04:27:10 +0000254 %tmp1 = load <4 x i16>* %B
Bob Wilson7a9ef442010-08-27 17:13:24 +0000255 %tmp2 = call %struct.__neon_int16x4x4_t @llvm.arm.neon.vld4lane.v4i16(i8* %tmp0, <4 x i16> %tmp1, <4 x i16> %tmp1, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1, i32 1)
Bob Wilsonec1d81c2009-10-06 21:16:19 +0000256 %tmp3 = extractvalue %struct.__neon_int16x4x4_t %tmp2, 0
257 %tmp4 = extractvalue %struct.__neon_int16x4x4_t %tmp2, 1
258 %tmp5 = extractvalue %struct.__neon_int16x4x4_t %tmp2, 2
259 %tmp6 = extractvalue %struct.__neon_int16x4x4_t %tmp2, 3
Bob Wilsonc0110052009-09-01 04:27:10 +0000260 %tmp7 = add <4 x i16> %tmp3, %tmp4
261 %tmp8 = add <4 x i16> %tmp5, %tmp6
262 %tmp9 = add <4 x i16> %tmp7, %tmp8
263 ret <4 x i16> %tmp9
264}
265
266define <2 x i32> @vld4lanei32(i32* %A, <2 x i32>* %B) nounwind {
267;CHECK: vld4lanei32:
Bob Wilson3454ed92010-10-19 00:16:32 +0000268;Check the alignment value. Max for this instruction is 128 bits:
269;CHECK: vld4.32 {d16[1], d17[1], d18[1], d19[1]}, [r0, :128]
Bob Wilson02170c02010-04-20 00:17:16 +0000270 %tmp0 = bitcast i32* %A to i8*
Bob Wilsonc0110052009-09-01 04:27:10 +0000271 %tmp1 = load <2 x i32>* %B
Bob Wilson3454ed92010-10-19 00:16:32 +0000272 %tmp2 = call %struct.__neon_int32x2x4_t @llvm.arm.neon.vld4lane.v2i32(i8* %tmp0, <2 x i32> %tmp1, <2 x i32> %tmp1, <2 x i32> %tmp1, <2 x i32> %tmp1, i32 1, i32 16)
Bob Wilsonec1d81c2009-10-06 21:16:19 +0000273 %tmp3 = extractvalue %struct.__neon_int32x2x4_t %tmp2, 0
274 %tmp4 = extractvalue %struct.__neon_int32x2x4_t %tmp2, 1
275 %tmp5 = extractvalue %struct.__neon_int32x2x4_t %tmp2, 2
276 %tmp6 = extractvalue %struct.__neon_int32x2x4_t %tmp2, 3
Bob Wilsonc0110052009-09-01 04:27:10 +0000277 %tmp7 = add <2 x i32> %tmp3, %tmp4
278 %tmp8 = add <2 x i32> %tmp5, %tmp6
279 %tmp9 = add <2 x i32> %tmp7, %tmp8
280 ret <2 x i32> %tmp9
281}
282
283define <2 x float> @vld4lanef(float* %A, <2 x float>* %B) nounwind {
284;CHECK: vld4lanef:
285;CHECK: vld4.32
Bob Wilson02170c02010-04-20 00:17:16 +0000286 %tmp0 = bitcast float* %A to i8*
Bob Wilsonc0110052009-09-01 04:27:10 +0000287 %tmp1 = load <2 x float>* %B
Bob Wilson7a9ef442010-08-27 17:13:24 +0000288 %tmp2 = call %struct.__neon_float32x2x4_t @llvm.arm.neon.vld4lane.v2f32(i8* %tmp0, <2 x float> %tmp1, <2 x float> %tmp1, <2 x float> %tmp1, <2 x float> %tmp1, i32 1, i32 1)
Bob Wilsonec1d81c2009-10-06 21:16:19 +0000289 %tmp3 = extractvalue %struct.__neon_float32x2x4_t %tmp2, 0
290 %tmp4 = extractvalue %struct.__neon_float32x2x4_t %tmp2, 1
291 %tmp5 = extractvalue %struct.__neon_float32x2x4_t %tmp2, 2
292 %tmp6 = extractvalue %struct.__neon_float32x2x4_t %tmp2, 3
Dan Gohmand4d01152010-05-03 22:36:46 +0000293 %tmp7 = fadd <2 x float> %tmp3, %tmp4
294 %tmp8 = fadd <2 x float> %tmp5, %tmp6
295 %tmp9 = fadd <2 x float> %tmp7, %tmp8
Bob Wilsonc0110052009-09-01 04:27:10 +0000296 ret <2 x float> %tmp9
297}
298
Bob Wilson62e053e2009-10-08 22:53:57 +0000299define <8 x i16> @vld4laneQi16(i16* %A, <8 x i16>* %B) nounwind {
300;CHECK: vld4laneQi16:
Bob Wilson3454ed92010-10-19 00:16:32 +0000301;Check the alignment value. Max for this instruction is 64 bits:
302;CHECK: vld4.16 {d16[1], d18[1], d20[1], d22[1]}, [r0, :64]
Bob Wilson02170c02010-04-20 00:17:16 +0000303 %tmp0 = bitcast i16* %A to i8*
Bob Wilson62e053e2009-10-08 22:53:57 +0000304 %tmp1 = load <8 x i16>* %B
Bob Wilson3454ed92010-10-19 00:16:32 +0000305 %tmp2 = call %struct.__neon_int16x8x4_t @llvm.arm.neon.vld4lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 1, i32 16)
Bob Wilson62e053e2009-10-08 22:53:57 +0000306 %tmp3 = extractvalue %struct.__neon_int16x8x4_t %tmp2, 0
307 %tmp4 = extractvalue %struct.__neon_int16x8x4_t %tmp2, 1
308 %tmp5 = extractvalue %struct.__neon_int16x8x4_t %tmp2, 2
309 %tmp6 = extractvalue %struct.__neon_int16x8x4_t %tmp2, 3
310 %tmp7 = add <8 x i16> %tmp3, %tmp4
311 %tmp8 = add <8 x i16> %tmp5, %tmp6
312 %tmp9 = add <8 x i16> %tmp7, %tmp8
313 ret <8 x i16> %tmp9
314}
315
316define <4 x i32> @vld4laneQi32(i32* %A, <4 x i32>* %B) nounwind {
317;CHECK: vld4laneQi32:
Bob Wilson3454ed92010-10-19 00:16:32 +0000318;Check the (default) alignment.
319;CHECK: vld4.32 {d17[0], d19[0], d21[0], d23[0]}, [r0]
Bob Wilson02170c02010-04-20 00:17:16 +0000320 %tmp0 = bitcast i32* %A to i8*
Bob Wilson62e053e2009-10-08 22:53:57 +0000321 %tmp1 = load <4 x i32>* %B
Bob Wilson3454ed92010-10-19 00:16:32 +0000322 %tmp2 = call %struct.__neon_int32x4x4_t @llvm.arm.neon.vld4lane.v4i32(i8* %tmp0, <4 x i32> %tmp1, <4 x i32> %tmp1, <4 x i32> %tmp1, <4 x i32> %tmp1, i32 2, i32 1)
Bob Wilson62e053e2009-10-08 22:53:57 +0000323 %tmp3 = extractvalue %struct.__neon_int32x4x4_t %tmp2, 0
324 %tmp4 = extractvalue %struct.__neon_int32x4x4_t %tmp2, 1
325 %tmp5 = extractvalue %struct.__neon_int32x4x4_t %tmp2, 2
326 %tmp6 = extractvalue %struct.__neon_int32x4x4_t %tmp2, 3
327 %tmp7 = add <4 x i32> %tmp3, %tmp4
328 %tmp8 = add <4 x i32> %tmp5, %tmp6
329 %tmp9 = add <4 x i32> %tmp7, %tmp8
330 ret <4 x i32> %tmp9
331}
332
333define <4 x float> @vld4laneQf(float* %A, <4 x float>* %B) nounwind {
334;CHECK: vld4laneQf:
335;CHECK: vld4.32
Bob Wilson02170c02010-04-20 00:17:16 +0000336 %tmp0 = bitcast float* %A to i8*
Bob Wilson62e053e2009-10-08 22:53:57 +0000337 %tmp1 = load <4 x float>* %B
Bob Wilson7a9ef442010-08-27 17:13:24 +0000338 %tmp2 = call %struct.__neon_float32x4x4_t @llvm.arm.neon.vld4lane.v4f32(i8* %tmp0, <4 x float> %tmp1, <4 x float> %tmp1, <4 x float> %tmp1, <4 x float> %tmp1, i32 1, i32 1)
Bob Wilson62e053e2009-10-08 22:53:57 +0000339 %tmp3 = extractvalue %struct.__neon_float32x4x4_t %tmp2, 0
340 %tmp4 = extractvalue %struct.__neon_float32x4x4_t %tmp2, 1
341 %tmp5 = extractvalue %struct.__neon_float32x4x4_t %tmp2, 2
342 %tmp6 = extractvalue %struct.__neon_float32x4x4_t %tmp2, 3
Dan Gohmand4d01152010-05-03 22:36:46 +0000343 %tmp7 = fadd <4 x float> %tmp3, %tmp4
344 %tmp8 = fadd <4 x float> %tmp5, %tmp6
345 %tmp9 = fadd <4 x float> %tmp7, %tmp8
Bob Wilson62e053e2009-10-08 22:53:57 +0000346 ret <4 x float> %tmp9
347}
348
Bob Wilson7a9ef442010-08-27 17:13:24 +0000349declare %struct.__neon_int8x8x4_t @llvm.arm.neon.vld4lane.v8i8(i8*, <8 x i8>, <8 x i8>, <8 x i8>, <8 x i8>, i32, i32) nounwind readonly
350declare %struct.__neon_int16x4x4_t @llvm.arm.neon.vld4lane.v4i16(i8*, <4 x i16>, <4 x i16>, <4 x i16>, <4 x i16>, i32, i32) nounwind readonly
351declare %struct.__neon_int32x2x4_t @llvm.arm.neon.vld4lane.v2i32(i8*, <2 x i32>, <2 x i32>, <2 x i32>, <2 x i32>, i32, i32) nounwind readonly
352declare %struct.__neon_float32x2x4_t @llvm.arm.neon.vld4lane.v2f32(i8*, <2 x float>, <2 x float>, <2 x float>, <2 x float>, i32, i32) nounwind readonly
Bob Wilson62e053e2009-10-08 22:53:57 +0000353
Bob Wilson7a9ef442010-08-27 17:13:24 +0000354declare %struct.__neon_int16x8x4_t @llvm.arm.neon.vld4lane.v8i16(i8*, <8 x i16>, <8 x i16>, <8 x i16>, <8 x i16>, i32, i32) nounwind readonly
355declare %struct.__neon_int32x4x4_t @llvm.arm.neon.vld4lane.v4i32(i8*, <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32>, i32, i32) nounwind readonly
356declare %struct.__neon_float32x4x4_t @llvm.arm.neon.vld4lane.v4f32(i8*, <4 x float>, <4 x float>, <4 x float>, <4 x float>, i32, i32) nounwind readonly