blob: 9c6b210be797698c85550e9b26e33da682731df6 [file] [log] [blame]
Bob Wilsonb2cae812009-10-07 22:30:19 +00001; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s
Bob Wilson5bafff32009-06-22 23:27:02 +00002
3define <8 x i8> @vmlai8(<8 x i8>* %A, <8 x i8>* %B, <8 x i8> * %C) nounwind {
Bob Wilsonb2cae812009-10-07 22:30:19 +00004;CHECK: vmlai8:
5;CHECK: vmla.i8
Bob Wilson5bafff32009-06-22 23:27:02 +00006 %tmp1 = load <8 x i8>* %A
7 %tmp2 = load <8 x i8>* %B
8 %tmp3 = load <8 x i8>* %C
9 %tmp4 = mul <8 x i8> %tmp2, %tmp3
10 %tmp5 = add <8 x i8> %tmp1, %tmp4
11 ret <8 x i8> %tmp5
12}
13
14define <4 x i16> @vmlai16(<4 x i16>* %A, <4 x i16>* %B, <4 x i16>* %C) nounwind {
Bob Wilsonb2cae812009-10-07 22:30:19 +000015;CHECK: vmlai16:
16;CHECK: vmla.i16
Bob Wilson5bafff32009-06-22 23:27:02 +000017 %tmp1 = load <4 x i16>* %A
18 %tmp2 = load <4 x i16>* %B
19 %tmp3 = load <4 x i16>* %C
20 %tmp4 = mul <4 x i16> %tmp2, %tmp3
21 %tmp5 = add <4 x i16> %tmp1, %tmp4
22 ret <4 x i16> %tmp5
23}
24
25define <2 x i32> @vmlai32(<2 x i32>* %A, <2 x i32>* %B, <2 x i32>* %C) nounwind {
Bob Wilsonb2cae812009-10-07 22:30:19 +000026;CHECK: vmlai32:
27;CHECK: vmla.i32
Bob Wilson5bafff32009-06-22 23:27:02 +000028 %tmp1 = load <2 x i32>* %A
29 %tmp2 = load <2 x i32>* %B
30 %tmp3 = load <2 x i32>* %C
31 %tmp4 = mul <2 x i32> %tmp2, %tmp3
32 %tmp5 = add <2 x i32> %tmp1, %tmp4
33 ret <2 x i32> %tmp5
34}
35
36define <2 x float> @vmlaf32(<2 x float>* %A, <2 x float>* %B, <2 x float>* %C) nounwind {
Bob Wilsonb2cae812009-10-07 22:30:19 +000037;CHECK: vmlaf32:
38;CHECK: vmla.f32
Bob Wilson5bafff32009-06-22 23:27:02 +000039 %tmp1 = load <2 x float>* %A
40 %tmp2 = load <2 x float>* %B
41 %tmp3 = load <2 x float>* %C
Dan Gohmand4d01152010-05-03 22:36:46 +000042 %tmp4 = fmul <2 x float> %tmp2, %tmp3
43 %tmp5 = fadd <2 x float> %tmp1, %tmp4
Bob Wilson5bafff32009-06-22 23:27:02 +000044 ret <2 x float> %tmp5
45}
46
47define <16 x i8> @vmlaQi8(<16 x i8>* %A, <16 x i8>* %B, <16 x i8> * %C) nounwind {
Bob Wilsonb2cae812009-10-07 22:30:19 +000048;CHECK: vmlaQi8:
49;CHECK: vmla.i8
Bob Wilson5bafff32009-06-22 23:27:02 +000050 %tmp1 = load <16 x i8>* %A
51 %tmp2 = load <16 x i8>* %B
52 %tmp3 = load <16 x i8>* %C
53 %tmp4 = mul <16 x i8> %tmp2, %tmp3
54 %tmp5 = add <16 x i8> %tmp1, %tmp4
55 ret <16 x i8> %tmp5
56}
57
58define <8 x i16> @vmlaQi16(<8 x i16>* %A, <8 x i16>* %B, <8 x i16>* %C) nounwind {
Bob Wilsonb2cae812009-10-07 22:30:19 +000059;CHECK: vmlaQi16:
60;CHECK: vmla.i16
Bob Wilson5bafff32009-06-22 23:27:02 +000061 %tmp1 = load <8 x i16>* %A
62 %tmp2 = load <8 x i16>* %B
63 %tmp3 = load <8 x i16>* %C
64 %tmp4 = mul <8 x i16> %tmp2, %tmp3
65 %tmp5 = add <8 x i16> %tmp1, %tmp4
66 ret <8 x i16> %tmp5
67}
68
69define <4 x i32> @vmlaQi32(<4 x i32>* %A, <4 x i32>* %B, <4 x i32>* %C) nounwind {
Bob Wilsonb2cae812009-10-07 22:30:19 +000070;CHECK: vmlaQi32:
71;CHECK: vmla.i32
Bob Wilson5bafff32009-06-22 23:27:02 +000072 %tmp1 = load <4 x i32>* %A
73 %tmp2 = load <4 x i32>* %B
74 %tmp3 = load <4 x i32>* %C
75 %tmp4 = mul <4 x i32> %tmp2, %tmp3
76 %tmp5 = add <4 x i32> %tmp1, %tmp4
77 ret <4 x i32> %tmp5
78}
79
80define <4 x float> @vmlaQf32(<4 x float>* %A, <4 x float>* %B, <4 x float>* %C) nounwind {
Bob Wilsonb2cae812009-10-07 22:30:19 +000081;CHECK: vmlaQf32:
82;CHECK: vmla.f32
Bob Wilson5bafff32009-06-22 23:27:02 +000083 %tmp1 = load <4 x float>* %A
84 %tmp2 = load <4 x float>* %B
85 %tmp3 = load <4 x float>* %C
Dan Gohmand4d01152010-05-03 22:36:46 +000086 %tmp4 = fmul <4 x float> %tmp2, %tmp3
87 %tmp5 = fadd <4 x float> %tmp1, %tmp4
Bob Wilson5bafff32009-06-22 23:27:02 +000088 ret <4 x float> %tmp5
89}
Bob Wilson83815ae2009-10-09 20:20:54 +000090
91define <8 x i16> @vmlals8(<8 x i16>* %A, <8 x i8>* %B, <8 x i8>* %C) nounwind {
92;CHECK: vmlals8:
93;CHECK: vmlal.s8
94 %tmp1 = load <8 x i16>* %A
95 %tmp2 = load <8 x i8>* %B
96 %tmp3 = load <8 x i8>* %C
Bob Wilsond0b69cf2010-09-01 23:50:19 +000097 %tmp4 = sext <8 x i8> %tmp2 to <8 x i16>
98 %tmp5 = sext <8 x i8> %tmp3 to <8 x i16>
99 %tmp6 = mul <8 x i16> %tmp4, %tmp5
100 %tmp7 = add <8 x i16> %tmp1, %tmp6
101 ret <8 x i16> %tmp7
Bob Wilson83815ae2009-10-09 20:20:54 +0000102}
103
104define <4 x i32> @vmlals16(<4 x i32>* %A, <4 x i16>* %B, <4 x i16>* %C) nounwind {
105;CHECK: vmlals16:
106;CHECK: vmlal.s16
107 %tmp1 = load <4 x i32>* %A
108 %tmp2 = load <4 x i16>* %B
109 %tmp3 = load <4 x i16>* %C
Bob Wilsond0b69cf2010-09-01 23:50:19 +0000110 %tmp4 = sext <4 x i16> %tmp2 to <4 x i32>
111 %tmp5 = sext <4 x i16> %tmp3 to <4 x i32>
112 %tmp6 = mul <4 x i32> %tmp4, %tmp5
113 %tmp7 = add <4 x i32> %tmp1, %tmp6
114 ret <4 x i32> %tmp7
Bob Wilson83815ae2009-10-09 20:20:54 +0000115}
116
117define <2 x i64> @vmlals32(<2 x i64>* %A, <2 x i32>* %B, <2 x i32>* %C) nounwind {
118;CHECK: vmlals32:
119;CHECK: vmlal.s32
120 %tmp1 = load <2 x i64>* %A
121 %tmp2 = load <2 x i32>* %B
122 %tmp3 = load <2 x i32>* %C
Bob Wilsond0b69cf2010-09-01 23:50:19 +0000123 %tmp4 = sext <2 x i32> %tmp2 to <2 x i64>
124 %tmp5 = sext <2 x i32> %tmp3 to <2 x i64>
125 %tmp6 = mul <2 x i64> %tmp4, %tmp5
126 %tmp7 = add <2 x i64> %tmp1, %tmp6
127 ret <2 x i64> %tmp7
Bob Wilson83815ae2009-10-09 20:20:54 +0000128}
129
130define <8 x i16> @vmlalu8(<8 x i16>* %A, <8 x i8>* %B, <8 x i8>* %C) nounwind {
131;CHECK: vmlalu8:
132;CHECK: vmlal.u8
133 %tmp1 = load <8 x i16>* %A
134 %tmp2 = load <8 x i8>* %B
135 %tmp3 = load <8 x i8>* %C
Bob Wilsond0b69cf2010-09-01 23:50:19 +0000136 %tmp4 = zext <8 x i8> %tmp2 to <8 x i16>
137 %tmp5 = zext <8 x i8> %tmp3 to <8 x i16>
138 %tmp6 = mul <8 x i16> %tmp4, %tmp5
139 %tmp7 = add <8 x i16> %tmp1, %tmp6
140 ret <8 x i16> %tmp7
Bob Wilson83815ae2009-10-09 20:20:54 +0000141}
142
143define <4 x i32> @vmlalu16(<4 x i32>* %A, <4 x i16>* %B, <4 x i16>* %C) nounwind {
144;CHECK: vmlalu16:
145;CHECK: vmlal.u16
146 %tmp1 = load <4 x i32>* %A
147 %tmp2 = load <4 x i16>* %B
148 %tmp3 = load <4 x i16>* %C
Bob Wilsond0b69cf2010-09-01 23:50:19 +0000149 %tmp4 = zext <4 x i16> %tmp2 to <4 x i32>
150 %tmp5 = zext <4 x i16> %tmp3 to <4 x i32>
151 %tmp6 = mul <4 x i32> %tmp4, %tmp5
152 %tmp7 = add <4 x i32> %tmp1, %tmp6
153 ret <4 x i32> %tmp7
Bob Wilson83815ae2009-10-09 20:20:54 +0000154}
155
156define <2 x i64> @vmlalu32(<2 x i64>* %A, <2 x i32>* %B, <2 x i32>* %C) nounwind {
157;CHECK: vmlalu32:
158;CHECK: vmlal.u32
159 %tmp1 = load <2 x i64>* %A
160 %tmp2 = load <2 x i32>* %B
161 %tmp3 = load <2 x i32>* %C
Bob Wilsond0b69cf2010-09-01 23:50:19 +0000162 %tmp4 = zext <2 x i32> %tmp2 to <2 x i64>
163 %tmp5 = zext <2 x i32> %tmp3 to <2 x i64>
164 %tmp6 = mul <2 x i64> %tmp4, %tmp5
165 %tmp7 = add <2 x i64> %tmp1, %tmp6
166 ret <2 x i64> %tmp7
Bob Wilson83815ae2009-10-09 20:20:54 +0000167}
168
169define arm_aapcs_vfpcc <4 x i32> @test_vmlal_lanes16(<4 x i32> %arg0_int32x4_t, <4 x i16> %arg1_int16x4_t, <4 x i16> %arg2_int16x4_t) nounwind readnone {
170entry:
171; CHECK: test_vmlal_lanes16
172; CHECK: vmlal.s16 q0, d2, d3[1]
173 %0 = shufflevector <4 x i16> %arg2_int16x4_t, <4 x i16> undef, <4 x i32> <i32 1, i32 1, i32 1, i32 1> ; <<4 x i16>> [#uses=1]
Bob Wilsond0b69cf2010-09-01 23:50:19 +0000174 %1 = sext <4 x i16> %arg1_int16x4_t to <4 x i32>
175 %2 = sext <4 x i16> %0 to <4 x i32>
176 %3 = mul <4 x i32> %1, %2
177 %4 = add <4 x i32> %arg0_int32x4_t, %3
178 ret <4 x i32> %4
Bob Wilson83815ae2009-10-09 20:20:54 +0000179}
180
181define arm_aapcs_vfpcc <2 x i64> @test_vmlal_lanes32(<2 x i64> %arg0_int64x2_t, <2 x i32> %arg1_int32x2_t, <2 x i32> %arg2_int32x2_t) nounwind readnone {
182entry:
183; CHECK: test_vmlal_lanes32
184; CHECK: vmlal.s32 q0, d2, d3[1]
185 %0 = shufflevector <2 x i32> %arg2_int32x2_t, <2 x i32> undef, <2 x i32> <i32 1, i32 1> ; <<2 x i32>> [#uses=1]
Bob Wilsond0b69cf2010-09-01 23:50:19 +0000186 %1 = sext <2 x i32> %arg1_int32x2_t to <2 x i64>
187 %2 = sext <2 x i32> %0 to <2 x i64>
188 %3 = mul <2 x i64> %1, %2
189 %4 = add <2 x i64> %arg0_int64x2_t, %3
190 ret <2 x i64> %4
Bob Wilson83815ae2009-10-09 20:20:54 +0000191}
192
193define arm_aapcs_vfpcc <4 x i32> @test_vmlal_laneu16(<4 x i32> %arg0_uint32x4_t, <4 x i16> %arg1_uint16x4_t, <4 x i16> %arg2_uint16x4_t) nounwind readnone {
194entry:
195; CHECK: test_vmlal_laneu16
196; CHECK: vmlal.u16 q0, d2, d3[1]
197 %0 = shufflevector <4 x i16> %arg2_uint16x4_t, <4 x i16> undef, <4 x i32> <i32 1, i32 1, i32 1, i32 1> ; <<4 x i16>> [#uses=1]
Bob Wilsond0b69cf2010-09-01 23:50:19 +0000198 %1 = zext <4 x i16> %arg1_uint16x4_t to <4 x i32>
199 %2 = zext <4 x i16> %0 to <4 x i32>
200 %3 = mul <4 x i32> %1, %2
201 %4 = add <4 x i32> %arg0_uint32x4_t, %3
202 ret <4 x i32> %4
Bob Wilson83815ae2009-10-09 20:20:54 +0000203}
204
205define arm_aapcs_vfpcc <2 x i64> @test_vmlal_laneu32(<2 x i64> %arg0_uint64x2_t, <2 x i32> %arg1_uint32x2_t, <2 x i32> %arg2_uint32x2_t) nounwind readnone {
206entry:
207; CHECK: test_vmlal_laneu32
208; CHECK: vmlal.u32 q0, d2, d3[1]
209 %0 = shufflevector <2 x i32> %arg2_uint32x2_t, <2 x i32> undef, <2 x i32> <i32 1, i32 1> ; <<2 x i32>> [#uses=1]
Bob Wilsond0b69cf2010-09-01 23:50:19 +0000210 %1 = zext <2 x i32> %arg1_uint32x2_t to <2 x i64>
211 %2 = zext <2 x i32> %0 to <2 x i64>
212 %3 = mul <2 x i64> %1, %2
213 %4 = add <2 x i64> %arg0_uint64x2_t, %3
214 ret <2 x i64> %4
Bob Wilson83815ae2009-10-09 20:20:54 +0000215}