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 -mem2reg -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 -mem2reg -sroa | FileCheck %s
4 
5 #include <arm_mve.h>
6 
7 // CHECK-LABEL: @test_vminvq_s8(
8 // CHECK-NEXT:  entry:
9 // CHECK-NEXT:    [[TMP0:%.*]] = zext i8 [[A:%.*]] to i32
10 // CHECK-NEXT:    [[TMP1:%.*]] = call i32 @llvm.arm.mve.minv.v16i8(i32 [[TMP0]], <16 x i8> [[B:%.*]], i32 0)
11 // CHECK-NEXT:    [[TMP2:%.*]] = trunc i32 [[TMP1]] to i8
12 // CHECK-NEXT:    ret i8 [[TMP2]]
13 //
test_vminvq_s8(int8_t a,int8x16_t b)14 int8_t test_vminvq_s8(int8_t a, int8x16_t b) {
15 #ifdef POLYMORPHIC
16   return vminvq(a, b);
17 #else  /* POLYMORPHIC */
18   return vminvq_s8(a, b);
19 #endif /* POLYMORPHIC */
20 }
21 
22 // CHECK-LABEL: @test_vminvq_s16(
23 // CHECK-NEXT:  entry:
24 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[A:%.*]] to i32
25 // CHECK-NEXT:    [[TMP1:%.*]] = call i32 @llvm.arm.mve.minv.v8i16(i32 [[TMP0]], <8 x i16> [[B:%.*]], i32 0)
26 // CHECK-NEXT:    [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
27 // CHECK-NEXT:    ret i16 [[TMP2]]
28 //
test_vminvq_s16(int16_t a,int16x8_t b)29 int16_t test_vminvq_s16(int16_t a, int16x8_t b) {
30 #ifdef POLYMORPHIC
31   return vminvq(a, b);
32 #else  /* POLYMORPHIC */
33   return vminvq_s16(a, b);
34 #endif /* POLYMORPHIC */
35 }
36 
37 // CHECK-LABEL: @test_vminvq_s32(
38 // CHECK-NEXT:  entry:
39 // CHECK-NEXT:    [[TMP0:%.*]] = call i32 @llvm.arm.mve.minv.v4i32(i32 [[A:%.*]], <4 x i32> [[B:%.*]], i32 0)
40 // CHECK-NEXT:    ret i32 [[TMP0]]
41 //
test_vminvq_s32(int32_t a,int32x4_t b)42 int32_t test_vminvq_s32(int32_t a, int32x4_t b) {
43 #ifdef POLYMORPHIC
44   return vminvq(a, b);
45 #else  /* POLYMORPHIC */
46   return vminvq_s32(a, b);
47 #endif /* POLYMORPHIC */
48 }
49 
50 // CHECK-LABEL: @test_vminvq_u8(
51 // CHECK-NEXT:  entry:
52 // CHECK-NEXT:    [[TMP0:%.*]] = zext i8 [[A:%.*]] to i32
53 // CHECK-NEXT:    [[TMP1:%.*]] = call i32 @llvm.arm.mve.minv.v16i8(i32 [[TMP0]], <16 x i8> [[B:%.*]], i32 1)
54 // CHECK-NEXT:    [[TMP2:%.*]] = trunc i32 [[TMP1]] to i8
55 // CHECK-NEXT:    ret i8 [[TMP2]]
56 //
test_vminvq_u8(uint8_t a,uint8x16_t b)57 uint8_t test_vminvq_u8(uint8_t a, uint8x16_t b) {
58 #ifdef POLYMORPHIC
59   return vminvq(a, b);
60 #else  /* POLYMORPHIC */
61   return vminvq_u8(a, b);
62 #endif /* POLYMORPHIC */
63 }
64 
65 // CHECK-LABEL: @test_vminvq_u16(
66 // CHECK-NEXT:  entry:
67 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[A:%.*]] to i32
68 // CHECK-NEXT:    [[TMP1:%.*]] = call i32 @llvm.arm.mve.minv.v8i16(i32 [[TMP0]], <8 x i16> [[B:%.*]], i32 1)
69 // CHECK-NEXT:    [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
70 // CHECK-NEXT:    ret i16 [[TMP2]]
71 //
test_vminvq_u16(uint16_t a,uint16x8_t b)72 uint16_t test_vminvq_u16(uint16_t a, uint16x8_t b) {
73 #ifdef POLYMORPHIC
74   return vminvq(a, b);
75 #else  /* POLYMORPHIC */
76   return vminvq_u16(a, b);
77 #endif /* POLYMORPHIC */
78 }
79 
80 // CHECK-LABEL: @test_vminvq_u32(
81 // CHECK-NEXT:  entry:
82 // CHECK-NEXT:    [[TMP0:%.*]] = call i32 @llvm.arm.mve.minv.v4i32(i32 [[A:%.*]], <4 x i32> [[B:%.*]], i32 1)
83 // CHECK-NEXT:    ret i32 [[TMP0]]
84 //
test_vminvq_u32(uint32_t a,uint32x4_t b)85 uint32_t test_vminvq_u32(uint32_t a, uint32x4_t b) {
86 #ifdef POLYMORPHIC
87   return vminvq(a, b);
88 #else  /* POLYMORPHIC */
89   return vminvq_u32(a, b);
90 #endif /* POLYMORPHIC */
91 }
92 
93 // CHECK-LABEL: @test_vmaxvq_s8(
94 // CHECK-NEXT:  entry:
95 // CHECK-NEXT:    [[TMP0:%.*]] = zext i8 [[A:%.*]] to i32
96 // CHECK-NEXT:    [[TMP1:%.*]] = call i32 @llvm.arm.mve.maxv.v16i8(i32 [[TMP0]], <16 x i8> [[B:%.*]], i32 0)
97 // CHECK-NEXT:    [[TMP2:%.*]] = trunc i32 [[TMP1]] to i8
98 // CHECK-NEXT:    ret i8 [[TMP2]]
99 //
test_vmaxvq_s8(int8_t a,int8x16_t b)100 int8_t test_vmaxvq_s8(int8_t a, int8x16_t b) {
101 #ifdef POLYMORPHIC
102   return vmaxvq(a, b);
103 #else  /* POLYMORPHIC */
104   return vmaxvq_s8(a, b);
105 #endif /* POLYMORPHIC */
106 }
107 
108 // CHECK-LABEL: @test_vmaxvq_s16(
109 // CHECK-NEXT:  entry:
110 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[A:%.*]] to i32
111 // CHECK-NEXT:    [[TMP1:%.*]] = call i32 @llvm.arm.mve.maxv.v8i16(i32 [[TMP0]], <8 x i16> [[B:%.*]], i32 0)
112 // CHECK-NEXT:    [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
113 // CHECK-NEXT:    ret i16 [[TMP2]]
114 //
test_vmaxvq_s16(int16_t a,int16x8_t b)115 int16_t test_vmaxvq_s16(int16_t a, int16x8_t b) {
116 #ifdef POLYMORPHIC
117   return vmaxvq(a, b);
118 #else  /* POLYMORPHIC */
119   return vmaxvq_s16(a, b);
120 #endif /* POLYMORPHIC */
121 }
122 
123 // CHECK-LABEL: @test_vmaxvq_s32(
124 // CHECK-NEXT:  entry:
125 // CHECK-NEXT:    [[TMP0:%.*]] = call i32 @llvm.arm.mve.maxv.v4i32(i32 [[A:%.*]], <4 x i32> [[B:%.*]], i32 0)
126 // CHECK-NEXT:    ret i32 [[TMP0]]
127 //
test_vmaxvq_s32(int32_t a,int32x4_t b)128 int32_t test_vmaxvq_s32(int32_t a, int32x4_t b) {
129 #ifdef POLYMORPHIC
130   return vmaxvq(a, b);
131 #else  /* POLYMORPHIC */
132   return vmaxvq_s32(a, b);
133 #endif /* POLYMORPHIC */
134 }
135 
136 // CHECK-LABEL: @test_vmaxvq_u8(
137 // CHECK-NEXT:  entry:
138 // CHECK-NEXT:    [[TMP0:%.*]] = zext i8 [[A:%.*]] to i32
139 // CHECK-NEXT:    [[TMP1:%.*]] = call i32 @llvm.arm.mve.maxv.v16i8(i32 [[TMP0]], <16 x i8> [[B:%.*]], i32 1)
140 // CHECK-NEXT:    [[TMP2:%.*]] = trunc i32 [[TMP1]] to i8
141 // CHECK-NEXT:    ret i8 [[TMP2]]
142 //
test_vmaxvq_u8(uint8_t a,uint8x16_t b)143 uint8_t test_vmaxvq_u8(uint8_t a, uint8x16_t b) {
144 #ifdef POLYMORPHIC
145   return vmaxvq(a, b);
146 #else  /* POLYMORPHIC */
147   return vmaxvq_u8(a, b);
148 #endif /* POLYMORPHIC */
149 }
150 
151 // CHECK-LABEL: @test_vmaxvq_u16(
152 // CHECK-NEXT:  entry:
153 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[A:%.*]] to i32
154 // CHECK-NEXT:    [[TMP1:%.*]] = call i32 @llvm.arm.mve.maxv.v8i16(i32 [[TMP0]], <8 x i16> [[B:%.*]], i32 1)
155 // CHECK-NEXT:    [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
156 // CHECK-NEXT:    ret i16 [[TMP2]]
157 //
test_vmaxvq_u16(uint16_t a,uint16x8_t b)158 uint16_t test_vmaxvq_u16(uint16_t a, uint16x8_t b) {
159 #ifdef POLYMORPHIC
160   return vmaxvq(a, b);
161 #else  /* POLYMORPHIC */
162   return vmaxvq_u16(a, b);
163 #endif /* POLYMORPHIC */
164 }
165 
166 // CHECK-LABEL: @test_vmaxvq_u32(
167 // CHECK-NEXT:  entry:
168 // CHECK-NEXT:    [[TMP0:%.*]] = call i32 @llvm.arm.mve.maxv.v4i32(i32 [[A:%.*]], <4 x i32> [[B:%.*]], i32 1)
169 // CHECK-NEXT:    ret i32 [[TMP0]]
170 //
test_vmaxvq_u32(uint32_t a,uint32x4_t b)171 uint32_t test_vmaxvq_u32(uint32_t a, uint32x4_t b) {
172 #ifdef POLYMORPHIC
173   return vmaxvq(a, b);
174 #else  /* POLYMORPHIC */
175   return vmaxvq_u32(a, b);
176 #endif /* POLYMORPHIC */
177 }
178 
179 // CHECK-LABEL: @test_vminavq_s8(
180 // CHECK-NEXT:  entry:
181 // CHECK-NEXT:    [[TMP0:%.*]] = zext i8 [[A:%.*]] to i32
182 // CHECK-NEXT:    [[TMP1:%.*]] = call i32 @llvm.arm.mve.minav.v16i8(i32 [[TMP0]], <16 x i8> [[B:%.*]])
183 // CHECK-NEXT:    [[TMP2:%.*]] = trunc i32 [[TMP1]] to i8
184 // CHECK-NEXT:    ret i8 [[TMP2]]
185 //
test_vminavq_s8(uint8_t a,int8x16_t b)186 uint8_t test_vminavq_s8(uint8_t a, int8x16_t b) {
187 #ifdef POLYMORPHIC
188   return vminavq(a, b);
189 #else  /* POLYMORPHIC */
190   return vminavq_s8(a, b);
191 #endif /* POLYMORPHIC */
192 }
193 
194 // CHECK-LABEL: @test_vminavq_s16(
195 // CHECK-NEXT:  entry:
196 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[A:%.*]] to i32
197 // CHECK-NEXT:    [[TMP1:%.*]] = call i32 @llvm.arm.mve.minav.v8i16(i32 [[TMP0]], <8 x i16> [[B:%.*]])
198 // CHECK-NEXT:    [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
199 // CHECK-NEXT:    ret i16 [[TMP2]]
200 //
test_vminavq_s16(uint16_t a,int16x8_t b)201 uint16_t test_vminavq_s16(uint16_t a, int16x8_t b) {
202 #ifdef POLYMORPHIC
203   return vminavq(a, b);
204 #else  /* POLYMORPHIC */
205   return vminavq_s16(a, b);
206 #endif /* POLYMORPHIC */
207 }
208 
209 // CHECK-LABEL: @test_vminavq_s32(
210 // CHECK-NEXT:  entry:
211 // CHECK-NEXT:    [[TMP0:%.*]] = call i32 @llvm.arm.mve.minav.v4i32(i32 [[A:%.*]], <4 x i32> [[B:%.*]])
212 // CHECK-NEXT:    ret i32 [[TMP0]]
213 //
test_vminavq_s32(uint32_t a,int32x4_t b)214 uint32_t test_vminavq_s32(uint32_t a, int32x4_t b) {
215 #ifdef POLYMORPHIC
216   return vminavq(a, b);
217 #else  /* POLYMORPHIC */
218   return vminavq_s32(a, b);
219 #endif /* POLYMORPHIC */
220 }
221 
222 // CHECK-LABEL: @test_vmaxavq_s8(
223 // CHECK-NEXT:  entry:
224 // CHECK-NEXT:    [[TMP0:%.*]] = zext i8 [[A:%.*]] to i32
225 // CHECK-NEXT:    [[TMP1:%.*]] = call i32 @llvm.arm.mve.maxav.v16i8(i32 [[TMP0]], <16 x i8> [[B:%.*]])
226 // CHECK-NEXT:    [[TMP2:%.*]] = trunc i32 [[TMP1]] to i8
227 // CHECK-NEXT:    ret i8 [[TMP2]]
228 //
test_vmaxavq_s8(uint8_t a,int8x16_t b)229 uint8_t test_vmaxavq_s8(uint8_t a, int8x16_t b) {
230 #ifdef POLYMORPHIC
231   return vmaxavq(a, b);
232 #else  /* POLYMORPHIC */
233   return vmaxavq_s8(a, b);
234 #endif /* POLYMORPHIC */
235 }
236 
237 // CHECK-LABEL: @test_vmaxavq_s16(
238 // CHECK-NEXT:  entry:
239 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[A:%.*]] to i32
240 // CHECK-NEXT:    [[TMP1:%.*]] = call i32 @llvm.arm.mve.maxav.v8i16(i32 [[TMP0]], <8 x i16> [[B:%.*]])
241 // CHECK-NEXT:    [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
242 // CHECK-NEXT:    ret i16 [[TMP2]]
243 //
test_vmaxavq_s16(uint16_t a,int16x8_t b)244 uint16_t test_vmaxavq_s16(uint16_t a, int16x8_t b) {
245 #ifdef POLYMORPHIC
246   return vmaxavq(a, b);
247 #else  /* POLYMORPHIC */
248   return vmaxavq_s16(a, b);
249 #endif /* POLYMORPHIC */
250 }
251 
252 // CHECK-LABEL: @test_vmaxavq_s32(
253 // CHECK-NEXT:  entry:
254 // CHECK-NEXT:    [[TMP0:%.*]] = call i32 @llvm.arm.mve.maxav.v4i32(i32 [[A:%.*]], <4 x i32> [[B:%.*]])
255 // CHECK-NEXT:    ret i32 [[TMP0]]
256 //
test_vmaxavq_s32(uint32_t a,int32x4_t b)257 uint32_t test_vmaxavq_s32(uint32_t a, int32x4_t b) {
258 #ifdef POLYMORPHIC
259   return vmaxavq(a, b);
260 #else  /* POLYMORPHIC */
261   return vmaxavq_s32(a, b);
262 #endif /* POLYMORPHIC */
263 }
264 
265 // CHECK-LABEL: @test_vminnmvq_f16(
266 // CHECK-NEXT:  entry:
267 // CHECK-NEXT:    [[TMP0:%.*]] = call half @llvm.arm.mve.minnmv.f16.v8f16(half [[A:%.*]], <8 x half> [[B:%.*]])
268 // CHECK-NEXT:    ret half [[TMP0]]
269 //
test_vminnmvq_f16(float16_t a,float16x8_t b)270 float16_t test_vminnmvq_f16(float16_t a, float16x8_t b) {
271 #ifdef POLYMORPHIC
272   return vminnmvq(a, b);
273 #else  /* POLYMORPHIC */
274   return vminnmvq_f16(a, b);
275 #endif /* POLYMORPHIC */
276 }
277 
278 // CHECK-LABEL: @test_vminnmvq_f32(
279 // CHECK-NEXT:  entry:
280 // CHECK-NEXT:    [[TMP0:%.*]] = call float @llvm.arm.mve.minnmv.f32.v4f32(float [[A:%.*]], <4 x float> [[B:%.*]])
281 // CHECK-NEXT:    ret float [[TMP0]]
282 //
test_vminnmvq_f32(float32_t a,float32x4_t b)283 float32_t test_vminnmvq_f32(float32_t a, float32x4_t b) {
284 #ifdef POLYMORPHIC
285   return vminnmvq(a, b);
286 #else  /* POLYMORPHIC */
287   return vminnmvq_f32(a, b);
288 #endif /* POLYMORPHIC */
289 }
290 
291 // CHECK-LABEL: @test_vminnmavq_f16(
292 // CHECK-NEXT:  entry:
293 // CHECK-NEXT:    [[TMP0:%.*]] = call half @llvm.arm.mve.minnmav.f16.v8f16(half [[A:%.*]], <8 x half> [[B:%.*]])
294 // CHECK-NEXT:    ret half [[TMP0]]
295 //
test_vminnmavq_f16(float16_t a,float16x8_t b)296 float16_t test_vminnmavq_f16(float16_t a, float16x8_t b) {
297 #ifdef POLYMORPHIC
298   return vminnmavq(a, b);
299 #else  /* POLYMORPHIC */
300   return vminnmavq_f16(a, b);
301 #endif /* POLYMORPHIC */
302 }
303 
304 // CHECK-LABEL: @test_vminnmavq_f32(
305 // CHECK-NEXT:  entry:
306 // CHECK-NEXT:    [[TMP0:%.*]] = call float @llvm.arm.mve.minnmav.f32.v4f32(float [[A:%.*]], <4 x float> [[B:%.*]])
307 // CHECK-NEXT:    ret float [[TMP0]]
308 //
test_vminnmavq_f32(float32_t a,float32x4_t b)309 float32_t test_vminnmavq_f32(float32_t a, float32x4_t b) {
310 #ifdef POLYMORPHIC
311   return vminnmavq(a, b);
312 #else  /* POLYMORPHIC */
313   return vminnmavq_f32(a, b);
314 #endif /* POLYMORPHIC */
315 }
316 
317 // CHECK-LABEL: @test_vmaxnmvq_f16(
318 // CHECK-NEXT:  entry:
319 // CHECK-NEXT:    [[TMP0:%.*]] = call half @llvm.arm.mve.maxnmv.f16.v8f16(half [[A:%.*]], <8 x half> [[B:%.*]])
320 // CHECK-NEXT:    ret half [[TMP0]]
321 //
test_vmaxnmvq_f16(float16_t a,float16x8_t b)322 float16_t test_vmaxnmvq_f16(float16_t a, float16x8_t b) {
323 #ifdef POLYMORPHIC
324   return vmaxnmvq(a, b);
325 #else  /* POLYMORPHIC */
326   return vmaxnmvq_f16(a, b);
327 #endif /* POLYMORPHIC */
328 }
329 
330 // CHECK-LABEL: @test_vmaxnmvq_f32(
331 // CHECK-NEXT:  entry:
332 // CHECK-NEXT:    [[TMP0:%.*]] = call float @llvm.arm.mve.maxnmv.f32.v4f32(float [[A:%.*]], <4 x float> [[B:%.*]])
333 // CHECK-NEXT:    ret float [[TMP0]]
334 //
test_vmaxnmvq_f32(float32_t a,float32x4_t b)335 float32_t test_vmaxnmvq_f32(float32_t a, float32x4_t b) {
336 #ifdef POLYMORPHIC
337   return vmaxnmvq(a, b);
338 #else  /* POLYMORPHIC */
339   return vmaxnmvq_f32(a, b);
340 #endif /* POLYMORPHIC */
341 }
342 
343 // CHECK-LABEL: @test_vmaxnmavq_f16(
344 // CHECK-NEXT:  entry:
345 // CHECK-NEXT:    [[TMP0:%.*]] = call half @llvm.arm.mve.maxnmav.f16.v8f16(half [[A:%.*]], <8 x half> [[B:%.*]])
346 // CHECK-NEXT:    ret half [[TMP0]]
347 //
test_vmaxnmavq_f16(float16_t a,float16x8_t b)348 float16_t test_vmaxnmavq_f16(float16_t a, float16x8_t b) {
349 #ifdef POLYMORPHIC
350   return vmaxnmavq(a, b);
351 #else  /* POLYMORPHIC */
352   return vmaxnmavq_f16(a, b);
353 #endif /* POLYMORPHIC */
354 }
355 
356 // CHECK-LABEL: @test_vmaxnmavq_f32(
357 // CHECK-NEXT:  entry:
358 // CHECK-NEXT:    [[TMP0:%.*]] = call float @llvm.arm.mve.maxnmav.f32.v4f32(float [[A:%.*]], <4 x float> [[B:%.*]])
359 // CHECK-NEXT:    ret float [[TMP0]]
360 //
test_vmaxnmavq_f32(float32_t a,float32x4_t b)361 float32_t test_vmaxnmavq_f32(float32_t a, float32x4_t b) {
362 #ifdef POLYMORPHIC
363   return vmaxnmavq(a, b);
364 #else  /* POLYMORPHIC */
365   return vmaxnmavq_f32(a, b);
366 #endif /* POLYMORPHIC */
367 }
368 
369 // CHECK-LABEL: @test_vminvq_p_s8(
370 // CHECK-NEXT:  entry:
371 // CHECK-NEXT:    [[TMP0:%.*]] = zext i8 [[A:%.*]] to i32
372 // CHECK-NEXT:    [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
373 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP1]])
374 // CHECK-NEXT:    [[TMP3:%.*]] = call i32 @llvm.arm.mve.minv.predicated.v16i8.v16i1(i32 [[TMP0]], <16 x i8> [[B:%.*]], i32 0, <16 x i1> [[TMP2]])
375 // CHECK-NEXT:    [[TMP4:%.*]] = trunc i32 [[TMP3]] to i8
376 // CHECK-NEXT:    ret i8 [[TMP4]]
377 //
test_vminvq_p_s8(int8_t a,int8x16_t b,mve_pred16_t p)378 int8_t test_vminvq_p_s8(int8_t a, int8x16_t b, mve_pred16_t p) {
379 #ifdef POLYMORPHIC
380   return vminvq_p(a, b, p);
381 #else  /* POLYMORPHIC */
382   return vminvq_p_s8(a, b, p);
383 #endif /* POLYMORPHIC */
384 }
385 
386 // CHECK-LABEL: @test_vminvq_p_s16(
387 // CHECK-NEXT:  entry:
388 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[A:%.*]] to i32
389 // CHECK-NEXT:    [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
390 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
391 // CHECK-NEXT:    [[TMP3:%.*]] = call i32 @llvm.arm.mve.minv.predicated.v8i16.v8i1(i32 [[TMP0]], <8 x i16> [[B:%.*]], i32 0, <8 x i1> [[TMP2]])
392 // CHECK-NEXT:    [[TMP4:%.*]] = trunc i32 [[TMP3]] to i16
393 // CHECK-NEXT:    ret i16 [[TMP4]]
394 //
test_vminvq_p_s16(int16_t a,int16x8_t b,mve_pred16_t p)395 int16_t test_vminvq_p_s16(int16_t a, int16x8_t b, mve_pred16_t p) {
396 #ifdef POLYMORPHIC
397   return vminvq_p(a, b, p);
398 #else  /* POLYMORPHIC */
399   return vminvq_p_s16(a, b, p);
400 #endif /* POLYMORPHIC */
401 }
402 
403 // CHECK-LABEL: @test_vminvq_p_s32(
404 // CHECK-NEXT:  entry:
405 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
406 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
407 // CHECK-NEXT:    [[TMP2:%.*]] = call i32 @llvm.arm.mve.minv.predicated.v4i32.v4i1(i32 [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, <4 x i1> [[TMP1]])
408 // CHECK-NEXT:    ret i32 [[TMP2]]
409 //
test_vminvq_p_s32(int32_t a,int32x4_t b,mve_pred16_t p)410 int32_t test_vminvq_p_s32(int32_t a, int32x4_t b, mve_pred16_t p) {
411 #ifdef POLYMORPHIC
412   return vminvq_p(a, b, p);
413 #else  /* POLYMORPHIC */
414   return vminvq_p_s32(a, b, p);
415 #endif /* POLYMORPHIC */
416 }
417 
418 // CHECK-LABEL: @test_vminvq_p_u8(
419 // CHECK-NEXT:  entry:
420 // CHECK-NEXT:    [[TMP0:%.*]] = zext i8 [[A:%.*]] to i32
421 // CHECK-NEXT:    [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
422 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP1]])
423 // CHECK-NEXT:    [[TMP3:%.*]] = call i32 @llvm.arm.mve.minv.predicated.v16i8.v16i1(i32 [[TMP0]], <16 x i8> [[B:%.*]], i32 1, <16 x i1> [[TMP2]])
424 // CHECK-NEXT:    [[TMP4:%.*]] = trunc i32 [[TMP3]] to i8
425 // CHECK-NEXT:    ret i8 [[TMP4]]
426 //
test_vminvq_p_u8(uint8_t a,uint8x16_t b,mve_pred16_t p)427 uint8_t test_vminvq_p_u8(uint8_t a, uint8x16_t b, mve_pred16_t p) {
428 #ifdef POLYMORPHIC
429   return vminvq_p(a, b, p);
430 #else  /* POLYMORPHIC */
431   return vminvq_p_u8(a, b, p);
432 #endif /* POLYMORPHIC */
433 }
434 
435 // CHECK-LABEL: @test_vminvq_p_u16(
436 // CHECK-NEXT:  entry:
437 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[A:%.*]] to i32
438 // CHECK-NEXT:    [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
439 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
440 // CHECK-NEXT:    [[TMP3:%.*]] = call i32 @llvm.arm.mve.minv.predicated.v8i16.v8i1(i32 [[TMP0]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP2]])
441 // CHECK-NEXT:    [[TMP4:%.*]] = trunc i32 [[TMP3]] to i16
442 // CHECK-NEXT:    ret i16 [[TMP4]]
443 //
test_vminvq_p_u16(uint16_t a,uint16x8_t b,mve_pred16_t p)444 uint16_t test_vminvq_p_u16(uint16_t a, uint16x8_t b, mve_pred16_t p) {
445 #ifdef POLYMORPHIC
446   return vminvq_p(a, b, p);
447 #else  /* POLYMORPHIC */
448   return vminvq_p_u16(a, b, p);
449 #endif /* POLYMORPHIC */
450 }
451 
452 // CHECK-LABEL: @test_vminvq_p_u32(
453 // CHECK-NEXT:  entry:
454 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
455 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
456 // CHECK-NEXT:    [[TMP2:%.*]] = call i32 @llvm.arm.mve.minv.predicated.v4i32.v4i1(i32 [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, <4 x i1> [[TMP1]])
457 // CHECK-NEXT:    ret i32 [[TMP2]]
458 //
test_vminvq_p_u32(uint32_t a,uint32x4_t b,mve_pred16_t p)459 uint32_t test_vminvq_p_u32(uint32_t a, uint32x4_t b, mve_pred16_t p) {
460 #ifdef POLYMORPHIC
461   return vminvq_p(a, b, p);
462 #else  /* POLYMORPHIC */
463   return vminvq_p_u32(a, b, p);
464 #endif /* POLYMORPHIC */
465 }
466 
467 // CHECK-LABEL: @test_vmaxvq_p_s8(
468 // CHECK-NEXT:  entry:
469 // CHECK-NEXT:    [[TMP0:%.*]] = zext i8 [[A:%.*]] to i32
470 // CHECK-NEXT:    [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
471 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP1]])
472 // CHECK-NEXT:    [[TMP3:%.*]] = call i32 @llvm.arm.mve.maxv.predicated.v16i8.v16i1(i32 [[TMP0]], <16 x i8> [[B:%.*]], i32 0, <16 x i1> [[TMP2]])
473 // CHECK-NEXT:    [[TMP4:%.*]] = trunc i32 [[TMP3]] to i8
474 // CHECK-NEXT:    ret i8 [[TMP4]]
475 //
test_vmaxvq_p_s8(int8_t a,int8x16_t b,mve_pred16_t p)476 int8_t test_vmaxvq_p_s8(int8_t a, int8x16_t b, mve_pred16_t p) {
477 #ifdef POLYMORPHIC
478   return vmaxvq_p(a, b, p);
479 #else  /* POLYMORPHIC */
480   return vmaxvq_p_s8(a, b, p);
481 #endif /* POLYMORPHIC */
482 }
483 
484 // CHECK-LABEL: @test_vmaxvq_p_s16(
485 // CHECK-NEXT:  entry:
486 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[A:%.*]] to i32
487 // CHECK-NEXT:    [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
488 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
489 // CHECK-NEXT:    [[TMP3:%.*]] = call i32 @llvm.arm.mve.maxv.predicated.v8i16.v8i1(i32 [[TMP0]], <8 x i16> [[B:%.*]], i32 0, <8 x i1> [[TMP2]])
490 // CHECK-NEXT:    [[TMP4:%.*]] = trunc i32 [[TMP3]] to i16
491 // CHECK-NEXT:    ret i16 [[TMP4]]
492 //
test_vmaxvq_p_s16(int16_t a,int16x8_t b,mve_pred16_t p)493 int16_t test_vmaxvq_p_s16(int16_t a, int16x8_t b, mve_pred16_t p) {
494 #ifdef POLYMORPHIC
495   return vmaxvq_p(a, b, p);
496 #else  /* POLYMORPHIC */
497   return vmaxvq_p_s16(a, b, p);
498 #endif /* POLYMORPHIC */
499 }
500 
501 // CHECK-LABEL: @test_vmaxvq_p_s32(
502 // CHECK-NEXT:  entry:
503 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
504 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
505 // CHECK-NEXT:    [[TMP2:%.*]] = call i32 @llvm.arm.mve.maxv.predicated.v4i32.v4i1(i32 [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, <4 x i1> [[TMP1]])
506 // CHECK-NEXT:    ret i32 [[TMP2]]
507 //
test_vmaxvq_p_s32(int32_t a,int32x4_t b,mve_pred16_t p)508 int32_t test_vmaxvq_p_s32(int32_t a, int32x4_t b, mve_pred16_t p) {
509 #ifdef POLYMORPHIC
510   return vmaxvq_p(a, b, p);
511 #else  /* POLYMORPHIC */
512   return vmaxvq_p_s32(a, b, p);
513 #endif /* POLYMORPHIC */
514 }
515 
516 // CHECK-LABEL: @test_vmaxvq_p_u8(
517 // CHECK-NEXT:  entry:
518 // CHECK-NEXT:    [[TMP0:%.*]] = zext i8 [[A:%.*]] to i32
519 // CHECK-NEXT:    [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
520 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP1]])
521 // CHECK-NEXT:    [[TMP3:%.*]] = call i32 @llvm.arm.mve.maxv.predicated.v16i8.v16i1(i32 [[TMP0]], <16 x i8> [[B:%.*]], i32 1, <16 x i1> [[TMP2]])
522 // CHECK-NEXT:    [[TMP4:%.*]] = trunc i32 [[TMP3]] to i8
523 // CHECK-NEXT:    ret i8 [[TMP4]]
524 //
test_vmaxvq_p_u8(uint8_t a,uint8x16_t b,mve_pred16_t p)525 uint8_t test_vmaxvq_p_u8(uint8_t a, uint8x16_t b, mve_pred16_t p) {
526 #ifdef POLYMORPHIC
527   return vmaxvq_p(a, b, p);
528 #else  /* POLYMORPHIC */
529   return vmaxvq_p_u8(a, b, p);
530 #endif /* POLYMORPHIC */
531 }
532 
533 // CHECK-LABEL: @test_vmaxvq_p_u16(
534 // CHECK-NEXT:  entry:
535 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[A:%.*]] to i32
536 // CHECK-NEXT:    [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
537 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
538 // CHECK-NEXT:    [[TMP3:%.*]] = call i32 @llvm.arm.mve.maxv.predicated.v8i16.v8i1(i32 [[TMP0]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP2]])
539 // CHECK-NEXT:    [[TMP4:%.*]] = trunc i32 [[TMP3]] to i16
540 // CHECK-NEXT:    ret i16 [[TMP4]]
541 //
test_vmaxvq_p_u16(uint16_t a,uint16x8_t b,mve_pred16_t p)542 uint16_t test_vmaxvq_p_u16(uint16_t a, uint16x8_t b, mve_pred16_t p) {
543 #ifdef POLYMORPHIC
544   return vmaxvq_p(a, b, p);
545 #else  /* POLYMORPHIC */
546   return vmaxvq_p_u16(a, b, p);
547 #endif /* POLYMORPHIC */
548 }
549 
550 // CHECK-LABEL: @test_vmaxvq_p_u32(
551 // CHECK-NEXT:  entry:
552 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
553 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
554 // CHECK-NEXT:    [[TMP2:%.*]] = call i32 @llvm.arm.mve.maxv.predicated.v4i32.v4i1(i32 [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, <4 x i1> [[TMP1]])
555 // CHECK-NEXT:    ret i32 [[TMP2]]
556 //
test_vmaxvq_p_u32(uint32_t a,uint32x4_t b,mve_pred16_t p)557 uint32_t test_vmaxvq_p_u32(uint32_t a, uint32x4_t b, mve_pred16_t p) {
558 #ifdef POLYMORPHIC
559   return vmaxvq_p(a, b, p);
560 #else  /* POLYMORPHIC */
561   return vmaxvq_p_u32(a, b, p);
562 #endif /* POLYMORPHIC */
563 }
564 
565 // CHECK-LABEL: @test_vminavq_p_s8(
566 // CHECK-NEXT:  entry:
567 // CHECK-NEXT:    [[TMP0:%.*]] = zext i8 [[A:%.*]] to i32
568 // CHECK-NEXT:    [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
569 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP1]])
570 // CHECK-NEXT:    [[TMP3:%.*]] = call i32 @llvm.arm.mve.minav.predicated.v16i8.v16i1(i32 [[TMP0]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP2]])
571 // CHECK-NEXT:    [[TMP4:%.*]] = trunc i32 [[TMP3]] to i8
572 // CHECK-NEXT:    ret i8 [[TMP4]]
573 //
test_vminavq_p_s8(uint8_t a,int8x16_t b,mve_pred16_t p)574 uint8_t test_vminavq_p_s8(uint8_t a, int8x16_t b, mve_pred16_t p) {
575 #ifdef POLYMORPHIC
576   return vminavq_p(a, b, p);
577 #else  /* POLYMORPHIC */
578   return vminavq_p_s8(a, b, p);
579 #endif /* POLYMORPHIC */
580 }
581 
582 // CHECK-LABEL: @test_vminavq_p_s16(
583 // CHECK-NEXT:  entry:
584 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[A:%.*]] to i32
585 // CHECK-NEXT:    [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
586 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
587 // CHECK-NEXT:    [[TMP3:%.*]] = call i32 @llvm.arm.mve.minav.predicated.v8i16.v8i1(i32 [[TMP0]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP2]])
588 // CHECK-NEXT:    [[TMP4:%.*]] = trunc i32 [[TMP3]] to i16
589 // CHECK-NEXT:    ret i16 [[TMP4]]
590 //
test_vminavq_p_s16(uint16_t a,int16x8_t b,mve_pred16_t p)591 uint16_t test_vminavq_p_s16(uint16_t a, int16x8_t b, mve_pred16_t p) {
592 #ifdef POLYMORPHIC
593   return vminavq_p(a, b, p);
594 #else  /* POLYMORPHIC */
595   return vminavq_p_s16(a, b, p);
596 #endif /* POLYMORPHIC */
597 }
598 
599 // CHECK-LABEL: @test_vminavq_p_s32(
600 // CHECK-NEXT:  entry:
601 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
602 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
603 // CHECK-NEXT:    [[TMP2:%.*]] = call i32 @llvm.arm.mve.minav.predicated.v4i32.v4i1(i32 [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
604 // CHECK-NEXT:    ret i32 [[TMP2]]
605 //
test_vminavq_p_s32(uint32_t a,int32x4_t b,mve_pred16_t p)606 uint32_t test_vminavq_p_s32(uint32_t a, int32x4_t b, mve_pred16_t p) {
607 #ifdef POLYMORPHIC
608   return vminavq_p(a, b, p);
609 #else  /* POLYMORPHIC */
610   return vminavq_p_s32(a, b, p);
611 #endif /* POLYMORPHIC */
612 }
613 
614 // CHECK-LABEL: @test_vmaxavq_p_s8(
615 // CHECK-NEXT:  entry:
616 // CHECK-NEXT:    [[TMP0:%.*]] = zext i8 [[A:%.*]] to i32
617 // CHECK-NEXT:    [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
618 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP1]])
619 // CHECK-NEXT:    [[TMP3:%.*]] = call i32 @llvm.arm.mve.maxav.predicated.v16i8.v16i1(i32 [[TMP0]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP2]])
620 // CHECK-NEXT:    [[TMP4:%.*]] = trunc i32 [[TMP3]] to i8
621 // CHECK-NEXT:    ret i8 [[TMP4]]
622 //
test_vmaxavq_p_s8(uint8_t a,int8x16_t b,mve_pred16_t p)623 uint8_t test_vmaxavq_p_s8(uint8_t a, int8x16_t b, mve_pred16_t p) {
624 #ifdef POLYMORPHIC
625   return vmaxavq_p(a, b, p);
626 #else  /* POLYMORPHIC */
627   return vmaxavq_p_s8(a, b, p);
628 #endif /* POLYMORPHIC */
629 }
630 
631 // CHECK-LABEL: @test_vmaxavq_p_s16(
632 // CHECK-NEXT:  entry:
633 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[A:%.*]] to i32
634 // CHECK-NEXT:    [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
635 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
636 // CHECK-NEXT:    [[TMP3:%.*]] = call i32 @llvm.arm.mve.maxav.predicated.v8i16.v8i1(i32 [[TMP0]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP2]])
637 // CHECK-NEXT:    [[TMP4:%.*]] = trunc i32 [[TMP3]] to i16
638 // CHECK-NEXT:    ret i16 [[TMP4]]
639 //
test_vmaxavq_p_s16(uint16_t a,int16x8_t b,mve_pred16_t p)640 uint16_t test_vmaxavq_p_s16(uint16_t a, int16x8_t b, mve_pred16_t p) {
641 #ifdef POLYMORPHIC
642   return vmaxavq_p(a, b, p);
643 #else  /* POLYMORPHIC */
644   return vmaxavq_p_s16(a, b, p);
645 #endif /* POLYMORPHIC */
646 }
647 
648 // CHECK-LABEL: @test_vmaxavq_p_s32(
649 // CHECK-NEXT:  entry:
650 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
651 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
652 // CHECK-NEXT:    [[TMP2:%.*]] = call i32 @llvm.arm.mve.maxav.predicated.v4i32.v4i1(i32 [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
653 // CHECK-NEXT:    ret i32 [[TMP2]]
654 //
test_vmaxavq_p_s32(uint32_t a,int32x4_t b,mve_pred16_t p)655 uint32_t test_vmaxavq_p_s32(uint32_t a, int32x4_t b, mve_pred16_t p) {
656 #ifdef POLYMORPHIC
657   return vmaxavq_p(a, b, p);
658 #else  /* POLYMORPHIC */
659   return vmaxavq_p_s32(a, b, p);
660 #endif /* POLYMORPHIC */
661 }
662 
663 // CHECK-LABEL: @test_vminnmvq_p_f16(
664 // CHECK-NEXT:  entry:
665 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
666 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
667 // CHECK-NEXT:    [[TMP2:%.*]] = call half @llvm.arm.mve.minnmv.predicated.f16.v8f16.v8i1(half [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]])
668 // CHECK-NEXT:    ret half [[TMP2]]
669 //
test_vminnmvq_p_f16(float16_t a,float16x8_t b,mve_pred16_t p)670 float16_t test_vminnmvq_p_f16(float16_t a, float16x8_t b, mve_pred16_t p) {
671 #ifdef POLYMORPHIC
672   return vminnmvq_p(a, b, p);
673 #else  /* POLYMORPHIC */
674   return vminnmvq_p_f16(a, b, p);
675 #endif /* POLYMORPHIC */
676 }
677 
678 // CHECK-LABEL: @test_vminnmvq_p_f32(
679 // CHECK-NEXT:  entry:
680 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
681 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
682 // CHECK-NEXT:    [[TMP2:%.*]] = call float @llvm.arm.mve.minnmv.predicated.f32.v4f32.v4i1(float [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]])
683 // CHECK-NEXT:    ret float [[TMP2]]
684 //
test_vminnmvq_p_f32(float32_t a,float32x4_t b,mve_pred16_t p)685 float32_t test_vminnmvq_p_f32(float32_t a, float32x4_t b, mve_pred16_t p) {
686 #ifdef POLYMORPHIC
687   return vminnmvq_p(a, b, p);
688 #else  /* POLYMORPHIC */
689   return vminnmvq_p_f32(a, b, p);
690 #endif /* POLYMORPHIC */
691 }
692 
693 // CHECK-LABEL: @test_vminnmavq_p_f16(
694 // CHECK-NEXT:  entry:
695 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
696 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
697 // CHECK-NEXT:    [[TMP2:%.*]] = call half @llvm.arm.mve.minnmav.predicated.f16.v8f16.v8i1(half [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]])
698 // CHECK-NEXT:    ret half [[TMP2]]
699 //
test_vminnmavq_p_f16(float16_t a,float16x8_t b,mve_pred16_t p)700 float16_t test_vminnmavq_p_f16(float16_t a, float16x8_t b, mve_pred16_t p) {
701 #ifdef POLYMORPHIC
702   return vminnmavq_p(a, b, p);
703 #else  /* POLYMORPHIC */
704   return vminnmavq_p_f16(a, b, p);
705 #endif /* POLYMORPHIC */
706 }
707 
708 // CHECK-LABEL: @test_vminnmavq_p_f32(
709 // CHECK-NEXT:  entry:
710 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
711 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
712 // CHECK-NEXT:    [[TMP2:%.*]] = call float @llvm.arm.mve.minnmav.predicated.f32.v4f32.v4i1(float [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]])
713 // CHECK-NEXT:    ret float [[TMP2]]
714 //
test_vminnmavq_p_f32(float32_t a,float32x4_t b,mve_pred16_t p)715 float32_t test_vminnmavq_p_f32(float32_t a, float32x4_t b, mve_pred16_t p) {
716 #ifdef POLYMORPHIC
717   return vminnmavq_p(a, b, p);
718 #else  /* POLYMORPHIC */
719   return vminnmavq_p_f32(a, b, p);
720 #endif /* POLYMORPHIC */
721 }
722 
723 // CHECK-LABEL: @test_vmaxnmvq_p_f16(
724 // CHECK-NEXT:  entry:
725 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
726 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
727 // CHECK-NEXT:    [[TMP2:%.*]] = call half @llvm.arm.mve.maxnmv.predicated.f16.v8f16.v8i1(half [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]])
728 // CHECK-NEXT:    ret half [[TMP2]]
729 //
test_vmaxnmvq_p_f16(float16_t a,float16x8_t b,mve_pred16_t p)730 float16_t test_vmaxnmvq_p_f16(float16_t a, float16x8_t b, mve_pred16_t p) {
731 #ifdef POLYMORPHIC
732   return vmaxnmvq_p(a, b, p);
733 #else  /* POLYMORPHIC */
734   return vmaxnmvq_p_f16(a, b, p);
735 #endif /* POLYMORPHIC */
736 }
737 
738 // CHECK-LABEL: @test_vmaxnmvq_p_f32(
739 // CHECK-NEXT:  entry:
740 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
741 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
742 // CHECK-NEXT:    [[TMP2:%.*]] = call float @llvm.arm.mve.maxnmv.predicated.f32.v4f32.v4i1(float [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]])
743 // CHECK-NEXT:    ret float [[TMP2]]
744 //
test_vmaxnmvq_p_f32(float32_t a,float32x4_t b,mve_pred16_t p)745 float32_t test_vmaxnmvq_p_f32(float32_t a, float32x4_t b, mve_pred16_t p) {
746 #ifdef POLYMORPHIC
747   return vmaxnmvq_p(a, b, p);
748 #else  /* POLYMORPHIC */
749   return vmaxnmvq_p_f32(a, b, p);
750 #endif /* POLYMORPHIC */
751 }
752 
753 // CHECK-LABEL: @test_vmaxnmavq_p_f16(
754 // CHECK-NEXT:  entry:
755 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
756 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
757 // CHECK-NEXT:    [[TMP2:%.*]] = call half @llvm.arm.mve.maxnmav.predicated.f16.v8f16.v8i1(half [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]])
758 // CHECK-NEXT:    ret half [[TMP2]]
759 //
test_vmaxnmavq_p_f16(float16_t a,float16x8_t b,mve_pred16_t p)760 float16_t test_vmaxnmavq_p_f16(float16_t a, float16x8_t b, mve_pred16_t p) {
761 #ifdef POLYMORPHIC
762   return vmaxnmavq_p(a, b, p);
763 #else  /* POLYMORPHIC */
764   return vmaxnmavq_p_f16(a, b, p);
765 #endif /* POLYMORPHIC */
766 }
767 
768 // CHECK-LABEL: @test_vmaxnmavq_p_f32(
769 // CHECK-NEXT:  entry:
770 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
771 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
772 // CHECK-NEXT:    [[TMP2:%.*]] = call float @llvm.arm.mve.maxnmav.predicated.f32.v4f32.v4i1(float [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]])
773 // CHECK-NEXT:    ret float [[TMP2]]
774 //
test_vmaxnmavq_p_f32(float32_t a,float32x4_t b,mve_pred16_t p)775 float32_t test_vmaxnmavq_p_f32(float32_t a, float32x4_t b, mve_pred16_t p) {
776 #ifdef POLYMORPHIC
777   return vmaxnmavq_p(a, b, p);
778 #else  /* POLYMORPHIC */
779   return vmaxnmavq_p_f32(a, b, p);
780 #endif /* POLYMORPHIC */
781 }
782