1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -sroa | FileCheck %s
3 // RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -sroa | FileCheck %s
4 
5 #include <arm_mve.h>
6 
7 // CHECK-LABEL: @test_vmulq_u8(
8 // CHECK-NEXT:  entry:
9 // CHECK-NEXT:    [[TMP0:%.*]] = mul <16 x i8> [[A:%.*]], [[B:%.*]]
10 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
11 //
test_vmulq_u8(uint8x16_t a,uint8x16_t b)12 uint8x16_t test_vmulq_u8(uint8x16_t a, uint8x16_t b)
13 {
14 #ifdef POLYMORPHIC
15     return vmulq(a, b);
16 #else /* POLYMORPHIC */
17     return vmulq_u8(a, b);
18 #endif /* POLYMORPHIC */
19 }
20 
21 // CHECK-LABEL: @test_vmulq_s16(
22 // CHECK-NEXT:  entry:
23 // CHECK-NEXT:    [[TMP0:%.*]] = mul <8 x i16> [[A:%.*]], [[B:%.*]]
24 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
25 //
test_vmulq_s16(int16x8_t a,int16x8_t b)26 int16x8_t test_vmulq_s16(int16x8_t a, int16x8_t b)
27 {
28 #ifdef POLYMORPHIC
29     return vmulq(a, b);
30 #else /* POLYMORPHIC */
31     return vmulq_s16(a, b);
32 #endif /* POLYMORPHIC */
33 }
34 
35 // CHECK-LABEL: @test_vmulq_u32(
36 // CHECK-NEXT:  entry:
37 // CHECK-NEXT:    [[TMP0:%.*]] = mul <4 x i32> [[A:%.*]], [[B:%.*]]
38 // CHECK-NEXT:    ret <4 x i32> [[TMP0]]
39 //
test_vmulq_u32(uint32x4_t a,uint32x4_t b)40 uint32x4_t test_vmulq_u32(uint32x4_t a, uint32x4_t b)
41 {
42 #ifdef POLYMORPHIC
43     return vmulq(a, b);
44 #else /* POLYMORPHIC */
45     return vmulq_u32(a, b);
46 #endif /* POLYMORPHIC */
47 }
48 
49 // CHECK-LABEL: @test_vmulq_f32(
50 // CHECK-NEXT:  entry:
51 // CHECK-NEXT:    [[TMP0:%.*]] = fmul <4 x float> [[A:%.*]], [[B:%.*]]
52 // CHECK-NEXT:    ret <4 x float> [[TMP0]]
53 //
test_vmulq_f32(float32x4_t a,float32x4_t b)54 float32x4_t test_vmulq_f32(float32x4_t a, float32x4_t b)
55 {
56 #ifdef POLYMORPHIC
57     return vmulq(a, b);
58 #else /* POLYMORPHIC */
59     return vmulq_f32(a, b);
60 #endif /* POLYMORPHIC */
61 }
62 
63 // CHECK-LABEL: @test_vmulq_m_s8(
64 // CHECK-NEXT:  entry:
65 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
66 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
67 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.mul.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
68 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
69 //
test_vmulq_m_s8(int8x16_t inactive,int8x16_t a,int8x16_t b,mve_pred16_t p)70 int8x16_t test_vmulq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
71 {
72 #ifdef POLYMORPHIC
73     return vmulq_m(inactive, a, b, p);
74 #else /* POLYMORPHIC */
75     return vmulq_m_s8(inactive, a, b, p);
76 #endif /* POLYMORPHIC */
77 }
78 
79 // CHECK-LABEL: @test_vmulq_m_u16(
80 // CHECK-NEXT:  entry:
81 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
82 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
83 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.mul.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
84 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
85 //
test_vmulq_m_u16(uint16x8_t inactive,uint16x8_t a,uint16x8_t b,mve_pred16_t p)86 uint16x8_t test_vmulq_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
87 {
88 #ifdef POLYMORPHIC
89     return vmulq_m(inactive, a, b, p);
90 #else /* POLYMORPHIC */
91     return vmulq_m_u16(inactive, a, b, p);
92 #endif /* POLYMORPHIC */
93 }
94 
95 // CHECK-LABEL: @test_vmulq_m_s32(
96 // CHECK-NEXT:  entry:
97 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
98 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
99 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.mul.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
100 // CHECK-NEXT:    ret <4 x i32> [[TMP2]]
101 //
test_vmulq_m_s32(int32x4_t inactive,int32x4_t a,int32x4_t b,mve_pred16_t p)102 int32x4_t test_vmulq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
103 {
104 #ifdef POLYMORPHIC
105     return vmulq_m(inactive, a, b, p);
106 #else /* POLYMORPHIC */
107     return vmulq_m_s32(inactive, a, b, p);
108 #endif /* POLYMORPHIC */
109 }
110 
111 // CHECK-LABEL: @test_vmulq_m_f16(
112 // CHECK-NEXT:  entry:
113 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
114 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
115 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.mul.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])
116 // CHECK-NEXT:    ret <8 x half> [[TMP2]]
117 //
test_vmulq_m_f16(float16x8_t inactive,float16x8_t a,float16x8_t b,mve_pred16_t p)118 float16x8_t test_vmulq_m_f16(float16x8_t inactive, float16x8_t a, float16x8_t b, mve_pred16_t p)
119 {
120 #ifdef POLYMORPHIC
121     return vmulq_m(inactive, a, b, p);
122 #else /* POLYMORPHIC */
123     return vmulq_m_f16(inactive, a, b, p);
124 #endif /* POLYMORPHIC */
125 }
126 
127 // CHECK-LABEL: @test_vmulq_x_u8(
128 // CHECK-NEXT:  entry:
129 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
130 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
131 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.mul.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]], <16 x i8> undef)
132 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
133 //
test_vmulq_x_u8(uint8x16_t a,uint8x16_t b,mve_pred16_t p)134 uint8x16_t test_vmulq_x_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
135 {
136 #ifdef POLYMORPHIC
137     return vmulq_x(a, b, p);
138 #else /* POLYMORPHIC */
139     return vmulq_x_u8(a, b, p);
140 #endif /* POLYMORPHIC */
141 }
142 
143 // CHECK-LABEL: @test_vmulq_x_s16(
144 // CHECK-NEXT:  entry:
145 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
146 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
147 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.mul.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]], <8 x i16> undef)
148 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
149 //
test_vmulq_x_s16(int16x8_t a,int16x8_t b,mve_pred16_t p)150 int16x8_t test_vmulq_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
151 {
152 #ifdef POLYMORPHIC
153     return vmulq_x(a, b, p);
154 #else /* POLYMORPHIC */
155     return vmulq_x_s16(a, b, p);
156 #endif /* POLYMORPHIC */
157 }
158 
159 // CHECK-LABEL: @test_vmulq_x_u32(
160 // CHECK-NEXT:  entry:
161 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
162 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
163 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.mul.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]], <4 x i32> undef)
164 // CHECK-NEXT:    ret <4 x i32> [[TMP2]]
165 //
test_vmulq_x_u32(uint32x4_t a,uint32x4_t b,mve_pred16_t p)166 uint32x4_t test_vmulq_x_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
167 {
168 #ifdef POLYMORPHIC
169     return vmulq_x(a, b, p);
170 #else /* POLYMORPHIC */
171     return vmulq_x_u32(a, b, p);
172 #endif /* POLYMORPHIC */
173 }
174 
175 // CHECK-LABEL: @test_vmulq_x_f32(
176 // CHECK-NEXT:  entry:
177 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
178 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
179 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.mul.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]], <4 x float> undef)
180 // CHECK-NEXT:    ret <4 x float> [[TMP2]]
181 //
test_vmulq_x_f32(float32x4_t a,float32x4_t b,mve_pred16_t p)182 float32x4_t test_vmulq_x_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
183 {
184 #ifdef POLYMORPHIC
185     return vmulq_x(a, b, p);
186 #else /* POLYMORPHIC */
187     return vmulq_x_f32(a, b, p);
188 #endif /* POLYMORPHIC */
189 }
190 
191 // CHECK-LABEL: @test_vmulq_n_u8(
192 // CHECK-NEXT:  entry:
193 // CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
194 // CHECK-NEXT:    [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
195 // CHECK-NEXT:    [[TMP0:%.*]] = mul <16 x i8> [[A:%.*]], [[DOTSPLAT]]
196 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
197 //
test_vmulq_n_u8(uint8x16_t a,uint8_t b)198 uint8x16_t test_vmulq_n_u8(uint8x16_t a, uint8_t b)
199 {
200 #ifdef POLYMORPHIC
201     return vmulq(a, b);
202 #else /* POLYMORPHIC */
203     return vmulq_n_u8(a, b);
204 #endif /* POLYMORPHIC */
205 }
206 
207 // CHECK-LABEL: @test_vmulq_n_s16(
208 // CHECK-NEXT:  entry:
209 // CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
210 // CHECK-NEXT:    [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
211 // CHECK-NEXT:    [[TMP0:%.*]] = mul <8 x i16> [[A:%.*]], [[DOTSPLAT]]
212 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
213 //
test_vmulq_n_s16(int16x8_t a,int16_t b)214 int16x8_t test_vmulq_n_s16(int16x8_t a, int16_t b)
215 {
216 #ifdef POLYMORPHIC
217     return vmulq(a, b);
218 #else /* POLYMORPHIC */
219     return vmulq_n_s16(a, b);
220 #endif /* POLYMORPHIC */
221 }
222 
223 // CHECK-LABEL: @test_vmulq_n_u32(
224 // CHECK-NEXT:  entry:
225 // CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
226 // CHECK-NEXT:    [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
227 // CHECK-NEXT:    [[TMP0:%.*]] = mul <4 x i32> [[A:%.*]], [[DOTSPLAT]]
228 // CHECK-NEXT:    ret <4 x i32> [[TMP0]]
229 //
test_vmulq_n_u32(uint32x4_t a,uint32_t b)230 uint32x4_t test_vmulq_n_u32(uint32x4_t a, uint32_t b)
231 {
232 #ifdef POLYMORPHIC
233     return vmulq(a, b);
234 #else /* POLYMORPHIC */
235     return vmulq_n_u32(a, b);
236 #endif /* POLYMORPHIC */
237 }
238 
239 // CHECK-LABEL: @test_vmulq_n_f32(
240 // CHECK-NEXT:  entry:
241 // CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <4 x float> undef, float [[B:%.*]], i32 0
242 // CHECK-NEXT:    [[DOTSPLAT:%.*]] = shufflevector <4 x float> [[DOTSPLATINSERT]], <4 x float> undef, <4 x i32> zeroinitializer
243 // CHECK-NEXT:    [[TMP0:%.*]] = fmul <4 x float> [[A:%.*]], [[DOTSPLAT]]
244 // CHECK-NEXT:    ret <4 x float> [[TMP0]]
245 //
test_vmulq_n_f32(float32x4_t a,float32_t b)246 float32x4_t test_vmulq_n_f32(float32x4_t a, float32_t b)
247 {
248 #ifdef POLYMORPHIC
249     return vmulq(a, b);
250 #else /* POLYMORPHIC */
251     return vmulq_n_f32(a, b);
252 #endif /* POLYMORPHIC */
253 }
254 
255 // CHECK-LABEL: @test_vmulq_m_n_s8(
256 // CHECK-NEXT:  entry:
257 // CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
258 // CHECK-NEXT:    [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
259 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
260 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
261 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.mul.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[DOTSPLAT]], <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
262 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
263 //
test_vmulq_m_n_s8(int8x16_t inactive,int8x16_t a,int8_t b,mve_pred16_t p)264 int8x16_t test_vmulq_m_n_s8(int8x16_t inactive, int8x16_t a, int8_t b, mve_pred16_t p)
265 {
266 #ifdef POLYMORPHIC
267     return vmulq_m(inactive, a, b, p);
268 #else /* POLYMORPHIC */
269     return vmulq_m_n_s8(inactive, a, b, p);
270 #endif /* POLYMORPHIC */
271 }
272 
273 // CHECK-LABEL: @test_vmulq_m_n_u16(
274 // CHECK-NEXT:  entry:
275 // CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
276 // CHECK-NEXT:    [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
277 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
278 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
279 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.mul.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[DOTSPLAT]], <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
280 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
281 //
test_vmulq_m_n_u16(uint16x8_t inactive,uint16x8_t a,uint16_t b,mve_pred16_t p)282 uint16x8_t test_vmulq_m_n_u16(uint16x8_t inactive, uint16x8_t a, uint16_t b, mve_pred16_t p)
283 {
284 #ifdef POLYMORPHIC
285     return vmulq_m(inactive, a, b, p);
286 #else /* POLYMORPHIC */
287     return vmulq_m_n_u16(inactive, a, b, p);
288 #endif /* POLYMORPHIC */
289 }
290 
291 // CHECK-LABEL: @test_vmulq_m_n_s32(
292 // CHECK-NEXT:  entry:
293 // CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
294 // CHECK-NEXT:    [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
295 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
296 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
297 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.mul.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[DOTSPLAT]], <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
298 // CHECK-NEXT:    ret <4 x i32> [[TMP2]]
299 //
test_vmulq_m_n_s32(int32x4_t inactive,int32x4_t a,int32_t b,mve_pred16_t p)300 int32x4_t test_vmulq_m_n_s32(int32x4_t inactive, int32x4_t a, int32_t b, mve_pred16_t p)
301 {
302 #ifdef POLYMORPHIC
303     return vmulq_m(inactive, a, b, p);
304 #else /* POLYMORPHIC */
305     return vmulq_m_n_s32(inactive, a, b, p);
306 #endif /* POLYMORPHIC */
307 }
308 
309 // CHECK-LABEL: @test_vmulq_m_n_f16(
310 // CHECK-NEXT:  entry:
311 // CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <8 x half> undef, half [[B:%.*]], i32 0
312 // CHECK-NEXT:    [[DOTSPLAT:%.*]] = shufflevector <8 x half> [[DOTSPLATINSERT]], <8 x half> undef, <8 x i32> zeroinitializer
313 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
314 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
315 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.mul.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x half> [[DOTSPLAT]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])
316 // CHECK-NEXT:    ret <8 x half> [[TMP2]]
317 //
test_vmulq_m_n_f16(float16x8_t inactive,float16x8_t a,float16_t b,mve_pred16_t p)318 float16x8_t test_vmulq_m_n_f16(float16x8_t inactive, float16x8_t a, float16_t b, mve_pred16_t p)
319 {
320 #ifdef POLYMORPHIC
321     return vmulq_m(inactive, a, b, p);
322 #else /* POLYMORPHIC */
323     return vmulq_m_n_f16(inactive, a, b, p);
324 #endif /* POLYMORPHIC */
325 }
326 
327 // CHECK-LABEL: @test_vmulq_x_n_u8(
328 // CHECK-NEXT:  entry:
329 // CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
330 // CHECK-NEXT:    [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
331 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
332 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
333 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.mul.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[DOTSPLAT]], <16 x i1> [[TMP1]], <16 x i8> undef)
334 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
335 //
test_vmulq_x_n_u8(uint8x16_t a,uint8_t b,mve_pred16_t p)336 uint8x16_t test_vmulq_x_n_u8(uint8x16_t a, uint8_t b, mve_pred16_t p)
337 {
338 #ifdef POLYMORPHIC
339     return vmulq_x(a, b, p);
340 #else /* POLYMORPHIC */
341     return vmulq_x_n_u8(a, b, p);
342 #endif /* POLYMORPHIC */
343 }
344 
345 // CHECK-LABEL: @test_vmulq_x_n_s16(
346 // CHECK-NEXT:  entry:
347 // CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
348 // CHECK-NEXT:    [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
349 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
350 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
351 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.mul.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[DOTSPLAT]], <8 x i1> [[TMP1]], <8 x i16> undef)
352 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
353 //
test_vmulq_x_n_s16(int16x8_t a,int16_t b,mve_pred16_t p)354 int16x8_t test_vmulq_x_n_s16(int16x8_t a, int16_t b, mve_pred16_t p)
355 {
356 #ifdef POLYMORPHIC
357     return vmulq_x(a, b, p);
358 #else /* POLYMORPHIC */
359     return vmulq_x_n_s16(a, b, p);
360 #endif /* POLYMORPHIC */
361 }
362 // CHECK-LABEL: @test_vmulq_x_n_u32(
363 // CHECK-NEXT:  entry:
364 // CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
365 // CHECK-NEXT:    [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
366 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
367 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
368 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.mul.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[DOTSPLAT]], <4 x i1> [[TMP1]], <4 x i32> undef)
369 // CHECK-NEXT:    ret <4 x i32> [[TMP2]]
370 //
test_vmulq_x_n_u32(uint32x4_t a,uint32_t b,mve_pred16_t p)371 uint32x4_t test_vmulq_x_n_u32(uint32x4_t a, uint32_t b, mve_pred16_t p)
372 {
373 #ifdef POLYMORPHIC
374     return vmulq_x(a, b, p);
375 #else /* POLYMORPHIC */
376     return vmulq_x_n_u32(a, b, p);
377 #endif /* POLYMORPHIC */
378 }
379 
380 // CHECK-LABEL: @test_vmulq_x_n_f32(
381 // CHECK-NEXT:  entry:
382 // CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <4 x float> undef, float [[B:%.*]], i32 0
383 // CHECK-NEXT:    [[DOTSPLAT:%.*]] = shufflevector <4 x float> [[DOTSPLATINSERT]], <4 x float> undef, <4 x i32> zeroinitializer
384 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
385 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
386 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.mul.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x float> [[DOTSPLAT]], <4 x i1> [[TMP1]], <4 x float> undef)
387 // CHECK-NEXT:    ret <4 x float> [[TMP2]]
388 //
test_vmulq_x_n_f32(float32x4_t a,float32_t b,mve_pred16_t p)389 float32x4_t test_vmulq_x_n_f32(float32x4_t a, float32_t b, mve_pred16_t p)
390 {
391 #ifdef POLYMORPHIC
392     return vmulq_x(a, b, p);
393 #else /* POLYMORPHIC */
394     return vmulq_x_n_f32(a, b, p);
395 #endif /* POLYMORPHIC */
396 }
397