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 -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
3 // RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature +mve -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
4 
5 #include <arm_mve.h>
6 
7 // CHECK-LABEL: @test_vclzq_s8(
8 // CHECK-NEXT:  entry:
9 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> [[A:%.*]], i1 false)
10 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
11 //
test_vclzq_s8(int8x16_t a)12 int8x16_t test_vclzq_s8(int8x16_t a)
13 {
14 #ifdef POLYMORPHIC
15     return vclzq(a);
16 #else /* POLYMORPHIC */
17     return vclzq_s8(a);
18 #endif /* POLYMORPHIC */
19 }
20 
21 // CHECK-LABEL: @test_vclzq_s16(
22 // CHECK-NEXT:  entry:
23 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> [[A:%.*]], i1 false)
24 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
25 //
test_vclzq_s16(int16x8_t a)26 int16x8_t test_vclzq_s16(int16x8_t a)
27 {
28 #ifdef POLYMORPHIC
29     return vclzq(a);
30 #else /* POLYMORPHIC */
31     return vclzq_s16(a);
32 #endif /* POLYMORPHIC */
33 }
34 
35 // CHECK-LABEL: @test_vclzq_s32(
36 // CHECK-NEXT:  entry:
37 // CHECK-NEXT:    [[TMP0:%.*]] = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> [[A:%.*]], i1 false)
38 // CHECK-NEXT:    ret <4 x i32> [[TMP0]]
39 //
test_vclzq_s32(int32x4_t a)40 int32x4_t test_vclzq_s32(int32x4_t a)
41 {
42 #ifdef POLYMORPHIC
43     return vclzq(a);
44 #else /* POLYMORPHIC */
45     return vclzq_s32(a);
46 #endif /* POLYMORPHIC */
47 }
48 
49 // CHECK-LABEL: @test_vclzq_u8(
50 // CHECK-NEXT:  entry:
51 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> [[A:%.*]], i1 false)
52 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
53 //
test_vclzq_u8(uint8x16_t a)54 uint8x16_t test_vclzq_u8(uint8x16_t a)
55 {
56 #ifdef POLYMORPHIC
57     return vclzq(a);
58 #else /* POLYMORPHIC */
59     return vclzq_u8(a);
60 #endif /* POLYMORPHIC */
61 }
62 
63 // CHECK-LABEL: @test_vclzq_u16(
64 // CHECK-NEXT:  entry:
65 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> [[A:%.*]], i1 false)
66 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
67 //
test_vclzq_u16(uint16x8_t a)68 uint16x8_t test_vclzq_u16(uint16x8_t a)
69 {
70 #ifdef POLYMORPHIC
71     return vclzq(a);
72 #else /* POLYMORPHIC */
73     return vclzq_u16(a);
74 #endif /* POLYMORPHIC */
75 }
76 
77 // CHECK-LABEL: @test_vclzq_u32(
78 // CHECK-NEXT:  entry:
79 // CHECK-NEXT:    [[TMP0:%.*]] = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> [[A:%.*]], i1 false)
80 // CHECK-NEXT:    ret <4 x i32> [[TMP0]]
81 //
test_vclzq_u32(uint32x4_t a)82 uint32x4_t test_vclzq_u32(uint32x4_t a)
83 {
84 #ifdef POLYMORPHIC
85     return vclzq(a);
86 #else /* POLYMORPHIC */
87     return vclzq_u32(a);
88 #endif /* POLYMORPHIC */
89 }
90 
91 // CHECK-LABEL: @test_vclsq_s8(
92 // CHECK-NEXT:  entry:
93 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vcls.v16i8(<16 x i8> [[A:%.*]])
94 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
95 //
test_vclsq_s8(int8x16_t a)96 int8x16_t test_vclsq_s8(int8x16_t a)
97 {
98 #ifdef POLYMORPHIC
99     return vclsq(a);
100 #else /* POLYMORPHIC */
101     return vclsq_s8(a);
102 #endif /* POLYMORPHIC */
103 }
104 
105 // CHECK-LABEL: @test_vclsq_s16(
106 // CHECK-NEXT:  entry:
107 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vcls.v8i16(<8 x i16> [[A:%.*]])
108 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
109 //
test_vclsq_s16(int16x8_t a)110 int16x8_t test_vclsq_s16(int16x8_t a)
111 {
112 #ifdef POLYMORPHIC
113     return vclsq(a);
114 #else /* POLYMORPHIC */
115     return vclsq_s16(a);
116 #endif /* POLYMORPHIC */
117 }
118 
119 // CHECK-LABEL: @test_vclsq_s32(
120 // CHECK-NEXT:  entry:
121 // CHECK-NEXT:    [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vcls.v4i32(<4 x i32> [[A:%.*]])
122 // CHECK-NEXT:    ret <4 x i32> [[TMP0]]
123 //
test_vclsq_s32(int32x4_t a)124 int32x4_t test_vclsq_s32(int32x4_t a)
125 {
126 #ifdef POLYMORPHIC
127     return vclsq(a);
128 #else /* POLYMORPHIC */
129     return vclsq_s32(a);
130 #endif /* POLYMORPHIC */
131 }
132 
133 // CHECK-LABEL: @test_vclsq_m_s8(
134 // CHECK-NEXT:  entry:
135 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
136 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
137 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.cls.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
138 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
139 //
test_vclsq_m_s8(int8x16_t inactive,int8x16_t a,mve_pred16_t p)140 int8x16_t test_vclsq_m_s8(int8x16_t inactive, int8x16_t a, mve_pred16_t p)
141 {
142 #ifdef POLYMORPHIC
143     return vclsq_m(inactive, a, p);
144 #else /* POLYMORPHIC */
145     return vclsq_m_s8(inactive, a, p);
146 #endif /* POLYMORPHIC */
147 }
148 
149 // CHECK-LABEL: @test_vclsq_m_s16(
150 // CHECK-NEXT:  entry:
151 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
152 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
153 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.cls.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
154 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
155 //
test_vclsq_m_s16(int16x8_t inactive,int16x8_t a,mve_pred16_t p)156 int16x8_t test_vclsq_m_s16(int16x8_t inactive, int16x8_t a, mve_pred16_t p)
157 {
158 #ifdef POLYMORPHIC
159     return vclsq_m(inactive, a, p);
160 #else /* POLYMORPHIC */
161     return vclsq_m_s16(inactive, a, p);
162 #endif /* POLYMORPHIC */
163 }
164 
165 // CHECK-LABEL: @test_vclsq_m_s32(
166 // CHECK-NEXT:  entry:
167 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
168 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
169 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.cls.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
170 // CHECK-NEXT:    ret <4 x i32> [[TMP2]]
171 //
test_vclsq_m_s32(int32x4_t inactive,int32x4_t a,mve_pred16_t p)172 int32x4_t test_vclsq_m_s32(int32x4_t inactive, int32x4_t a, mve_pred16_t p)
173 {
174 #ifdef POLYMORPHIC
175     return vclsq_m(inactive, a, p);
176 #else /* POLYMORPHIC */
177     return vclsq_m_s32(inactive, a, p);
178 #endif /* POLYMORPHIC */
179 }
180 
181 // CHECK-LABEL: @test_vclzq_m_s8(
182 // CHECK-NEXT:  entry:
183 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
184 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
185 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.clz.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
186 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
187 //
test_vclzq_m_s8(int8x16_t inactive,int8x16_t a,mve_pred16_t p)188 int8x16_t test_vclzq_m_s8(int8x16_t inactive, int8x16_t a, mve_pred16_t p)
189 {
190 #ifdef POLYMORPHIC
191     return vclzq_m(inactive, a, p);
192 #else /* POLYMORPHIC */
193     return vclzq_m_s8(inactive, a, p);
194 #endif /* POLYMORPHIC */
195 }
196 
197 // CHECK-LABEL: @test_vclzq_m_s16(
198 // CHECK-NEXT:  entry:
199 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
200 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
201 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.clz.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
202 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
203 //
test_vclzq_m_s16(int16x8_t inactive,int16x8_t a,mve_pred16_t p)204 int16x8_t test_vclzq_m_s16(int16x8_t inactive, int16x8_t a, mve_pred16_t p)
205 {
206 #ifdef POLYMORPHIC
207     return vclzq_m(inactive, a, p);
208 #else /* POLYMORPHIC */
209     return vclzq_m_s16(inactive, a, p);
210 #endif /* POLYMORPHIC */
211 }
212 
213 // CHECK-LABEL: @test_vclzq_m_s32(
214 // CHECK-NEXT:  entry:
215 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
216 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
217 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.clz.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
218 // CHECK-NEXT:    ret <4 x i32> [[TMP2]]
219 //
test_vclzq_m_s32(int32x4_t inactive,int32x4_t a,mve_pred16_t p)220 int32x4_t test_vclzq_m_s32(int32x4_t inactive, int32x4_t a, mve_pred16_t p)
221 {
222 #ifdef POLYMORPHIC
223     return vclzq_m(inactive, a, p);
224 #else /* POLYMORPHIC */
225     return vclzq_m_s32(inactive, a, p);
226 #endif /* POLYMORPHIC */
227 }
228 
229 // CHECK-LABEL: @test_vclzq_m_u8(
230 // CHECK-NEXT:  entry:
231 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
232 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
233 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.clz.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
234 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
235 //
test_vclzq_m_u8(uint8x16_t inactive,uint8x16_t a,mve_pred16_t p)236 uint8x16_t test_vclzq_m_u8(uint8x16_t inactive, uint8x16_t a, mve_pred16_t p)
237 {
238 #ifdef POLYMORPHIC
239     return vclzq_m(inactive, a, p);
240 #else /* POLYMORPHIC */
241     return vclzq_m_u8(inactive, a, p);
242 #endif /* POLYMORPHIC */
243 }
244 
245 // CHECK-LABEL: @test_vclzq_m_u16(
246 // CHECK-NEXT:  entry:
247 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
248 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
249 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.clz.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
250 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
251 //
test_vclzq_m_u16(uint16x8_t inactive,uint16x8_t a,mve_pred16_t p)252 uint16x8_t test_vclzq_m_u16(uint16x8_t inactive, uint16x8_t a, mve_pred16_t p)
253 {
254 #ifdef POLYMORPHIC
255     return vclzq_m(inactive, a, p);
256 #else /* POLYMORPHIC */
257     return vclzq_m_u16(inactive, a, p);
258 #endif /* POLYMORPHIC */
259 }
260 
261 // CHECK-LABEL: @test_vclzq_m_u32(
262 // CHECK-NEXT:  entry:
263 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
264 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
265 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.clz.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
266 // CHECK-NEXT:    ret <4 x i32> [[TMP2]]
267 //
test_vclzq_m_u32(uint32x4_t inactive,uint32x4_t a,mve_pred16_t p)268 uint32x4_t test_vclzq_m_u32(uint32x4_t inactive, uint32x4_t a, mve_pred16_t p)
269 {
270 #ifdef POLYMORPHIC
271     return vclzq_m(inactive, a, p);
272 #else /* POLYMORPHIC */
273     return vclzq_m_u32(inactive, a, p);
274 #endif /* POLYMORPHIC */
275 }
276 
277 // CHECK-LABEL: @test_vclsq_x_s8(
278 // CHECK-NEXT:  entry:
279 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
280 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
281 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.cls.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i1> [[TMP1]], <16 x i8> undef)
282 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
283 //
test_vclsq_x_s8(int8x16_t a,mve_pred16_t p)284 int8x16_t test_vclsq_x_s8(int8x16_t a, mve_pred16_t p)
285 {
286 #ifdef POLYMORPHIC
287     return vclsq_x(a, p);
288 #else /* POLYMORPHIC */
289     return vclsq_x_s8(a, p);
290 #endif /* POLYMORPHIC */
291 }
292 
293 // CHECK-LABEL: @test_vclsq_x_s16(
294 // CHECK-NEXT:  entry:
295 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
296 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
297 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.cls.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i1> [[TMP1]], <8 x i16> undef)
298 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
299 //
test_vclsq_x_s16(int16x8_t a,mve_pred16_t p)300 int16x8_t test_vclsq_x_s16(int16x8_t a, mve_pred16_t p)
301 {
302 #ifdef POLYMORPHIC
303     return vclsq_x(a, p);
304 #else /* POLYMORPHIC */
305     return vclsq_x_s16(a, p);
306 #endif /* POLYMORPHIC */
307 }
308 
309 // CHECK-LABEL: @test_vclsq_x_s32(
310 // CHECK-NEXT:  entry:
311 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
312 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
313 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.cls.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i1> [[TMP1]], <4 x i32> undef)
314 // CHECK-NEXT:    ret <4 x i32> [[TMP2]]
315 //
test_vclsq_x_s32(int32x4_t a,mve_pred16_t p)316 int32x4_t test_vclsq_x_s32(int32x4_t a, mve_pred16_t p)
317 {
318 #ifdef POLYMORPHIC
319     return vclsq_x(a, p);
320 #else /* POLYMORPHIC */
321     return vclsq_x_s32(a, p);
322 #endif /* POLYMORPHIC */
323 }
324 
325 // CHECK-LABEL: @test_vclzq_x_s8(
326 // CHECK-NEXT:  entry:
327 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
328 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
329 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.clz.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i1> [[TMP1]], <16 x i8> undef)
330 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
331 //
test_vclzq_x_s8(int8x16_t a,mve_pred16_t p)332 int8x16_t test_vclzq_x_s8(int8x16_t a, mve_pred16_t p)
333 {
334 #ifdef POLYMORPHIC
335     return vclzq_x(a, p);
336 #else /* POLYMORPHIC */
337     return vclzq_x_s8(a, p);
338 #endif /* POLYMORPHIC */
339 }
340 
341 // CHECK-LABEL: @test_vclzq_x_s16(
342 // CHECK-NEXT:  entry:
343 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
344 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
345 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.clz.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i1> [[TMP1]], <8 x i16> undef)
346 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
347 //
test_vclzq_x_s16(int16x8_t a,mve_pred16_t p)348 int16x8_t test_vclzq_x_s16(int16x8_t a, mve_pred16_t p)
349 {
350 #ifdef POLYMORPHIC
351     return vclzq_x(a, p);
352 #else /* POLYMORPHIC */
353     return vclzq_x_s16(a, p);
354 #endif /* POLYMORPHIC */
355 }
356 
357 // CHECK-LABEL: @test_vclzq_x_s32(
358 // CHECK-NEXT:  entry:
359 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
360 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
361 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.clz.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i1> [[TMP1]], <4 x i32> undef)
362 // CHECK-NEXT:    ret <4 x i32> [[TMP2]]
363 //
test_vclzq_x_s32(int32x4_t a,mve_pred16_t p)364 int32x4_t test_vclzq_x_s32(int32x4_t a, mve_pred16_t p)
365 {
366 #ifdef POLYMORPHIC
367     return vclzq_x(a, p);
368 #else /* POLYMORPHIC */
369     return vclzq_x_s32(a, p);
370 #endif /* POLYMORPHIC */
371 }
372 
373 // CHECK-LABEL: @test_vclzq_x_u8(
374 // CHECK-NEXT:  entry:
375 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
376 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
377 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.clz.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i1> [[TMP1]], <16 x i8> undef)
378 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
379 //
test_vclzq_x_u8(uint8x16_t a,mve_pred16_t p)380 uint8x16_t test_vclzq_x_u8(uint8x16_t a, mve_pred16_t p)
381 {
382 #ifdef POLYMORPHIC
383     return vclzq_x(a, p);
384 #else /* POLYMORPHIC */
385     return vclzq_x_u8(a, p);
386 #endif /* POLYMORPHIC */
387 }
388 
389 // CHECK-LABEL: @test_vclzq_x_u16(
390 // CHECK-NEXT:  entry:
391 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
392 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
393 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.clz.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i1> [[TMP1]], <8 x i16> undef)
394 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
395 //
test_vclzq_x_u16(uint16x8_t a,mve_pred16_t p)396 uint16x8_t test_vclzq_x_u16(uint16x8_t a, mve_pred16_t p)
397 {
398 #ifdef POLYMORPHIC
399     return vclzq_x(a, p);
400 #else /* POLYMORPHIC */
401     return vclzq_x_u16(a, p);
402 #endif /* POLYMORPHIC */
403 }
404 
405 // CHECK-LABEL: @test_vclzq_x_u32(
406 // CHECK-NEXT:  entry:
407 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
408 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
409 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.clz.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i1> [[TMP1]], <4 x i32> undef)
410 // CHECK-NEXT:    ret <4 x i32> [[TMP2]]
411 //
test_vclzq_x_u32(uint32x4_t a,mve_pred16_t p)412 uint32x4_t test_vclzq_x_u32(uint32x4_t a, mve_pred16_t p)
413 {
414 #ifdef POLYMORPHIC
415     return vclzq_x(a, p);
416 #else /* POLYMORPHIC */
417     return vclzq_x_u32(a, p);
418 #endif /* POLYMORPHIC */
419 }
420