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