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