blob: 325da5deabe514a27afe06bd6b07fdd92572c375 [file] [log] [blame]
Bob Wilsonfe27c512009-10-07 23:47:21 +00001; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s
Bob Wilson5bafff32009-06-22 23:27:02 +00002
3define <8 x i8> @vmuli8(<8 x i8>* %A, <8 x i8>* %B) nounwind {
Bob Wilsonfe27c512009-10-07 23:47:21 +00004;CHECK: vmuli8:
5;CHECK: vmul.i8
Bob Wilson5bafff32009-06-22 23:27:02 +00006 %tmp1 = load <8 x i8>* %A
7 %tmp2 = load <8 x i8>* %B
8 %tmp3 = mul <8 x i8> %tmp1, %tmp2
9 ret <8 x i8> %tmp3
10}
11
12define <4 x i16> @vmuli16(<4 x i16>* %A, <4 x i16>* %B) nounwind {
Bob Wilsonfe27c512009-10-07 23:47:21 +000013;CHECK: vmuli16:
14;CHECK: vmul.i16
Bob Wilson5bafff32009-06-22 23:27:02 +000015 %tmp1 = load <4 x i16>* %A
16 %tmp2 = load <4 x i16>* %B
17 %tmp3 = mul <4 x i16> %tmp1, %tmp2
18 ret <4 x i16> %tmp3
19}
20
21define <2 x i32> @vmuli32(<2 x i32>* %A, <2 x i32>* %B) nounwind {
Bob Wilsonfe27c512009-10-07 23:47:21 +000022;CHECK: vmuli32:
23;CHECK: vmul.i32
Bob Wilson5bafff32009-06-22 23:27:02 +000024 %tmp1 = load <2 x i32>* %A
25 %tmp2 = load <2 x i32>* %B
26 %tmp3 = mul <2 x i32> %tmp1, %tmp2
27 ret <2 x i32> %tmp3
28}
29
30define <2 x float> @vmulf32(<2 x float>* %A, <2 x float>* %B) nounwind {
Bob Wilsonfe27c512009-10-07 23:47:21 +000031;CHECK: vmulf32:
32;CHECK: vmul.f32
Bob Wilson5bafff32009-06-22 23:27:02 +000033 %tmp1 = load <2 x float>* %A
34 %tmp2 = load <2 x float>* %B
35 %tmp3 = mul <2 x float> %tmp1, %tmp2
36 ret <2 x float> %tmp3
37}
38
39define <8 x i8> @vmulp8(<8 x i8>* %A, <8 x i8>* %B) nounwind {
Bob Wilsonfe27c512009-10-07 23:47:21 +000040;CHECK: vmulp8:
41;CHECK: vmul.p8
Bob Wilson5bafff32009-06-22 23:27:02 +000042 %tmp1 = load <8 x i8>* %A
43 %tmp2 = load <8 x i8>* %B
44 %tmp3 = call <8 x i8> @llvm.arm.neon.vmulp.v8i8(<8 x i8> %tmp1, <8 x i8> %tmp2)
45 ret <8 x i8> %tmp3
46}
47
48define <16 x i8> @vmulQi8(<16 x i8>* %A, <16 x i8>* %B) nounwind {
Bob Wilsonfe27c512009-10-07 23:47:21 +000049;CHECK: vmulQi8:
50;CHECK: vmul.i8
Bob Wilson5bafff32009-06-22 23:27:02 +000051 %tmp1 = load <16 x i8>* %A
52 %tmp2 = load <16 x i8>* %B
53 %tmp3 = mul <16 x i8> %tmp1, %tmp2
54 ret <16 x i8> %tmp3
55}
56
57define <8 x i16> @vmulQi16(<8 x i16>* %A, <8 x i16>* %B) nounwind {
Bob Wilsonfe27c512009-10-07 23:47:21 +000058;CHECK: vmulQi16:
59;CHECK: vmul.i16
Bob Wilson5bafff32009-06-22 23:27:02 +000060 %tmp1 = load <8 x i16>* %A
61 %tmp2 = load <8 x i16>* %B
62 %tmp3 = mul <8 x i16> %tmp1, %tmp2
63 ret <8 x i16> %tmp3
64}
65
66define <4 x i32> @vmulQi32(<4 x i32>* %A, <4 x i32>* %B) nounwind {
Bob Wilsonfe27c512009-10-07 23:47:21 +000067;CHECK: vmulQi32:
68;CHECK: vmul.i32
Bob Wilson5bafff32009-06-22 23:27:02 +000069 %tmp1 = load <4 x i32>* %A
70 %tmp2 = load <4 x i32>* %B
71 %tmp3 = mul <4 x i32> %tmp1, %tmp2
72 ret <4 x i32> %tmp3
73}
74
75define <4 x float> @vmulQf32(<4 x float>* %A, <4 x float>* %B) nounwind {
Bob Wilsonfe27c512009-10-07 23:47:21 +000076;CHECK: vmulQf32:
77;CHECK: vmul.f32
Bob Wilson5bafff32009-06-22 23:27:02 +000078 %tmp1 = load <4 x float>* %A
79 %tmp2 = load <4 x float>* %B
80 %tmp3 = mul <4 x float> %tmp1, %tmp2
81 ret <4 x float> %tmp3
82}
83
84define <16 x i8> @vmulQp8(<16 x i8>* %A, <16 x i8>* %B) nounwind {
Bob Wilsonfe27c512009-10-07 23:47:21 +000085;CHECK: vmulQp8:
86;CHECK: vmul.p8
Bob Wilson5bafff32009-06-22 23:27:02 +000087 %tmp1 = load <16 x i8>* %A
88 %tmp2 = load <16 x i8>* %B
89 %tmp3 = call <16 x i8> @llvm.arm.neon.vmulp.v16i8(<16 x i8> %tmp1, <16 x i8> %tmp2)
90 ret <16 x i8> %tmp3
91}
92
93declare <8 x i8> @llvm.arm.neon.vmulp.v8i8(<8 x i8>, <8 x i8>) nounwind readnone
94declare <16 x i8> @llvm.arm.neon.vmulp.v16i8(<16 x i8>, <16 x i8>) nounwind readnone
Bob Wilson83815ae2009-10-09 20:20:54 +000095
96define arm_aapcs_vfpcc <2 x float> @test_vmul_lanef32(<2 x float> %arg0_float32x2_t, <2 x float> %arg1_float32x2_t) nounwind readnone {
97entry:
98; CHECK: test_vmul_lanef32:
99; CHECK: vmul.f32 d0, d0, d1[0]
100 %0 = shufflevector <2 x float> %arg1_float32x2_t, <2 x float> undef, <2 x i32> zeroinitializer ; <<2 x float>> [#uses=1]
101 %1 = fmul <2 x float> %0, %arg0_float32x2_t ; <<2 x float>> [#uses=1]
102 ret <2 x float> %1
103}
104
105define arm_aapcs_vfpcc <4 x i16> @test_vmul_lanes16(<4 x i16> %arg0_int16x4_t, <4 x i16> %arg1_int16x4_t) nounwind readnone {
106entry:
107; CHECK: test_vmul_lanes16:
108; CHECK: vmul.i16 d0, d0, d1[1]
109 %0 = shufflevector <4 x i16> %arg1_int16x4_t, <4 x i16> undef, <4 x i32> <i32 1, i32 1, i32 1, i32 1> ; <<4 x i16>> [#uses$
110 %1 = mul <4 x i16> %0, %arg0_int16x4_t ; <<4 x i16>> [#uses=1]
111 ret <4 x i16> %1
112}
113
114define arm_aapcs_vfpcc <2 x i32> @test_vmul_lanes32(<2 x i32> %arg0_int32x2_t, <2 x i32> %arg1_int32x2_t) nounwind readnone {
115entry:
116; CHECK: test_vmul_lanes32:
117; CHECK: vmul.i32 d0, d0, d1[1]
118 %0 = shufflevector <2 x i32> %arg1_int32x2_t, <2 x i32> undef, <2 x i32> <i32 1, i32 1> ; <<2 x i32>> [#uses=1]
119 %1 = mul <2 x i32> %0, %arg0_int32x2_t ; <<2 x i32>> [#uses=1]
120 ret <2 x i32> %1
121}
122
123define arm_aapcs_vfpcc <4 x float> @test_vmulQ_lanef32(<4 x float> %arg0_float32x4_t, <2 x float> %arg1_float32x2_t) nounwind readnone {
124entry:
125; CHECK: test_vmulQ_lanef32:
126; CHECK: vmul.f32 q0, q0, d2[1]
127 %0 = shufflevector <2 x float> %arg1_float32x2_t, <2 x float> undef, <4 x i32> <i32 1, i32 1, i32 1, i32 1> ; <<4 x float>$
128 %1 = fmul <4 x float> %0, %arg0_float32x4_t ; <<4 x float>> [#uses=1]
129 ret <4 x float> %1
130}
131
132define arm_aapcs_vfpcc <8 x i16> @test_vmulQ_lanes16(<8 x i16> %arg0_int16x8_t, <4 x i16> %arg1_int16x4_t) nounwind readnone {
133entry:
134; CHECK: test_vmulQ_lanes16:
135; CHECK: vmul.i16 q0, q0, d2[1]
136 %0 = shufflevector <4 x i16> %arg1_int16x4_t, <4 x i16> undef, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
137 %1 = mul <8 x i16> %0, %arg0_int16x8_t ; <<8 x i16>> [#uses=1]
138 ret <8 x i16> %1
139}
140
141define arm_aapcs_vfpcc <4 x i32> @test_vmulQ_lanes32(<4 x i32> %arg0_int32x4_t, <2 x i32> %arg1_int32x2_t) nounwind readnone {
142entry:
143; CHECK: test_vmulQ_lanes32:
144; CHECK: vmul.i32 q0, q0, d2[1]
145 %0 = shufflevector <2 x i32> %arg1_int32x2_t, <2 x i32> undef, <4 x i32> <i32 1, i32 1, i32 1, i32 1> ; <<4 x i32>> [#uses$
146 %1 = mul <4 x i32> %0, %arg0_int32x4_t ; <<4 x i32>> [#uses=1]
147 ret <4 x i32> %1
148}
149
150define <8 x i16> @vmulls8(<8 x i8>* %A, <8 x i8>* %B) nounwind {
151;CHECK: vmulls8:
152;CHECK: vmull.s8
153 %tmp1 = load <8 x i8>* %A
154 %tmp2 = load <8 x i8>* %B
155 %tmp3 = call <8 x i16> @llvm.arm.neon.vmulls.v8i16(<8 x i8> %tmp1, <8 x i8> %tmp2)
156 ret <8 x i16> %tmp3
157}
158
159define <4 x i32> @vmulls16(<4 x i16>* %A, <4 x i16>* %B) nounwind {
160;CHECK: vmulls16:
161;CHECK: vmull.s16
162 %tmp1 = load <4 x i16>* %A
163 %tmp2 = load <4 x i16>* %B
164 %tmp3 = call <4 x i32> @llvm.arm.neon.vmulls.v4i32(<4 x i16> %tmp1, <4 x i16> %tmp2)
165 ret <4 x i32> %tmp3
166}
167
168define <2 x i64> @vmulls32(<2 x i32>* %A, <2 x i32>* %B) nounwind {
169;CHECK: vmulls32:
170;CHECK: vmull.s32
171 %tmp1 = load <2 x i32>* %A
172 %tmp2 = load <2 x i32>* %B
173 %tmp3 = call <2 x i64> @llvm.arm.neon.vmulls.v2i64(<2 x i32> %tmp1, <2 x i32> %tmp2)
174 ret <2 x i64> %tmp3
175}
176
177define <8 x i16> @vmullu8(<8 x i8>* %A, <8 x i8>* %B) nounwind {
178;CHECK: vmullu8:
179;CHECK: vmull.u8
180 %tmp1 = load <8 x i8>* %A
181 %tmp2 = load <8 x i8>* %B
182 %tmp3 = call <8 x i16> @llvm.arm.neon.vmullu.v8i16(<8 x i8> %tmp1, <8 x i8> %tmp2)
183 ret <8 x i16> %tmp3
184}
185
186define <4 x i32> @vmullu16(<4 x i16>* %A, <4 x i16>* %B) nounwind {
187;CHECK: vmullu16:
188;CHECK: vmull.u16
189 %tmp1 = load <4 x i16>* %A
190 %tmp2 = load <4 x i16>* %B
191 %tmp3 = call <4 x i32> @llvm.arm.neon.vmullu.v4i32(<4 x i16> %tmp1, <4 x i16> %tmp2)
192 ret <4 x i32> %tmp3
193}
194
195define <2 x i64> @vmullu32(<2 x i32>* %A, <2 x i32>* %B) nounwind {
196;CHECK: vmullu32:
197;CHECK: vmull.u32
198 %tmp1 = load <2 x i32>* %A
199 %tmp2 = load <2 x i32>* %B
200 %tmp3 = call <2 x i64> @llvm.arm.neon.vmullu.v2i64(<2 x i32> %tmp1, <2 x i32> %tmp2)
201 ret <2 x i64> %tmp3
202}
203
204define <8 x i16> @vmullp8(<8 x i8>* %A, <8 x i8>* %B) nounwind {
205;CHECK: vmullp8:
206;CHECK: vmull.p8
207 %tmp1 = load <8 x i8>* %A
208 %tmp2 = load <8 x i8>* %B
209 %tmp3 = call <8 x i16> @llvm.arm.neon.vmullp.v8i16(<8 x i8> %tmp1, <8 x i8> %tmp2)
210 ret <8 x i16> %tmp3
211}
212
213define arm_aapcs_vfpcc <4 x i32> @test_vmull_lanes16(<4 x i16> %arg0_int16x4_t, <4 x i16> %arg1_int16x4_t) nounwind readnone {
214entry:
215; CHECK: test_vmull_lanes16
216; CHECK: vmull.s16 q0, d0, d1[1]
217 %0 = shufflevector <4 x i16> %arg1_int16x4_t, <4 x i16> undef, <4 x i32> <i32 1, i32 1, i32 1, i32 1> ; <<4 x i16>> [#uses=1]
218 %1 = tail call <4 x i32> @llvm.arm.neon.vmulls.v4i32(<4 x i16> %arg0_int16x4_t, <4 x i16> %0) ; <<4 x i32>> [#uses=1]
219 ret <4 x i32> %1
220}
221
222define arm_aapcs_vfpcc <2 x i64> @test_vmull_lanes32(<2 x i32> %arg0_int32x2_t, <2 x i32> %arg1_int32x2_t) nounwind readnone {
223entry:
224; CHECK: test_vmull_lanes32
225; CHECK: vmull.s32 q0, d0, d1[1]
226 %0 = shufflevector <2 x i32> %arg1_int32x2_t, <2 x i32> undef, <2 x i32> <i32 1, i32 1> ; <<2 x i32>> [#uses=1]
227 %1 = tail call <2 x i64> @llvm.arm.neon.vmulls.v2i64(<2 x i32> %arg0_int32x2_t, <2 x i32> %0) ; <<2 x i64>> [#uses=1]
228 ret <2 x i64> %1
229}
230
231define arm_aapcs_vfpcc <4 x i32> @test_vmull_laneu16(<4 x i16> %arg0_uint16x4_t, <4 x i16> %arg1_uint16x4_t) nounwind readnone {
232entry:
233; CHECK: test_vmull_laneu16
234; CHECK: vmull.u16 q0, d0, d1[1]
235 %0 = shufflevector <4 x i16> %arg1_uint16x4_t, <4 x i16> undef, <4 x i32> <i32 1, i32 1, i32 1, i32 1> ; <<4 x i16>> [#uses=1]
236 %1 = tail call <4 x i32> @llvm.arm.neon.vmullu.v4i32(<4 x i16> %arg0_uint16x4_t, <4 x i16> %0) ; <<4 x i32>> [#uses=1]
237 ret <4 x i32> %1
238}
239
240define arm_aapcs_vfpcc <2 x i64> @test_vmull_laneu32(<2 x i32> %arg0_uint32x2_t, <2 x i32> %arg1_uint32x2_t) nounwind readnone {
241entry:
242; CHECK: test_vmull_laneu32
243; CHECK: vmull.u32 q0, d0, d1[1]
244 %0 = shufflevector <2 x i32> %arg1_uint32x2_t, <2 x i32> undef, <2 x i32> <i32 1, i32 1> ; <<2 x i32>> [#uses=1]
245 %1 = tail call <2 x i64> @llvm.arm.neon.vmullu.v2i64(<2 x i32> %arg0_uint32x2_t, <2 x i32> %0) ; <<2 x i64>> [#uses=1]
246 ret <2 x i64> %1
247}
248
249declare <8 x i16> @llvm.arm.neon.vmulls.v8i16(<8 x i8>, <8 x i8>) nounwind readnone
250declare <4 x i32> @llvm.arm.neon.vmulls.v4i32(<4 x i16>, <4 x i16>) nounwind readnone
251declare <2 x i64> @llvm.arm.neon.vmulls.v2i64(<2 x i32>, <2 x i32>) nounwind readnone
252
253declare <8 x i16> @llvm.arm.neon.vmullu.v8i16(<8 x i8>, <8 x i8>) nounwind readnone
254declare <4 x i32> @llvm.arm.neon.vmullu.v4i32(<4 x i16>, <4 x i16>) nounwind readnone
255declare <2 x i64> @llvm.arm.neon.vmullu.v2i64(<2 x i32>, <2 x i32>) nounwind readnone
256
257declare <8 x i16> @llvm.arm.neon.vmullp.v8i16(<8 x i8>, <8 x i8>) nounwind readnone