1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mattr=+sve -force-streaming-compatible-sve < %s | FileCheck %s
4 target triple = "aarch64-unknown-linux-gnu"
10 define i8 @uaddv_v8i8(<8 x i8> %a) {
11 ; CHECK-LABEL: uaddv_v8i8:
13 ; CHECK-NEXT: ptrue p0.b, vl8
14 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
15 ; CHECK-NEXT: uaddv d0, p0, z0.b
16 ; CHECK-NEXT: fmov x0, d0
17 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
19 %res = call i8 @llvm.vector.reduce.add.v8i8(<8 x i8> %a)
23 define i8 @uaddv_v16i8(<16 x i8> %a) {
24 ; CHECK-LABEL: uaddv_v16i8:
26 ; CHECK-NEXT: ptrue p0.b, vl16
27 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
28 ; CHECK-NEXT: uaddv d0, p0, z0.b
29 ; CHECK-NEXT: fmov x0, d0
30 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
32 %res = call i8 @llvm.vector.reduce.add.v16i8(<16 x i8> %a)
36 define i8 @uaddv_v32i8(ptr %a) {
37 ; CHECK-LABEL: uaddv_v32i8:
39 ; CHECK-NEXT: ptrue p0.b, vl16
40 ; CHECK-NEXT: ldp q1, q0, [x0]
41 ; CHECK-NEXT: add z0.b, z1.b, z0.b
42 ; CHECK-NEXT: uaddv d0, p0, z0.b
43 ; CHECK-NEXT: fmov x0, d0
44 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
46 %op = load <32 x i8>, ptr %a
47 %res = call i8 @llvm.vector.reduce.add.v32i8(<32 x i8> %op)
51 define i16 @uaddv_v4i16(<4 x i16> %a) {
52 ; CHECK-LABEL: uaddv_v4i16:
54 ; CHECK-NEXT: ptrue p0.h, vl4
55 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
56 ; CHECK-NEXT: uaddv d0, p0, z0.h
57 ; CHECK-NEXT: fmov x0, d0
58 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
60 %res = call i16 @llvm.vector.reduce.add.v4i16(<4 x i16> %a)
64 define i16 @uaddv_v8i16(<8 x i16> %a) {
65 ; CHECK-LABEL: uaddv_v8i16:
67 ; CHECK-NEXT: ptrue p0.h, vl8
68 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
69 ; CHECK-NEXT: uaddv d0, p0, z0.h
70 ; CHECK-NEXT: fmov x0, d0
71 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
73 %res = call i16 @llvm.vector.reduce.add.v8i16(<8 x i16> %a)
77 define i16 @uaddv_v16i16(ptr %a) {
78 ; CHECK-LABEL: uaddv_v16i16:
80 ; CHECK-NEXT: ptrue p0.h, vl8
81 ; CHECK-NEXT: ldp q1, q0, [x0]
82 ; CHECK-NEXT: add z0.h, z1.h, z0.h
83 ; CHECK-NEXT: uaddv d0, p0, z0.h
84 ; CHECK-NEXT: fmov x0, d0
85 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
87 %op = load <16 x i16>, ptr %a
88 %res = call i16 @llvm.vector.reduce.add.v16i16(<16 x i16> %op)
92 define i32 @uaddv_v2i32(<2 x i32> %a) {
93 ; CHECK-LABEL: uaddv_v2i32:
95 ; CHECK-NEXT: ptrue p0.s, vl2
96 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
97 ; CHECK-NEXT: uaddv d0, p0, z0.s
98 ; CHECK-NEXT: fmov x0, d0
99 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
101 %res = call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %a)
105 define i32 @uaddv_v4i32(<4 x i32> %a) {
106 ; CHECK-LABEL: uaddv_v4i32:
108 ; CHECK-NEXT: ptrue p0.s, vl4
109 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
110 ; CHECK-NEXT: uaddv d0, p0, z0.s
111 ; CHECK-NEXT: fmov x0, d0
112 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
114 %res = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %a)
118 define i32 @uaddv_v8i32(ptr %a) {
119 ; CHECK-LABEL: uaddv_v8i32:
121 ; CHECK-NEXT: ptrue p0.s, vl4
122 ; CHECK-NEXT: ldp q1, q0, [x0]
123 ; CHECK-NEXT: add z0.s, z1.s, z0.s
124 ; CHECK-NEXT: uaddv d0, p0, z0.s
125 ; CHECK-NEXT: fmov x0, d0
126 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
128 %op = load <8 x i32>, ptr %a
129 %res = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %op)
133 define i64 @uaddv_v2i64(<2 x i64> %a) {
134 ; CHECK-LABEL: uaddv_v2i64:
136 ; CHECK-NEXT: ptrue p0.d, vl2
137 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
138 ; CHECK-NEXT: uaddv d0, p0, z0.d
139 ; CHECK-NEXT: fmov x0, d0
141 %res = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %a)
145 define i64 @uaddv_v4i64(ptr %a) {
146 ; CHECK-LABEL: uaddv_v4i64:
148 ; CHECK-NEXT: ptrue p0.d, vl2
149 ; CHECK-NEXT: ldp q1, q0, [x0]
150 ; CHECK-NEXT: add z0.d, z1.d, z0.d
151 ; CHECK-NEXT: uaddv d0, p0, z0.d
152 ; CHECK-NEXT: fmov x0, d0
154 %op = load <4 x i64>, ptr %a
155 %res = call i64 @llvm.vector.reduce.add.v4i64(<4 x i64> %op)
163 define i8 @smaxv_v8i8(<8 x i8> %a) {
164 ; CHECK-LABEL: smaxv_v8i8:
166 ; CHECK-NEXT: ptrue p0.b, vl8
167 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
168 ; CHECK-NEXT: smaxv b0, p0, z0.b
169 ; CHECK-NEXT: fmov w0, s0
171 %res = call i8 @llvm.vector.reduce.smax.v8i8(<8 x i8> %a)
175 define i8 @smaxv_v16i8(<16 x i8> %a) {
176 ; CHECK-LABEL: smaxv_v16i8:
178 ; CHECK-NEXT: ptrue p0.b, vl16
179 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
180 ; CHECK-NEXT: smaxv b0, p0, z0.b
181 ; CHECK-NEXT: fmov w0, s0
183 %res = call i8 @llvm.vector.reduce.smax.v16i8(<16 x i8> %a)
187 define i8 @smaxv_v32i8(ptr %a) {
188 ; CHECK-LABEL: smaxv_v32i8:
190 ; CHECK-NEXT: ptrue p0.b, vl16
191 ; CHECK-NEXT: ldp q1, q0, [x0]
192 ; CHECK-NEXT: smax z0.b, p0/m, z0.b, z1.b
193 ; CHECK-NEXT: smaxv b0, p0, z0.b
194 ; CHECK-NEXT: fmov w0, s0
196 %op = load <32 x i8>, ptr %a
197 %res = call i8 @llvm.vector.reduce.smax.v32i8(<32 x i8> %op)
201 define i16 @smaxv_v4i16(<4 x i16> %a) {
202 ; CHECK-LABEL: smaxv_v4i16:
204 ; CHECK-NEXT: ptrue p0.h, vl4
205 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
206 ; CHECK-NEXT: smaxv h0, p0, z0.h
207 ; CHECK-NEXT: fmov w0, s0
209 %res = call i16 @llvm.vector.reduce.smax.v4i16(<4 x i16> %a)
213 define i16 @smaxv_v8i16(<8 x i16> %a) {
214 ; CHECK-LABEL: smaxv_v8i16:
216 ; CHECK-NEXT: ptrue p0.h, vl8
217 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
218 ; CHECK-NEXT: smaxv h0, p0, z0.h
219 ; CHECK-NEXT: fmov w0, s0
221 %res = call i16 @llvm.vector.reduce.smax.v8i16(<8 x i16> %a)
225 define i16 @smaxv_v16i16(ptr %a) {
226 ; CHECK-LABEL: smaxv_v16i16:
228 ; CHECK-NEXT: ptrue p0.h, vl8
229 ; CHECK-NEXT: ldp q1, q0, [x0]
230 ; CHECK-NEXT: smax z0.h, p0/m, z0.h, z1.h
231 ; CHECK-NEXT: smaxv h0, p0, z0.h
232 ; CHECK-NEXT: fmov w0, s0
234 %op = load <16 x i16>, ptr %a
235 %res = call i16 @llvm.vector.reduce.smax.v16i16(<16 x i16> %op)
239 define i32 @smaxv_v2i32(<2 x i32> %a) {
240 ; CHECK-LABEL: smaxv_v2i32:
242 ; CHECK-NEXT: ptrue p0.s, vl2
243 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
244 ; CHECK-NEXT: smaxv s0, p0, z0.s
245 ; CHECK-NEXT: fmov w0, s0
247 %res = call i32 @llvm.vector.reduce.smax.v2i32(<2 x i32> %a)
251 define i32 @smaxv_v4i32(<4 x i32> %a) {
252 ; CHECK-LABEL: smaxv_v4i32:
254 ; CHECK-NEXT: ptrue p0.s, vl4
255 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
256 ; CHECK-NEXT: smaxv s0, p0, z0.s
257 ; CHECK-NEXT: fmov w0, s0
259 %res = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %a)
263 define i32 @smaxv_v8i32(ptr %a) {
264 ; CHECK-LABEL: smaxv_v8i32:
266 ; CHECK-NEXT: ptrue p0.s, vl4
267 ; CHECK-NEXT: ldp q1, q0, [x0]
268 ; CHECK-NEXT: smax z0.s, p0/m, z0.s, z1.s
269 ; CHECK-NEXT: smaxv s0, p0, z0.s
270 ; CHECK-NEXT: fmov w0, s0
272 %op = load <8 x i32>, ptr %a
273 %res = call i32 @llvm.vector.reduce.smax.v8i32(<8 x i32> %op)
277 ; No NEON 64-bit vector SMAXV support. Use SVE.
278 define i64 @smaxv_v2i64(<2 x i64> %a) {
279 ; CHECK-LABEL: smaxv_v2i64:
281 ; CHECK-NEXT: ptrue p0.d, vl2
282 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
283 ; CHECK-NEXT: smaxv d0, p0, z0.d
284 ; CHECK-NEXT: fmov x0, d0
286 %res = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %a)
290 define i64 @smaxv_v4i64(ptr %a) {
291 ; CHECK-LABEL: smaxv_v4i64:
293 ; CHECK-NEXT: ptrue p0.d, vl2
294 ; CHECK-NEXT: ldp q1, q0, [x0]
295 ; CHECK-NEXT: smax z0.d, p0/m, z0.d, z1.d
296 ; CHECK-NEXT: smaxv d0, p0, z0.d
297 ; CHECK-NEXT: fmov x0, d0
299 %op = load <4 x i64>, ptr %a
300 %res = call i64 @llvm.vector.reduce.smax.v4i64(<4 x i64> %op)
308 define i8 @sminv_v8i8(<8 x i8> %a) {
309 ; CHECK-LABEL: sminv_v8i8:
311 ; CHECK-NEXT: ptrue p0.b, vl8
312 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
313 ; CHECK-NEXT: sminv b0, p0, z0.b
314 ; CHECK-NEXT: fmov w0, s0
316 %res = call i8 @llvm.vector.reduce.smin.v8i8(<8 x i8> %a)
320 define i8 @sminv_v16i8(<16 x i8> %a) {
321 ; CHECK-LABEL: sminv_v16i8:
323 ; CHECK-NEXT: ptrue p0.b, vl16
324 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
325 ; CHECK-NEXT: sminv b0, p0, z0.b
326 ; CHECK-NEXT: fmov w0, s0
328 %res = call i8 @llvm.vector.reduce.smin.v16i8(<16 x i8> %a)
332 define i8 @sminv_v32i8(ptr %a) {
333 ; CHECK-LABEL: sminv_v32i8:
335 ; CHECK-NEXT: ptrue p0.b, vl16
336 ; CHECK-NEXT: ldp q1, q0, [x0]
337 ; CHECK-NEXT: smin z0.b, p0/m, z0.b, z1.b
338 ; CHECK-NEXT: sminv b0, p0, z0.b
339 ; CHECK-NEXT: fmov w0, s0
341 %op = load <32 x i8>, ptr %a
342 %res = call i8 @llvm.vector.reduce.smin.v32i8(<32 x i8> %op)
346 define i16 @sminv_v4i16(<4 x i16> %a) {
347 ; CHECK-LABEL: sminv_v4i16:
349 ; CHECK-NEXT: ptrue p0.h, vl4
350 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
351 ; CHECK-NEXT: sminv h0, p0, z0.h
352 ; CHECK-NEXT: fmov w0, s0
354 %res = call i16 @llvm.vector.reduce.smin.v4i16(<4 x i16> %a)
358 define i16 @sminv_v8i16(<8 x i16> %a) {
359 ; CHECK-LABEL: sminv_v8i16:
361 ; CHECK-NEXT: ptrue p0.h, vl8
362 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
363 ; CHECK-NEXT: sminv h0, p0, z0.h
364 ; CHECK-NEXT: fmov w0, s0
366 %res = call i16 @llvm.vector.reduce.smin.v8i16(<8 x i16> %a)
370 define i16 @sminv_v16i16(ptr %a) {
371 ; CHECK-LABEL: sminv_v16i16:
373 ; CHECK-NEXT: ptrue p0.h, vl8
374 ; CHECK-NEXT: ldp q1, q0, [x0]
375 ; CHECK-NEXT: smin z0.h, p0/m, z0.h, z1.h
376 ; CHECK-NEXT: sminv h0, p0, z0.h
377 ; CHECK-NEXT: fmov w0, s0
379 %op = load <16 x i16>, ptr %a
380 %res = call i16 @llvm.vector.reduce.smin.v16i16(<16 x i16> %op)
384 define i32 @sminv_v2i32(<2 x i32> %a) {
385 ; CHECK-LABEL: sminv_v2i32:
387 ; CHECK-NEXT: ptrue p0.s, vl2
388 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
389 ; CHECK-NEXT: sminv s0, p0, z0.s
390 ; CHECK-NEXT: fmov w0, s0
392 %res = call i32 @llvm.vector.reduce.smin.v2i32(<2 x i32> %a)
396 define i32 @sminv_v4i32(<4 x i32> %a) {
397 ; CHECK-LABEL: sminv_v4i32:
399 ; CHECK-NEXT: ptrue p0.s, vl4
400 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
401 ; CHECK-NEXT: sminv s0, p0, z0.s
402 ; CHECK-NEXT: fmov w0, s0
404 %res = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %a)
408 define i32 @sminv_v8i32(ptr %a) {
409 ; CHECK-LABEL: sminv_v8i32:
411 ; CHECK-NEXT: ptrue p0.s, vl4
412 ; CHECK-NEXT: ldp q1, q0, [x0]
413 ; CHECK-NEXT: smin z0.s, p0/m, z0.s, z1.s
414 ; CHECK-NEXT: sminv s0, p0, z0.s
415 ; CHECK-NEXT: fmov w0, s0
417 %op = load <8 x i32>, ptr %a
418 %res = call i32 @llvm.vector.reduce.smin.v8i32(<8 x i32> %op)
422 ; No NEON 64-bit vector SMINV support. Use SVE.
423 define i64 @sminv_v2i64(<2 x i64> %a) {
424 ; CHECK-LABEL: sminv_v2i64:
426 ; CHECK-NEXT: ptrue p0.d, vl2
427 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
428 ; CHECK-NEXT: sminv d0, p0, z0.d
429 ; CHECK-NEXT: fmov x0, d0
431 %res = call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %a)
435 define i64 @sminv_v4i64(ptr %a) {
436 ; CHECK-LABEL: sminv_v4i64:
438 ; CHECK-NEXT: ptrue p0.d, vl2
439 ; CHECK-NEXT: ldp q1, q0, [x0]
440 ; CHECK-NEXT: smin z0.d, p0/m, z0.d, z1.d
441 ; CHECK-NEXT: sminv d0, p0, z0.d
442 ; CHECK-NEXT: fmov x0, d0
444 %op = load <4 x i64>, ptr %a
445 %res = call i64 @llvm.vector.reduce.smin.v4i64(<4 x i64> %op)
453 define i8 @umaxv_v8i8(<8 x i8> %a) {
454 ; CHECK-LABEL: umaxv_v8i8:
456 ; CHECK-NEXT: ptrue p0.b, vl8
457 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
458 ; CHECK-NEXT: umaxv b0, p0, z0.b
459 ; CHECK-NEXT: fmov w0, s0
461 %res = call i8 @llvm.vector.reduce.umax.v8i8(<8 x i8> %a)
465 define i8 @umaxv_v16i8(<16 x i8> %a) {
466 ; CHECK-LABEL: umaxv_v16i8:
468 ; CHECK-NEXT: ptrue p0.b, vl16
469 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
470 ; CHECK-NEXT: umaxv b0, p0, z0.b
471 ; CHECK-NEXT: fmov w0, s0
473 %res = call i8 @llvm.vector.reduce.umax.v16i8(<16 x i8> %a)
477 define i8 @umaxv_v32i8(ptr %a) {
478 ; CHECK-LABEL: umaxv_v32i8:
480 ; CHECK-NEXT: ptrue p0.b, vl16
481 ; CHECK-NEXT: ldp q1, q0, [x0]
482 ; CHECK-NEXT: umax z0.b, p0/m, z0.b, z1.b
483 ; CHECK-NEXT: umaxv b0, p0, z0.b
484 ; CHECK-NEXT: fmov w0, s0
486 %op = load <32 x i8>, ptr %a
487 %res = call i8 @llvm.vector.reduce.umax.v32i8(<32 x i8> %op)
491 define i16 @umaxv_v4i16(<4 x i16> %a) {
492 ; CHECK-LABEL: umaxv_v4i16:
494 ; CHECK-NEXT: ptrue p0.h, vl4
495 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
496 ; CHECK-NEXT: umaxv h0, p0, z0.h
497 ; CHECK-NEXT: fmov w0, s0
499 %res = call i16 @llvm.vector.reduce.umax.v4i16(<4 x i16> %a)
503 define i16 @umaxv_v8i16(<8 x i16> %a) {
504 ; CHECK-LABEL: umaxv_v8i16:
506 ; CHECK-NEXT: ptrue p0.h, vl8
507 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
508 ; CHECK-NEXT: umaxv h0, p0, z0.h
509 ; CHECK-NEXT: fmov w0, s0
511 %res = call i16 @llvm.vector.reduce.umax.v8i16(<8 x i16> %a)
515 define i16 @umaxv_v16i16(ptr %a) {
516 ; CHECK-LABEL: umaxv_v16i16:
518 ; CHECK-NEXT: ptrue p0.h, vl8
519 ; CHECK-NEXT: ldp q1, q0, [x0]
520 ; CHECK-NEXT: umax z0.h, p0/m, z0.h, z1.h
521 ; CHECK-NEXT: umaxv h0, p0, z0.h
522 ; CHECK-NEXT: fmov w0, s0
524 %op = load <16 x i16>, ptr %a
525 %res = call i16 @llvm.vector.reduce.umax.v16i16(<16 x i16> %op)
529 define i32 @umaxv_v2i32(<2 x i32> %a) {
530 ; CHECK-LABEL: umaxv_v2i32:
532 ; CHECK-NEXT: ptrue p0.s, vl2
533 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
534 ; CHECK-NEXT: umaxv s0, p0, z0.s
535 ; CHECK-NEXT: fmov w0, s0
537 %res = call i32 @llvm.vector.reduce.umax.v2i32(<2 x i32> %a)
541 define i32 @umaxv_v4i32(<4 x i32> %a) {
542 ; CHECK-LABEL: umaxv_v4i32:
544 ; CHECK-NEXT: ptrue p0.s, vl4
545 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
546 ; CHECK-NEXT: umaxv s0, p0, z0.s
547 ; CHECK-NEXT: fmov w0, s0
549 %res = call i32 @llvm.vector.reduce.umax.v4i32(<4 x i32> %a)
553 define i32 @umaxv_v8i32(ptr %a) {
554 ; CHECK-LABEL: umaxv_v8i32:
556 ; CHECK-NEXT: ptrue p0.s, vl4
557 ; CHECK-NEXT: ldp q1, q0, [x0]
558 ; CHECK-NEXT: umax z0.s, p0/m, z0.s, z1.s
559 ; CHECK-NEXT: umaxv s0, p0, z0.s
560 ; CHECK-NEXT: fmov w0, s0
562 %op = load <8 x i32>, ptr %a
563 %res = call i32 @llvm.vector.reduce.umax.v8i32(<8 x i32> %op)
567 ; No NEON 64-bit vector UMAXV support. Use SVE.
568 define i64 @umaxv_v2i64(<2 x i64> %a) {
569 ; CHECK-LABEL: umaxv_v2i64:
571 ; CHECK-NEXT: ptrue p0.d, vl2
572 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
573 ; CHECK-NEXT: umaxv d0, p0, z0.d
574 ; CHECK-NEXT: fmov x0, d0
576 %res = call i64 @llvm.vector.reduce.umax.v2i64(<2 x i64> %a)
580 define i64 @umaxv_v4i64(ptr %a) {
581 ; CHECK-LABEL: umaxv_v4i64:
583 ; CHECK-NEXT: ptrue p0.d, vl2
584 ; CHECK-NEXT: ldp q1, q0, [x0]
585 ; CHECK-NEXT: umax z0.d, p0/m, z0.d, z1.d
586 ; CHECK-NEXT: umaxv d0, p0, z0.d
587 ; CHECK-NEXT: fmov x0, d0
589 %op = load <4 x i64>, ptr %a
590 %res = call i64 @llvm.vector.reduce.umax.v4i64(<4 x i64> %op)
598 define i8 @uminv_v8i8(<8 x i8> %a) {
599 ; CHECK-LABEL: uminv_v8i8:
601 ; CHECK-NEXT: ptrue p0.b, vl8
602 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
603 ; CHECK-NEXT: uminv b0, p0, z0.b
604 ; CHECK-NEXT: fmov w0, s0
606 %res = call i8 @llvm.vector.reduce.umin.v8i8(<8 x i8> %a)
610 define i8 @uminv_v16i8(<16 x i8> %a) {
611 ; CHECK-LABEL: uminv_v16i8:
613 ; CHECK-NEXT: ptrue p0.b, vl16
614 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
615 ; CHECK-NEXT: uminv b0, p0, z0.b
616 ; CHECK-NEXT: fmov w0, s0
618 %res = call i8 @llvm.vector.reduce.umin.v16i8(<16 x i8> %a)
622 define i8 @uminv_v32i8(ptr %a) {
623 ; CHECK-LABEL: uminv_v32i8:
625 ; CHECK-NEXT: ptrue p0.b, vl16
626 ; CHECK-NEXT: ldp q1, q0, [x0]
627 ; CHECK-NEXT: umin z0.b, p0/m, z0.b, z1.b
628 ; CHECK-NEXT: uminv b0, p0, z0.b
629 ; CHECK-NEXT: fmov w0, s0
631 %op = load <32 x i8>, ptr %a
632 %res = call i8 @llvm.vector.reduce.umin.v32i8(<32 x i8> %op)
636 define i16 @uminv_v4i16(<4 x i16> %a) {
637 ; CHECK-LABEL: uminv_v4i16:
639 ; CHECK-NEXT: ptrue p0.h, vl4
640 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
641 ; CHECK-NEXT: uminv h0, p0, z0.h
642 ; CHECK-NEXT: fmov w0, s0
644 %res = call i16 @llvm.vector.reduce.umin.v4i16(<4 x i16> %a)
648 define i16 @uminv_v8i16(<8 x i16> %a) {
649 ; CHECK-LABEL: uminv_v8i16:
651 ; CHECK-NEXT: ptrue p0.h, vl8
652 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
653 ; CHECK-NEXT: uminv h0, p0, z0.h
654 ; CHECK-NEXT: fmov w0, s0
656 %res = call i16 @llvm.vector.reduce.umin.v8i16(<8 x i16> %a)
660 define i16 @uminv_v16i16(ptr %a) {
661 ; CHECK-LABEL: uminv_v16i16:
663 ; CHECK-NEXT: ptrue p0.h, vl8
664 ; CHECK-NEXT: ldp q1, q0, [x0]
665 ; CHECK-NEXT: umin z0.h, p0/m, z0.h, z1.h
666 ; CHECK-NEXT: uminv h0, p0, z0.h
667 ; CHECK-NEXT: fmov w0, s0
669 %op = load <16 x i16>, ptr %a
670 %res = call i16 @llvm.vector.reduce.umin.v16i16(<16 x i16> %op)
674 define i32 @uminv_v2i32(<2 x i32> %a) {
675 ; CHECK-LABEL: uminv_v2i32:
677 ; CHECK-NEXT: ptrue p0.s, vl2
678 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
679 ; CHECK-NEXT: uminv s0, p0, z0.s
680 ; CHECK-NEXT: fmov w0, s0
682 %res = call i32 @llvm.vector.reduce.umin.v2i32(<2 x i32> %a)
686 define i32 @uminv_v4i32(<4 x i32> %a) {
687 ; CHECK-LABEL: uminv_v4i32:
689 ; CHECK-NEXT: ptrue p0.s, vl4
690 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
691 ; CHECK-NEXT: uminv s0, p0, z0.s
692 ; CHECK-NEXT: fmov w0, s0
694 %res = call i32 @llvm.vector.reduce.umin.v4i32(<4 x i32> %a)
698 define i32 @uminv_v8i32(ptr %a) {
699 ; CHECK-LABEL: uminv_v8i32:
701 ; CHECK-NEXT: ptrue p0.s, vl4
702 ; CHECK-NEXT: ldp q1, q0, [x0]
703 ; CHECK-NEXT: umin z0.s, p0/m, z0.s, z1.s
704 ; CHECK-NEXT: uminv s0, p0, z0.s
705 ; CHECK-NEXT: fmov w0, s0
707 %op = load <8 x i32>, ptr %a
708 %res = call i32 @llvm.vector.reduce.umin.v8i32(<8 x i32> %op)
712 ; No NEON 64-bit vector UMINV support. Use SVE.
713 define i64 @uminv_v2i64(<2 x i64> %a) {
714 ; CHECK-LABEL: uminv_v2i64:
716 ; CHECK-NEXT: ptrue p0.d, vl2
717 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
718 ; CHECK-NEXT: uminv d0, p0, z0.d
719 ; CHECK-NEXT: fmov x0, d0
721 %res = call i64 @llvm.vector.reduce.umin.v2i64(<2 x i64> %a)
725 define i64 @uminv_v4i64(ptr %a) {
726 ; CHECK-LABEL: uminv_v4i64:
728 ; CHECK-NEXT: ptrue p0.d, vl2
729 ; CHECK-NEXT: ldp q1, q0, [x0]
730 ; CHECK-NEXT: umin z0.d, p0/m, z0.d, z1.d
731 ; CHECK-NEXT: uminv d0, p0, z0.d
732 ; CHECK-NEXT: fmov x0, d0
734 %op = load <4 x i64>, ptr %a
735 %res = call i64 @llvm.vector.reduce.umin.v4i64(<4 x i64> %op)
739 declare i8 @llvm.vector.reduce.add.v8i8(<8 x i8>)
740 declare i8 @llvm.vector.reduce.add.v16i8(<16 x i8>)
741 declare i8 @llvm.vector.reduce.add.v32i8(<32 x i8>)
743 declare i16 @llvm.vector.reduce.add.v4i16(<4 x i16>)
744 declare i16 @llvm.vector.reduce.add.v8i16(<8 x i16>)
745 declare i16 @llvm.vector.reduce.add.v16i16(<16 x i16>)
747 declare i32 @llvm.vector.reduce.add.v2i32(<2 x i32>)
748 declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>)
749 declare i32 @llvm.vector.reduce.add.v8i32(<8 x i32>)
751 declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>)
752 declare i64 @llvm.vector.reduce.add.v4i64(<4 x i64>)
754 declare i8 @llvm.vector.reduce.smax.v8i8(<8 x i8>)
755 declare i8 @llvm.vector.reduce.smax.v16i8(<16 x i8>)
756 declare i8 @llvm.vector.reduce.smax.v32i8(<32 x i8>)
758 declare i16 @llvm.vector.reduce.smax.v4i16(<4 x i16>)
759 declare i16 @llvm.vector.reduce.smax.v8i16(<8 x i16>)
760 declare i16 @llvm.vector.reduce.smax.v16i16(<16 x i16>)
762 declare i32 @llvm.vector.reduce.smax.v2i32(<2 x i32>)
763 declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>)
764 declare i32 @llvm.vector.reduce.smax.v8i32(<8 x i32>)
766 declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>)
767 declare i64 @llvm.vector.reduce.smax.v4i64(<4 x i64>)
769 declare i8 @llvm.vector.reduce.smin.v8i8(<8 x i8>)
770 declare i8 @llvm.vector.reduce.smin.v16i8(<16 x i8>)
771 declare i8 @llvm.vector.reduce.smin.v32i8(<32 x i8>)
773 declare i16 @llvm.vector.reduce.smin.v4i16(<4 x i16>)
774 declare i16 @llvm.vector.reduce.smin.v8i16(<8 x i16>)
775 declare i16 @llvm.vector.reduce.smin.v16i16(<16 x i16>)
777 declare i32 @llvm.vector.reduce.smin.v2i32(<2 x i32>)
778 declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>)
779 declare i32 @llvm.vector.reduce.smin.v8i32(<8 x i32>)
781 declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>)
782 declare i64 @llvm.vector.reduce.smin.v4i64(<4 x i64>)
784 declare i8 @llvm.vector.reduce.umax.v8i8(<8 x i8>)
785 declare i8 @llvm.vector.reduce.umax.v16i8(<16 x i8>)
786 declare i8 @llvm.vector.reduce.umax.v32i8(<32 x i8>)
788 declare i16 @llvm.vector.reduce.umax.v4i16(<4 x i16>)
789 declare i16 @llvm.vector.reduce.umax.v8i16(<8 x i16>)
790 declare i16 @llvm.vector.reduce.umax.v16i16(<16 x i16>)
792 declare i32 @llvm.vector.reduce.umax.v2i32(<2 x i32>)
793 declare i32 @llvm.vector.reduce.umax.v4i32(<4 x i32>)
794 declare i32 @llvm.vector.reduce.umax.v8i32(<8 x i32>)
796 declare i64 @llvm.vector.reduce.umax.v2i64(<2 x i64>)
797 declare i64 @llvm.vector.reduce.umax.v4i64(<4 x i64>)
799 declare i8 @llvm.vector.reduce.umin.v8i8(<8 x i8>)
800 declare i8 @llvm.vector.reduce.umin.v16i8(<16 x i8>)
801 declare i8 @llvm.vector.reduce.umin.v32i8(<32 x i8>)
803 declare i16 @llvm.vector.reduce.umin.v4i16(<4 x i16>)
804 declare i16 @llvm.vector.reduce.umin.v8i16(<8 x i16>)
805 declare i16 @llvm.vector.reduce.umin.v16i16(<16 x i16>)
807 declare i32 @llvm.vector.reduce.umin.v2i32(<2 x i32>)
808 declare i32 @llvm.vector.reduce.umin.v4i32(<4 x i32>)
809 declare i32 @llvm.vector.reduce.umin.v8i32(<8 x i32>)
811 declare i64 @llvm.vector.reduce.umin.v2i64(<2 x i64>)
812 declare i64 @llvm.vector.reduce.umin.v4i64(<4 x i64>)