1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < %s | FileCheck %s
3 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s | FileCheck %s
5 declare i1 @llvm.vp.reduce.and.nxv1i1(i1, <vscale x 1 x i1>, <vscale x 1 x i1>, i32)
7 define zeroext i1 @vpreduce_and_nxv1i1(i1 zeroext %s, <vscale x 1 x i1> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
8 ; CHECK-LABEL: vpreduce_and_nxv1i1:
10 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
11 ; CHECK-NEXT: vmnot.m v9, v0
12 ; CHECK-NEXT: vmv1r.v v0, v8
13 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
14 ; CHECK-NEXT: seqz a1, a1
15 ; CHECK-NEXT: and a0, a1, a0
17 %r = call i1 @llvm.vp.reduce.and.nxv1i1(i1 %s, <vscale x 1 x i1> %v, <vscale x 1 x i1> %m, i32 %evl)
21 declare i1 @llvm.vp.reduce.or.nxv1i1(i1, <vscale x 1 x i1>, <vscale x 1 x i1>, i32)
23 define zeroext i1 @vpreduce_or_nxv1i1(i1 zeroext %s, <vscale x 1 x i1> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
24 ; CHECK-LABEL: vpreduce_or_nxv1i1:
26 ; CHECK-NEXT: vmv1r.v v9, v0
27 ; CHECK-NEXT: vmv1r.v v0, v8
28 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
29 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
30 ; CHECK-NEXT: snez a1, a1
31 ; CHECK-NEXT: or a0, a1, a0
33 %r = call i1 @llvm.vp.reduce.or.nxv1i1(i1 %s, <vscale x 1 x i1> %v, <vscale x 1 x i1> %m, i32 %evl)
37 declare i1 @llvm.vp.reduce.xor.nxv1i1(i1, <vscale x 1 x i1>, <vscale x 1 x i1>, i32)
39 define zeroext i1 @vpreduce_xor_nxv1i1(i1 zeroext %s, <vscale x 1 x i1> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
40 ; CHECK-LABEL: vpreduce_xor_nxv1i1:
42 ; CHECK-NEXT: vmv1r.v v9, v0
43 ; CHECK-NEXT: vmv1r.v v0, v8
44 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
45 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
46 ; CHECK-NEXT: andi a1, a1, 1
47 ; CHECK-NEXT: xor a0, a1, a0
49 %r = call i1 @llvm.vp.reduce.xor.nxv1i1(i1 %s, <vscale x 1 x i1> %v, <vscale x 1 x i1> %m, i32 %evl)
53 declare i1 @llvm.vp.reduce.and.nxv2i1(i1, <vscale x 2 x i1>, <vscale x 2 x i1>, i32)
55 define zeroext i1 @vpreduce_and_nxv2i1(i1 zeroext %s, <vscale x 2 x i1> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
56 ; CHECK-LABEL: vpreduce_and_nxv2i1:
58 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
59 ; CHECK-NEXT: vmnot.m v9, v0
60 ; CHECK-NEXT: vmv1r.v v0, v8
61 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
62 ; CHECK-NEXT: seqz a1, a1
63 ; CHECK-NEXT: and a0, a1, a0
65 %r = call i1 @llvm.vp.reduce.and.nxv2i1(i1 %s, <vscale x 2 x i1> %v, <vscale x 2 x i1> %m, i32 %evl)
69 declare i1 @llvm.vp.reduce.or.nxv2i1(i1, <vscale x 2 x i1>, <vscale x 2 x i1>, i32)
71 define zeroext i1 @vpreduce_or_nxv2i1(i1 zeroext %s, <vscale x 2 x i1> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
72 ; CHECK-LABEL: vpreduce_or_nxv2i1:
74 ; CHECK-NEXT: vmv1r.v v9, v0
75 ; CHECK-NEXT: vmv1r.v v0, v8
76 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
77 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
78 ; CHECK-NEXT: snez a1, a1
79 ; CHECK-NEXT: or a0, a1, a0
81 %r = call i1 @llvm.vp.reduce.or.nxv2i1(i1 %s, <vscale x 2 x i1> %v, <vscale x 2 x i1> %m, i32 %evl)
85 declare i1 @llvm.vp.reduce.xor.nxv2i1(i1, <vscale x 2 x i1>, <vscale x 2 x i1>, i32)
87 define zeroext i1 @vpreduce_xor_nxv2i1(i1 zeroext %s, <vscale x 2 x i1> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
88 ; CHECK-LABEL: vpreduce_xor_nxv2i1:
90 ; CHECK-NEXT: vmv1r.v v9, v0
91 ; CHECK-NEXT: vmv1r.v v0, v8
92 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
93 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
94 ; CHECK-NEXT: andi a1, a1, 1
95 ; CHECK-NEXT: xor a0, a1, a0
97 %r = call i1 @llvm.vp.reduce.xor.nxv2i1(i1 %s, <vscale x 2 x i1> %v, <vscale x 2 x i1> %m, i32 %evl)
101 declare i1 @llvm.vp.reduce.and.nxv4i1(i1, <vscale x 4 x i1>, <vscale x 4 x i1>, i32)
103 define zeroext i1 @vpreduce_and_nxv4i1(i1 zeroext %s, <vscale x 4 x i1> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
104 ; CHECK-LABEL: vpreduce_and_nxv4i1:
106 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
107 ; CHECK-NEXT: vmnot.m v9, v0
108 ; CHECK-NEXT: vmv1r.v v0, v8
109 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
110 ; CHECK-NEXT: seqz a1, a1
111 ; CHECK-NEXT: and a0, a1, a0
113 %r = call i1 @llvm.vp.reduce.and.nxv4i1(i1 %s, <vscale x 4 x i1> %v, <vscale x 4 x i1> %m, i32 %evl)
117 declare i1 @llvm.vp.reduce.or.nxv4i1(i1, <vscale x 4 x i1>, <vscale x 4 x i1>, i32)
119 define zeroext i1 @vpreduce_or_nxv4i1(i1 zeroext %s, <vscale x 4 x i1> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
120 ; CHECK-LABEL: vpreduce_or_nxv4i1:
122 ; CHECK-NEXT: vmv1r.v v9, v0
123 ; CHECK-NEXT: vmv1r.v v0, v8
124 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
125 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
126 ; CHECK-NEXT: snez a1, a1
127 ; CHECK-NEXT: or a0, a1, a0
129 %r = call i1 @llvm.vp.reduce.or.nxv4i1(i1 %s, <vscale x 4 x i1> %v, <vscale x 4 x i1> %m, i32 %evl)
133 declare i1 @llvm.vp.reduce.xor.nxv4i1(i1, <vscale x 4 x i1>, <vscale x 4 x i1>, i32)
135 define zeroext i1 @vpreduce_xor_nxv4i1(i1 zeroext %s, <vscale x 4 x i1> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
136 ; CHECK-LABEL: vpreduce_xor_nxv4i1:
138 ; CHECK-NEXT: vmv1r.v v9, v0
139 ; CHECK-NEXT: vmv1r.v v0, v8
140 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
141 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
142 ; CHECK-NEXT: andi a1, a1, 1
143 ; CHECK-NEXT: xor a0, a1, a0
145 %r = call i1 @llvm.vp.reduce.xor.nxv4i1(i1 %s, <vscale x 4 x i1> %v, <vscale x 4 x i1> %m, i32 %evl)
149 declare i1 @llvm.vp.reduce.and.nxv8i1(i1, <vscale x 8 x i1>, <vscale x 8 x i1>, i32)
151 define zeroext i1 @vpreduce_and_nxv8i1(i1 zeroext %s, <vscale x 8 x i1> %v, <vscale x 8 x i1> %m, i32 zeroext %evl) {
152 ; CHECK-LABEL: vpreduce_and_nxv8i1:
154 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
155 ; CHECK-NEXT: vmnot.m v9, v0
156 ; CHECK-NEXT: vmv1r.v v0, v8
157 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
158 ; CHECK-NEXT: seqz a1, a1
159 ; CHECK-NEXT: and a0, a1, a0
161 %r = call i1 @llvm.vp.reduce.and.nxv8i1(i1 %s, <vscale x 8 x i1> %v, <vscale x 8 x i1> %m, i32 %evl)
165 declare i1 @llvm.vp.reduce.or.nxv8i1(i1, <vscale x 8 x i1>, <vscale x 8 x i1>, i32)
167 define zeroext i1 @vpreduce_or_nxv8i1(i1 zeroext %s, <vscale x 8 x i1> %v, <vscale x 8 x i1> %m, i32 zeroext %evl) {
168 ; CHECK-LABEL: vpreduce_or_nxv8i1:
170 ; CHECK-NEXT: vmv1r.v v9, v0
171 ; CHECK-NEXT: vmv1r.v v0, v8
172 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
173 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
174 ; CHECK-NEXT: snez a1, a1
175 ; CHECK-NEXT: or a0, a1, a0
177 %r = call i1 @llvm.vp.reduce.or.nxv8i1(i1 %s, <vscale x 8 x i1> %v, <vscale x 8 x i1> %m, i32 %evl)
181 declare i1 @llvm.vp.reduce.xor.nxv8i1(i1, <vscale x 8 x i1>, <vscale x 8 x i1>, i32)
183 define zeroext i1 @vpreduce_xor_nxv8i1(i1 zeroext %s, <vscale x 8 x i1> %v, <vscale x 8 x i1> %m, i32 zeroext %evl) {
184 ; CHECK-LABEL: vpreduce_xor_nxv8i1:
186 ; CHECK-NEXT: vmv1r.v v9, v0
187 ; CHECK-NEXT: vmv1r.v v0, v8
188 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
189 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
190 ; CHECK-NEXT: andi a1, a1, 1
191 ; CHECK-NEXT: xor a0, a1, a0
193 %r = call i1 @llvm.vp.reduce.xor.nxv8i1(i1 %s, <vscale x 8 x i1> %v, <vscale x 8 x i1> %m, i32 %evl)
197 declare i1 @llvm.vp.reduce.and.nxv16i1(i1, <vscale x 16 x i1>, <vscale x 16 x i1>, i32)
199 define zeroext i1 @vpreduce_and_nxv16i1(i1 zeroext %s, <vscale x 16 x i1> %v, <vscale x 16 x i1> %m, i32 zeroext %evl) {
200 ; CHECK-LABEL: vpreduce_and_nxv16i1:
202 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
203 ; CHECK-NEXT: vmnot.m v9, v0
204 ; CHECK-NEXT: vmv1r.v v0, v8
205 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
206 ; CHECK-NEXT: seqz a1, a1
207 ; CHECK-NEXT: and a0, a1, a0
209 %r = call i1 @llvm.vp.reduce.and.nxv16i1(i1 %s, <vscale x 16 x i1> %v, <vscale x 16 x i1> %m, i32 %evl)
213 declare i1 @llvm.vp.reduce.or.nxv16i1(i1, <vscale x 16 x i1>, <vscale x 16 x i1>, i32)
215 define zeroext i1 @vpreduce_or_nxv16i1(i1 zeroext %s, <vscale x 16 x i1> %v, <vscale x 16 x i1> %m, i32 zeroext %evl) {
216 ; CHECK-LABEL: vpreduce_or_nxv16i1:
218 ; CHECK-NEXT: vmv1r.v v9, v0
219 ; CHECK-NEXT: vmv1r.v v0, v8
220 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
221 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
222 ; CHECK-NEXT: snez a1, a1
223 ; CHECK-NEXT: or a0, a1, a0
225 %r = call i1 @llvm.vp.reduce.or.nxv16i1(i1 %s, <vscale x 16 x i1> %v, <vscale x 16 x i1> %m, i32 %evl)
229 declare i1 @llvm.vp.reduce.xor.nxv16i1(i1, <vscale x 16 x i1>, <vscale x 16 x i1>, i32)
231 define zeroext i1 @vpreduce_xor_nxv16i1(i1 zeroext %s, <vscale x 16 x i1> %v, <vscale x 16 x i1> %m, i32 zeroext %evl) {
232 ; CHECK-LABEL: vpreduce_xor_nxv16i1:
234 ; CHECK-NEXT: vmv1r.v v9, v0
235 ; CHECK-NEXT: vmv1r.v v0, v8
236 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
237 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
238 ; CHECK-NEXT: andi a1, a1, 1
239 ; CHECK-NEXT: xor a0, a1, a0
241 %r = call i1 @llvm.vp.reduce.xor.nxv16i1(i1 %s, <vscale x 16 x i1> %v, <vscale x 16 x i1> %m, i32 %evl)
245 declare i1 @llvm.vp.reduce.and.nxv32i1(i1, <vscale x 32 x i1>, <vscale x 32 x i1>, i32)
247 define zeroext i1 @vpreduce_and_nxv32i1(i1 zeroext %s, <vscale x 32 x i1> %v, <vscale x 32 x i1> %m, i32 zeroext %evl) {
248 ; CHECK-LABEL: vpreduce_and_nxv32i1:
250 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
251 ; CHECK-NEXT: vmnot.m v9, v0
252 ; CHECK-NEXT: vmv1r.v v0, v8
253 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
254 ; CHECK-NEXT: seqz a1, a1
255 ; CHECK-NEXT: and a0, a1, a0
257 %r = call i1 @llvm.vp.reduce.and.nxv32i1(i1 %s, <vscale x 32 x i1> %v, <vscale x 32 x i1> %m, i32 %evl)
261 declare i1 @llvm.vp.reduce.or.nxv32i1(i1, <vscale x 32 x i1>, <vscale x 32 x i1>, i32)
263 define zeroext i1 @vpreduce_or_nxv32i1(i1 zeroext %s, <vscale x 32 x i1> %v, <vscale x 32 x i1> %m, i32 zeroext %evl) {
264 ; CHECK-LABEL: vpreduce_or_nxv32i1:
266 ; CHECK-NEXT: vmv1r.v v9, v0
267 ; CHECK-NEXT: vmv1r.v v0, v8
268 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
269 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
270 ; CHECK-NEXT: snez a1, a1
271 ; CHECK-NEXT: or a0, a1, a0
273 %r = call i1 @llvm.vp.reduce.or.nxv32i1(i1 %s, <vscale x 32 x i1> %v, <vscale x 32 x i1> %m, i32 %evl)
277 declare i1 @llvm.vp.reduce.xor.nxv32i1(i1, <vscale x 32 x i1>, <vscale x 32 x i1>, i32)
279 define zeroext i1 @vpreduce_xor_nxv32i1(i1 zeroext %s, <vscale x 32 x i1> %v, <vscale x 32 x i1> %m, i32 zeroext %evl) {
280 ; CHECK-LABEL: vpreduce_xor_nxv32i1:
282 ; CHECK-NEXT: vmv1r.v v9, v0
283 ; CHECK-NEXT: vmv1r.v v0, v8
284 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
285 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
286 ; CHECK-NEXT: andi a1, a1, 1
287 ; CHECK-NEXT: xor a0, a1, a0
289 %r = call i1 @llvm.vp.reduce.xor.nxv32i1(i1 %s, <vscale x 32 x i1> %v, <vscale x 32 x i1> %m, i32 %evl)
293 declare i1 @llvm.vp.reduce.or.nxv40i1(i1, <vscale x 40 x i1>, <vscale x 40 x i1>, i32)
295 define zeroext i1 @vpreduce_or_nxv40i1(i1 zeroext %s, <vscale x 40 x i1> %v, <vscale x 40 x i1> %m, i32 zeroext %evl) {
296 ; CHECK-LABEL: vpreduce_or_nxv40i1:
298 ; CHECK-NEXT: vmv1r.v v9, v0
299 ; CHECK-NEXT: vmv1r.v v0, v8
300 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
301 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
302 ; CHECK-NEXT: snez a1, a1
303 ; CHECK-NEXT: or a0, a1, a0
305 %r = call i1 @llvm.vp.reduce.or.nxv40i1(i1 %s, <vscale x 40 x i1> %v, <vscale x 40 x i1> %m, i32 %evl)
309 declare i1 @llvm.vp.reduce.and.nxv64i1(i1, <vscale x 64 x i1>, <vscale x 64 x i1>, i32)
311 define zeroext i1 @vpreduce_and_nxv64i1(i1 zeroext %s, <vscale x 64 x i1> %v, <vscale x 64 x i1> %m, i32 zeroext %evl) {
312 ; CHECK-LABEL: vpreduce_and_nxv64i1:
314 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
315 ; CHECK-NEXT: vmnot.m v9, v0
316 ; CHECK-NEXT: vmv1r.v v0, v8
317 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
318 ; CHECK-NEXT: seqz a1, a1
319 ; CHECK-NEXT: and a0, a1, a0
321 %r = call i1 @llvm.vp.reduce.and.nxv64i1(i1 %s, <vscale x 64 x i1> %v, <vscale x 64 x i1> %m, i32 %evl)
325 declare i1 @llvm.vp.reduce.or.nxv64i1(i1, <vscale x 64 x i1>, <vscale x 64 x i1>, i32)
327 define zeroext i1 @vpreduce_or_nxv64i1(i1 zeroext %s, <vscale x 64 x i1> %v, <vscale x 64 x i1> %m, i32 zeroext %evl) {
328 ; CHECK-LABEL: vpreduce_or_nxv64i1:
330 ; CHECK-NEXT: vmv1r.v v9, v0
331 ; CHECK-NEXT: vmv1r.v v0, v8
332 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
333 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
334 ; CHECK-NEXT: snez a1, a1
335 ; CHECK-NEXT: or a0, a1, a0
337 %r = call i1 @llvm.vp.reduce.or.nxv64i1(i1 %s, <vscale x 64 x i1> %v, <vscale x 64 x i1> %m, i32 %evl)
341 declare i1 @llvm.vp.reduce.xor.nxv64i1(i1, <vscale x 64 x i1>, <vscale x 64 x i1>, i32)
343 define zeroext i1 @vpreduce_xor_nxv64i1(i1 zeroext %s, <vscale x 64 x i1> %v, <vscale x 64 x i1> %m, i32 zeroext %evl) {
344 ; CHECK-LABEL: vpreduce_xor_nxv64i1:
346 ; CHECK-NEXT: vmv1r.v v9, v0
347 ; CHECK-NEXT: vmv1r.v v0, v8
348 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
349 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
350 ; CHECK-NEXT: andi a1, a1, 1
351 ; CHECK-NEXT: xor a0, a1, a0
353 %r = call i1 @llvm.vp.reduce.xor.nxv64i1(i1 %s, <vscale x 64 x i1> %v, <vscale x 64 x i1> %m, i32 %evl)
357 declare i1 @llvm.vp.reduce.or.nxv128i1(i1, <vscale x 128 x i1>, <vscale x 128 x i1>, i32)
359 define zeroext i1 @vpreduce_or_nxv128i1(i1 zeroext %s, <vscale x 128 x i1> %v, <vscale x 128 x i1> %m, i32 zeroext %evl) {
360 ; CHECK-LABEL: vpreduce_or_nxv128i1:
362 ; CHECK-NEXT: vmv1r.v v11, v0
363 ; CHECK-NEXT: csrr a2, vlenb
364 ; CHECK-NEXT: slli a2, a2, 3
365 ; CHECK-NEXT: sub a3, a1, a2
366 ; CHECK-NEXT: sltu a4, a1, a3
367 ; CHECK-NEXT: addi a4, a4, -1
368 ; CHECK-NEXT: and a3, a4, a3
369 ; CHECK-NEXT: vmv1r.v v0, v10
370 ; CHECK-NEXT: vsetvli zero, a3, e8, m8, ta, ma
371 ; CHECK-NEXT: vcpop.m a3, v8, v0.t
372 ; CHECK-NEXT: snez a3, a3
373 ; CHECK-NEXT: bltu a1, a2, .LBB22_2
374 ; CHECK-NEXT: # %bb.1:
375 ; CHECK-NEXT: mv a1, a2
376 ; CHECK-NEXT: .LBB22_2:
377 ; CHECK-NEXT: vmv1r.v v0, v9
378 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
379 ; CHECK-NEXT: vcpop.m a1, v11, v0.t
380 ; CHECK-NEXT: snez a1, a1
381 ; CHECK-NEXT: or a0, a1, a0
382 ; CHECK-NEXT: or a0, a3, a0
384 %r = call i1 @llvm.vp.reduce.or.nxv128i1(i1 %s, <vscale x 128 x i1> %v, <vscale x 128 x i1> %m, i32 %evl)
388 declare i1 @llvm.vp.reduce.add.nxv1i1(i1, <vscale x 1 x i1>, <vscale x 1 x i1>, i32)
390 define zeroext i1 @vpreduce_add_nxv1i1(i1 zeroext %s, <vscale x 1 x i1> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
391 ; CHECK-LABEL: vpreduce_add_nxv1i1:
393 ; CHECK-NEXT: vmv1r.v v9, v0
394 ; CHECK-NEXT: vmv1r.v v0, v8
395 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
396 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
397 ; CHECK-NEXT: andi a1, a1, 1
398 ; CHECK-NEXT: xor a0, a1, a0
400 %r = call i1 @llvm.vp.reduce.add.nxv1i1(i1 %s, <vscale x 1 x i1> %v, <vscale x 1 x i1> %m, i32 %evl)
404 declare i1 @llvm.vp.reduce.add.nxv2i1(i1, <vscale x 2 x i1>, <vscale x 2 x i1>, i32)
406 define zeroext i1 @vpreduce_add_nxv2i1(i1 zeroext %s, <vscale x 2 x i1> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
407 ; CHECK-LABEL: vpreduce_add_nxv2i1:
409 ; CHECK-NEXT: vmv1r.v v9, v0
410 ; CHECK-NEXT: vmv1r.v v0, v8
411 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
412 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
413 ; CHECK-NEXT: andi a1, a1, 1
414 ; CHECK-NEXT: xor a0, a1, a0
416 %r = call i1 @llvm.vp.reduce.add.nxv2i1(i1 %s, <vscale x 2 x i1> %v, <vscale x 2 x i1> %m, i32 %evl)
420 declare i1 @llvm.vp.reduce.add.nxv4i1(i1, <vscale x 4 x i1>, <vscale x 4 x i1>, i32)
422 define zeroext i1 @vpreduce_add_nxv4i1(i1 zeroext %s, <vscale x 4 x i1> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
423 ; CHECK-LABEL: vpreduce_add_nxv4i1:
425 ; CHECK-NEXT: vmv1r.v v9, v0
426 ; CHECK-NEXT: vmv1r.v v0, v8
427 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
428 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
429 ; CHECK-NEXT: andi a1, a1, 1
430 ; CHECK-NEXT: xor a0, a1, a0
432 %r = call i1 @llvm.vp.reduce.add.nxv4i1(i1 %s, <vscale x 4 x i1> %v, <vscale x 4 x i1> %m, i32 %evl)
436 declare i1 @llvm.vp.reduce.add.nxv8i1(i1, <vscale x 8 x i1>, <vscale x 8 x i1>, i32)
438 define zeroext i1 @vpreduce_add_nxv8i1(i1 zeroext %s, <vscale x 8 x i1> %v, <vscale x 8 x i1> %m, i32 zeroext %evl) {
439 ; CHECK-LABEL: vpreduce_add_nxv8i1:
441 ; CHECK-NEXT: vmv1r.v v9, v0
442 ; CHECK-NEXT: vmv1r.v v0, v8
443 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
444 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
445 ; CHECK-NEXT: andi a1, a1, 1
446 ; CHECK-NEXT: xor a0, a1, a0
448 %r = call i1 @llvm.vp.reduce.add.nxv8i1(i1 %s, <vscale x 8 x i1> %v, <vscale x 8 x i1> %m, i32 %evl)
452 declare i1 @llvm.vp.reduce.add.nxv16i1(i1, <vscale x 16 x i1>, <vscale x 16 x i1>, i32)
454 define zeroext i1 @vpreduce_add_nxv16i1(i1 zeroext %s, <vscale x 16 x i1> %v, <vscale x 16 x i1> %m, i32 zeroext %evl) {
455 ; CHECK-LABEL: vpreduce_add_nxv16i1:
457 ; CHECK-NEXT: vmv1r.v v9, v0
458 ; CHECK-NEXT: vmv1r.v v0, v8
459 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
460 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
461 ; CHECK-NEXT: andi a1, a1, 1
462 ; CHECK-NEXT: xor a0, a1, a0
464 %r = call i1 @llvm.vp.reduce.add.nxv16i1(i1 %s, <vscale x 16 x i1> %v, <vscale x 16 x i1> %m, i32 %evl)
468 declare i1 @llvm.vp.reduce.add.nxv32i1(i1, <vscale x 32 x i1>, <vscale x 32 x i1>, i32)
470 define zeroext i1 @vpreduce_add_nxv32i1(i1 zeroext %s, <vscale x 32 x i1> %v, <vscale x 32 x i1> %m, i32 zeroext %evl) {
471 ; CHECK-LABEL: vpreduce_add_nxv32i1:
473 ; CHECK-NEXT: vmv1r.v v9, v0
474 ; CHECK-NEXT: vmv1r.v v0, v8
475 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
476 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
477 ; CHECK-NEXT: andi a1, a1, 1
478 ; CHECK-NEXT: xor a0, a1, a0
480 %r = call i1 @llvm.vp.reduce.add.nxv32i1(i1 %s, <vscale x 32 x i1> %v, <vscale x 32 x i1> %m, i32 %evl)
484 declare i1 @llvm.vp.reduce.add.nxv64i1(i1, <vscale x 64 x i1>, <vscale x 64 x i1>, i32)
486 define zeroext i1 @vpreduce_add_nxv64i1(i1 zeroext %s, <vscale x 64 x i1> %v, <vscale x 64 x i1> %m, i32 zeroext %evl) {
487 ; CHECK-LABEL: vpreduce_add_nxv64i1:
489 ; CHECK-NEXT: vmv1r.v v9, v0
490 ; CHECK-NEXT: vmv1r.v v0, v8
491 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
492 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
493 ; CHECK-NEXT: andi a1, a1, 1
494 ; CHECK-NEXT: xor a0, a1, a0
496 %r = call i1 @llvm.vp.reduce.add.nxv64i1(i1 %s, <vscale x 64 x i1> %v, <vscale x 64 x i1> %m, i32 %evl)
501 declare i1 @llvm.vp.reduce.smax.nxv1i1(i1, <vscale x 1 x i1>, <vscale x 1 x i1>, i32)
503 define zeroext i1 @vpreduce_smax_nxv1i1(i1 zeroext %s, <vscale x 1 x i1> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
504 ; CHECK-LABEL: vpreduce_smax_nxv1i1:
506 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
507 ; CHECK-NEXT: vmnot.m v9, v0
508 ; CHECK-NEXT: vmv1r.v v0, v8
509 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
510 ; CHECK-NEXT: seqz a1, a1
511 ; CHECK-NEXT: and a0, a1, a0
513 %r = call i1 @llvm.vp.reduce.smax.nxv1i1(i1 %s, <vscale x 1 x i1> %v, <vscale x 1 x i1> %m, i32 %evl)
517 declare i1 @llvm.vp.reduce.smax.nxv2i1(i1, <vscale x 2 x i1>, <vscale x 2 x i1>, i32)
519 define zeroext i1 @vpreduce_smax_nxv2i1(i1 zeroext %s, <vscale x 2 x i1> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
520 ; CHECK-LABEL: vpreduce_smax_nxv2i1:
522 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
523 ; CHECK-NEXT: vmnot.m v9, v0
524 ; CHECK-NEXT: vmv1r.v v0, v8
525 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
526 ; CHECK-NEXT: seqz a1, a1
527 ; CHECK-NEXT: and a0, a1, a0
529 %r = call i1 @llvm.vp.reduce.smax.nxv2i1(i1 %s, <vscale x 2 x i1> %v, <vscale x 2 x i1> %m, i32 %evl)
533 declare i1 @llvm.vp.reduce.smax.nxv4i1(i1, <vscale x 4 x i1>, <vscale x 4 x i1>, i32)
535 define zeroext i1 @vpreduce_smax_nxv4i1(i1 zeroext %s, <vscale x 4 x i1> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
536 ; CHECK-LABEL: vpreduce_smax_nxv4i1:
538 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
539 ; CHECK-NEXT: vmnot.m v9, v0
540 ; CHECK-NEXT: vmv1r.v v0, v8
541 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
542 ; CHECK-NEXT: seqz a1, a1
543 ; CHECK-NEXT: and a0, a1, a0
545 %r = call i1 @llvm.vp.reduce.smax.nxv4i1(i1 %s, <vscale x 4 x i1> %v, <vscale x 4 x i1> %m, i32 %evl)
549 declare i1 @llvm.vp.reduce.smax.nxv8i1(i1, <vscale x 8 x i1>, <vscale x 8 x i1>, i32)
551 define zeroext i1 @vpreduce_smax_nxv8i1(i1 zeroext %s, <vscale x 8 x i1> %v, <vscale x 8 x i1> %m, i32 zeroext %evl) {
552 ; CHECK-LABEL: vpreduce_smax_nxv8i1:
554 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
555 ; CHECK-NEXT: vmnot.m v9, v0
556 ; CHECK-NEXT: vmv1r.v v0, v8
557 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
558 ; CHECK-NEXT: seqz a1, a1
559 ; CHECK-NEXT: and a0, a1, a0
561 %r = call i1 @llvm.vp.reduce.smax.nxv8i1(i1 %s, <vscale x 8 x i1> %v, <vscale x 8 x i1> %m, i32 %evl)
565 declare i1 @llvm.vp.reduce.smax.nxv16i1(i1, <vscale x 16 x i1>, <vscale x 16 x i1>, i32)
567 define zeroext i1 @vpreduce_smax_nxv16i1(i1 zeroext %s, <vscale x 16 x i1> %v, <vscale x 16 x i1> %m, i32 zeroext %evl) {
568 ; CHECK-LABEL: vpreduce_smax_nxv16i1:
570 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
571 ; CHECK-NEXT: vmnot.m v9, v0
572 ; CHECK-NEXT: vmv1r.v v0, v8
573 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
574 ; CHECK-NEXT: seqz a1, a1
575 ; CHECK-NEXT: and a0, a1, a0
577 %r = call i1 @llvm.vp.reduce.smax.nxv16i1(i1 %s, <vscale x 16 x i1> %v, <vscale x 16 x i1> %m, i32 %evl)
581 declare i1 @llvm.vp.reduce.smax.nxv32i1(i1, <vscale x 32 x i1>, <vscale x 32 x i1>, i32)
583 define zeroext i1 @vpreduce_smax_nxv32i1(i1 zeroext %s, <vscale x 32 x i1> %v, <vscale x 32 x i1> %m, i32 zeroext %evl) {
584 ; CHECK-LABEL: vpreduce_smax_nxv32i1:
586 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
587 ; CHECK-NEXT: vmnot.m v9, v0
588 ; CHECK-NEXT: vmv1r.v v0, v8
589 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
590 ; CHECK-NEXT: seqz a1, a1
591 ; CHECK-NEXT: and a0, a1, a0
593 %r = call i1 @llvm.vp.reduce.smax.nxv32i1(i1 %s, <vscale x 32 x i1> %v, <vscale x 32 x i1> %m, i32 %evl)
597 declare i1 @llvm.vp.reduce.smax.nxv64i1(i1, <vscale x 64 x i1>, <vscale x 64 x i1>, i32)
599 define zeroext i1 @vpreduce_smax_nxv64i1(i1 zeroext %s, <vscale x 64 x i1> %v, <vscale x 64 x i1> %m, i32 zeroext %evl) {
600 ; CHECK-LABEL: vpreduce_smax_nxv64i1:
602 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
603 ; CHECK-NEXT: vmnot.m v9, v0
604 ; CHECK-NEXT: vmv1r.v v0, v8
605 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
606 ; CHECK-NEXT: seqz a1, a1
607 ; CHECK-NEXT: and a0, a1, a0
609 %r = call i1 @llvm.vp.reduce.smax.nxv64i1(i1 %s, <vscale x 64 x i1> %v, <vscale x 64 x i1> %m, i32 %evl)
613 declare i1 @llvm.vp.reduce.smin.nxv1i1(i1, <vscale x 1 x i1>, <vscale x 1 x i1>, i32)
615 define zeroext i1 @vpreduce_smin_nxv1i1(i1 zeroext %s, <vscale x 1 x i1> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
616 ; CHECK-LABEL: vpreduce_smin_nxv1i1:
618 ; CHECK-NEXT: vmv1r.v v9, v0
619 ; CHECK-NEXT: vmv1r.v v0, v8
620 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
621 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
622 ; CHECK-NEXT: snez a1, a1
623 ; CHECK-NEXT: or a0, a1, a0
625 %r = call i1 @llvm.vp.reduce.smin.nxv1i1(i1 %s, <vscale x 1 x i1> %v, <vscale x 1 x i1> %m, i32 %evl)
629 declare i1 @llvm.vp.reduce.smin.nxv2i1(i1, <vscale x 2 x i1>, <vscale x 2 x i1>, i32)
631 define zeroext i1 @vpreduce_smin_nxv2i1(i1 zeroext %s, <vscale x 2 x i1> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
632 ; CHECK-LABEL: vpreduce_smin_nxv2i1:
634 ; CHECK-NEXT: vmv1r.v v9, v0
635 ; CHECK-NEXT: vmv1r.v v0, v8
636 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
637 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
638 ; CHECK-NEXT: snez a1, a1
639 ; CHECK-NEXT: or a0, a1, a0
641 %r = call i1 @llvm.vp.reduce.smin.nxv2i1(i1 %s, <vscale x 2 x i1> %v, <vscale x 2 x i1> %m, i32 %evl)
645 declare i1 @llvm.vp.reduce.smin.nxv4i1(i1, <vscale x 4 x i1>, <vscale x 4 x i1>, i32)
647 define zeroext i1 @vpreduce_smin_nxv4i1(i1 zeroext %s, <vscale x 4 x i1> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
648 ; CHECK-LABEL: vpreduce_smin_nxv4i1:
650 ; CHECK-NEXT: vmv1r.v v9, v0
651 ; CHECK-NEXT: vmv1r.v v0, v8
652 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
653 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
654 ; CHECK-NEXT: snez a1, a1
655 ; CHECK-NEXT: or a0, a1, a0
657 %r = call i1 @llvm.vp.reduce.smin.nxv4i1(i1 %s, <vscale x 4 x i1> %v, <vscale x 4 x i1> %m, i32 %evl)
661 declare i1 @llvm.vp.reduce.smin.nxv8i1(i1, <vscale x 8 x i1>, <vscale x 8 x i1>, i32)
663 define zeroext i1 @vpreduce_smin_nxv8i1(i1 zeroext %s, <vscale x 8 x i1> %v, <vscale x 8 x i1> %m, i32 zeroext %evl) {
664 ; CHECK-LABEL: vpreduce_smin_nxv8i1:
666 ; CHECK-NEXT: vmv1r.v v9, v0
667 ; CHECK-NEXT: vmv1r.v v0, v8
668 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
669 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
670 ; CHECK-NEXT: snez a1, a1
671 ; CHECK-NEXT: or a0, a1, a0
673 %r = call i1 @llvm.vp.reduce.smin.nxv8i1(i1 %s, <vscale x 8 x i1> %v, <vscale x 8 x i1> %m, i32 %evl)
677 declare i1 @llvm.vp.reduce.smin.nxv16i1(i1, <vscale x 16 x i1>, <vscale x 16 x i1>, i32)
679 define zeroext i1 @vpreduce_smin_nxv16i1(i1 zeroext %s, <vscale x 16 x i1> %v, <vscale x 16 x i1> %m, i32 zeroext %evl) {
680 ; CHECK-LABEL: vpreduce_smin_nxv16i1:
682 ; CHECK-NEXT: vmv1r.v v9, v0
683 ; CHECK-NEXT: vmv1r.v v0, v8
684 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
685 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
686 ; CHECK-NEXT: snez a1, a1
687 ; CHECK-NEXT: or a0, a1, a0
689 %r = call i1 @llvm.vp.reduce.smin.nxv16i1(i1 %s, <vscale x 16 x i1> %v, <vscale x 16 x i1> %m, i32 %evl)
693 declare i1 @llvm.vp.reduce.smin.nxv32i1(i1, <vscale x 32 x i1>, <vscale x 32 x i1>, i32)
695 define zeroext i1 @vpreduce_smin_nxv32i1(i1 zeroext %s, <vscale x 32 x i1> %v, <vscale x 32 x i1> %m, i32 zeroext %evl) {
696 ; CHECK-LABEL: vpreduce_smin_nxv32i1:
698 ; CHECK-NEXT: vmv1r.v v9, v0
699 ; CHECK-NEXT: vmv1r.v v0, v8
700 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
701 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
702 ; CHECK-NEXT: snez a1, a1
703 ; CHECK-NEXT: or a0, a1, a0
705 %r = call i1 @llvm.vp.reduce.smin.nxv32i1(i1 %s, <vscale x 32 x i1> %v, <vscale x 32 x i1> %m, i32 %evl)
709 declare i1 @llvm.vp.reduce.smin.nxv64i1(i1, <vscale x 64 x i1>, <vscale x 64 x i1>, i32)
711 define zeroext i1 @vpreduce_smin_nxv64i1(i1 zeroext %s, <vscale x 64 x i1> %v, <vscale x 64 x i1> %m, i32 zeroext %evl) {
712 ; CHECK-LABEL: vpreduce_smin_nxv64i1:
714 ; CHECK-NEXT: vmv1r.v v9, v0
715 ; CHECK-NEXT: vmv1r.v v0, v8
716 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
717 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
718 ; CHECK-NEXT: snez a1, a1
719 ; CHECK-NEXT: or a0, a1, a0
721 %r = call i1 @llvm.vp.reduce.smin.nxv64i1(i1 %s, <vscale x 64 x i1> %v, <vscale x 64 x i1> %m, i32 %evl)
725 declare i1 @llvm.vp.reduce.umax.nxv1i1(i1, <vscale x 1 x i1>, <vscale x 1 x i1>, i32)
727 define zeroext i1 @vpreduce_umax_nxv1i1(i1 zeroext %s, <vscale x 1 x i1> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
728 ; CHECK-LABEL: vpreduce_umax_nxv1i1:
730 ; CHECK-NEXT: vmv1r.v v9, v0
731 ; CHECK-NEXT: vmv1r.v v0, v8
732 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
733 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
734 ; CHECK-NEXT: snez a1, a1
735 ; CHECK-NEXT: or a0, a1, a0
737 %r = call i1 @llvm.vp.reduce.umax.nxv1i1(i1 %s, <vscale x 1 x i1> %v, <vscale x 1 x i1> %m, i32 %evl)
741 declare i1 @llvm.vp.reduce.umax.nxv2i1(i1, <vscale x 2 x i1>, <vscale x 2 x i1>, i32)
743 define zeroext i1 @vpreduce_umax_nxv2i1(i1 zeroext %s, <vscale x 2 x i1> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
744 ; CHECK-LABEL: vpreduce_umax_nxv2i1:
746 ; CHECK-NEXT: vmv1r.v v9, v0
747 ; CHECK-NEXT: vmv1r.v v0, v8
748 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
749 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
750 ; CHECK-NEXT: snez a1, a1
751 ; CHECK-NEXT: or a0, a1, a0
753 %r = call i1 @llvm.vp.reduce.umax.nxv2i1(i1 %s, <vscale x 2 x i1> %v, <vscale x 2 x i1> %m, i32 %evl)
757 declare i1 @llvm.vp.reduce.umax.nxv4i1(i1, <vscale x 4 x i1>, <vscale x 4 x i1>, i32)
759 define zeroext i1 @vpreduce_umax_nxv4i1(i1 zeroext %s, <vscale x 4 x i1> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
760 ; CHECK-LABEL: vpreduce_umax_nxv4i1:
762 ; CHECK-NEXT: vmv1r.v v9, v0
763 ; CHECK-NEXT: vmv1r.v v0, v8
764 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
765 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
766 ; CHECK-NEXT: snez a1, a1
767 ; CHECK-NEXT: or a0, a1, a0
769 %r = call i1 @llvm.vp.reduce.umax.nxv4i1(i1 %s, <vscale x 4 x i1> %v, <vscale x 4 x i1> %m, i32 %evl)
773 declare i1 @llvm.vp.reduce.umax.nxv8i1(i1, <vscale x 8 x i1>, <vscale x 8 x i1>, i32)
775 define zeroext i1 @vpreduce_umax_nxv8i1(i1 zeroext %s, <vscale x 8 x i1> %v, <vscale x 8 x i1> %m, i32 zeroext %evl) {
776 ; CHECK-LABEL: vpreduce_umax_nxv8i1:
778 ; CHECK-NEXT: vmv1r.v v9, v0
779 ; CHECK-NEXT: vmv1r.v v0, v8
780 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
781 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
782 ; CHECK-NEXT: snez a1, a1
783 ; CHECK-NEXT: or a0, a1, a0
785 %r = call i1 @llvm.vp.reduce.umax.nxv8i1(i1 %s, <vscale x 8 x i1> %v, <vscale x 8 x i1> %m, i32 %evl)
789 declare i1 @llvm.vp.reduce.umax.nxv16i1(i1, <vscale x 16 x i1>, <vscale x 16 x i1>, i32)
791 define zeroext i1 @vpreduce_umax_nxv16i1(i1 zeroext %s, <vscale x 16 x i1> %v, <vscale x 16 x i1> %m, i32 zeroext %evl) {
792 ; CHECK-LABEL: vpreduce_umax_nxv16i1:
794 ; CHECK-NEXT: vmv1r.v v9, v0
795 ; CHECK-NEXT: vmv1r.v v0, v8
796 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
797 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
798 ; CHECK-NEXT: snez a1, a1
799 ; CHECK-NEXT: or a0, a1, a0
801 %r = call i1 @llvm.vp.reduce.umax.nxv16i1(i1 %s, <vscale x 16 x i1> %v, <vscale x 16 x i1> %m, i32 %evl)
805 declare i1 @llvm.vp.reduce.umax.nxv32i1(i1, <vscale x 32 x i1>, <vscale x 32 x i1>, i32)
807 define zeroext i1 @vpreduce_umax_nxv32i1(i1 zeroext %s, <vscale x 32 x i1> %v, <vscale x 32 x i1> %m, i32 zeroext %evl) {
808 ; CHECK-LABEL: vpreduce_umax_nxv32i1:
810 ; CHECK-NEXT: vmv1r.v v9, v0
811 ; CHECK-NEXT: vmv1r.v v0, v8
812 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
813 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
814 ; CHECK-NEXT: snez a1, a1
815 ; CHECK-NEXT: or a0, a1, a0
817 %r = call i1 @llvm.vp.reduce.umax.nxv32i1(i1 %s, <vscale x 32 x i1> %v, <vscale x 32 x i1> %m, i32 %evl)
821 declare i1 @llvm.vp.reduce.umax.nxv64i1(i1, <vscale x 64 x i1>, <vscale x 64 x i1>, i32)
823 define zeroext i1 @vpreduce_umax_nxv64i1(i1 zeroext %s, <vscale x 64 x i1> %v, <vscale x 64 x i1> %m, i32 zeroext %evl) {
824 ; CHECK-LABEL: vpreduce_umax_nxv64i1:
826 ; CHECK-NEXT: vmv1r.v v9, v0
827 ; CHECK-NEXT: vmv1r.v v0, v8
828 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
829 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
830 ; CHECK-NEXT: snez a1, a1
831 ; CHECK-NEXT: or a0, a1, a0
833 %r = call i1 @llvm.vp.reduce.umax.nxv64i1(i1 %s, <vscale x 64 x i1> %v, <vscale x 64 x i1> %m, i32 %evl)
837 declare i1 @llvm.vp.reduce.umin.nxv1i1(i1, <vscale x 1 x i1>, <vscale x 1 x i1>, i32)
839 define zeroext i1 @vpreduce_umin_nxv1i1(i1 zeroext %s, <vscale x 1 x i1> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
840 ; CHECK-LABEL: vpreduce_umin_nxv1i1:
842 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
843 ; CHECK-NEXT: vmnot.m v9, v0
844 ; CHECK-NEXT: vmv1r.v v0, v8
845 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
846 ; CHECK-NEXT: seqz a1, a1
847 ; CHECK-NEXT: and a0, a1, a0
849 %r = call i1 @llvm.vp.reduce.umin.nxv1i1(i1 %s, <vscale x 1 x i1> %v, <vscale x 1 x i1> %m, i32 %evl)
853 declare i1 @llvm.vp.reduce.umin.nxv2i1(i1, <vscale x 2 x i1>, <vscale x 2 x i1>, i32)
855 define zeroext i1 @vpreduce_umin_nxv2i1(i1 zeroext %s, <vscale x 2 x i1> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
856 ; CHECK-LABEL: vpreduce_umin_nxv2i1:
858 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
859 ; CHECK-NEXT: vmnot.m v9, v0
860 ; CHECK-NEXT: vmv1r.v v0, v8
861 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
862 ; CHECK-NEXT: seqz a1, a1
863 ; CHECK-NEXT: and a0, a1, a0
865 %r = call i1 @llvm.vp.reduce.umin.nxv2i1(i1 %s, <vscale x 2 x i1> %v, <vscale x 2 x i1> %m, i32 %evl)
869 declare i1 @llvm.vp.reduce.umin.nxv4i1(i1, <vscale x 4 x i1>, <vscale x 4 x i1>, i32)
871 define zeroext i1 @vpreduce_umin_nxv4i1(i1 zeroext %s, <vscale x 4 x i1> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
872 ; CHECK-LABEL: vpreduce_umin_nxv4i1:
874 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
875 ; CHECK-NEXT: vmnot.m v9, v0
876 ; CHECK-NEXT: vmv1r.v v0, v8
877 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
878 ; CHECK-NEXT: seqz a1, a1
879 ; CHECK-NEXT: and a0, a1, a0
881 %r = call i1 @llvm.vp.reduce.umin.nxv4i1(i1 %s, <vscale x 4 x i1> %v, <vscale x 4 x i1> %m, i32 %evl)
885 declare i1 @llvm.vp.reduce.umin.nxv8i1(i1, <vscale x 8 x i1>, <vscale x 8 x i1>, i32)
887 define zeroext i1 @vpreduce_umin_nxv8i1(i1 zeroext %s, <vscale x 8 x i1> %v, <vscale x 8 x i1> %m, i32 zeroext %evl) {
888 ; CHECK-LABEL: vpreduce_umin_nxv8i1:
890 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
891 ; CHECK-NEXT: vmnot.m v9, v0
892 ; CHECK-NEXT: vmv1r.v v0, v8
893 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
894 ; CHECK-NEXT: seqz a1, a1
895 ; CHECK-NEXT: and a0, a1, a0
897 %r = call i1 @llvm.vp.reduce.umin.nxv8i1(i1 %s, <vscale x 8 x i1> %v, <vscale x 8 x i1> %m, i32 %evl)
901 declare i1 @llvm.vp.reduce.umin.nxv16i1(i1, <vscale x 16 x i1>, <vscale x 16 x i1>, i32)
903 define zeroext i1 @vpreduce_umin_nxv16i1(i1 zeroext %s, <vscale x 16 x i1> %v, <vscale x 16 x i1> %m, i32 zeroext %evl) {
904 ; CHECK-LABEL: vpreduce_umin_nxv16i1:
906 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
907 ; CHECK-NEXT: vmnot.m v9, v0
908 ; CHECK-NEXT: vmv1r.v v0, v8
909 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
910 ; CHECK-NEXT: seqz a1, a1
911 ; CHECK-NEXT: and a0, a1, a0
913 %r = call i1 @llvm.vp.reduce.umin.nxv16i1(i1 %s, <vscale x 16 x i1> %v, <vscale x 16 x i1> %m, i32 %evl)
917 declare i1 @llvm.vp.reduce.umin.nxv32i1(i1, <vscale x 32 x i1>, <vscale x 32 x i1>, i32)
919 define zeroext i1 @vpreduce_umin_nxv32i1(i1 zeroext %s, <vscale x 32 x i1> %v, <vscale x 32 x i1> %m, i32 zeroext %evl) {
920 ; CHECK-LABEL: vpreduce_umin_nxv32i1:
922 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
923 ; CHECK-NEXT: vmnot.m v9, v0
924 ; CHECK-NEXT: vmv1r.v v0, v8
925 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
926 ; CHECK-NEXT: seqz a1, a1
927 ; CHECK-NEXT: and a0, a1, a0
929 %r = call i1 @llvm.vp.reduce.umin.nxv32i1(i1 %s, <vscale x 32 x i1> %v, <vscale x 32 x i1> %m, i32 %evl)
933 declare i1 @llvm.vp.reduce.umin.nxv64i1(i1, <vscale x 64 x i1>, <vscale x 64 x i1>, i32)
935 define zeroext i1 @vpreduce_umin_nxv64i1(i1 zeroext %s, <vscale x 64 x i1> %v, <vscale x 64 x i1> %m, i32 zeroext %evl) {
936 ; CHECK-LABEL: vpreduce_umin_nxv64i1:
938 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
939 ; CHECK-NEXT: vmnot.m v9, v0
940 ; CHECK-NEXT: vmv1r.v v0, v8
941 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
942 ; CHECK-NEXT: seqz a1, a1
943 ; CHECK-NEXT: and a0, a1, a0
945 %r = call i1 @llvm.vp.reduce.umin.nxv64i1(i1 %s, <vscale x 64 x i1> %v, <vscale x 64 x i1> %m, i32 %evl)
949 declare i1 @llvm.vp.reduce.mul.nxv1i1(i1, <vscale x 1 x i1>, <vscale x 1 x i1>, i32)
951 define zeroext i1 @vpreduce_mul_nxv1i1(i1 zeroext %s, <vscale x 1 x i1> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
952 ; CHECK-LABEL: vpreduce_mul_nxv1i1:
954 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
955 ; CHECK-NEXT: vmnot.m v9, v0
956 ; CHECK-NEXT: vmv1r.v v0, v8
957 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
958 ; CHECK-NEXT: seqz a1, a1
959 ; CHECK-NEXT: and a0, a1, a0
961 %r = call i1 @llvm.vp.reduce.mul.nxv1i1(i1 %s, <vscale x 1 x i1> %v, <vscale x 1 x i1> %m, i32 %evl)
965 declare i1 @llvm.vp.reduce.mul.nxv2i1(i1, <vscale x 2 x i1>, <vscale x 2 x i1>, i32)
967 define zeroext i1 @vpreduce_mul_nxv2i1(i1 zeroext %s, <vscale x 2 x i1> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
968 ; CHECK-LABEL: vpreduce_mul_nxv2i1:
970 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
971 ; CHECK-NEXT: vmnot.m v9, v0
972 ; CHECK-NEXT: vmv1r.v v0, v8
973 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
974 ; CHECK-NEXT: seqz a1, a1
975 ; CHECK-NEXT: and a0, a1, a0
977 %r = call i1 @llvm.vp.reduce.mul.nxv2i1(i1 %s, <vscale x 2 x i1> %v, <vscale x 2 x i1> %m, i32 %evl)
981 declare i1 @llvm.vp.reduce.mul.nxv4i1(i1, <vscale x 4 x i1>, <vscale x 4 x i1>, i32)
983 define zeroext i1 @vpreduce_mul_nxv4i1(i1 zeroext %s, <vscale x 4 x i1> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
984 ; CHECK-LABEL: vpreduce_mul_nxv4i1:
986 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
987 ; CHECK-NEXT: vmnot.m v9, v0
988 ; CHECK-NEXT: vmv1r.v v0, v8
989 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
990 ; CHECK-NEXT: seqz a1, a1
991 ; CHECK-NEXT: and a0, a1, a0
993 %r = call i1 @llvm.vp.reduce.mul.nxv4i1(i1 %s, <vscale x 4 x i1> %v, <vscale x 4 x i1> %m, i32 %evl)
997 declare i1 @llvm.vp.reduce.mul.nxv8i1(i1, <vscale x 8 x i1>, <vscale x 8 x i1>, i32)
999 define zeroext i1 @vpreduce_mul_nxv8i1(i1 zeroext %s, <vscale x 8 x i1> %v, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1000 ; CHECK-LABEL: vpreduce_mul_nxv8i1:
1002 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
1003 ; CHECK-NEXT: vmnot.m v9, v0
1004 ; CHECK-NEXT: vmv1r.v v0, v8
1005 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
1006 ; CHECK-NEXT: seqz a1, a1
1007 ; CHECK-NEXT: and a0, a1, a0
1009 %r = call i1 @llvm.vp.reduce.mul.nxv8i1(i1 %s, <vscale x 8 x i1> %v, <vscale x 8 x i1> %m, i32 %evl)
1013 declare i1 @llvm.vp.reduce.mul.nxv16i1(i1, <vscale x 16 x i1>, <vscale x 16 x i1>, i32)
1015 define zeroext i1 @vpreduce_mul_nxv16i1(i1 zeroext %s, <vscale x 16 x i1> %v, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1016 ; CHECK-LABEL: vpreduce_mul_nxv16i1:
1018 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
1019 ; CHECK-NEXT: vmnot.m v9, v0
1020 ; CHECK-NEXT: vmv1r.v v0, v8
1021 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
1022 ; CHECK-NEXT: seqz a1, a1
1023 ; CHECK-NEXT: and a0, a1, a0
1025 %r = call i1 @llvm.vp.reduce.mul.nxv16i1(i1 %s, <vscale x 16 x i1> %v, <vscale x 16 x i1> %m, i32 %evl)
1029 declare i1 @llvm.vp.reduce.mul.nxv32i1(i1, <vscale x 32 x i1>, <vscale x 32 x i1>, i32)
1031 define zeroext i1 @vpreduce_mul_nxv32i1(i1 zeroext %s, <vscale x 32 x i1> %v, <vscale x 32 x i1> %m, i32 zeroext %evl) {
1032 ; CHECK-LABEL: vpreduce_mul_nxv32i1:
1034 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
1035 ; CHECK-NEXT: vmnot.m v9, v0
1036 ; CHECK-NEXT: vmv1r.v v0, v8
1037 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
1038 ; CHECK-NEXT: seqz a1, a1
1039 ; CHECK-NEXT: and a0, a1, a0
1041 %r = call i1 @llvm.vp.reduce.mul.nxv32i1(i1 %s, <vscale x 32 x i1> %v, <vscale x 32 x i1> %m, i32 %evl)
1045 declare i1 @llvm.vp.reduce.mul.nxv64i1(i1, <vscale x 64 x i1>, <vscale x 64 x i1>, i32)
1047 define zeroext i1 @vpreduce_mul_nxv64i1(i1 zeroext %s, <vscale x 64 x i1> %v, <vscale x 64 x i1> %m, i32 zeroext %evl) {
1048 ; CHECK-LABEL: vpreduce_mul_nxv64i1:
1050 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
1051 ; CHECK-NEXT: vmnot.m v9, v0
1052 ; CHECK-NEXT: vmv1r.v v0, v8
1053 ; CHECK-NEXT: vcpop.m a1, v9, v0.t
1054 ; CHECK-NEXT: seqz a1, a1
1055 ; CHECK-NEXT: and a0, a1, a0
1057 %r = call i1 @llvm.vp.reduce.mul.nxv64i1(i1 %s, <vscale x 64 x i1> %v, <vscale x 64 x i1> %m, i32 %evl)