1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main-none-none-eabi -mattr=+mve.fp %s -o - | FileCheck %s
4 define arm_aapcs_vfpcc zeroext i8 @uminv16i8(<16 x i8> %vec, i8 zeroext %min) {
5 ; CHECK-LABEL: uminv16i8:
7 ; CHECK-NEXT: vminv.u8 r0, q0
8 ; CHECK-NEXT: uxtb r0, r0
10 %x = call i8 @llvm.vector.reduce.umin.v16i8(<16 x i8> %vec)
11 %cmp = icmp ult i8 %x, %min
12 %1 = select i1 %cmp, i8 %x, i8 %min
16 define arm_aapcs_vfpcc zeroext i16 @uminv8i16(<8 x i16> %vec, i16 zeroext %min) {
17 ; CHECK-LABEL: uminv8i16:
19 ; CHECK-NEXT: vminv.u16 r0, q0
20 ; CHECK-NEXT: uxth r0, r0
22 %x = call i16 @llvm.vector.reduce.umin.v8i16(<8 x i16> %vec)
23 %cmp = icmp ult i16 %x, %min
24 %1 = select i1 %cmp, i16 %x, i16 %min
28 define arm_aapcs_vfpcc i32 @uminv4i32(<4 x i32> %vec, i32 %min) {
29 ; CHECK-LABEL: uminv4i32:
31 ; CHECK-NEXT: vminv.u32 r0, q0
33 %x = call i32 @llvm.vector.reduce.umin.v4i32(<4 x i32> %vec)
34 %cmp = icmp ult i32 %x, %min
35 %1 = select i1 %cmp, i32 %x, i32 %min
39 define arm_aapcs_vfpcc signext i8 @sminv16i8(<16 x i8> %vec, i8 signext %min) {
40 ; CHECK-LABEL: sminv16i8:
42 ; CHECK-NEXT: vminv.s8 r0, q0
43 ; CHECK-NEXT: sxtb r0, r0
45 %x = call i8 @llvm.vector.reduce.smin.v16i8(<16 x i8> %vec)
46 %cmp = icmp slt i8 %x, %min
47 %1 = select i1 %cmp, i8 %x, i8 %min
51 define arm_aapcs_vfpcc signext i16 @sminv8i16(<8 x i16> %vec, i16 signext %min) {
52 ; CHECK-LABEL: sminv8i16:
54 ; CHECK-NEXT: vminv.s16 r0, q0
55 ; CHECK-NEXT: sxth r0, r0
57 %x = call i16 @llvm.vector.reduce.smin.v8i16(<8 x i16> %vec)
58 %cmp = icmp slt i16 %x, %min
59 %1 = select i1 %cmp, i16 %x, i16 %min
63 define arm_aapcs_vfpcc i32 @sminv4i32(<4 x i32> %vec, i32 %min) {
64 ; CHECK-LABEL: sminv4i32:
66 ; CHECK-NEXT: vminv.s32 r0, q0
68 %x = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %vec)
69 %cmp = icmp slt i32 %x, %min
70 %1 = select i1 %cmp, i32 %x, i32 %min
74 define arm_aapcs_vfpcc zeroext i8 @umaxv16i8(<16 x i8> %vec, i8 zeroext %max) {
75 ; CHECK-LABEL: umaxv16i8:
77 ; CHECK-NEXT: vmaxv.u8 r0, q0
78 ; CHECK-NEXT: uxtb r0, r0
80 %x = call i8 @llvm.vector.reduce.umax.v16i8(<16 x i8> %vec)
81 %cmp = icmp ugt i8 %x, %max
82 %1 = select i1 %cmp, i8 %x, i8 %max
86 define arm_aapcs_vfpcc zeroext i16 @umaxv8i16(<8 x i16> %vec, i16 zeroext %max) {
87 ; CHECK-LABEL: umaxv8i16:
89 ; CHECK-NEXT: vmaxv.u16 r0, q0
90 ; CHECK-NEXT: uxth r0, r0
92 %x = call i16 @llvm.vector.reduce.umax.v8i16(<8 x i16> %vec)
93 %cmp = icmp ugt i16 %x, %max
94 %1 = select i1 %cmp, i16 %x, i16 %max
98 define arm_aapcs_vfpcc i32 @umaxv4i32(<4 x i32> %vec, i32 %max) {
99 ; CHECK-LABEL: umaxv4i32:
101 ; CHECK-NEXT: vmaxv.u32 r0, q0
103 %x = call i32 @llvm.vector.reduce.umax.v4i32(<4 x i32> %vec)
104 %cmp = icmp ugt i32 %x, %max
105 %1 = select i1 %cmp, i32 %x, i32 %max
109 define arm_aapcs_vfpcc signext i8 @smaxv16i8(<16 x i8> %vec, i8 signext %max) {
110 ; CHECK-LABEL: smaxv16i8:
112 ; CHECK-NEXT: vmaxv.s8 r0, q0
113 ; CHECK-NEXT: sxtb r0, r0
115 %x = call i8 @llvm.vector.reduce.smax.v16i8(<16 x i8> %vec)
116 %cmp = icmp sgt i8 %x, %max
117 %1 = select i1 %cmp, i8 %x, i8 %max
121 define arm_aapcs_vfpcc signext i16 @smaxv8i16(<8 x i16> %vec, i16 signext %max) {
122 ; CHECK-LABEL: smaxv8i16:
124 ; CHECK-NEXT: vmaxv.s16 r0, q0
125 ; CHECK-NEXT: sxth r0, r0
127 %x = call i16 @llvm.vector.reduce.smax.v8i16(<8 x i16> %vec)
128 %cmp = icmp sgt i16 %x, %max
129 %1 = select i1 %cmp, i16 %x, i16 %max
133 define arm_aapcs_vfpcc i32 @smaxv4i32(<4 x i32> %vec, i32 %max) {
134 ; CHECK-LABEL: smaxv4i32:
136 ; CHECK-NEXT: vmaxv.s32 r0, q0
138 %x = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %vec)
139 %cmp = icmp sgt i32 %x, %max
140 %1 = select i1 %cmp, i32 %x, i32 %max
144 define arm_aapcs_vfpcc zeroext i8 @commute_uminv16i8(<16 x i8> %vec, i8 zeroext %min) {
145 ; CHECK-LABEL: commute_uminv16i8:
147 ; CHECK-NEXT: vminv.u8 r0, q0
148 ; CHECK-NEXT: uxtb r0, r0
150 %x = call i8 @llvm.vector.reduce.umin.v16i8(<16 x i8> %vec)
151 %cmp = icmp ult i8 %min, %x
152 %1 = select i1 %cmp, i8 %min, i8 %x
156 define arm_aapcs_vfpcc zeroext i16 @commute_uminv8i16(<8 x i16> %vec, i16 zeroext %min) {
157 ; CHECK-LABEL: commute_uminv8i16:
159 ; CHECK-NEXT: vminv.u16 r0, q0
160 ; CHECK-NEXT: uxth r0, r0
162 %x = call i16 @llvm.vector.reduce.umin.v8i16(<8 x i16> %vec)
163 %cmp = icmp ult i16 %min, %x
164 %1 = select i1 %cmp, i16 %min, i16 %x
168 define arm_aapcs_vfpcc i32 @commute_uminv4i32(<4 x i32> %vec, i32 %min) {
169 ; CHECK-LABEL: commute_uminv4i32:
171 ; CHECK-NEXT: vminv.u32 r0, q0
173 %x = call i32 @llvm.vector.reduce.umin.v4i32(<4 x i32> %vec)
174 %cmp = icmp ult i32 %min, %x
175 %1 = select i1 %cmp, i32 %min, i32 %x
179 define arm_aapcs_vfpcc signext i8 @commute_sminv16i8(<16 x i8> %vec, i8 signext %min) {
180 ; CHECK-LABEL: commute_sminv16i8:
182 ; CHECK-NEXT: vminv.s8 r0, q0
183 ; CHECK-NEXT: sxtb r0, r0
185 %x = call i8 @llvm.vector.reduce.smin.v16i8(<16 x i8> %vec)
186 %cmp = icmp slt i8 %min, %x
187 %1 = select i1 %cmp, i8 %min, i8 %x
191 define arm_aapcs_vfpcc signext i16 @commute_sminv8i16(<8 x i16> %vec, i16 signext %min) {
192 ; CHECK-LABEL: commute_sminv8i16:
194 ; CHECK-NEXT: vminv.s16 r0, q0
195 ; CHECK-NEXT: sxth r0, r0
197 %x = call i16 @llvm.vector.reduce.smin.v8i16(<8 x i16> %vec)
198 %cmp = icmp slt i16 %min, %x
199 %1 = select i1 %cmp, i16 %min, i16 %x
203 define arm_aapcs_vfpcc i32 @commute_sminv4i32(<4 x i32> %vec, i32 %min) {
204 ; CHECK-LABEL: commute_sminv4i32:
206 ; CHECK-NEXT: vminv.s32 r0, q0
208 %x = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %vec)
209 %cmp = icmp slt i32 %min, %x
210 %1 = select i1 %cmp, i32 %min, i32 %x
214 define arm_aapcs_vfpcc zeroext i8 @commute_umaxv16i8(<16 x i8> %vec, i8 zeroext %max) {
215 ; CHECK-LABEL: commute_umaxv16i8:
217 ; CHECK-NEXT: vmaxv.u8 r0, q0
218 ; CHECK-NEXT: uxtb r0, r0
220 %x = call i8 @llvm.vector.reduce.umax.v16i8(<16 x i8> %vec)
221 %cmp = icmp ugt i8 %max, %x
222 %1 = select i1 %cmp, i8 %max, i8 %x
226 define arm_aapcs_vfpcc zeroext i16 @commute_umaxv8i16(<8 x i16> %vec, i16 zeroext %max) {
227 ; CHECK-LABEL: commute_umaxv8i16:
229 ; CHECK-NEXT: vmaxv.u16 r0, q0
230 ; CHECK-NEXT: uxth r0, r0
232 %x = call i16 @llvm.vector.reduce.umax.v8i16(<8 x i16> %vec)
233 %cmp = icmp ugt i16 %max, %x
234 %1 = select i1 %cmp, i16 %max, i16 %x
238 define arm_aapcs_vfpcc i32 @commute_umaxv4i32(<4 x i32> %vec, i32 %max) {
239 ; CHECK-LABEL: commute_umaxv4i32:
241 ; CHECK-NEXT: vmaxv.u32 r0, q0
243 %x = call i32 @llvm.vector.reduce.umax.v4i32(<4 x i32> %vec)
244 %cmp = icmp ugt i32 %max, %x
245 %1 = select i1 %cmp, i32 %max, i32 %x
249 define arm_aapcs_vfpcc signext i8 @commute_smaxv16i8(<16 x i8> %vec, i8 signext %max) {
250 ; CHECK-LABEL: commute_smaxv16i8:
252 ; CHECK-NEXT: vmaxv.s8 r0, q0
253 ; CHECK-NEXT: sxtb r0, r0
255 %x = call i8 @llvm.vector.reduce.smax.v16i8(<16 x i8> %vec)
256 %cmp = icmp sgt i8 %max, %x
257 %1 = select i1 %cmp, i8 %max, i8 %x
261 define arm_aapcs_vfpcc signext i16 @commute_smaxv8i16(<8 x i16> %vec, i16 signext %max) {
262 ; CHECK-LABEL: commute_smaxv8i16:
264 ; CHECK-NEXT: vmaxv.s16 r0, q0
265 ; CHECK-NEXT: sxth r0, r0
267 %x = call i16 @llvm.vector.reduce.smax.v8i16(<8 x i16> %vec)
268 %cmp = icmp sgt i16 %max, %x
269 %1 = select i1 %cmp, i16 %max, i16 %x
273 define arm_aapcs_vfpcc i32 @commute_smaxv4i32(<4 x i32> %vec, i32 %max) {
274 ; CHECK-LABEL: commute_smaxv4i32:
276 ; CHECK-NEXT: vmaxv.s32 r0, q0
278 %x = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %vec)
279 %cmp = icmp sgt i32 %max, %x
280 %1 = select i1 %cmp, i32 %max, i32 %x
284 define arm_aapcs_vfpcc signext i8 @mismatch_smaxv16i8(<16 x i8> %vec, i8 signext %max) {
285 ; CHECK-LABEL: mismatch_smaxv16i8:
287 ; CHECK-NEXT: mvn r1, #127
288 ; CHECK-NEXT: vmaxv.s8 r1, q0
289 ; CHECK-NEXT: sxtb r2, r1
290 ; CHECK-NEXT: cmp r2, r0
291 ; CHECK-NEXT: csel r0, r0, r1, gt
292 ; CHECK-NEXT: sxtb r0, r0
294 %x = call i8 @llvm.vector.reduce.smax.v16i8(<16 x i8> %vec)
295 %cmp = icmp sgt i8 %x, %max
296 %1 = select i1 %cmp, i8 %max, i8 %x
300 define arm_aapcs_vfpcc signext i8 @mismatch2_smaxv16i8(<16 x i8> %vec, i8 signext %max) {
301 ; CHECK-LABEL: mismatch2_smaxv16i8:
303 ; CHECK-NEXT: mvn r1, #127
304 ; CHECK-NEXT: vmaxv.s8 r1, q0
305 ; CHECK-NEXT: sxtb r2, r1
306 ; CHECK-NEXT: cmp r0, r2
307 ; CHECK-NEXT: csel r0, r1, r0, gt
308 ; CHECK-NEXT: sxtb r0, r0
310 %x = call i8 @llvm.vector.reduce.smax.v16i8(<16 x i8> %vec)
311 %cmp = icmp sgt i8 %max, %x
312 %1 = select i1 %cmp, i8 %x, i8 %max
316 define arm_aapcs_vfpcc zeroext i8 @inverted_uminv16i8(<16 x i8> %vec, i8 zeroext %min) {
317 ; CHECK-LABEL: inverted_uminv16i8:
319 ; CHECK-NEXT: vminv.u8 r0, q0
320 ; CHECK-NEXT: uxtb r0, r0
322 %x = call i8 @llvm.vector.reduce.umin.v16i8(<16 x i8> %vec)
323 %cmp = icmp ugt i8 %x, %min
324 %1 = select i1 %cmp, i8 %min, i8 %x
328 define arm_aapcs_vfpcc zeroext i16 @inverted_uminv8i16(<8 x i16> %vec, i16 zeroext %min) {
329 ; CHECK-LABEL: inverted_uminv8i16:
331 ; CHECK-NEXT: vminv.u16 r0, q0
332 ; CHECK-NEXT: uxth r0, r0
334 %x = call i16 @llvm.vector.reduce.umin.v8i16(<8 x i16> %vec)
335 %cmp = icmp ugt i16 %x, %min
336 %1 = select i1 %cmp, i16 %min, i16 %x
340 define arm_aapcs_vfpcc i32 @inverted_uminv4i32(<4 x i32> %vec, i32 %min) {
341 ; CHECK-LABEL: inverted_uminv4i32:
343 ; CHECK-NEXT: vminv.u32 r0, q0
345 %x = call i32 @llvm.vector.reduce.umin.v4i32(<4 x i32> %vec)
346 %cmp = icmp ugt i32 %x, %min
347 %1 = select i1 %cmp, i32 %min, i32 %x
351 define arm_aapcs_vfpcc signext i8 @inverted_sminv16i8(<16 x i8> %vec, i8 signext %min) {
352 ; CHECK-LABEL: inverted_sminv16i8:
354 ; CHECK-NEXT: vminv.s8 r0, q0
355 ; CHECK-NEXT: sxtb r0, r0
357 %x = call i8 @llvm.vector.reduce.smin.v16i8(<16 x i8> %vec)
358 %cmp = icmp sgt i8 %x, %min
359 %1 = select i1 %cmp, i8 %min, i8 %x
363 define arm_aapcs_vfpcc signext i16 @inverted_sminv8i16(<8 x i16> %vec, i16 signext %min) {
364 ; CHECK-LABEL: inverted_sminv8i16:
366 ; CHECK-NEXT: vminv.s16 r0, q0
367 ; CHECK-NEXT: sxth r0, r0
369 %x = call i16 @llvm.vector.reduce.smin.v8i16(<8 x i16> %vec)
370 %cmp = icmp sgt i16 %x, %min
371 %1 = select i1 %cmp, i16 %min, i16 %x
375 define arm_aapcs_vfpcc i32 @inverted_sminv4i32(<4 x i32> %vec, i32 %min) {
376 ; CHECK-LABEL: inverted_sminv4i32:
378 ; CHECK-NEXT: vminv.s32 r0, q0
380 %x = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %vec)
381 %cmp = icmp sgt i32 %x, %min
382 %1 = select i1 %cmp, i32 %min, i32 %x
386 define arm_aapcs_vfpcc zeroext i8 @inverted_umaxv16i8(<16 x i8> %vec, i8 zeroext %max) {
387 ; CHECK-LABEL: inverted_umaxv16i8:
389 ; CHECK-NEXT: vmaxv.u8 r0, q0
390 ; CHECK-NEXT: uxtb r0, r0
392 %x = call i8 @llvm.vector.reduce.umax.v16i8(<16 x i8> %vec)
393 %cmp = icmp ult i8 %x, %max
394 %1 = select i1 %cmp, i8 %max, i8 %x
398 define arm_aapcs_vfpcc zeroext i16 @inverted_umaxv8i16(<8 x i16> %vec, i16 zeroext %max) {
399 ; CHECK-LABEL: inverted_umaxv8i16:
401 ; CHECK-NEXT: vmaxv.u16 r0, q0
402 ; CHECK-NEXT: uxth r0, r0
404 %x = call i16 @llvm.vector.reduce.umax.v8i16(<8 x i16> %vec)
405 %cmp = icmp ult i16 %x, %max
406 %1 = select i1 %cmp, i16 %max, i16 %x
410 define arm_aapcs_vfpcc i32 @inverted_umaxv4i32(<4 x i32> %vec, i32 %max) {
411 ; CHECK-LABEL: inverted_umaxv4i32:
413 ; CHECK-NEXT: vmaxv.u32 r0, q0
415 %x = call i32 @llvm.vector.reduce.umax.v4i32(<4 x i32> %vec)
416 %cmp = icmp ult i32 %x, %max
417 %1 = select i1 %cmp, i32 %max, i32 %x
421 define arm_aapcs_vfpcc signext i8 @inverted_smaxv16i8(<16 x i8> %vec, i8 signext %max) {
422 ; CHECK-LABEL: inverted_smaxv16i8:
424 ; CHECK-NEXT: vmaxv.s8 r0, q0
425 ; CHECK-NEXT: sxtb r0, r0
427 %x = call i8 @llvm.vector.reduce.smax.v16i8(<16 x i8> %vec)
428 %cmp = icmp slt i8 %x, %max
429 %1 = select i1 %cmp, i8 %max, i8 %x
433 define arm_aapcs_vfpcc signext i16 @inverted_smaxv8i16(<8 x i16> %vec, i16 signext %max) {
434 ; CHECK-LABEL: inverted_smaxv8i16:
436 ; CHECK-NEXT: vmaxv.s16 r0, q0
437 ; CHECK-NEXT: sxth r0, r0
439 %x = call i16 @llvm.vector.reduce.smax.v8i16(<8 x i16> %vec)
440 %cmp = icmp slt i16 %x, %max
441 %1 = select i1 %cmp, i16 %max, i16 %x
445 define arm_aapcs_vfpcc i32 @inverted_smaxv4i32(<4 x i32> %vec, i32 %max) {
446 ; CHECK-LABEL: inverted_smaxv4i32:
448 ; CHECK-NEXT: vmaxv.s32 r0, q0
450 %x = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %vec)
451 %cmp = icmp slt i32 %x, %max
452 %1 = select i1 %cmp, i32 %max, i32 %x
456 define arm_aapcs_vfpcc signext i16 @trunc_and_sext(<8 x i16> %vec, i32 %max) #1 {
457 ; CHECK-LABEL: trunc_and_sext:
459 ; CHECK-NEXT: movw r1, #32768
460 ; CHECK-NEXT: movt r1, #65535
461 ; CHECK-NEXT: vmaxv.s16 r1, q0
462 ; CHECK-NEXT: sxth r2, r1
463 ; CHECK-NEXT: cmp r0, r2
464 ; CHECK-NEXT: csel r0, r0, r1, gt
465 ; CHECK-NEXT: sxth r0, r0
467 %x = call i16 @llvm.vector.reduce.smax.v8i16(<8 x i16> %vec)
468 %xs = sext i16 %x to i32
469 %cmp = icmp sgt i32 %max, %xs
470 %mt = trunc i32 %max to i16
471 %1 = select i1 %cmp, i16 %mt, i16 %x
475 define arm_aapcs_vfpcc signext i16 @trunc_and_zext(<8 x i16> %vec, i32 %max) #1 {
476 ; CHECK-LABEL: trunc_and_zext:
478 ; CHECK-NEXT: movs r1, #0
479 ; CHECK-NEXT: vmaxv.u16 r1, q0
480 ; CHECK-NEXT: uxth r2, r1
481 ; CHECK-NEXT: cmp r0, r2
482 ; CHECK-NEXT: csel r0, r0, r1, gt
483 ; CHECK-NEXT: sxth r0, r0
485 %x = call i16 @llvm.vector.reduce.umax.v8i16(<8 x i16> %vec)
486 %xs = zext i16 %x to i32
487 %cmp = icmp sgt i32 %max, %xs
488 %mt = trunc i32 %max to i16
489 %1 = select i1 %cmp, i16 %mt, i16 %x
493 define arm_aapcs_vfpcc i64 @uminv2i64(<2 x i64> %vec, i64 %min) {
494 ; CHECK-LABEL: uminv2i64:
496 ; CHECK-NEXT: .save {r4, lr}
497 ; CHECK-NEXT: push {r4, lr}
498 ; CHECK-NEXT: vmov r12, lr, d1
499 ; CHECK-NEXT: vmov r2, r3, d0
500 ; CHECK-NEXT: subs.w r4, r2, r12
501 ; CHECK-NEXT: sbcs.w r4, r3, lr
502 ; CHECK-NEXT: cset r4, lo
503 ; CHECK-NEXT: cmp r4, #0
504 ; CHECK-NEXT: csel r2, r2, r12, ne
505 ; CHECK-NEXT: csel r3, r3, lr, ne
506 ; CHECK-NEXT: subs r4, r2, r0
507 ; CHECK-NEXT: sbcs.w r4, r3, r1
508 ; CHECK-NEXT: cset r4, lo
509 ; CHECK-NEXT: cmp r4, #0
510 ; CHECK-NEXT: csel r0, r2, r0, ne
511 ; CHECK-NEXT: csel r1, r3, r1, ne
512 ; CHECK-NEXT: pop {r4, pc}
513 %x = call i64 @llvm.vector.reduce.umin.v2i64(<2 x i64> %vec)
514 %cmp = icmp ult i64 %x, %min
515 %1 = select i1 %cmp, i64 %x, i64 %min
519 define arm_aapcs_vfpcc i64 @sminv2i64(<2 x i64> %vec, i64 %min) {
520 ; CHECK-LABEL: sminv2i64:
522 ; CHECK-NEXT: .save {r4, lr}
523 ; CHECK-NEXT: push {r4, lr}
524 ; CHECK-NEXT: vmov r12, lr, d1
525 ; CHECK-NEXT: vmov r2, r3, d0
526 ; CHECK-NEXT: subs.w r4, r2, r12
527 ; CHECK-NEXT: sbcs.w r4, r3, lr
528 ; CHECK-NEXT: cset r4, lt
529 ; CHECK-NEXT: cmp r4, #0
530 ; CHECK-NEXT: csel r2, r2, r12, ne
531 ; CHECK-NEXT: csel r3, r3, lr, ne
532 ; CHECK-NEXT: subs r4, r2, r0
533 ; CHECK-NEXT: sbcs.w r4, r3, r1
534 ; CHECK-NEXT: cset r4, lt
535 ; CHECK-NEXT: cmp r4, #0
536 ; CHECK-NEXT: csel r0, r2, r0, ne
537 ; CHECK-NEXT: csel r1, r3, r1, ne
538 ; CHECK-NEXT: pop {r4, pc}
539 %x = call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %vec)
540 %cmp = icmp slt i64 %x, %min
541 %1 = select i1 %cmp, i64 %x, i64 %min
545 define arm_aapcs_vfpcc i64 @umaxv2i64(<2 x i64> %vec, i64 %max) {
546 ; CHECK-LABEL: umaxv2i64:
548 ; CHECK-NEXT: .save {r4, lr}
549 ; CHECK-NEXT: push {r4, lr}
550 ; CHECK-NEXT: vmov r12, lr, d0
551 ; CHECK-NEXT: vmov r2, r3, d1
552 ; CHECK-NEXT: subs.w r4, r2, r12
553 ; CHECK-NEXT: sbcs.w r4, r3, lr
554 ; CHECK-NEXT: cset r4, lo
555 ; CHECK-NEXT: cmp r4, #0
556 ; CHECK-NEXT: csel r2, r12, r2, ne
557 ; CHECK-NEXT: csel r3, lr, r3, ne
558 ; CHECK-NEXT: subs r4, r0, r2
559 ; CHECK-NEXT: sbcs.w r4, r1, r3
560 ; CHECK-NEXT: cset r4, lo
561 ; CHECK-NEXT: cmp r4, #0
562 ; CHECK-NEXT: csel r0, r2, r0, ne
563 ; CHECK-NEXT: csel r1, r3, r1, ne
564 ; CHECK-NEXT: pop {r4, pc}
565 %x = call i64 @llvm.vector.reduce.umax.v2i64(<2 x i64> %vec)
566 %cmp = icmp ugt i64 %x, %max
567 %1 = select i1 %cmp, i64 %x, i64 %max
571 define arm_aapcs_vfpcc i64 @smaxv2i64(<2 x i64> %vec, i64 %max) {
572 ; CHECK-LABEL: smaxv2i64:
574 ; CHECK-NEXT: .save {r4, lr}
575 ; CHECK-NEXT: push {r4, lr}
576 ; CHECK-NEXT: vmov r12, lr, d0
577 ; CHECK-NEXT: vmov r2, r3, d1
578 ; CHECK-NEXT: subs.w r4, r2, r12
579 ; CHECK-NEXT: sbcs.w r4, r3, lr
580 ; CHECK-NEXT: cset r4, lt
581 ; CHECK-NEXT: cmp r4, #0
582 ; CHECK-NEXT: csel r2, r12, r2, ne
583 ; CHECK-NEXT: csel r3, lr, r3, ne
584 ; CHECK-NEXT: subs r4, r0, r2
585 ; CHECK-NEXT: sbcs.w r4, r1, r3
586 ; CHECK-NEXT: cset r4, lt
587 ; CHECK-NEXT: cmp r4, #0
588 ; CHECK-NEXT: csel r0, r2, r0, ne
589 ; CHECK-NEXT: csel r1, r3, r1, ne
590 ; CHECK-NEXT: pop {r4, pc}
591 %x = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %vec)
592 %cmp = icmp sgt i64 %x, %max
593 %1 = select i1 %cmp, i64 %x, i64 %max
597 declare i8 @llvm.vector.reduce.umin.v16i8(<16 x i8>)
599 declare i16 @llvm.vector.reduce.umin.v8i16(<8 x i16>)
601 declare i32 @llvm.vector.reduce.umin.v4i32(<4 x i32>)
603 declare i64 @llvm.vector.reduce.umin.v2i64(<2 x i64>)
605 declare i8 @llvm.vector.reduce.smin.v16i8(<16 x i8>)
607 declare i16 @llvm.vector.reduce.smin.v8i16(<8 x i16>)
609 declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>)
611 declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>)
613 declare i8 @llvm.vector.reduce.umax.v16i8(<16 x i8>)
615 declare i16 @llvm.vector.reduce.umax.v8i16(<8 x i16>)
617 declare i32 @llvm.vector.reduce.umax.v4i32(<4 x i32>)
619 declare i64 @llvm.vector.reduce.umax.v2i64(<2 x i64>)
621 declare i8 @llvm.vector.reduce.smax.v16i8(<16 x i8>)
623 declare i16 @llvm.vector.reduce.smax.v8i16(<8 x i16>)
625 declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>)
627 declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>)