1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+m,+v -verify-machineinstrs < %s | FileCheck %s
3 ; RUN: llc -mtriple=riscv64 -mattr=+m,+v -verify-machineinstrs < %s | FileCheck %s
5 declare i1 @llvm.vector.reduce.or.v1i1(<1 x i1>)
7 define zeroext i1 @vreduce_or_v1i1(<1 x i1> %v) {
8 ; CHECK-LABEL: vreduce_or_v1i1:
10 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
11 ; CHECK-NEXT: vfirst.m a0, v0
12 ; CHECK-NEXT: seqz a0, a0
14 %red = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> %v)
18 declare i1 @llvm.vector.reduce.xor.v1i1(<1 x i1>)
20 define zeroext i1 @vreduce_xor_v1i1(<1 x i1> %v) {
21 ; CHECK-LABEL: vreduce_xor_v1i1:
23 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
24 ; CHECK-NEXT: vfirst.m a0, v0
25 ; CHECK-NEXT: seqz a0, a0
27 %red = call i1 @llvm.vector.reduce.xor.v1i1(<1 x i1> %v)
31 declare i1 @llvm.vector.reduce.and.v1i1(<1 x i1>)
33 define zeroext i1 @vreduce_and_v1i1(<1 x i1> %v) {
34 ; CHECK-LABEL: vreduce_and_v1i1:
36 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
37 ; CHECK-NEXT: vfirst.m a0, v0
38 ; CHECK-NEXT: seqz a0, a0
40 %red = call i1 @llvm.vector.reduce.and.v1i1(<1 x i1> %v)
44 declare i1 @llvm.vector.reduce.umax.v1i1(<1 x i1>)
46 define zeroext i1 @vreduce_umax_v1i1(<1 x i1> %v) {
47 ; CHECK-LABEL: vreduce_umax_v1i1:
49 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
50 ; CHECK-NEXT: vfirst.m a0, v0
51 ; CHECK-NEXT: seqz a0, a0
53 %red = call i1 @llvm.vector.reduce.umax.v1i1(<1 x i1> %v)
57 declare i1 @llvm.vector.reduce.smax.v1i1(<1 x i1>)
59 define zeroext i1 @vreduce_smax_v1i1(<1 x i1> %v) {
60 ; CHECK-LABEL: vreduce_smax_v1i1:
62 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
63 ; CHECK-NEXT: vfirst.m a0, v0
64 ; CHECK-NEXT: seqz a0, a0
66 %red = call i1 @llvm.vector.reduce.smax.v1i1(<1 x i1> %v)
70 declare i1 @llvm.vector.reduce.umin.v1i1(<1 x i1>)
72 define zeroext i1 @vreduce_umin_v1i1(<1 x i1> %v) {
73 ; CHECK-LABEL: vreduce_umin_v1i1:
75 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
76 ; CHECK-NEXT: vfirst.m a0, v0
77 ; CHECK-NEXT: seqz a0, a0
79 %red = call i1 @llvm.vector.reduce.umin.v1i1(<1 x i1> %v)
83 declare i1 @llvm.vector.reduce.smin.v1i1(<1 x i1>)
85 define zeroext i1 @vreduce_smin_v1i1(<1 x i1> %v) {
86 ; CHECK-LABEL: vreduce_smin_v1i1:
88 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
89 ; CHECK-NEXT: vfirst.m a0, v0
90 ; CHECK-NEXT: seqz a0, a0
92 %red = call i1 @llvm.vector.reduce.smin.v1i1(<1 x i1> %v)
96 declare i1 @llvm.vector.reduce.or.v2i1(<2 x i1>)
98 define zeroext i1 @vreduce_or_v2i1(<2 x i1> %v) {
99 ; CHECK-LABEL: vreduce_or_v2i1:
101 ; CHECK-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
102 ; CHECK-NEXT: vcpop.m a0, v0
103 ; CHECK-NEXT: snez a0, a0
105 %red = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> %v)
109 declare i1 @llvm.vector.reduce.xor.v2i1(<2 x i1>)
111 define zeroext i1 @vreduce_xor_v2i1(<2 x i1> %v) {
112 ; CHECK-LABEL: vreduce_xor_v2i1:
114 ; CHECK-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
115 ; CHECK-NEXT: vcpop.m a0, v0
116 ; CHECK-NEXT: andi a0, a0, 1
118 %red = call i1 @llvm.vector.reduce.xor.v2i1(<2 x i1> %v)
122 declare i1 @llvm.vector.reduce.and.v2i1(<2 x i1>)
124 define zeroext i1 @vreduce_and_v2i1(<2 x i1> %v) {
125 ; CHECK-LABEL: vreduce_and_v2i1:
127 ; CHECK-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
128 ; CHECK-NEXT: vmnot.m v8, v0
129 ; CHECK-NEXT: vcpop.m a0, v8
130 ; CHECK-NEXT: seqz a0, a0
132 %red = call i1 @llvm.vector.reduce.and.v2i1(<2 x i1> %v)
136 declare i1 @llvm.vector.reduce.umax.v2i1(<2 x i1>)
138 define zeroext i1 @vreduce_umax_v2i1(<2 x i1> %v) {
139 ; CHECK-LABEL: vreduce_umax_v2i1:
141 ; CHECK-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
142 ; CHECK-NEXT: vcpop.m a0, v0
143 ; CHECK-NEXT: snez a0, a0
145 %red = call i1 @llvm.vector.reduce.umax.v2i1(<2 x i1> %v)
149 declare i1 @llvm.vector.reduce.smax.v2i1(<2 x i1>)
151 define zeroext i1 @vreduce_smax_v2i1(<2 x i1> %v) {
152 ; CHECK-LABEL: vreduce_smax_v2i1:
154 ; CHECK-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
155 ; CHECK-NEXT: vmnot.m v8, v0
156 ; CHECK-NEXT: vcpop.m a0, v8
157 ; CHECK-NEXT: seqz a0, a0
159 %red = call i1 @llvm.vector.reduce.smax.v2i1(<2 x i1> %v)
163 declare i1 @llvm.vector.reduce.umin.v2i1(<2 x i1>)
165 define zeroext i1 @vreduce_umin_v2i1(<2 x i1> %v) {
166 ; CHECK-LABEL: vreduce_umin_v2i1:
168 ; CHECK-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
169 ; CHECK-NEXT: vmnot.m v8, v0
170 ; CHECK-NEXT: vcpop.m a0, v8
171 ; CHECK-NEXT: seqz a0, a0
173 %red = call i1 @llvm.vector.reduce.umin.v2i1(<2 x i1> %v)
177 declare i1 @llvm.vector.reduce.smin.v2i1(<2 x i1>)
179 define zeroext i1 @vreduce_smin_v2i1(<2 x i1> %v) {
180 ; CHECK-LABEL: vreduce_smin_v2i1:
182 ; CHECK-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
183 ; CHECK-NEXT: vcpop.m a0, v0
184 ; CHECK-NEXT: snez a0, a0
186 %red = call i1 @llvm.vector.reduce.smin.v2i1(<2 x i1> %v)
190 declare i1 @llvm.vector.reduce.or.v4i1(<4 x i1>)
192 define zeroext i1 @vreduce_or_v4i1(<4 x i1> %v) {
193 ; CHECK-LABEL: vreduce_or_v4i1:
195 ; CHECK-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
196 ; CHECK-NEXT: vcpop.m a0, v0
197 ; CHECK-NEXT: snez a0, a0
199 %red = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> %v)
203 declare i1 @llvm.vector.reduce.xor.v4i1(<4 x i1>)
205 define zeroext i1 @vreduce_xor_v4i1(<4 x i1> %v) {
206 ; CHECK-LABEL: vreduce_xor_v4i1:
208 ; CHECK-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
209 ; CHECK-NEXT: vcpop.m a0, v0
210 ; CHECK-NEXT: andi a0, a0, 1
212 %red = call i1 @llvm.vector.reduce.xor.v4i1(<4 x i1> %v)
216 declare i1 @llvm.vector.reduce.and.v4i1(<4 x i1>)
218 define zeroext i1 @vreduce_and_v4i1(<4 x i1> %v) {
219 ; CHECK-LABEL: vreduce_and_v4i1:
221 ; CHECK-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
222 ; CHECK-NEXT: vmnot.m v8, v0
223 ; CHECK-NEXT: vcpop.m a0, v8
224 ; CHECK-NEXT: seqz a0, a0
226 %red = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> %v)
230 declare i1 @llvm.vector.reduce.umax.v4i1(<4 x i1>)
232 define zeroext i1 @vreduce_umax_v4i1(<4 x i1> %v) {
233 ; CHECK-LABEL: vreduce_umax_v4i1:
235 ; CHECK-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
236 ; CHECK-NEXT: vcpop.m a0, v0
237 ; CHECK-NEXT: snez a0, a0
239 %red = call i1 @llvm.vector.reduce.umax.v4i1(<4 x i1> %v)
243 declare i1 @llvm.vector.reduce.smax.v4i1(<4 x i1>)
245 define zeroext i1 @vreduce_smax_v4i1(<4 x i1> %v) {
246 ; CHECK-LABEL: vreduce_smax_v4i1:
248 ; CHECK-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
249 ; CHECK-NEXT: vmnot.m v8, v0
250 ; CHECK-NEXT: vcpop.m a0, v8
251 ; CHECK-NEXT: seqz a0, a0
253 %red = call i1 @llvm.vector.reduce.smax.v4i1(<4 x i1> %v)
257 declare i1 @llvm.vector.reduce.umin.v4i1(<4 x i1>)
259 define zeroext i1 @vreduce_umin_v4i1(<4 x i1> %v) {
260 ; CHECK-LABEL: vreduce_umin_v4i1:
262 ; CHECK-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
263 ; CHECK-NEXT: vmnot.m v8, v0
264 ; CHECK-NEXT: vcpop.m a0, v8
265 ; CHECK-NEXT: seqz a0, a0
267 %red = call i1 @llvm.vector.reduce.umin.v4i1(<4 x i1> %v)
271 declare i1 @llvm.vector.reduce.smin.v4i1(<4 x i1>)
273 define zeroext i1 @vreduce_smin_v4i1(<4 x i1> %v) {
274 ; CHECK-LABEL: vreduce_smin_v4i1:
276 ; CHECK-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
277 ; CHECK-NEXT: vcpop.m a0, v0
278 ; CHECK-NEXT: snez a0, a0
280 %red = call i1 @llvm.vector.reduce.smin.v4i1(<4 x i1> %v)
284 declare i1 @llvm.vector.reduce.or.v8i1(<8 x i1>)
286 define zeroext i1 @vreduce_or_v8i1(<8 x i1> %v) {
287 ; CHECK-LABEL: vreduce_or_v8i1:
289 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
290 ; CHECK-NEXT: vcpop.m a0, v0
291 ; CHECK-NEXT: snez a0, a0
293 %red = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> %v)
297 declare i1 @llvm.vector.reduce.xor.v8i1(<8 x i1>)
299 define zeroext i1 @vreduce_xor_v8i1(<8 x i1> %v) {
300 ; CHECK-LABEL: vreduce_xor_v8i1:
302 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
303 ; CHECK-NEXT: vcpop.m a0, v0
304 ; CHECK-NEXT: andi a0, a0, 1
306 %red = call i1 @llvm.vector.reduce.xor.v8i1(<8 x i1> %v)
310 declare i1 @llvm.vector.reduce.and.v8i1(<8 x i1>)
312 define zeroext i1 @vreduce_and_v8i1(<8 x i1> %v) {
313 ; CHECK-LABEL: vreduce_and_v8i1:
315 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
316 ; CHECK-NEXT: vmnot.m v8, v0
317 ; CHECK-NEXT: vcpop.m a0, v8
318 ; CHECK-NEXT: seqz a0, a0
320 %red = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> %v)
324 declare i1 @llvm.vector.reduce.umax.v8i1(<8 x i1>)
326 define zeroext i1 @vreduce_umax_v8i1(<8 x i1> %v) {
327 ; CHECK-LABEL: vreduce_umax_v8i1:
329 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
330 ; CHECK-NEXT: vcpop.m a0, v0
331 ; CHECK-NEXT: snez a0, a0
333 %red = call i1 @llvm.vector.reduce.umax.v8i1(<8 x i1> %v)
337 declare i1 @llvm.vector.reduce.smax.v8i1(<8 x i1>)
339 define zeroext i1 @vreduce_smax_v8i1(<8 x i1> %v) {
340 ; CHECK-LABEL: vreduce_smax_v8i1:
342 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
343 ; CHECK-NEXT: vmnot.m v8, v0
344 ; CHECK-NEXT: vcpop.m a0, v8
345 ; CHECK-NEXT: seqz a0, a0
347 %red = call i1 @llvm.vector.reduce.smax.v8i1(<8 x i1> %v)
351 declare i1 @llvm.vector.reduce.umin.v8i1(<8 x i1>)
353 define zeroext i1 @vreduce_umin_v8i1(<8 x i1> %v) {
354 ; CHECK-LABEL: vreduce_umin_v8i1:
356 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
357 ; CHECK-NEXT: vmnot.m v8, v0
358 ; CHECK-NEXT: vcpop.m a0, v8
359 ; CHECK-NEXT: seqz a0, a0
361 %red = call i1 @llvm.vector.reduce.umin.v8i1(<8 x i1> %v)
365 declare i1 @llvm.vector.reduce.smin.v8i1(<8 x i1>)
367 define zeroext i1 @vreduce_smin_v8i1(<8 x i1> %v) {
368 ; CHECK-LABEL: vreduce_smin_v8i1:
370 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
371 ; CHECK-NEXT: vcpop.m a0, v0
372 ; CHECK-NEXT: snez a0, a0
374 %red = call i1 @llvm.vector.reduce.smin.v8i1(<8 x i1> %v)
378 declare i1 @llvm.vector.reduce.or.v16i1(<16 x i1>)
380 define zeroext i1 @vreduce_or_v16i1(<16 x i1> %v) {
381 ; CHECK-LABEL: vreduce_or_v16i1:
383 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
384 ; CHECK-NEXT: vcpop.m a0, v0
385 ; CHECK-NEXT: snez a0, a0
387 %red = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> %v)
391 declare i1 @llvm.vector.reduce.xor.v16i1(<16 x i1>)
393 define zeroext i1 @vreduce_xor_v16i1(<16 x i1> %v) {
394 ; CHECK-LABEL: vreduce_xor_v16i1:
396 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
397 ; CHECK-NEXT: vcpop.m a0, v0
398 ; CHECK-NEXT: andi a0, a0, 1
400 %red = call i1 @llvm.vector.reduce.xor.v16i1(<16 x i1> %v)
404 declare i1 @llvm.vector.reduce.and.v16i1(<16 x i1>)
406 define zeroext i1 @vreduce_and_v16i1(<16 x i1> %v) {
407 ; CHECK-LABEL: vreduce_and_v16i1:
409 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
410 ; CHECK-NEXT: vmnot.m v8, v0
411 ; CHECK-NEXT: vcpop.m a0, v8
412 ; CHECK-NEXT: seqz a0, a0
414 %red = call i1 @llvm.vector.reduce.and.v16i1(<16 x i1> %v)
418 declare i1 @llvm.vector.reduce.umax.v16i1(<16 x i1>)
420 define zeroext i1 @vreduce_umax_v16i1(<16 x i1> %v) {
421 ; CHECK-LABEL: vreduce_umax_v16i1:
423 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
424 ; CHECK-NEXT: vcpop.m a0, v0
425 ; CHECK-NEXT: snez a0, a0
427 %red = call i1 @llvm.vector.reduce.umax.v16i1(<16 x i1> %v)
431 declare i1 @llvm.vector.reduce.smax.v16i1(<16 x i1>)
433 define zeroext i1 @vreduce_smax_v16i1(<16 x i1> %v) {
434 ; CHECK-LABEL: vreduce_smax_v16i1:
436 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
437 ; CHECK-NEXT: vmnot.m v8, v0
438 ; CHECK-NEXT: vcpop.m a0, v8
439 ; CHECK-NEXT: seqz a0, a0
441 %red = call i1 @llvm.vector.reduce.smax.v16i1(<16 x i1> %v)
445 declare i1 @llvm.vector.reduce.umin.v16i1(<16 x i1>)
447 define zeroext i1 @vreduce_umin_v16i1(<16 x i1> %v) {
448 ; CHECK-LABEL: vreduce_umin_v16i1:
450 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
451 ; CHECK-NEXT: vmnot.m v8, v0
452 ; CHECK-NEXT: vcpop.m a0, v8
453 ; CHECK-NEXT: seqz a0, a0
455 %red = call i1 @llvm.vector.reduce.umin.v16i1(<16 x i1> %v)
459 declare i1 @llvm.vector.reduce.smin.v16i1(<16 x i1>)
461 define zeroext i1 @vreduce_smin_v16i1(<16 x i1> %v) {
462 ; CHECK-LABEL: vreduce_smin_v16i1:
464 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
465 ; CHECK-NEXT: vcpop.m a0, v0
466 ; CHECK-NEXT: snez a0, a0
468 %red = call i1 @llvm.vector.reduce.smin.v16i1(<16 x i1> %v)
472 declare i1 @llvm.vector.reduce.or.v32i1(<32 x i1>)
474 define zeroext i1 @vreduce_or_v32i1(<32 x i1> %v) {
475 ; CHECK-LABEL: vreduce_or_v32i1:
477 ; CHECK-NEXT: li a0, 32
478 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
479 ; CHECK-NEXT: vcpop.m a0, v0
480 ; CHECK-NEXT: snez a0, a0
482 %red = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> %v)
486 declare i1 @llvm.vector.reduce.xor.v32i1(<32 x i1>)
488 define zeroext i1 @vreduce_xor_v32i1(<32 x i1> %v) {
489 ; CHECK-LABEL: vreduce_xor_v32i1:
491 ; CHECK-NEXT: li a0, 32
492 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
493 ; CHECK-NEXT: vcpop.m a0, v0
494 ; CHECK-NEXT: andi a0, a0, 1
496 %red = call i1 @llvm.vector.reduce.xor.v32i1(<32 x i1> %v)
500 declare i1 @llvm.vector.reduce.and.v32i1(<32 x i1>)
502 define zeroext i1 @vreduce_and_v32i1(<32 x i1> %v) {
503 ; CHECK-LABEL: vreduce_and_v32i1:
505 ; CHECK-NEXT: li a0, 32
506 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
507 ; CHECK-NEXT: vmnot.m v8, v0
508 ; CHECK-NEXT: vcpop.m a0, v8
509 ; CHECK-NEXT: seqz a0, a0
511 %red = call i1 @llvm.vector.reduce.and.v32i1(<32 x i1> %v)
515 declare i1 @llvm.vector.reduce.umax.v32i1(<32 x i1>)
517 define zeroext i1 @vreduce_umax_v32i1(<32 x i1> %v) {
518 ; CHECK-LABEL: vreduce_umax_v32i1:
520 ; CHECK-NEXT: li a0, 32
521 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
522 ; CHECK-NEXT: vcpop.m a0, v0
523 ; CHECK-NEXT: snez a0, a0
525 %red = call i1 @llvm.vector.reduce.umax.v32i1(<32 x i1> %v)
529 declare i1 @llvm.vector.reduce.smax.v32i1(<32 x i1>)
531 define zeroext i1 @vreduce_smax_v32i1(<32 x i1> %v) {
532 ; CHECK-LABEL: vreduce_smax_v32i1:
534 ; CHECK-NEXT: li a0, 32
535 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
536 ; CHECK-NEXT: vmnot.m v8, v0
537 ; CHECK-NEXT: vcpop.m a0, v8
538 ; CHECK-NEXT: seqz a0, a0
540 %red = call i1 @llvm.vector.reduce.smax.v32i1(<32 x i1> %v)
544 declare i1 @llvm.vector.reduce.umin.v32i1(<32 x i1>)
546 define zeroext i1 @vreduce_umin_v32i1(<32 x i1> %v) {
547 ; CHECK-LABEL: vreduce_umin_v32i1:
549 ; CHECK-NEXT: li a0, 32
550 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
551 ; CHECK-NEXT: vmnot.m v8, v0
552 ; CHECK-NEXT: vcpop.m a0, v8
553 ; CHECK-NEXT: seqz a0, a0
555 %red = call i1 @llvm.vector.reduce.umin.v32i1(<32 x i1> %v)
559 declare i1 @llvm.vector.reduce.smin.v32i1(<32 x i1>)
561 define zeroext i1 @vreduce_smin_v32i1(<32 x i1> %v) {
562 ; CHECK-LABEL: vreduce_smin_v32i1:
564 ; CHECK-NEXT: li a0, 32
565 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
566 ; CHECK-NEXT: vcpop.m a0, v0
567 ; CHECK-NEXT: snez a0, a0
569 %red = call i1 @llvm.vector.reduce.smin.v32i1(<32 x i1> %v)
573 declare i1 @llvm.vector.reduce.or.v64i1(<64 x i1>)
575 define zeroext i1 @vreduce_or_v64i1(<64 x i1> %v) {
576 ; CHECK-LABEL: vreduce_or_v64i1:
578 ; CHECK-NEXT: li a0, 64
579 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
580 ; CHECK-NEXT: vcpop.m a0, v0
581 ; CHECK-NEXT: snez a0, a0
583 %red = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> %v)
587 declare i1 @llvm.vector.reduce.xor.v64i1(<64 x i1>)
589 define zeroext i1 @vreduce_xor_v64i1(<64 x i1> %v) {
590 ; CHECK-LABEL: vreduce_xor_v64i1:
592 ; CHECK-NEXT: li a0, 64
593 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
594 ; CHECK-NEXT: vcpop.m a0, v0
595 ; CHECK-NEXT: andi a0, a0, 1
597 %red = call i1 @llvm.vector.reduce.xor.v64i1(<64 x i1> %v)
601 declare i1 @llvm.vector.reduce.and.v64i1(<64 x i1>)
603 define zeroext i1 @vreduce_and_v64i1(<64 x i1> %v) {
604 ; CHECK-LABEL: vreduce_and_v64i1:
606 ; CHECK-NEXT: li a0, 64
607 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
608 ; CHECK-NEXT: vmnot.m v8, v0
609 ; CHECK-NEXT: vcpop.m a0, v8
610 ; CHECK-NEXT: seqz a0, a0
612 %red = call i1 @llvm.vector.reduce.and.v64i1(<64 x i1> %v)
616 declare i1 @llvm.vector.reduce.umax.v64i1(<64 x i1>)
618 define zeroext i1 @vreduce_umax_v64i1(<64 x i1> %v) {
619 ; CHECK-LABEL: vreduce_umax_v64i1:
621 ; CHECK-NEXT: li a0, 64
622 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
623 ; CHECK-NEXT: vcpop.m a0, v0
624 ; CHECK-NEXT: snez a0, a0
626 %red = call i1 @llvm.vector.reduce.umax.v64i1(<64 x i1> %v)
630 declare i1 @llvm.vector.reduce.smax.v64i1(<64 x i1>)
632 define zeroext i1 @vreduce_smax_v64i1(<64 x i1> %v) {
633 ; CHECK-LABEL: vreduce_smax_v64i1:
635 ; CHECK-NEXT: li a0, 64
636 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
637 ; CHECK-NEXT: vmnot.m v8, v0
638 ; CHECK-NEXT: vcpop.m a0, v8
639 ; CHECK-NEXT: seqz a0, a0
641 %red = call i1 @llvm.vector.reduce.smax.v64i1(<64 x i1> %v)
645 declare i1 @llvm.vector.reduce.umin.v64i1(<64 x i1>)
647 define zeroext i1 @vreduce_umin_v64i1(<64 x i1> %v) {
648 ; CHECK-LABEL: vreduce_umin_v64i1:
650 ; CHECK-NEXT: li a0, 64
651 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
652 ; CHECK-NEXT: vmnot.m v8, v0
653 ; CHECK-NEXT: vcpop.m a0, v8
654 ; CHECK-NEXT: seqz a0, a0
656 %red = call i1 @llvm.vector.reduce.umin.v64i1(<64 x i1> %v)
660 declare i1 @llvm.vector.reduce.smin.v64i1(<64 x i1>)
662 define zeroext i1 @vreduce_smin_v64i1(<64 x i1> %v) {
663 ; CHECK-LABEL: vreduce_smin_v64i1:
665 ; CHECK-NEXT: li a0, 64
666 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
667 ; CHECK-NEXT: vcpop.m a0, v0
668 ; CHECK-NEXT: snez a0, a0
670 %red = call i1 @llvm.vector.reduce.smin.v64i1(<64 x i1> %v)
674 declare i1 @llvm.vector.reduce.add.v1i1(<1 x i1>)
676 define zeroext i1 @vreduce_add_v1i1(<1 x i1> %v) {
677 ; CHECK-LABEL: vreduce_add_v1i1:
679 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
680 ; CHECK-NEXT: vfirst.m a0, v0
681 ; CHECK-NEXT: seqz a0, a0
683 %red = call i1 @llvm.vector.reduce.add.v1i1(<1 x i1> %v)
687 declare i1 @llvm.vector.reduce.add.v2i1(<2 x i1>)
689 define zeroext i1 @vreduce_add_v2i1(<2 x i1> %v) {
690 ; CHECK-LABEL: vreduce_add_v2i1:
692 ; CHECK-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
693 ; CHECK-NEXT: vcpop.m a0, v0
694 ; CHECK-NEXT: andi a0, a0, 1
696 %red = call i1 @llvm.vector.reduce.add.v2i1(<2 x i1> %v)
700 declare i1 @llvm.vector.reduce.add.v4i1(<4 x i1>)
702 define zeroext i1 @vreduce_add_v4i1(<4 x i1> %v) {
703 ; CHECK-LABEL: vreduce_add_v4i1:
705 ; CHECK-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
706 ; CHECK-NEXT: vcpop.m a0, v0
707 ; CHECK-NEXT: andi a0, a0, 1
709 %red = call i1 @llvm.vector.reduce.add.v4i1(<4 x i1> %v)
713 declare i1 @llvm.vector.reduce.add.v8i1(<8 x i1>)
715 define zeroext i1 @vreduce_add_v8i1(<8 x i1> %v) {
716 ; CHECK-LABEL: vreduce_add_v8i1:
718 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
719 ; CHECK-NEXT: vcpop.m a0, v0
720 ; CHECK-NEXT: andi a0, a0, 1
722 %red = call i1 @llvm.vector.reduce.add.v8i1(<8 x i1> %v)
726 declare i1 @llvm.vector.reduce.add.v16i1(<16 x i1>)
728 define zeroext i1 @vreduce_add_v16i1(<16 x i1> %v) {
729 ; CHECK-LABEL: vreduce_add_v16i1:
731 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
732 ; CHECK-NEXT: vcpop.m a0, v0
733 ; CHECK-NEXT: andi a0, a0, 1
735 %red = call i1 @llvm.vector.reduce.add.v16i1(<16 x i1> %v)
739 declare i1 @llvm.vector.reduce.add.v32i1(<32 x i1>)
741 define zeroext i1 @vreduce_add_v32i1(<32 x i1> %v) {
742 ; CHECK-LABEL: vreduce_add_v32i1:
744 ; CHECK-NEXT: li a0, 32
745 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
746 ; CHECK-NEXT: vcpop.m a0, v0
747 ; CHECK-NEXT: andi a0, a0, 1
749 %red = call i1 @llvm.vector.reduce.add.v32i1(<32 x i1> %v)
753 declare i1 @llvm.vector.reduce.add.v64i1(<64 x i1>)
755 define zeroext i1 @vreduce_add_v64i1(<64 x i1> %v) {
756 ; CHECK-LABEL: vreduce_add_v64i1:
758 ; CHECK-NEXT: li a0, 64
759 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
760 ; CHECK-NEXT: vcpop.m a0, v0
761 ; CHECK-NEXT: andi a0, a0, 1
763 %red = call i1 @llvm.vector.reduce.add.v64i1(<64 x i1> %v)
767 declare i1 @llvm.vector.reduce.or.v128i1(<128 x i1>)
769 define zeroext i1 @vreduce_or_v128i1(<128 x i1> %v) {
770 ; CHECK-LABEL: vreduce_or_v128i1:
772 ; CHECK-NEXT: li a0, 128
773 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
774 ; CHECK-NEXT: vcpop.m a0, v0
775 ; CHECK-NEXT: snez a0, a0
777 %red = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> %v)
781 declare i1 @llvm.vector.reduce.xor.v128i1(<128 x i1>)
783 define zeroext i1 @vreduce_xor_v128i1(<128 x i1> %v) {
784 ; CHECK-LABEL: vreduce_xor_v128i1:
786 ; CHECK-NEXT: li a0, 128
787 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
788 ; CHECK-NEXT: vcpop.m a0, v0
789 ; CHECK-NEXT: andi a0, a0, 1
791 %red = call i1 @llvm.vector.reduce.xor.v128i1(<128 x i1> %v)
795 declare i1 @llvm.vector.reduce.and.v128i1(<128 x i1>)
797 define zeroext i1 @vreduce_and_v128i1(<128 x i1> %v) {
798 ; CHECK-LABEL: vreduce_and_v128i1:
800 ; CHECK-NEXT: li a0, 128
801 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
802 ; CHECK-NEXT: vmnot.m v8, v0
803 ; CHECK-NEXT: vcpop.m a0, v8
804 ; CHECK-NEXT: seqz a0, a0
806 %red = call i1 @llvm.vector.reduce.and.v128i1(<128 x i1> %v)
810 declare i1 @llvm.vector.reduce.umax.v128i1(<128 x i1>)
812 define zeroext i1 @vreduce_umax_v128i1(<128 x i1> %v) {
813 ; CHECK-LABEL: vreduce_umax_v128i1:
815 ; CHECK-NEXT: li a0, 128
816 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
817 ; CHECK-NEXT: vcpop.m a0, v0
818 ; CHECK-NEXT: snez a0, a0
820 %red = call i1 @llvm.vector.reduce.umax.v128i1(<128 x i1> %v)
824 declare i1 @llvm.vector.reduce.smax.v128i1(<128 x i1>)
826 define zeroext i1 @vreduce_smax_v128i1(<128 x i1> %v) {
827 ; CHECK-LABEL: vreduce_smax_v128i1:
829 ; CHECK-NEXT: li a0, 128
830 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
831 ; CHECK-NEXT: vmnot.m v8, v0
832 ; CHECK-NEXT: vcpop.m a0, v8
833 ; CHECK-NEXT: seqz a0, a0
835 %red = call i1 @llvm.vector.reduce.smax.v128i1(<128 x i1> %v)
839 declare i1 @llvm.vector.reduce.umin.v128i1(<128 x i1>)
841 define zeroext i1 @vreduce_umin_v128i1(<128 x i1> %v) {
842 ; CHECK-LABEL: vreduce_umin_v128i1:
844 ; CHECK-NEXT: li a0, 128
845 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
846 ; CHECK-NEXT: vmnot.m v8, v0
847 ; CHECK-NEXT: vcpop.m a0, v8
848 ; CHECK-NEXT: seqz a0, a0
850 %red = call i1 @llvm.vector.reduce.umin.v128i1(<128 x i1> %v)
854 declare i1 @llvm.vector.reduce.smin.v128i1(<128 x i1>)
856 define zeroext i1 @vreduce_smin_v128i1(<128 x i1> %v) {
857 ; CHECK-LABEL: vreduce_smin_v128i1:
859 ; CHECK-NEXT: li a0, 128
860 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
861 ; CHECK-NEXT: vcpop.m a0, v0
862 ; CHECK-NEXT: snez a0, a0
864 %red = call i1 @llvm.vector.reduce.smin.v128i1(<128 x i1> %v)
868 declare i1 @llvm.vector.reduce.or.v256i1(<256 x i1>)
870 define zeroext i1 @vreduce_or_v256i1(<256 x i1> %v) {
871 ; CHECK-LABEL: vreduce_or_v256i1:
873 ; CHECK-NEXT: li a0, 128
874 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
875 ; CHECK-NEXT: vmor.mm v8, v0, v8
876 ; CHECK-NEXT: vcpop.m a0, v8
877 ; CHECK-NEXT: snez a0, a0
879 %red = call i1 @llvm.vector.reduce.or.v256i1(<256 x i1> %v)
883 declare i1 @llvm.vector.reduce.xor.v256i1(<256 x i1>)
885 define zeroext i1 @vreduce_xor_v256i1(<256 x i1> %v) {
886 ; CHECK-LABEL: vreduce_xor_v256i1:
888 ; CHECK-NEXT: li a0, 128
889 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
890 ; CHECK-NEXT: vmxor.mm v8, v0, v8
891 ; CHECK-NEXT: vcpop.m a0, v8
892 ; CHECK-NEXT: andi a0, a0, 1
894 %red = call i1 @llvm.vector.reduce.xor.v256i1(<256 x i1> %v)
898 declare i1 @llvm.vector.reduce.and.v256i1(<256 x i1>)
900 define zeroext i1 @vreduce_and_v256i1(<256 x i1> %v) {
901 ; CHECK-LABEL: vreduce_and_v256i1:
903 ; CHECK-NEXT: li a0, 128
904 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
905 ; CHECK-NEXT: vmnand.mm v8, v0, v8
906 ; CHECK-NEXT: vcpop.m a0, v8
907 ; CHECK-NEXT: seqz a0, a0
909 %red = call i1 @llvm.vector.reduce.and.v256i1(<256 x i1> %v)
913 declare i1 @llvm.vector.reduce.umax.v256i1(<256 x i1>)
915 define zeroext i1 @vreduce_umax_v256i1(<256 x i1> %v) {
916 ; CHECK-LABEL: vreduce_umax_v256i1:
918 ; CHECK-NEXT: li a0, 128
919 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
920 ; CHECK-NEXT: vmor.mm v8, v0, v8
921 ; CHECK-NEXT: vcpop.m a0, v8
922 ; CHECK-NEXT: snez a0, a0
924 %red = call i1 @llvm.vector.reduce.umax.v256i1(<256 x i1> %v)
928 declare i1 @llvm.vector.reduce.smax.v256i1(<256 x i1>)
930 define zeroext i1 @vreduce_smax_v256i1(<256 x i1> %v) {
931 ; CHECK-LABEL: vreduce_smax_v256i1:
933 ; CHECK-NEXT: li a0, 128
934 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
935 ; CHECK-NEXT: vmnand.mm v8, v0, v8
936 ; CHECK-NEXT: vcpop.m a0, v8
937 ; CHECK-NEXT: seqz a0, a0
939 %red = call i1 @llvm.vector.reduce.smax.v256i1(<256 x i1> %v)
943 declare i1 @llvm.vector.reduce.umin.v256i1(<256 x i1>)
945 define zeroext i1 @vreduce_umin_v256i1(<256 x i1> %v) {
946 ; CHECK-LABEL: vreduce_umin_v256i1:
948 ; CHECK-NEXT: li a0, 128
949 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
950 ; CHECK-NEXT: vmnand.mm v8, v0, v8
951 ; CHECK-NEXT: vcpop.m a0, v8
952 ; CHECK-NEXT: seqz a0, a0
954 %red = call i1 @llvm.vector.reduce.umin.v256i1(<256 x i1> %v)
958 declare i1 @llvm.vector.reduce.smin.v256i1(<256 x i1>)
960 define zeroext i1 @vreduce_smin_v256i1(<256 x i1> %v) {
961 ; CHECK-LABEL: vreduce_smin_v256i1:
963 ; CHECK-NEXT: li a0, 128
964 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
965 ; CHECK-NEXT: vmor.mm v8, v0, v8
966 ; CHECK-NEXT: vcpop.m a0, v8
967 ; CHECK-NEXT: snez a0, a0
969 %red = call i1 @llvm.vector.reduce.smin.v256i1(<256 x i1> %v)
973 declare i1 @llvm.vector.reduce.or.v512i1(<512 x i1>)
975 define zeroext i1 @vreduce_or_v512i1(<512 x i1> %v) {
976 ; CHECK-LABEL: vreduce_or_v512i1:
978 ; CHECK-NEXT: li a0, 128
979 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
980 ; CHECK-NEXT: vmor.mm v8, v8, v10
981 ; CHECK-NEXT: vmor.mm v9, v0, v9
982 ; CHECK-NEXT: vmor.mm v8, v9, v8
983 ; CHECK-NEXT: vcpop.m a0, v8
984 ; CHECK-NEXT: snez a0, a0
986 %red = call i1 @llvm.vector.reduce.or.v512i1(<512 x i1> %v)
990 declare i1 @llvm.vector.reduce.xor.v512i1(<512 x i1>)
992 define zeroext i1 @vreduce_xor_v512i1(<512 x i1> %v) {
993 ; CHECK-LABEL: vreduce_xor_v512i1:
995 ; CHECK-NEXT: li a0, 128
996 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
997 ; CHECK-NEXT: vmxor.mm v8, v8, v10
998 ; CHECK-NEXT: vmxor.mm v9, v0, v9
999 ; CHECK-NEXT: vmxor.mm v8, v9, v8
1000 ; CHECK-NEXT: vcpop.m a0, v8
1001 ; CHECK-NEXT: andi a0, a0, 1
1003 %red = call i1 @llvm.vector.reduce.xor.v512i1(<512 x i1> %v)
1007 declare i1 @llvm.vector.reduce.and.v512i1(<512 x i1>)
1009 define zeroext i1 @vreduce_and_v512i1(<512 x i1> %v) {
1010 ; CHECK-LABEL: vreduce_and_v512i1:
1012 ; CHECK-NEXT: li a0, 128
1013 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
1014 ; CHECK-NEXT: vmand.mm v8, v8, v10
1015 ; CHECK-NEXT: vmand.mm v9, v0, v9
1016 ; CHECK-NEXT: vmnand.mm v8, v9, v8
1017 ; CHECK-NEXT: vcpop.m a0, v8
1018 ; CHECK-NEXT: seqz a0, a0
1020 %red = call i1 @llvm.vector.reduce.and.v512i1(<512 x i1> %v)
1024 declare i1 @llvm.vector.reduce.umax.v512i1(<512 x i1>)
1026 define zeroext i1 @vreduce_umax_v512i1(<512 x i1> %v) {
1027 ; CHECK-LABEL: vreduce_umax_v512i1:
1029 ; CHECK-NEXT: li a0, 128
1030 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
1031 ; CHECK-NEXT: vmor.mm v8, v8, v10
1032 ; CHECK-NEXT: vmor.mm v9, v0, v9
1033 ; CHECK-NEXT: vmor.mm v8, v9, v8
1034 ; CHECK-NEXT: vcpop.m a0, v8
1035 ; CHECK-NEXT: snez a0, a0
1037 %red = call i1 @llvm.vector.reduce.umax.v512i1(<512 x i1> %v)
1041 declare i1 @llvm.vector.reduce.smax.v512i1(<512 x i1>)
1043 define zeroext i1 @vreduce_smax_v512i1(<512 x i1> %v) {
1044 ; CHECK-LABEL: vreduce_smax_v512i1:
1046 ; CHECK-NEXT: li a0, 128
1047 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
1048 ; CHECK-NEXT: vmand.mm v8, v8, v10
1049 ; CHECK-NEXT: vmand.mm v9, v0, v9
1050 ; CHECK-NEXT: vmnand.mm v8, v9, v8
1051 ; CHECK-NEXT: vcpop.m a0, v8
1052 ; CHECK-NEXT: seqz a0, a0
1054 %red = call i1 @llvm.vector.reduce.smax.v512i1(<512 x i1> %v)
1058 declare i1 @llvm.vector.reduce.umin.v512i1(<512 x i1>)
1060 define zeroext i1 @vreduce_umin_v512i1(<512 x i1> %v) {
1061 ; CHECK-LABEL: vreduce_umin_v512i1:
1063 ; CHECK-NEXT: li a0, 128
1064 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
1065 ; CHECK-NEXT: vmand.mm v8, v8, v10
1066 ; CHECK-NEXT: vmand.mm v9, v0, v9
1067 ; CHECK-NEXT: vmnand.mm v8, v9, v8
1068 ; CHECK-NEXT: vcpop.m a0, v8
1069 ; CHECK-NEXT: seqz a0, a0
1071 %red = call i1 @llvm.vector.reduce.umin.v512i1(<512 x i1> %v)
1075 declare i1 @llvm.vector.reduce.smin.v512i1(<512 x i1>)
1077 define zeroext i1 @vreduce_smin_v512i1(<512 x i1> %v) {
1078 ; CHECK-LABEL: vreduce_smin_v512i1:
1080 ; CHECK-NEXT: li a0, 128
1081 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
1082 ; CHECK-NEXT: vmor.mm v8, v8, v10
1083 ; CHECK-NEXT: vmor.mm v9, v0, v9
1084 ; CHECK-NEXT: vmor.mm v8, v9, v8
1085 ; CHECK-NEXT: vcpop.m a0, v8
1086 ; CHECK-NEXT: snez a0, a0
1088 %red = call i1 @llvm.vector.reduce.smin.v512i1(<512 x i1> %v)
1092 declare i1 @llvm.vector.reduce.or.v1024i1(<1024 x i1>)
1094 define zeroext i1 @vreduce_or_v1024i1(<1024 x i1> %v) {
1095 ; CHECK-LABEL: vreduce_or_v1024i1:
1097 ; CHECK-NEXT: li a0, 128
1098 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
1099 ; CHECK-NEXT: vmor.mm v10, v10, v14
1100 ; CHECK-NEXT: vmor.mm v8, v8, v12
1101 ; CHECK-NEXT: vmor.mm v9, v9, v13
1102 ; CHECK-NEXT: vmor.mm v11, v0, v11
1103 ; CHECK-NEXT: vmor.mm v8, v8, v10
1104 ; CHECK-NEXT: vmor.mm v9, v11, v9
1105 ; CHECK-NEXT: vmor.mm v8, v9, v8
1106 ; CHECK-NEXT: vcpop.m a0, v8
1107 ; CHECK-NEXT: snez a0, a0
1109 %red = call i1 @llvm.vector.reduce.or.v1024i1(<1024 x i1> %v)
1113 declare i1 @llvm.vector.reduce.xor.v1024i1(<1024 x i1>)
1115 define zeroext i1 @vreduce_xor_v1024i1(<1024 x i1> %v) {
1116 ; CHECK-LABEL: vreduce_xor_v1024i1:
1118 ; CHECK-NEXT: li a0, 128
1119 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
1120 ; CHECK-NEXT: vmxor.mm v10, v10, v14
1121 ; CHECK-NEXT: vmxor.mm v8, v8, v12
1122 ; CHECK-NEXT: vmxor.mm v9, v9, v13
1123 ; CHECK-NEXT: vmxor.mm v11, v0, v11
1124 ; CHECK-NEXT: vmxor.mm v8, v8, v10
1125 ; CHECK-NEXT: vmxor.mm v9, v11, v9
1126 ; CHECK-NEXT: vmxor.mm v8, v9, v8
1127 ; CHECK-NEXT: vcpop.m a0, v8
1128 ; CHECK-NEXT: andi a0, a0, 1
1130 %red = call i1 @llvm.vector.reduce.xor.v1024i1(<1024 x i1> %v)
1134 declare i1 @llvm.vector.reduce.and.v1024i1(<1024 x i1>)
1136 define zeroext i1 @vreduce_and_v1024i1(<1024 x i1> %v) {
1137 ; CHECK-LABEL: vreduce_and_v1024i1:
1139 ; CHECK-NEXT: li a0, 128
1140 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
1141 ; CHECK-NEXT: vmand.mm v10, v10, v14
1142 ; CHECK-NEXT: vmand.mm v8, v8, v12
1143 ; CHECK-NEXT: vmand.mm v9, v9, v13
1144 ; CHECK-NEXT: vmand.mm v11, v0, v11
1145 ; CHECK-NEXT: vmand.mm v8, v8, v10
1146 ; CHECK-NEXT: vmand.mm v9, v11, v9
1147 ; CHECK-NEXT: vmnand.mm v8, v9, v8
1148 ; CHECK-NEXT: vcpop.m a0, v8
1149 ; CHECK-NEXT: seqz a0, a0
1151 %red = call i1 @llvm.vector.reduce.and.v1024i1(<1024 x i1> %v)
1155 declare i1 @llvm.vector.reduce.umax.v1024i1(<1024 x i1>)
1157 define zeroext i1 @vreduce_umax_v1024i1(<1024 x i1> %v) {
1158 ; CHECK-LABEL: vreduce_umax_v1024i1:
1160 ; CHECK-NEXT: li a0, 128
1161 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
1162 ; CHECK-NEXT: vmor.mm v10, v10, v14
1163 ; CHECK-NEXT: vmor.mm v8, v8, v12
1164 ; CHECK-NEXT: vmor.mm v9, v9, v13
1165 ; CHECK-NEXT: vmor.mm v11, v0, v11
1166 ; CHECK-NEXT: vmor.mm v8, v8, v10
1167 ; CHECK-NEXT: vmor.mm v9, v11, v9
1168 ; CHECK-NEXT: vmor.mm v8, v9, v8
1169 ; CHECK-NEXT: vcpop.m a0, v8
1170 ; CHECK-NEXT: snez a0, a0
1172 %red = call i1 @llvm.vector.reduce.umax.v1024i1(<1024 x i1> %v)
1176 declare i1 @llvm.vector.reduce.smax.v1024i1(<1024 x i1>)
1178 define zeroext i1 @vreduce_smax_v1024i1(<1024 x i1> %v) {
1179 ; CHECK-LABEL: vreduce_smax_v1024i1:
1181 ; CHECK-NEXT: li a0, 128
1182 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
1183 ; CHECK-NEXT: vmand.mm v10, v10, v14
1184 ; CHECK-NEXT: vmand.mm v8, v8, v12
1185 ; CHECK-NEXT: vmand.mm v9, v9, v13
1186 ; CHECK-NEXT: vmand.mm v11, v0, v11
1187 ; CHECK-NEXT: vmand.mm v8, v8, v10
1188 ; CHECK-NEXT: vmand.mm v9, v11, v9
1189 ; CHECK-NEXT: vmnand.mm v8, v9, v8
1190 ; CHECK-NEXT: vcpop.m a0, v8
1191 ; CHECK-NEXT: seqz a0, a0
1193 %red = call i1 @llvm.vector.reduce.smax.v1024i1(<1024 x i1> %v)
1197 declare i1 @llvm.vector.reduce.umin.v1024i1(<1024 x i1>)
1199 define zeroext i1 @vreduce_umin_v1024i1(<1024 x i1> %v) {
1200 ; CHECK-LABEL: vreduce_umin_v1024i1:
1202 ; CHECK-NEXT: li a0, 128
1203 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
1204 ; CHECK-NEXT: vmand.mm v10, v10, v14
1205 ; CHECK-NEXT: vmand.mm v8, v8, v12
1206 ; CHECK-NEXT: vmand.mm v9, v9, v13
1207 ; CHECK-NEXT: vmand.mm v11, v0, v11
1208 ; CHECK-NEXT: vmand.mm v8, v8, v10
1209 ; CHECK-NEXT: vmand.mm v9, v11, v9
1210 ; CHECK-NEXT: vmnand.mm v8, v9, v8
1211 ; CHECK-NEXT: vcpop.m a0, v8
1212 ; CHECK-NEXT: seqz a0, a0
1214 %red = call i1 @llvm.vector.reduce.umin.v1024i1(<1024 x i1> %v)
1218 declare i1 @llvm.vector.reduce.smin.v1024i1(<1024 x i1>)
1220 define zeroext i1 @vreduce_smin_v1024i1(<1024 x i1> %v) {
1221 ; CHECK-LABEL: vreduce_smin_v1024i1:
1223 ; CHECK-NEXT: li a0, 128
1224 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
1225 ; CHECK-NEXT: vmor.mm v10, v10, v14
1226 ; CHECK-NEXT: vmor.mm v8, v8, v12
1227 ; CHECK-NEXT: vmor.mm v9, v9, v13
1228 ; CHECK-NEXT: vmor.mm v11, v0, v11
1229 ; CHECK-NEXT: vmor.mm v8, v8, v10
1230 ; CHECK-NEXT: vmor.mm v9, v11, v9
1231 ; CHECK-NEXT: vmor.mm v8, v9, v8
1232 ; CHECK-NEXT: vcpop.m a0, v8
1233 ; CHECK-NEXT: snez a0, a0
1235 %red = call i1 @llvm.vector.reduce.smin.v1024i1(<1024 x i1> %v)