1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < %s \
3 ; RUN: | FileCheck %s --check-prefixes=CHECK,RV32
4 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s \
5 ; RUN: | FileCheck %s --check-prefixes=CHECK,RV64
7 declare i8 @llvm.vp.reduce.add.nxv1i8(i8, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
9 define signext i8 @vpreduce_add_nxv1i8(i8 signext %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
10 ; CHECK-LABEL: vpreduce_add_nxv1i8:
12 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
13 ; CHECK-NEXT: vmv.s.x v9, a0
14 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
15 ; CHECK-NEXT: vredsum.vs v9, v8, v9, v0.t
16 ; CHECK-NEXT: vmv.x.s a0, v9
18 %r = call i8 @llvm.vp.reduce.add.nxv1i8(i8 %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 %evl)
22 declare i8 @llvm.vp.reduce.umax.nxv1i8(i8, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
24 define signext i8 @vpreduce_umax_nxv1i8(i8 signext %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
25 ; CHECK-LABEL: vpreduce_umax_nxv1i8:
27 ; CHECK-NEXT: andi a0, a0, 255
28 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
29 ; CHECK-NEXT: vmv.s.x v9, a0
30 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
31 ; CHECK-NEXT: vredmaxu.vs v9, v8, v9, v0.t
32 ; CHECK-NEXT: vmv.x.s a0, v9
34 %r = call i8 @llvm.vp.reduce.umax.nxv1i8(i8 %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 %evl)
38 declare i8 @llvm.vp.reduce.smax.nxv1i8(i8, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
40 define signext i8 @vpreduce_smax_nxv1i8(i8 signext %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
41 ; CHECK-LABEL: vpreduce_smax_nxv1i8:
43 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
44 ; CHECK-NEXT: vmv.s.x v9, a0
45 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
46 ; CHECK-NEXT: vredmax.vs v9, v8, v9, v0.t
47 ; CHECK-NEXT: vmv.x.s a0, v9
49 %r = call i8 @llvm.vp.reduce.smax.nxv1i8(i8 %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 %evl)
53 declare i8 @llvm.vp.reduce.umin.nxv1i8(i8, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
55 define signext i8 @vpreduce_umin_nxv1i8(i8 signext %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
56 ; CHECK-LABEL: vpreduce_umin_nxv1i8:
58 ; CHECK-NEXT: andi a0, a0, 255
59 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
60 ; CHECK-NEXT: vmv.s.x v9, a0
61 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
62 ; CHECK-NEXT: vredminu.vs v9, v8, v9, v0.t
63 ; CHECK-NEXT: vmv.x.s a0, v9
65 %r = call i8 @llvm.vp.reduce.umin.nxv1i8(i8 %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 %evl)
69 declare i8 @llvm.vp.reduce.smin.nxv1i8(i8, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
71 define signext i8 @vpreduce_smin_nxv1i8(i8 signext %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
72 ; CHECK-LABEL: vpreduce_smin_nxv1i8:
74 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
75 ; CHECK-NEXT: vmv.s.x v9, a0
76 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
77 ; CHECK-NEXT: vredmin.vs v9, v8, v9, v0.t
78 ; CHECK-NEXT: vmv.x.s a0, v9
80 %r = call i8 @llvm.vp.reduce.smin.nxv1i8(i8 %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 %evl)
84 declare i8 @llvm.vp.reduce.and.nxv1i8(i8, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
86 define signext i8 @vpreduce_and_nxv1i8(i8 signext %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
87 ; CHECK-LABEL: vpreduce_and_nxv1i8:
89 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
90 ; CHECK-NEXT: vmv.s.x v9, a0
91 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
92 ; CHECK-NEXT: vredand.vs v9, v8, v9, v0.t
93 ; CHECK-NEXT: vmv.x.s a0, v9
95 %r = call i8 @llvm.vp.reduce.and.nxv1i8(i8 %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 %evl)
99 declare i8 @llvm.vp.reduce.or.nxv1i8(i8, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
101 define signext i8 @vpreduce_or_nxv1i8(i8 signext %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
102 ; CHECK-LABEL: vpreduce_or_nxv1i8:
104 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
105 ; CHECK-NEXT: vmv.s.x v9, a0
106 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
107 ; CHECK-NEXT: vredor.vs v9, v8, v9, v0.t
108 ; CHECK-NEXT: vmv.x.s a0, v9
110 %r = call i8 @llvm.vp.reduce.or.nxv1i8(i8 %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 %evl)
114 declare i8 @llvm.vp.reduce.xor.nxv1i8(i8, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
116 define signext i8 @vpreduce_xor_nxv1i8(i8 signext %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
117 ; CHECK-LABEL: vpreduce_xor_nxv1i8:
119 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
120 ; CHECK-NEXT: vmv.s.x v9, a0
121 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
122 ; CHECK-NEXT: vredxor.vs v9, v8, v9, v0.t
123 ; CHECK-NEXT: vmv.x.s a0, v9
125 %r = call i8 @llvm.vp.reduce.xor.nxv1i8(i8 %s, <vscale x 1 x i8> %v, <vscale x 1 x i1> %m, i32 %evl)
129 declare i8 @llvm.vp.reduce.add.nxv2i8(i8, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
131 define signext i8 @vpreduce_add_nxv2i8(i8 signext %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
132 ; CHECK-LABEL: vpreduce_add_nxv2i8:
134 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
135 ; CHECK-NEXT: vmv.s.x v9, a0
136 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
137 ; CHECK-NEXT: vredsum.vs v9, v8, v9, v0.t
138 ; CHECK-NEXT: vmv.x.s a0, v9
140 %r = call i8 @llvm.vp.reduce.add.nxv2i8(i8 %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 %evl)
144 declare i8 @llvm.vp.reduce.umax.nxv2i8(i8, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
146 define signext i8 @vpreduce_umax_nxv2i8(i8 signext %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
147 ; CHECK-LABEL: vpreduce_umax_nxv2i8:
149 ; CHECK-NEXT: andi a0, a0, 255
150 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
151 ; CHECK-NEXT: vmv.s.x v9, a0
152 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
153 ; CHECK-NEXT: vredmaxu.vs v9, v8, v9, v0.t
154 ; CHECK-NEXT: vmv.x.s a0, v9
156 %r = call i8 @llvm.vp.reduce.umax.nxv2i8(i8 %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 %evl)
160 declare i8 @llvm.vp.reduce.smax.nxv2i8(i8, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
162 define signext i8 @vpreduce_smax_nxv2i8(i8 signext %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
163 ; CHECK-LABEL: vpreduce_smax_nxv2i8:
165 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
166 ; CHECK-NEXT: vmv.s.x v9, a0
167 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
168 ; CHECK-NEXT: vredmax.vs v9, v8, v9, v0.t
169 ; CHECK-NEXT: vmv.x.s a0, v9
171 %r = call i8 @llvm.vp.reduce.smax.nxv2i8(i8 %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 %evl)
175 declare i8 @llvm.vp.reduce.umin.nxv2i8(i8, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
177 define signext i8 @vpreduce_umin_nxv2i8(i8 signext %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
178 ; CHECK-LABEL: vpreduce_umin_nxv2i8:
180 ; CHECK-NEXT: andi a0, a0, 255
181 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
182 ; CHECK-NEXT: vmv.s.x v9, a0
183 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
184 ; CHECK-NEXT: vredminu.vs v9, v8, v9, v0.t
185 ; CHECK-NEXT: vmv.x.s a0, v9
187 %r = call i8 @llvm.vp.reduce.umin.nxv2i8(i8 %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 %evl)
191 declare i8 @llvm.vp.reduce.smin.nxv2i8(i8, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
193 define signext i8 @vpreduce_smin_nxv2i8(i8 signext %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
194 ; CHECK-LABEL: vpreduce_smin_nxv2i8:
196 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
197 ; CHECK-NEXT: vmv.s.x v9, a0
198 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
199 ; CHECK-NEXT: vredmin.vs v9, v8, v9, v0.t
200 ; CHECK-NEXT: vmv.x.s a0, v9
202 %r = call i8 @llvm.vp.reduce.smin.nxv2i8(i8 %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 %evl)
206 declare i8 @llvm.vp.reduce.and.nxv2i8(i8, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
208 define signext i8 @vpreduce_and_nxv2i8(i8 signext %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
209 ; CHECK-LABEL: vpreduce_and_nxv2i8:
211 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
212 ; CHECK-NEXT: vmv.s.x v9, a0
213 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
214 ; CHECK-NEXT: vredand.vs v9, v8, v9, v0.t
215 ; CHECK-NEXT: vmv.x.s a0, v9
217 %r = call i8 @llvm.vp.reduce.and.nxv2i8(i8 %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 %evl)
221 declare i8 @llvm.vp.reduce.or.nxv2i8(i8, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
223 define signext i8 @vpreduce_or_nxv2i8(i8 signext %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
224 ; CHECK-LABEL: vpreduce_or_nxv2i8:
226 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
227 ; CHECK-NEXT: vmv.s.x v9, a0
228 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
229 ; CHECK-NEXT: vredor.vs v9, v8, v9, v0.t
230 ; CHECK-NEXT: vmv.x.s a0, v9
232 %r = call i8 @llvm.vp.reduce.or.nxv2i8(i8 %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 %evl)
236 declare i8 @llvm.vp.reduce.xor.nxv2i8(i8, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
238 define signext i8 @vpreduce_xor_nxv2i8(i8 signext %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
239 ; CHECK-LABEL: vpreduce_xor_nxv2i8:
241 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
242 ; CHECK-NEXT: vmv.s.x v9, a0
243 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
244 ; CHECK-NEXT: vredxor.vs v9, v8, v9, v0.t
245 ; CHECK-NEXT: vmv.x.s a0, v9
247 %r = call i8 @llvm.vp.reduce.xor.nxv2i8(i8 %s, <vscale x 2 x i8> %v, <vscale x 2 x i1> %m, i32 %evl)
251 declare i8 @llvm.vp.reduce.smax.nxv3i8(i8, <vscale x 3 x i8>, <vscale x 3 x i1>, i32)
253 define signext i8 @vpreduce_smax_nxv3i8(i8 signext %s, <vscale x 3 x i8> %v, <vscale x 3 x i1> %m, i32 zeroext %evl) {
254 ; CHECK-LABEL: vpreduce_smax_nxv3i8:
256 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
257 ; CHECK-NEXT: vmv.s.x v9, a0
258 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
259 ; CHECK-NEXT: vredmax.vs v9, v8, v9, v0.t
260 ; CHECK-NEXT: vmv.x.s a0, v9
262 %r = call i8 @llvm.vp.reduce.smax.nxv3i8(i8 %s, <vscale x 3 x i8> %v, <vscale x 3 x i1> %m, i32 %evl)
266 declare i8 @llvm.vp.reduce.add.nxv4i8(i8, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
268 define signext i8 @vpreduce_add_nxv4i8(i8 signext %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
269 ; CHECK-LABEL: vpreduce_add_nxv4i8:
271 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
272 ; CHECK-NEXT: vmv.s.x v9, a0
273 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
274 ; CHECK-NEXT: vredsum.vs v9, v8, v9, v0.t
275 ; CHECK-NEXT: vmv.x.s a0, v9
277 %r = call i8 @llvm.vp.reduce.add.nxv4i8(i8 %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 %evl)
281 declare i8 @llvm.vp.reduce.umax.nxv4i8(i8, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
283 define signext i8 @vpreduce_umax_nxv4i8(i8 signext %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
284 ; CHECK-LABEL: vpreduce_umax_nxv4i8:
286 ; CHECK-NEXT: andi a0, a0, 255
287 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
288 ; CHECK-NEXT: vmv.s.x v9, a0
289 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
290 ; CHECK-NEXT: vredmaxu.vs v9, v8, v9, v0.t
291 ; CHECK-NEXT: vmv.x.s a0, v9
293 %r = call i8 @llvm.vp.reduce.umax.nxv4i8(i8 %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 %evl)
297 declare i8 @llvm.vp.reduce.smax.nxv4i8(i8, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
299 define signext i8 @vpreduce_smax_nxv4i8(i8 signext %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
300 ; CHECK-LABEL: vpreduce_smax_nxv4i8:
302 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
303 ; CHECK-NEXT: vmv.s.x v9, a0
304 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
305 ; CHECK-NEXT: vredmax.vs v9, v8, v9, v0.t
306 ; CHECK-NEXT: vmv.x.s a0, v9
308 %r = call i8 @llvm.vp.reduce.smax.nxv4i8(i8 %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 %evl)
312 declare i8 @llvm.vp.reduce.umin.nxv4i8(i8, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
314 define signext i8 @vpreduce_umin_nxv4i8(i8 signext %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
315 ; CHECK-LABEL: vpreduce_umin_nxv4i8:
317 ; CHECK-NEXT: andi a0, a0, 255
318 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
319 ; CHECK-NEXT: vmv.s.x v9, a0
320 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
321 ; CHECK-NEXT: vredminu.vs v9, v8, v9, v0.t
322 ; CHECK-NEXT: vmv.x.s a0, v9
324 %r = call i8 @llvm.vp.reduce.umin.nxv4i8(i8 %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 %evl)
328 declare i8 @llvm.vp.reduce.smin.nxv4i8(i8, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
330 define signext i8 @vpreduce_smin_nxv4i8(i8 signext %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
331 ; CHECK-LABEL: vpreduce_smin_nxv4i8:
333 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
334 ; CHECK-NEXT: vmv.s.x v9, a0
335 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
336 ; CHECK-NEXT: vredmin.vs v9, v8, v9, v0.t
337 ; CHECK-NEXT: vmv.x.s a0, v9
339 %r = call i8 @llvm.vp.reduce.smin.nxv4i8(i8 %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 %evl)
343 declare i8 @llvm.vp.reduce.and.nxv4i8(i8, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
345 define signext i8 @vpreduce_and_nxv4i8(i8 signext %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
346 ; CHECK-LABEL: vpreduce_and_nxv4i8:
348 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
349 ; CHECK-NEXT: vmv.s.x v9, a0
350 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
351 ; CHECK-NEXT: vredand.vs v9, v8, v9, v0.t
352 ; CHECK-NEXT: vmv.x.s a0, v9
354 %r = call i8 @llvm.vp.reduce.and.nxv4i8(i8 %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 %evl)
358 declare i8 @llvm.vp.reduce.or.nxv4i8(i8, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
360 define signext i8 @vpreduce_or_nxv4i8(i8 signext %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
361 ; CHECK-LABEL: vpreduce_or_nxv4i8:
363 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
364 ; CHECK-NEXT: vmv.s.x v9, a0
365 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
366 ; CHECK-NEXT: vredor.vs v9, v8, v9, v0.t
367 ; CHECK-NEXT: vmv.x.s a0, v9
369 %r = call i8 @llvm.vp.reduce.or.nxv4i8(i8 %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 %evl)
373 declare i8 @llvm.vp.reduce.xor.nxv4i8(i8, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
375 define signext i8 @vpreduce_xor_nxv4i8(i8 signext %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
376 ; CHECK-LABEL: vpreduce_xor_nxv4i8:
378 ; CHECK-NEXT: vsetivli zero, 1, e8, m1, ta, ma
379 ; CHECK-NEXT: vmv.s.x v9, a0
380 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
381 ; CHECK-NEXT: vredxor.vs v9, v8, v9, v0.t
382 ; CHECK-NEXT: vmv.x.s a0, v9
384 %r = call i8 @llvm.vp.reduce.xor.nxv4i8(i8 %s, <vscale x 4 x i8> %v, <vscale x 4 x i1> %m, i32 %evl)
388 declare i16 @llvm.vp.reduce.add.nxv1i16(i16, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
390 define signext i16 @vpreduce_add_nxv1i16(i16 signext %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
391 ; CHECK-LABEL: vpreduce_add_nxv1i16:
393 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
394 ; CHECK-NEXT: vmv.s.x v9, a0
395 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
396 ; CHECK-NEXT: vredsum.vs v9, v8, v9, v0.t
397 ; CHECK-NEXT: vmv.x.s a0, v9
399 %r = call i16 @llvm.vp.reduce.add.nxv1i16(i16 %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 %evl)
403 declare i16 @llvm.vp.reduce.umax.nxv1i16(i16, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
405 define signext i16 @vpreduce_umax_nxv1i16(i16 signext %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
406 ; RV32-LABEL: vpreduce_umax_nxv1i16:
408 ; RV32-NEXT: slli a0, a0, 16
409 ; RV32-NEXT: srli a0, a0, 16
410 ; RV32-NEXT: vsetivli zero, 1, e16, m1, ta, ma
411 ; RV32-NEXT: vmv.s.x v9, a0
412 ; RV32-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
413 ; RV32-NEXT: vredmaxu.vs v9, v8, v9, v0.t
414 ; RV32-NEXT: vmv.x.s a0, v9
417 ; RV64-LABEL: vpreduce_umax_nxv1i16:
419 ; RV64-NEXT: slli a0, a0, 48
420 ; RV64-NEXT: srli a0, a0, 48
421 ; RV64-NEXT: vsetivli zero, 1, e16, m1, ta, ma
422 ; RV64-NEXT: vmv.s.x v9, a0
423 ; RV64-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
424 ; RV64-NEXT: vredmaxu.vs v9, v8, v9, v0.t
425 ; RV64-NEXT: vmv.x.s a0, v9
427 %r = call i16 @llvm.vp.reduce.umax.nxv1i16(i16 %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 %evl)
431 declare i16 @llvm.vp.reduce.smax.nxv1i16(i16, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
433 define signext i16 @vpreduce_smax_nxv1i16(i16 signext %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
434 ; CHECK-LABEL: vpreduce_smax_nxv1i16:
436 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
437 ; CHECK-NEXT: vmv.s.x v9, a0
438 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
439 ; CHECK-NEXT: vredmax.vs v9, v8, v9, v0.t
440 ; CHECK-NEXT: vmv.x.s a0, v9
442 %r = call i16 @llvm.vp.reduce.smax.nxv1i16(i16 %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 %evl)
446 declare i16 @llvm.vp.reduce.umin.nxv1i16(i16, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
448 define signext i16 @vpreduce_umin_nxv1i16(i16 signext %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
449 ; RV32-LABEL: vpreduce_umin_nxv1i16:
451 ; RV32-NEXT: slli a0, a0, 16
452 ; RV32-NEXT: srli a0, a0, 16
453 ; RV32-NEXT: vsetivli zero, 1, e16, m1, ta, ma
454 ; RV32-NEXT: vmv.s.x v9, a0
455 ; RV32-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
456 ; RV32-NEXT: vredminu.vs v9, v8, v9, v0.t
457 ; RV32-NEXT: vmv.x.s a0, v9
460 ; RV64-LABEL: vpreduce_umin_nxv1i16:
462 ; RV64-NEXT: slli a0, a0, 48
463 ; RV64-NEXT: srli a0, a0, 48
464 ; RV64-NEXT: vsetivli zero, 1, e16, m1, ta, ma
465 ; RV64-NEXT: vmv.s.x v9, a0
466 ; RV64-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
467 ; RV64-NEXT: vredminu.vs v9, v8, v9, v0.t
468 ; RV64-NEXT: vmv.x.s a0, v9
470 %r = call i16 @llvm.vp.reduce.umin.nxv1i16(i16 %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 %evl)
474 declare i16 @llvm.vp.reduce.smin.nxv1i16(i16, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
476 define signext i16 @vpreduce_smin_nxv1i16(i16 signext %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
477 ; CHECK-LABEL: vpreduce_smin_nxv1i16:
479 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
480 ; CHECK-NEXT: vmv.s.x v9, a0
481 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
482 ; CHECK-NEXT: vredmin.vs v9, v8, v9, v0.t
483 ; CHECK-NEXT: vmv.x.s a0, v9
485 %r = call i16 @llvm.vp.reduce.smin.nxv1i16(i16 %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 %evl)
489 declare i16 @llvm.vp.reduce.and.nxv1i16(i16, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
491 define signext i16 @vpreduce_and_nxv1i16(i16 signext %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
492 ; CHECK-LABEL: vpreduce_and_nxv1i16:
494 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
495 ; CHECK-NEXT: vmv.s.x v9, a0
496 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
497 ; CHECK-NEXT: vredand.vs v9, v8, v9, v0.t
498 ; CHECK-NEXT: vmv.x.s a0, v9
500 %r = call i16 @llvm.vp.reduce.and.nxv1i16(i16 %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 %evl)
504 declare i16 @llvm.vp.reduce.or.nxv1i16(i16, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
506 define signext i16 @vpreduce_or_nxv1i16(i16 signext %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
507 ; CHECK-LABEL: vpreduce_or_nxv1i16:
509 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
510 ; CHECK-NEXT: vmv.s.x v9, a0
511 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
512 ; CHECK-NEXT: vredor.vs v9, v8, v9, v0.t
513 ; CHECK-NEXT: vmv.x.s a0, v9
515 %r = call i16 @llvm.vp.reduce.or.nxv1i16(i16 %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 %evl)
519 declare i16 @llvm.vp.reduce.xor.nxv1i16(i16, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
521 define signext i16 @vpreduce_xor_nxv1i16(i16 signext %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
522 ; CHECK-LABEL: vpreduce_xor_nxv1i16:
524 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
525 ; CHECK-NEXT: vmv.s.x v9, a0
526 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
527 ; CHECK-NEXT: vredxor.vs v9, v8, v9, v0.t
528 ; CHECK-NEXT: vmv.x.s a0, v9
530 %r = call i16 @llvm.vp.reduce.xor.nxv1i16(i16 %s, <vscale x 1 x i16> %v, <vscale x 1 x i1> %m, i32 %evl)
534 declare i16 @llvm.vp.reduce.add.nxv2i16(i16, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
536 define signext i16 @vpreduce_add_nxv2i16(i16 signext %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
537 ; CHECK-LABEL: vpreduce_add_nxv2i16:
539 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
540 ; CHECK-NEXT: vmv.s.x v9, a0
541 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
542 ; CHECK-NEXT: vredsum.vs v9, v8, v9, v0.t
543 ; CHECK-NEXT: vmv.x.s a0, v9
545 %r = call i16 @llvm.vp.reduce.add.nxv2i16(i16 %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 %evl)
549 declare i16 @llvm.vp.reduce.umax.nxv2i16(i16, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
551 define signext i16 @vpreduce_umax_nxv2i16(i16 signext %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
552 ; RV32-LABEL: vpreduce_umax_nxv2i16:
554 ; RV32-NEXT: slli a0, a0, 16
555 ; RV32-NEXT: srli a0, a0, 16
556 ; RV32-NEXT: vsetivli zero, 1, e16, m1, ta, ma
557 ; RV32-NEXT: vmv.s.x v9, a0
558 ; RV32-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
559 ; RV32-NEXT: vredmaxu.vs v9, v8, v9, v0.t
560 ; RV32-NEXT: vmv.x.s a0, v9
563 ; RV64-LABEL: vpreduce_umax_nxv2i16:
565 ; RV64-NEXT: slli a0, a0, 48
566 ; RV64-NEXT: srli a0, a0, 48
567 ; RV64-NEXT: vsetivli zero, 1, e16, m1, ta, ma
568 ; RV64-NEXT: vmv.s.x v9, a0
569 ; RV64-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
570 ; RV64-NEXT: vredmaxu.vs v9, v8, v9, v0.t
571 ; RV64-NEXT: vmv.x.s a0, v9
573 %r = call i16 @llvm.vp.reduce.umax.nxv2i16(i16 %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 %evl)
577 declare i16 @llvm.vp.reduce.smax.nxv2i16(i16, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
579 define signext i16 @vpreduce_smax_nxv2i16(i16 signext %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
580 ; CHECK-LABEL: vpreduce_smax_nxv2i16:
582 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
583 ; CHECK-NEXT: vmv.s.x v9, a0
584 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
585 ; CHECK-NEXT: vredmax.vs v9, v8, v9, v0.t
586 ; CHECK-NEXT: vmv.x.s a0, v9
588 %r = call i16 @llvm.vp.reduce.smax.nxv2i16(i16 %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 %evl)
592 declare i16 @llvm.vp.reduce.umin.nxv2i16(i16, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
594 define signext i16 @vpreduce_umin_nxv2i16(i16 signext %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
595 ; RV32-LABEL: vpreduce_umin_nxv2i16:
597 ; RV32-NEXT: slli a0, a0, 16
598 ; RV32-NEXT: srli a0, a0, 16
599 ; RV32-NEXT: vsetivli zero, 1, e16, m1, ta, ma
600 ; RV32-NEXT: vmv.s.x v9, a0
601 ; RV32-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
602 ; RV32-NEXT: vredminu.vs v9, v8, v9, v0.t
603 ; RV32-NEXT: vmv.x.s a0, v9
606 ; RV64-LABEL: vpreduce_umin_nxv2i16:
608 ; RV64-NEXT: slli a0, a0, 48
609 ; RV64-NEXT: srli a0, a0, 48
610 ; RV64-NEXT: vsetivli zero, 1, e16, m1, ta, ma
611 ; RV64-NEXT: vmv.s.x v9, a0
612 ; RV64-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
613 ; RV64-NEXT: vredminu.vs v9, v8, v9, v0.t
614 ; RV64-NEXT: vmv.x.s a0, v9
616 %r = call i16 @llvm.vp.reduce.umin.nxv2i16(i16 %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 %evl)
620 declare i16 @llvm.vp.reduce.smin.nxv2i16(i16, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
622 define signext i16 @vpreduce_smin_nxv2i16(i16 signext %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
623 ; CHECK-LABEL: vpreduce_smin_nxv2i16:
625 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
626 ; CHECK-NEXT: vmv.s.x v9, a0
627 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
628 ; CHECK-NEXT: vredmin.vs v9, v8, v9, v0.t
629 ; CHECK-NEXT: vmv.x.s a0, v9
631 %r = call i16 @llvm.vp.reduce.smin.nxv2i16(i16 %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 %evl)
635 declare i16 @llvm.vp.reduce.and.nxv2i16(i16, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
637 define signext i16 @vpreduce_and_nxv2i16(i16 signext %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
638 ; CHECK-LABEL: vpreduce_and_nxv2i16:
640 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
641 ; CHECK-NEXT: vmv.s.x v9, a0
642 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
643 ; CHECK-NEXT: vredand.vs v9, v8, v9, v0.t
644 ; CHECK-NEXT: vmv.x.s a0, v9
646 %r = call i16 @llvm.vp.reduce.and.nxv2i16(i16 %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 %evl)
650 declare i16 @llvm.vp.reduce.or.nxv2i16(i16, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
652 define signext i16 @vpreduce_or_nxv2i16(i16 signext %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
653 ; CHECK-LABEL: vpreduce_or_nxv2i16:
655 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
656 ; CHECK-NEXT: vmv.s.x v9, a0
657 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
658 ; CHECK-NEXT: vredor.vs v9, v8, v9, v0.t
659 ; CHECK-NEXT: vmv.x.s a0, v9
661 %r = call i16 @llvm.vp.reduce.or.nxv2i16(i16 %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 %evl)
665 declare i16 @llvm.vp.reduce.xor.nxv2i16(i16, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
667 define signext i16 @vpreduce_xor_nxv2i16(i16 signext %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
668 ; CHECK-LABEL: vpreduce_xor_nxv2i16:
670 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
671 ; CHECK-NEXT: vmv.s.x v9, a0
672 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
673 ; CHECK-NEXT: vredxor.vs v9, v8, v9, v0.t
674 ; CHECK-NEXT: vmv.x.s a0, v9
676 %r = call i16 @llvm.vp.reduce.xor.nxv2i16(i16 %s, <vscale x 2 x i16> %v, <vscale x 2 x i1> %m, i32 %evl)
680 declare i16 @llvm.vp.reduce.add.nxv4i16(i16, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
682 define signext i16 @vpreduce_add_nxv4i16(i16 signext %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
683 ; CHECK-LABEL: vpreduce_add_nxv4i16:
685 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
686 ; CHECK-NEXT: vmv.s.x v9, a0
687 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
688 ; CHECK-NEXT: vredsum.vs v9, v8, v9, v0.t
689 ; CHECK-NEXT: vmv.x.s a0, v9
691 %r = call i16 @llvm.vp.reduce.add.nxv4i16(i16 %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 %evl)
695 declare i16 @llvm.vp.reduce.umax.nxv4i16(i16, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
697 define signext i16 @vpreduce_umax_nxv4i16(i16 signext %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
698 ; RV32-LABEL: vpreduce_umax_nxv4i16:
700 ; RV32-NEXT: slli a0, a0, 16
701 ; RV32-NEXT: srli a0, a0, 16
702 ; RV32-NEXT: vsetivli zero, 1, e16, m1, ta, ma
703 ; RV32-NEXT: vmv.s.x v9, a0
704 ; RV32-NEXT: vsetvli zero, a1, e16, m1, ta, ma
705 ; RV32-NEXT: vredmaxu.vs v9, v8, v9, v0.t
706 ; RV32-NEXT: vmv.x.s a0, v9
709 ; RV64-LABEL: vpreduce_umax_nxv4i16:
711 ; RV64-NEXT: slli a0, a0, 48
712 ; RV64-NEXT: srli a0, a0, 48
713 ; RV64-NEXT: vsetivli zero, 1, e16, m1, ta, ma
714 ; RV64-NEXT: vmv.s.x v9, a0
715 ; RV64-NEXT: vsetvli zero, a1, e16, m1, ta, ma
716 ; RV64-NEXT: vredmaxu.vs v9, v8, v9, v0.t
717 ; RV64-NEXT: vmv.x.s a0, v9
719 %r = call i16 @llvm.vp.reduce.umax.nxv4i16(i16 %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 %evl)
723 declare i16 @llvm.vp.reduce.smax.nxv4i16(i16, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
725 define signext i16 @vpreduce_smax_nxv4i16(i16 signext %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
726 ; CHECK-LABEL: vpreduce_smax_nxv4i16:
728 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
729 ; CHECK-NEXT: vmv.s.x v9, a0
730 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
731 ; CHECK-NEXT: vredmax.vs v9, v8, v9, v0.t
732 ; CHECK-NEXT: vmv.x.s a0, v9
734 %r = call i16 @llvm.vp.reduce.smax.nxv4i16(i16 %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 %evl)
738 declare i16 @llvm.vp.reduce.umin.nxv4i16(i16, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
740 define signext i16 @vpreduce_umin_nxv4i16(i16 signext %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
741 ; RV32-LABEL: vpreduce_umin_nxv4i16:
743 ; RV32-NEXT: slli a0, a0, 16
744 ; RV32-NEXT: srli a0, a0, 16
745 ; RV32-NEXT: vsetivli zero, 1, e16, m1, ta, ma
746 ; RV32-NEXT: vmv.s.x v9, a0
747 ; RV32-NEXT: vsetvli zero, a1, e16, m1, ta, ma
748 ; RV32-NEXT: vredminu.vs v9, v8, v9, v0.t
749 ; RV32-NEXT: vmv.x.s a0, v9
752 ; RV64-LABEL: vpreduce_umin_nxv4i16:
754 ; RV64-NEXT: slli a0, a0, 48
755 ; RV64-NEXT: srli a0, a0, 48
756 ; RV64-NEXT: vsetivli zero, 1, e16, m1, ta, ma
757 ; RV64-NEXT: vmv.s.x v9, a0
758 ; RV64-NEXT: vsetvli zero, a1, e16, m1, ta, ma
759 ; RV64-NEXT: vredminu.vs v9, v8, v9, v0.t
760 ; RV64-NEXT: vmv.x.s a0, v9
762 %r = call i16 @llvm.vp.reduce.umin.nxv4i16(i16 %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 %evl)
766 declare i16 @llvm.vp.reduce.smin.nxv4i16(i16, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
768 define signext i16 @vpreduce_smin_nxv4i16(i16 signext %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
769 ; CHECK-LABEL: vpreduce_smin_nxv4i16:
771 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
772 ; CHECK-NEXT: vmv.s.x v9, a0
773 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
774 ; CHECK-NEXT: vredmin.vs v9, v8, v9, v0.t
775 ; CHECK-NEXT: vmv.x.s a0, v9
777 %r = call i16 @llvm.vp.reduce.smin.nxv4i16(i16 %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 %evl)
781 declare i16 @llvm.vp.reduce.and.nxv4i16(i16, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
783 define signext i16 @vpreduce_and_nxv4i16(i16 signext %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
784 ; CHECK-LABEL: vpreduce_and_nxv4i16:
786 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
787 ; CHECK-NEXT: vmv.s.x v9, a0
788 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
789 ; CHECK-NEXT: vredand.vs v9, v8, v9, v0.t
790 ; CHECK-NEXT: vmv.x.s a0, v9
792 %r = call i16 @llvm.vp.reduce.and.nxv4i16(i16 %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 %evl)
796 declare i16 @llvm.vp.reduce.or.nxv4i16(i16, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
798 define signext i16 @vpreduce_or_nxv4i16(i16 signext %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
799 ; CHECK-LABEL: vpreduce_or_nxv4i16:
801 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
802 ; CHECK-NEXT: vmv.s.x v9, a0
803 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
804 ; CHECK-NEXT: vredor.vs v9, v8, v9, v0.t
805 ; CHECK-NEXT: vmv.x.s a0, v9
807 %r = call i16 @llvm.vp.reduce.or.nxv4i16(i16 %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 %evl)
811 declare i16 @llvm.vp.reduce.xor.nxv4i16(i16, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
813 define signext i16 @vpreduce_xor_nxv4i16(i16 signext %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
814 ; CHECK-LABEL: vpreduce_xor_nxv4i16:
816 ; CHECK-NEXT: vsetivli zero, 1, e16, m1, ta, ma
817 ; CHECK-NEXT: vmv.s.x v9, a0
818 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
819 ; CHECK-NEXT: vredxor.vs v9, v8, v9, v0.t
820 ; CHECK-NEXT: vmv.x.s a0, v9
822 %r = call i16 @llvm.vp.reduce.xor.nxv4i16(i16 %s, <vscale x 4 x i16> %v, <vscale x 4 x i1> %m, i32 %evl)
826 declare i32 @llvm.vp.reduce.add.nxv1i32(i32, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
828 define signext i32 @vpreduce_add_nxv1i32(i32 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
829 ; CHECK-LABEL: vpreduce_add_nxv1i32:
831 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
832 ; CHECK-NEXT: vmv.s.x v9, a0
833 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
834 ; CHECK-NEXT: vredsum.vs v9, v8, v9, v0.t
835 ; CHECK-NEXT: vmv.x.s a0, v9
837 %r = call i32 @llvm.vp.reduce.add.nxv1i32(i32 %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 %evl)
841 declare i32 @llvm.vp.reduce.umax.nxv1i32(i32, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
843 define signext i32 @vpreduce_umax_nxv1i32(i32 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
844 ; CHECK-LABEL: vpreduce_umax_nxv1i32:
846 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
847 ; CHECK-NEXT: vmv.s.x v9, a0
848 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
849 ; CHECK-NEXT: vredmaxu.vs v9, v8, v9, v0.t
850 ; CHECK-NEXT: vmv.x.s a0, v9
852 %r = call i32 @llvm.vp.reduce.umax.nxv1i32(i32 %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 %evl)
856 declare i32 @llvm.vp.reduce.smax.nxv1i32(i32, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
858 define signext i32 @vpreduce_smax_nxv1i32(i32 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
859 ; CHECK-LABEL: vpreduce_smax_nxv1i32:
861 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
862 ; CHECK-NEXT: vmv.s.x v9, a0
863 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
864 ; CHECK-NEXT: vredmax.vs v9, v8, v9, v0.t
865 ; CHECK-NEXT: vmv.x.s a0, v9
867 %r = call i32 @llvm.vp.reduce.smax.nxv1i32(i32 %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 %evl)
871 declare i32 @llvm.vp.reduce.umin.nxv1i32(i32, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
873 define signext i32 @vpreduce_umin_nxv1i32(i32 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
874 ; CHECK-LABEL: vpreduce_umin_nxv1i32:
876 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
877 ; CHECK-NEXT: vmv.s.x v9, a0
878 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
879 ; CHECK-NEXT: vredminu.vs v9, v8, v9, v0.t
880 ; CHECK-NEXT: vmv.x.s a0, v9
882 %r = call i32 @llvm.vp.reduce.umin.nxv1i32(i32 %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 %evl)
886 declare i32 @llvm.vp.reduce.smin.nxv1i32(i32, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
888 define signext i32 @vpreduce_smin_nxv1i32(i32 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
889 ; CHECK-LABEL: vpreduce_smin_nxv1i32:
891 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
892 ; CHECK-NEXT: vmv.s.x v9, a0
893 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
894 ; CHECK-NEXT: vredmin.vs v9, v8, v9, v0.t
895 ; CHECK-NEXT: vmv.x.s a0, v9
897 %r = call i32 @llvm.vp.reduce.smin.nxv1i32(i32 %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 %evl)
901 declare i32 @llvm.vp.reduce.and.nxv1i32(i32, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
903 define signext i32 @vpreduce_and_nxv1i32(i32 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
904 ; CHECK-LABEL: vpreduce_and_nxv1i32:
906 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
907 ; CHECK-NEXT: vmv.s.x v9, a0
908 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
909 ; CHECK-NEXT: vredand.vs v9, v8, v9, v0.t
910 ; CHECK-NEXT: vmv.x.s a0, v9
912 %r = call i32 @llvm.vp.reduce.and.nxv1i32(i32 %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 %evl)
916 declare i32 @llvm.vp.reduce.or.nxv1i32(i32, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
918 define signext i32 @vpreduce_or_nxv1i32(i32 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
919 ; CHECK-LABEL: vpreduce_or_nxv1i32:
921 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
922 ; CHECK-NEXT: vmv.s.x v9, a0
923 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
924 ; CHECK-NEXT: vredor.vs v9, v8, v9, v0.t
925 ; CHECK-NEXT: vmv.x.s a0, v9
927 %r = call i32 @llvm.vp.reduce.or.nxv1i32(i32 %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 %evl)
931 declare i32 @llvm.vp.reduce.xor.nxv1i32(i32, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
933 define signext i32 @vpreduce_xor_nxv1i32(i32 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
934 ; CHECK-LABEL: vpreduce_xor_nxv1i32:
936 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
937 ; CHECK-NEXT: vmv.s.x v9, a0
938 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
939 ; CHECK-NEXT: vredxor.vs v9, v8, v9, v0.t
940 ; CHECK-NEXT: vmv.x.s a0, v9
942 %r = call i32 @llvm.vp.reduce.xor.nxv1i32(i32 %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 %evl)
946 declare i32 @llvm.vp.reduce.add.nxv2i32(i32, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
948 define signext i32 @vpreduce_add_nxv2i32(i32 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
949 ; CHECK-LABEL: vpreduce_add_nxv2i32:
951 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
952 ; CHECK-NEXT: vmv.s.x v9, a0
953 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
954 ; CHECK-NEXT: vredsum.vs v9, v8, v9, v0.t
955 ; CHECK-NEXT: vmv.x.s a0, v9
957 %r = call i32 @llvm.vp.reduce.add.nxv2i32(i32 %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 %evl)
961 declare i32 @llvm.vp.reduce.umax.nxv2i32(i32, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
963 define signext i32 @vpreduce_umax_nxv2i32(i32 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
964 ; CHECK-LABEL: vpreduce_umax_nxv2i32:
966 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
967 ; CHECK-NEXT: vmv.s.x v9, a0
968 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
969 ; CHECK-NEXT: vredmaxu.vs v9, v8, v9, v0.t
970 ; CHECK-NEXT: vmv.x.s a0, v9
972 %r = call i32 @llvm.vp.reduce.umax.nxv2i32(i32 %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 %evl)
976 declare i32 @llvm.vp.reduce.smax.nxv2i32(i32, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
978 define signext i32 @vpreduce_smax_nxv2i32(i32 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
979 ; CHECK-LABEL: vpreduce_smax_nxv2i32:
981 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
982 ; CHECK-NEXT: vmv.s.x v9, a0
983 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
984 ; CHECK-NEXT: vredmax.vs v9, v8, v9, v0.t
985 ; CHECK-NEXT: vmv.x.s a0, v9
987 %r = call i32 @llvm.vp.reduce.smax.nxv2i32(i32 %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 %evl)
991 declare i32 @llvm.vp.reduce.umin.nxv2i32(i32, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
993 define signext i32 @vpreduce_umin_nxv2i32(i32 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
994 ; CHECK-LABEL: vpreduce_umin_nxv2i32:
996 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
997 ; CHECK-NEXT: vmv.s.x v9, a0
998 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
999 ; CHECK-NEXT: vredminu.vs v9, v8, v9, v0.t
1000 ; CHECK-NEXT: vmv.x.s a0, v9
1002 %r = call i32 @llvm.vp.reduce.umin.nxv2i32(i32 %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 %evl)
1006 declare i32 @llvm.vp.reduce.smin.nxv2i32(i32, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
1008 define signext i32 @vpreduce_smin_nxv2i32(i32 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1009 ; CHECK-LABEL: vpreduce_smin_nxv2i32:
1011 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1012 ; CHECK-NEXT: vmv.s.x v9, a0
1013 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
1014 ; CHECK-NEXT: vredmin.vs v9, v8, v9, v0.t
1015 ; CHECK-NEXT: vmv.x.s a0, v9
1017 %r = call i32 @llvm.vp.reduce.smin.nxv2i32(i32 %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 %evl)
1021 declare i32 @llvm.vp.reduce.and.nxv2i32(i32, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
1023 define signext i32 @vpreduce_and_nxv2i32(i32 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1024 ; CHECK-LABEL: vpreduce_and_nxv2i32:
1026 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1027 ; CHECK-NEXT: vmv.s.x v9, a0
1028 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
1029 ; CHECK-NEXT: vredand.vs v9, v8, v9, v0.t
1030 ; CHECK-NEXT: vmv.x.s a0, v9
1032 %r = call i32 @llvm.vp.reduce.and.nxv2i32(i32 %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 %evl)
1036 declare i32 @llvm.vp.reduce.or.nxv2i32(i32, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
1038 define signext i32 @vpreduce_or_nxv2i32(i32 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1039 ; CHECK-LABEL: vpreduce_or_nxv2i32:
1041 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1042 ; CHECK-NEXT: vmv.s.x v9, a0
1043 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
1044 ; CHECK-NEXT: vredor.vs v9, v8, v9, v0.t
1045 ; CHECK-NEXT: vmv.x.s a0, v9
1047 %r = call i32 @llvm.vp.reduce.or.nxv2i32(i32 %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 %evl)
1051 declare i32 @llvm.vp.reduce.xor.nxv2i32(i32, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
1053 define signext i32 @vpreduce_xor_nxv2i32(i32 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1054 ; CHECK-LABEL: vpreduce_xor_nxv2i32:
1056 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1057 ; CHECK-NEXT: vmv.s.x v9, a0
1058 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
1059 ; CHECK-NEXT: vredxor.vs v9, v8, v9, v0.t
1060 ; CHECK-NEXT: vmv.x.s a0, v9
1062 %r = call i32 @llvm.vp.reduce.xor.nxv2i32(i32 %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 %evl)
1066 declare i32 @llvm.vp.reduce.add.nxv4i32(i32, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1068 define signext i32 @vpreduce_add_nxv4i32(i32 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1069 ; CHECK-LABEL: vpreduce_add_nxv4i32:
1071 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1072 ; CHECK-NEXT: vmv.s.x v10, a0
1073 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1074 ; CHECK-NEXT: vredsum.vs v10, v8, v10, v0.t
1075 ; CHECK-NEXT: vmv.x.s a0, v10
1077 %r = call i32 @llvm.vp.reduce.add.nxv4i32(i32 %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 %evl)
1081 declare i32 @llvm.vp.reduce.umax.nxv4i32(i32, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1083 define signext i32 @vpreduce_umax_nxv4i32(i32 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1084 ; CHECK-LABEL: vpreduce_umax_nxv4i32:
1086 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1087 ; CHECK-NEXT: vmv.s.x v10, a0
1088 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1089 ; CHECK-NEXT: vredmaxu.vs v10, v8, v10, v0.t
1090 ; CHECK-NEXT: vmv.x.s a0, v10
1092 %r = call i32 @llvm.vp.reduce.umax.nxv4i32(i32 %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 %evl)
1096 declare i32 @llvm.vp.reduce.umax.nxv32i32(i32, <vscale x 32 x i32>, <vscale x 32 x i1>, i32)
1098 define signext i32 @vpreduce_umax_nxv32i32(i32 signext %s, <vscale x 32 x i32> %v, <vscale x 32 x i1> %m, i32 zeroext %evl) {
1099 ; CHECK-LABEL: vpreduce_umax_nxv32i32:
1101 ; CHECK-NEXT: csrr a3, vlenb
1102 ; CHECK-NEXT: srli a2, a3, 2
1103 ; CHECK-NEXT: slli a3, a3, 1
1104 ; CHECK-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
1105 ; CHECK-NEXT: vslidedown.vx v24, v0, a2
1106 ; CHECK-NEXT: sub a2, a1, a3
1107 ; CHECK-NEXT: sltu a4, a1, a2
1108 ; CHECK-NEXT: addi a4, a4, -1
1109 ; CHECK-NEXT: and a2, a4, a2
1110 ; CHECK-NEXT: bltu a1, a3, .LBB67_2
1111 ; CHECK-NEXT: # %bb.1:
1112 ; CHECK-NEXT: mv a1, a3
1113 ; CHECK-NEXT: .LBB67_2:
1114 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
1115 ; CHECK-NEXT: vmv.s.x v25, a0
1116 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1117 ; CHECK-NEXT: vredmaxu.vs v25, v8, v25, v0.t
1118 ; CHECK-NEXT: vmv1r.v v0, v24
1119 ; CHECK-NEXT: vsetvli zero, a2, e32, m8, ta, ma
1120 ; CHECK-NEXT: vredmaxu.vs v25, v16, v25, v0.t
1121 ; CHECK-NEXT: vmv.x.s a0, v25
1123 %r = call i32 @llvm.vp.reduce.umax.nxv32i32(i32 %s, <vscale x 32 x i32> %v, <vscale x 32 x i1> %m, i32 %evl)
1127 declare i32 @llvm.vp.reduce.smax.nxv4i32(i32, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1129 define signext i32 @vpreduce_smax_nxv4i32(i32 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1130 ; CHECK-LABEL: vpreduce_smax_nxv4i32:
1132 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1133 ; CHECK-NEXT: vmv.s.x v10, a0
1134 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1135 ; CHECK-NEXT: vredmax.vs v10, v8, v10, v0.t
1136 ; CHECK-NEXT: vmv.x.s a0, v10
1138 %r = call i32 @llvm.vp.reduce.smax.nxv4i32(i32 %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 %evl)
1142 declare i32 @llvm.vp.reduce.umin.nxv4i32(i32, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1144 define signext i32 @vpreduce_umin_nxv4i32(i32 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1145 ; CHECK-LABEL: vpreduce_umin_nxv4i32:
1147 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1148 ; CHECK-NEXT: vmv.s.x v10, a0
1149 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1150 ; CHECK-NEXT: vredminu.vs v10, v8, v10, v0.t
1151 ; CHECK-NEXT: vmv.x.s a0, v10
1153 %r = call i32 @llvm.vp.reduce.umin.nxv4i32(i32 %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 %evl)
1157 declare i32 @llvm.vp.reduce.smin.nxv4i32(i32, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1159 define signext i32 @vpreduce_smin_nxv4i32(i32 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1160 ; CHECK-LABEL: vpreduce_smin_nxv4i32:
1162 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1163 ; CHECK-NEXT: vmv.s.x v10, a0
1164 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1165 ; CHECK-NEXT: vredmin.vs v10, v8, v10, v0.t
1166 ; CHECK-NEXT: vmv.x.s a0, v10
1168 %r = call i32 @llvm.vp.reduce.smin.nxv4i32(i32 %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 %evl)
1172 declare i32 @llvm.vp.reduce.and.nxv4i32(i32, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1174 define signext i32 @vpreduce_and_nxv4i32(i32 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1175 ; CHECK-LABEL: vpreduce_and_nxv4i32:
1177 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1178 ; CHECK-NEXT: vmv.s.x v10, a0
1179 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1180 ; CHECK-NEXT: vredand.vs v10, v8, v10, v0.t
1181 ; CHECK-NEXT: vmv.x.s a0, v10
1183 %r = call i32 @llvm.vp.reduce.and.nxv4i32(i32 %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 %evl)
1187 declare i32 @llvm.vp.reduce.or.nxv4i32(i32, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1189 define signext i32 @vpreduce_or_nxv4i32(i32 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1190 ; CHECK-LABEL: vpreduce_or_nxv4i32:
1192 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1193 ; CHECK-NEXT: vmv.s.x v10, a0
1194 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1195 ; CHECK-NEXT: vredor.vs v10, v8, v10, v0.t
1196 ; CHECK-NEXT: vmv.x.s a0, v10
1198 %r = call i32 @llvm.vp.reduce.or.nxv4i32(i32 %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 %evl)
1202 declare i32 @llvm.vp.reduce.xor.nxv4i32(i32, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1204 define signext i32 @vpreduce_xor_nxv4i32(i32 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1205 ; CHECK-LABEL: vpreduce_xor_nxv4i32:
1207 ; CHECK-NEXT: vsetivli zero, 1, e32, m1, ta, ma
1208 ; CHECK-NEXT: vmv.s.x v10, a0
1209 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1210 ; CHECK-NEXT: vredxor.vs v10, v8, v10, v0.t
1211 ; CHECK-NEXT: vmv.x.s a0, v10
1213 %r = call i32 @llvm.vp.reduce.xor.nxv4i32(i32 %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 %evl)
1217 declare i64 @llvm.vp.reduce.add.nxv1i64(i64, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1219 define signext i64 @vpreduce_add_nxv1i64(i64 signext %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1220 ; RV32-LABEL: vpreduce_add_nxv1i64:
1222 ; RV32-NEXT: addi sp, sp, -16
1223 ; RV32-NEXT: .cfi_def_cfa_offset 16
1224 ; RV32-NEXT: sw a0, 8(sp)
1225 ; RV32-NEXT: sw a1, 12(sp)
1226 ; RV32-NEXT: addi a0, sp, 8
1227 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1228 ; RV32-NEXT: vlse64.v v9, (a0), zero
1229 ; RV32-NEXT: li a1, 32
1230 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1231 ; RV32-NEXT: vredsum.vs v9, v8, v9, v0.t
1232 ; RV32-NEXT: vmv.x.s a0, v9
1233 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1234 ; RV32-NEXT: vsrl.vx v8, v9, a1
1235 ; RV32-NEXT: vmv.x.s a1, v8
1236 ; RV32-NEXT: addi sp, sp, 16
1237 ; RV32-NEXT: .cfi_def_cfa_offset 0
1240 ; RV64-LABEL: vpreduce_add_nxv1i64:
1242 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1243 ; RV64-NEXT: vmv.s.x v9, a0
1244 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1245 ; RV64-NEXT: vredsum.vs v9, v8, v9, v0.t
1246 ; RV64-NEXT: vmv.x.s a0, v9
1248 %r = call i64 @llvm.vp.reduce.add.nxv1i64(i64 %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 %evl)
1252 define signext i64 @vpwreduce_add_nxv1i32(i64 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1253 ; RV32-LABEL: vpwreduce_add_nxv1i32:
1255 ; RV32-NEXT: addi sp, sp, -16
1256 ; RV32-NEXT: .cfi_def_cfa_offset 16
1257 ; RV32-NEXT: sw a0, 8(sp)
1258 ; RV32-NEXT: sw a1, 12(sp)
1259 ; RV32-NEXT: addi a0, sp, 8
1260 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1261 ; RV32-NEXT: vlse64.v v9, (a0), zero
1262 ; RV32-NEXT: li a1, 32
1263 ; RV32-NEXT: vsetvli zero, a2, e32, mf2, ta, ma
1264 ; RV32-NEXT: vwredsum.vs v9, v8, v9, v0.t
1265 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1266 ; RV32-NEXT: vmv.x.s a0, v9
1267 ; RV32-NEXT: vsrl.vx v8, v9, a1
1268 ; RV32-NEXT: vmv.x.s a1, v8
1269 ; RV32-NEXT: addi sp, sp, 16
1270 ; RV32-NEXT: .cfi_def_cfa_offset 0
1273 ; RV64-LABEL: vpwreduce_add_nxv1i32:
1275 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1276 ; RV64-NEXT: vmv.s.x v9, a0
1277 ; RV64-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
1278 ; RV64-NEXT: vwredsum.vs v9, v8, v9, v0.t
1279 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, ma
1280 ; RV64-NEXT: vmv.x.s a0, v9
1282 %e = sext <vscale x 1 x i32> %v to <vscale x 1 x i64>
1283 %r = call i64 @llvm.vp.reduce.add.nxv1i64(i64 %s, <vscale x 1 x i64> %e, <vscale x 1 x i1> %m, i32 %evl)
1287 define signext i64 @vpwreduce_uadd_nxv1i32(i64 signext %s, <vscale x 1 x i32> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1288 ; RV32-LABEL: vpwreduce_uadd_nxv1i32:
1290 ; RV32-NEXT: addi sp, sp, -16
1291 ; RV32-NEXT: .cfi_def_cfa_offset 16
1292 ; RV32-NEXT: sw a0, 8(sp)
1293 ; RV32-NEXT: sw a1, 12(sp)
1294 ; RV32-NEXT: addi a0, sp, 8
1295 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1296 ; RV32-NEXT: vlse64.v v9, (a0), zero
1297 ; RV32-NEXT: li a1, 32
1298 ; RV32-NEXT: vsetvli zero, a2, e32, mf2, ta, ma
1299 ; RV32-NEXT: vwredsum.vs v9, v8, v9, v0.t
1300 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1301 ; RV32-NEXT: vmv.x.s a0, v9
1302 ; RV32-NEXT: vsrl.vx v8, v9, a1
1303 ; RV32-NEXT: vmv.x.s a1, v8
1304 ; RV32-NEXT: addi sp, sp, 16
1305 ; RV32-NEXT: .cfi_def_cfa_offset 0
1308 ; RV64-LABEL: vpwreduce_uadd_nxv1i32:
1310 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1311 ; RV64-NEXT: vmv.s.x v9, a0
1312 ; RV64-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
1313 ; RV64-NEXT: vwredsum.vs v9, v8, v9, v0.t
1314 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, ma
1315 ; RV64-NEXT: vmv.x.s a0, v9
1317 %e = sext <vscale x 1 x i32> %v to <vscale x 1 x i64>
1318 %r = call i64 @llvm.vp.reduce.add.nxv1i64(i64 %s, <vscale x 1 x i64> %e, <vscale x 1 x i1> %m, i32 %evl)
1322 declare i64 @llvm.vp.reduce.umax.nxv1i64(i64, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1324 define signext i64 @vpreduce_umax_nxv1i64(i64 signext %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1325 ; RV32-LABEL: vpreduce_umax_nxv1i64:
1327 ; RV32-NEXT: addi sp, sp, -16
1328 ; RV32-NEXT: .cfi_def_cfa_offset 16
1329 ; RV32-NEXT: sw a0, 8(sp)
1330 ; RV32-NEXT: sw a1, 12(sp)
1331 ; RV32-NEXT: addi a0, sp, 8
1332 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1333 ; RV32-NEXT: vlse64.v v9, (a0), zero
1334 ; RV32-NEXT: li a1, 32
1335 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1336 ; RV32-NEXT: vredmaxu.vs v9, v8, v9, v0.t
1337 ; RV32-NEXT: vmv.x.s a0, v9
1338 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1339 ; RV32-NEXT: vsrl.vx v8, v9, a1
1340 ; RV32-NEXT: vmv.x.s a1, v8
1341 ; RV32-NEXT: addi sp, sp, 16
1342 ; RV32-NEXT: .cfi_def_cfa_offset 0
1345 ; RV64-LABEL: vpreduce_umax_nxv1i64:
1347 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1348 ; RV64-NEXT: vmv.s.x v9, a0
1349 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1350 ; RV64-NEXT: vredmaxu.vs v9, v8, v9, v0.t
1351 ; RV64-NEXT: vmv.x.s a0, v9
1353 %r = call i64 @llvm.vp.reduce.umax.nxv1i64(i64 %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 %evl)
1357 declare i64 @llvm.vp.reduce.smax.nxv1i64(i64, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1359 define signext i64 @vpreduce_smax_nxv1i64(i64 signext %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1360 ; RV32-LABEL: vpreduce_smax_nxv1i64:
1362 ; RV32-NEXT: addi sp, sp, -16
1363 ; RV32-NEXT: .cfi_def_cfa_offset 16
1364 ; RV32-NEXT: sw a0, 8(sp)
1365 ; RV32-NEXT: sw a1, 12(sp)
1366 ; RV32-NEXT: addi a0, sp, 8
1367 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1368 ; RV32-NEXT: vlse64.v v9, (a0), zero
1369 ; RV32-NEXT: li a1, 32
1370 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1371 ; RV32-NEXT: vredmax.vs v9, v8, v9, v0.t
1372 ; RV32-NEXT: vmv.x.s a0, v9
1373 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1374 ; RV32-NEXT: vsrl.vx v8, v9, a1
1375 ; RV32-NEXT: vmv.x.s a1, v8
1376 ; RV32-NEXT: addi sp, sp, 16
1377 ; RV32-NEXT: .cfi_def_cfa_offset 0
1380 ; RV64-LABEL: vpreduce_smax_nxv1i64:
1382 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1383 ; RV64-NEXT: vmv.s.x v9, a0
1384 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1385 ; RV64-NEXT: vredmax.vs v9, v8, v9, v0.t
1386 ; RV64-NEXT: vmv.x.s a0, v9
1388 %r = call i64 @llvm.vp.reduce.smax.nxv1i64(i64 %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 %evl)
1392 declare i64 @llvm.vp.reduce.umin.nxv1i64(i64, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1394 define signext i64 @vpreduce_umin_nxv1i64(i64 signext %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1395 ; RV32-LABEL: vpreduce_umin_nxv1i64:
1397 ; RV32-NEXT: addi sp, sp, -16
1398 ; RV32-NEXT: .cfi_def_cfa_offset 16
1399 ; RV32-NEXT: sw a0, 8(sp)
1400 ; RV32-NEXT: sw a1, 12(sp)
1401 ; RV32-NEXT: addi a0, sp, 8
1402 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1403 ; RV32-NEXT: vlse64.v v9, (a0), zero
1404 ; RV32-NEXT: li a1, 32
1405 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1406 ; RV32-NEXT: vredminu.vs v9, v8, v9, v0.t
1407 ; RV32-NEXT: vmv.x.s a0, v9
1408 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1409 ; RV32-NEXT: vsrl.vx v8, v9, a1
1410 ; RV32-NEXT: vmv.x.s a1, v8
1411 ; RV32-NEXT: addi sp, sp, 16
1412 ; RV32-NEXT: .cfi_def_cfa_offset 0
1415 ; RV64-LABEL: vpreduce_umin_nxv1i64:
1417 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1418 ; RV64-NEXT: vmv.s.x v9, a0
1419 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1420 ; RV64-NEXT: vredminu.vs v9, v8, v9, v0.t
1421 ; RV64-NEXT: vmv.x.s a0, v9
1423 %r = call i64 @llvm.vp.reduce.umin.nxv1i64(i64 %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 %evl)
1427 declare i64 @llvm.vp.reduce.smin.nxv1i64(i64, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1429 define signext i64 @vpreduce_smin_nxv1i64(i64 signext %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1430 ; RV32-LABEL: vpreduce_smin_nxv1i64:
1432 ; RV32-NEXT: addi sp, sp, -16
1433 ; RV32-NEXT: .cfi_def_cfa_offset 16
1434 ; RV32-NEXT: sw a0, 8(sp)
1435 ; RV32-NEXT: sw a1, 12(sp)
1436 ; RV32-NEXT: addi a0, sp, 8
1437 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1438 ; RV32-NEXT: vlse64.v v9, (a0), zero
1439 ; RV32-NEXT: li a1, 32
1440 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1441 ; RV32-NEXT: vredmin.vs v9, v8, v9, v0.t
1442 ; RV32-NEXT: vmv.x.s a0, v9
1443 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1444 ; RV32-NEXT: vsrl.vx v8, v9, a1
1445 ; RV32-NEXT: vmv.x.s a1, v8
1446 ; RV32-NEXT: addi sp, sp, 16
1447 ; RV32-NEXT: .cfi_def_cfa_offset 0
1450 ; RV64-LABEL: vpreduce_smin_nxv1i64:
1452 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1453 ; RV64-NEXT: vmv.s.x v9, a0
1454 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1455 ; RV64-NEXT: vredmin.vs v9, v8, v9, v0.t
1456 ; RV64-NEXT: vmv.x.s a0, v9
1458 %r = call i64 @llvm.vp.reduce.smin.nxv1i64(i64 %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 %evl)
1462 declare i64 @llvm.vp.reduce.and.nxv1i64(i64, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1464 define signext i64 @vpreduce_and_nxv1i64(i64 signext %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1465 ; RV32-LABEL: vpreduce_and_nxv1i64:
1467 ; RV32-NEXT: addi sp, sp, -16
1468 ; RV32-NEXT: .cfi_def_cfa_offset 16
1469 ; RV32-NEXT: sw a0, 8(sp)
1470 ; RV32-NEXT: sw a1, 12(sp)
1471 ; RV32-NEXT: addi a0, sp, 8
1472 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1473 ; RV32-NEXT: vlse64.v v9, (a0), zero
1474 ; RV32-NEXT: li a1, 32
1475 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1476 ; RV32-NEXT: vredand.vs v9, v8, v9, v0.t
1477 ; RV32-NEXT: vmv.x.s a0, v9
1478 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1479 ; RV32-NEXT: vsrl.vx v8, v9, a1
1480 ; RV32-NEXT: vmv.x.s a1, v8
1481 ; RV32-NEXT: addi sp, sp, 16
1482 ; RV32-NEXT: .cfi_def_cfa_offset 0
1485 ; RV64-LABEL: vpreduce_and_nxv1i64:
1487 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1488 ; RV64-NEXT: vmv.s.x v9, a0
1489 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1490 ; RV64-NEXT: vredand.vs v9, v8, v9, v0.t
1491 ; RV64-NEXT: vmv.x.s a0, v9
1493 %r = call i64 @llvm.vp.reduce.and.nxv1i64(i64 %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 %evl)
1497 declare i64 @llvm.vp.reduce.or.nxv1i64(i64, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1499 define signext i64 @vpreduce_or_nxv1i64(i64 signext %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1500 ; RV32-LABEL: vpreduce_or_nxv1i64:
1502 ; RV32-NEXT: addi sp, sp, -16
1503 ; RV32-NEXT: .cfi_def_cfa_offset 16
1504 ; RV32-NEXT: sw a0, 8(sp)
1505 ; RV32-NEXT: sw a1, 12(sp)
1506 ; RV32-NEXT: addi a0, sp, 8
1507 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1508 ; RV32-NEXT: vlse64.v v9, (a0), zero
1509 ; RV32-NEXT: li a1, 32
1510 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1511 ; RV32-NEXT: vredor.vs v9, v8, v9, v0.t
1512 ; RV32-NEXT: vmv.x.s a0, v9
1513 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1514 ; RV32-NEXT: vsrl.vx v8, v9, a1
1515 ; RV32-NEXT: vmv.x.s a1, v8
1516 ; RV32-NEXT: addi sp, sp, 16
1517 ; RV32-NEXT: .cfi_def_cfa_offset 0
1520 ; RV64-LABEL: vpreduce_or_nxv1i64:
1522 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1523 ; RV64-NEXT: vmv.s.x v9, a0
1524 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1525 ; RV64-NEXT: vredor.vs v9, v8, v9, v0.t
1526 ; RV64-NEXT: vmv.x.s a0, v9
1528 %r = call i64 @llvm.vp.reduce.or.nxv1i64(i64 %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 %evl)
1532 declare i64 @llvm.vp.reduce.xor.nxv1i64(i64, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1534 define signext i64 @vpreduce_xor_nxv1i64(i64 signext %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1535 ; RV32-LABEL: vpreduce_xor_nxv1i64:
1537 ; RV32-NEXT: addi sp, sp, -16
1538 ; RV32-NEXT: .cfi_def_cfa_offset 16
1539 ; RV32-NEXT: sw a0, 8(sp)
1540 ; RV32-NEXT: sw a1, 12(sp)
1541 ; RV32-NEXT: addi a0, sp, 8
1542 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1543 ; RV32-NEXT: vlse64.v v9, (a0), zero
1544 ; RV32-NEXT: li a1, 32
1545 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1546 ; RV32-NEXT: vredxor.vs v9, v8, v9, v0.t
1547 ; RV32-NEXT: vmv.x.s a0, v9
1548 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1549 ; RV32-NEXT: vsrl.vx v8, v9, a1
1550 ; RV32-NEXT: vmv.x.s a1, v8
1551 ; RV32-NEXT: addi sp, sp, 16
1552 ; RV32-NEXT: .cfi_def_cfa_offset 0
1555 ; RV64-LABEL: vpreduce_xor_nxv1i64:
1557 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1558 ; RV64-NEXT: vmv.s.x v9, a0
1559 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1560 ; RV64-NEXT: vredxor.vs v9, v8, v9, v0.t
1561 ; RV64-NEXT: vmv.x.s a0, v9
1563 %r = call i64 @llvm.vp.reduce.xor.nxv1i64(i64 %s, <vscale x 1 x i64> %v, <vscale x 1 x i1> %m, i32 %evl)
1567 declare i64 @llvm.vp.reduce.add.nxv2i64(i64, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1569 define signext i64 @vpreduce_add_nxv2i64(i64 signext %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1570 ; RV32-LABEL: vpreduce_add_nxv2i64:
1572 ; RV32-NEXT: addi sp, sp, -16
1573 ; RV32-NEXT: .cfi_def_cfa_offset 16
1574 ; RV32-NEXT: sw a0, 8(sp)
1575 ; RV32-NEXT: sw a1, 12(sp)
1576 ; RV32-NEXT: addi a0, sp, 8
1577 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1578 ; RV32-NEXT: vlse64.v v10, (a0), zero
1579 ; RV32-NEXT: li a1, 32
1580 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1581 ; RV32-NEXT: vredsum.vs v10, v8, v10, v0.t
1582 ; RV32-NEXT: vmv.x.s a0, v10
1583 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1584 ; RV32-NEXT: vsrl.vx v8, v10, a1
1585 ; RV32-NEXT: vmv.x.s a1, v8
1586 ; RV32-NEXT: addi sp, sp, 16
1587 ; RV32-NEXT: .cfi_def_cfa_offset 0
1590 ; RV64-LABEL: vpreduce_add_nxv2i64:
1592 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1593 ; RV64-NEXT: vmv.s.x v10, a0
1594 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1595 ; RV64-NEXT: vredsum.vs v10, v8, v10, v0.t
1596 ; RV64-NEXT: vmv.x.s a0, v10
1598 %r = call i64 @llvm.vp.reduce.add.nxv2i64(i64 %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 %evl)
1602 define signext i64 @vwpreduce_add_nxv2i32(i64 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1603 ; RV32-LABEL: vwpreduce_add_nxv2i32:
1605 ; RV32-NEXT: addi sp, sp, -16
1606 ; RV32-NEXT: .cfi_def_cfa_offset 16
1607 ; RV32-NEXT: sw a0, 8(sp)
1608 ; RV32-NEXT: sw a1, 12(sp)
1609 ; RV32-NEXT: addi a0, sp, 8
1610 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1611 ; RV32-NEXT: vlse64.v v9, (a0), zero
1612 ; RV32-NEXT: li a1, 32
1613 ; RV32-NEXT: vsetvli zero, a2, e32, m1, ta, ma
1614 ; RV32-NEXT: vwredsum.vs v9, v8, v9, v0.t
1615 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1616 ; RV32-NEXT: vmv.x.s a0, v9
1617 ; RV32-NEXT: vsrl.vx v8, v9, a1
1618 ; RV32-NEXT: vmv.x.s a1, v8
1619 ; RV32-NEXT: addi sp, sp, 16
1620 ; RV32-NEXT: .cfi_def_cfa_offset 0
1623 ; RV64-LABEL: vwpreduce_add_nxv2i32:
1625 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1626 ; RV64-NEXT: vmv.s.x v9, a0
1627 ; RV64-NEXT: vsetvli zero, a1, e32, m1, ta, ma
1628 ; RV64-NEXT: vwredsum.vs v9, v8, v9, v0.t
1629 ; RV64-NEXT: vsetvli zero, zero, e64, m2, ta, ma
1630 ; RV64-NEXT: vmv.x.s a0, v9
1632 %e = sext <vscale x 2 x i32> %v to <vscale x 2 x i64>
1633 %r = call i64 @llvm.vp.reduce.add.nxv2i64(i64 %s, <vscale x 2 x i64> %e, <vscale x 2 x i1> %m, i32 %evl)
1637 define signext i64 @vwpreduce_uadd_nxv2i32(i64 signext %s, <vscale x 2 x i32> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1638 ; RV32-LABEL: vwpreduce_uadd_nxv2i32:
1640 ; RV32-NEXT: addi sp, sp, -16
1641 ; RV32-NEXT: .cfi_def_cfa_offset 16
1642 ; RV32-NEXT: sw a0, 8(sp)
1643 ; RV32-NEXT: sw a1, 12(sp)
1644 ; RV32-NEXT: addi a0, sp, 8
1645 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1646 ; RV32-NEXT: vlse64.v v9, (a0), zero
1647 ; RV32-NEXT: li a1, 32
1648 ; RV32-NEXT: vsetvli zero, a2, e32, m1, ta, ma
1649 ; RV32-NEXT: vwredsum.vs v9, v8, v9, v0.t
1650 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1651 ; RV32-NEXT: vmv.x.s a0, v9
1652 ; RV32-NEXT: vsrl.vx v8, v9, a1
1653 ; RV32-NEXT: vmv.x.s a1, v8
1654 ; RV32-NEXT: addi sp, sp, 16
1655 ; RV32-NEXT: .cfi_def_cfa_offset 0
1658 ; RV64-LABEL: vwpreduce_uadd_nxv2i32:
1660 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1661 ; RV64-NEXT: vmv.s.x v9, a0
1662 ; RV64-NEXT: vsetvli zero, a1, e32, m1, ta, ma
1663 ; RV64-NEXT: vwredsum.vs v9, v8, v9, v0.t
1664 ; RV64-NEXT: vsetvli zero, zero, e64, m2, ta, ma
1665 ; RV64-NEXT: vmv.x.s a0, v9
1667 %e = sext <vscale x 2 x i32> %v to <vscale x 2 x i64>
1668 %r = call i64 @llvm.vp.reduce.add.nxv2i64(i64 %s, <vscale x 2 x i64> %e, <vscale x 2 x i1> %m, i32 %evl)
1672 declare i64 @llvm.vp.reduce.umax.nxv2i64(i64, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1674 define signext i64 @vpreduce_umax_nxv2i64(i64 signext %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1675 ; RV32-LABEL: vpreduce_umax_nxv2i64:
1677 ; RV32-NEXT: addi sp, sp, -16
1678 ; RV32-NEXT: .cfi_def_cfa_offset 16
1679 ; RV32-NEXT: sw a0, 8(sp)
1680 ; RV32-NEXT: sw a1, 12(sp)
1681 ; RV32-NEXT: addi a0, sp, 8
1682 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1683 ; RV32-NEXT: vlse64.v v10, (a0), zero
1684 ; RV32-NEXT: li a1, 32
1685 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1686 ; RV32-NEXT: vredmaxu.vs v10, v8, v10, v0.t
1687 ; RV32-NEXT: vmv.x.s a0, v10
1688 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1689 ; RV32-NEXT: vsrl.vx v8, v10, a1
1690 ; RV32-NEXT: vmv.x.s a1, v8
1691 ; RV32-NEXT: addi sp, sp, 16
1692 ; RV32-NEXT: .cfi_def_cfa_offset 0
1695 ; RV64-LABEL: vpreduce_umax_nxv2i64:
1697 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1698 ; RV64-NEXT: vmv.s.x v10, a0
1699 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1700 ; RV64-NEXT: vredmaxu.vs v10, v8, v10, v0.t
1701 ; RV64-NEXT: vmv.x.s a0, v10
1703 %r = call i64 @llvm.vp.reduce.umax.nxv2i64(i64 %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 %evl)
1707 declare i64 @llvm.vp.reduce.smax.nxv2i64(i64, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1709 define signext i64 @vpreduce_smax_nxv2i64(i64 signext %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1710 ; RV32-LABEL: vpreduce_smax_nxv2i64:
1712 ; RV32-NEXT: addi sp, sp, -16
1713 ; RV32-NEXT: .cfi_def_cfa_offset 16
1714 ; RV32-NEXT: sw a0, 8(sp)
1715 ; RV32-NEXT: sw a1, 12(sp)
1716 ; RV32-NEXT: addi a0, sp, 8
1717 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1718 ; RV32-NEXT: vlse64.v v10, (a0), zero
1719 ; RV32-NEXT: li a1, 32
1720 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1721 ; RV32-NEXT: vredmax.vs v10, v8, v10, v0.t
1722 ; RV32-NEXT: vmv.x.s a0, v10
1723 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1724 ; RV32-NEXT: vsrl.vx v8, v10, a1
1725 ; RV32-NEXT: vmv.x.s a1, v8
1726 ; RV32-NEXT: addi sp, sp, 16
1727 ; RV32-NEXT: .cfi_def_cfa_offset 0
1730 ; RV64-LABEL: vpreduce_smax_nxv2i64:
1732 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1733 ; RV64-NEXT: vmv.s.x v10, a0
1734 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1735 ; RV64-NEXT: vredmax.vs v10, v8, v10, v0.t
1736 ; RV64-NEXT: vmv.x.s a0, v10
1738 %r = call i64 @llvm.vp.reduce.smax.nxv2i64(i64 %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 %evl)
1742 declare i64 @llvm.vp.reduce.umin.nxv2i64(i64, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1744 define signext i64 @vpreduce_umin_nxv2i64(i64 signext %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1745 ; RV32-LABEL: vpreduce_umin_nxv2i64:
1747 ; RV32-NEXT: addi sp, sp, -16
1748 ; RV32-NEXT: .cfi_def_cfa_offset 16
1749 ; RV32-NEXT: sw a0, 8(sp)
1750 ; RV32-NEXT: sw a1, 12(sp)
1751 ; RV32-NEXT: addi a0, sp, 8
1752 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1753 ; RV32-NEXT: vlse64.v v10, (a0), zero
1754 ; RV32-NEXT: li a1, 32
1755 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1756 ; RV32-NEXT: vredminu.vs v10, v8, v10, v0.t
1757 ; RV32-NEXT: vmv.x.s a0, v10
1758 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1759 ; RV32-NEXT: vsrl.vx v8, v10, a1
1760 ; RV32-NEXT: vmv.x.s a1, v8
1761 ; RV32-NEXT: addi sp, sp, 16
1762 ; RV32-NEXT: .cfi_def_cfa_offset 0
1765 ; RV64-LABEL: vpreduce_umin_nxv2i64:
1767 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1768 ; RV64-NEXT: vmv.s.x v10, a0
1769 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1770 ; RV64-NEXT: vredminu.vs v10, v8, v10, v0.t
1771 ; RV64-NEXT: vmv.x.s a0, v10
1773 %r = call i64 @llvm.vp.reduce.umin.nxv2i64(i64 %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 %evl)
1777 declare i64 @llvm.vp.reduce.smin.nxv2i64(i64, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1779 define signext i64 @vpreduce_smin_nxv2i64(i64 signext %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1780 ; RV32-LABEL: vpreduce_smin_nxv2i64:
1782 ; RV32-NEXT: addi sp, sp, -16
1783 ; RV32-NEXT: .cfi_def_cfa_offset 16
1784 ; RV32-NEXT: sw a0, 8(sp)
1785 ; RV32-NEXT: sw a1, 12(sp)
1786 ; RV32-NEXT: addi a0, sp, 8
1787 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1788 ; RV32-NEXT: vlse64.v v10, (a0), zero
1789 ; RV32-NEXT: li a1, 32
1790 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1791 ; RV32-NEXT: vredmin.vs v10, v8, v10, v0.t
1792 ; RV32-NEXT: vmv.x.s a0, v10
1793 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1794 ; RV32-NEXT: vsrl.vx v8, v10, a1
1795 ; RV32-NEXT: vmv.x.s a1, v8
1796 ; RV32-NEXT: addi sp, sp, 16
1797 ; RV32-NEXT: .cfi_def_cfa_offset 0
1800 ; RV64-LABEL: vpreduce_smin_nxv2i64:
1802 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1803 ; RV64-NEXT: vmv.s.x v10, a0
1804 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1805 ; RV64-NEXT: vredmin.vs v10, v8, v10, v0.t
1806 ; RV64-NEXT: vmv.x.s a0, v10
1808 %r = call i64 @llvm.vp.reduce.smin.nxv2i64(i64 %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 %evl)
1812 declare i64 @llvm.vp.reduce.and.nxv2i64(i64, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1814 define signext i64 @vpreduce_and_nxv2i64(i64 signext %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1815 ; RV32-LABEL: vpreduce_and_nxv2i64:
1817 ; RV32-NEXT: addi sp, sp, -16
1818 ; RV32-NEXT: .cfi_def_cfa_offset 16
1819 ; RV32-NEXT: sw a0, 8(sp)
1820 ; RV32-NEXT: sw a1, 12(sp)
1821 ; RV32-NEXT: addi a0, sp, 8
1822 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1823 ; RV32-NEXT: vlse64.v v10, (a0), zero
1824 ; RV32-NEXT: li a1, 32
1825 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1826 ; RV32-NEXT: vredand.vs v10, v8, v10, v0.t
1827 ; RV32-NEXT: vmv.x.s a0, v10
1828 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1829 ; RV32-NEXT: vsrl.vx v8, v10, a1
1830 ; RV32-NEXT: vmv.x.s a1, v8
1831 ; RV32-NEXT: addi sp, sp, 16
1832 ; RV32-NEXT: .cfi_def_cfa_offset 0
1835 ; RV64-LABEL: vpreduce_and_nxv2i64:
1837 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1838 ; RV64-NEXT: vmv.s.x v10, a0
1839 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1840 ; RV64-NEXT: vredand.vs v10, v8, v10, v0.t
1841 ; RV64-NEXT: vmv.x.s a0, v10
1843 %r = call i64 @llvm.vp.reduce.and.nxv2i64(i64 %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 %evl)
1847 declare i64 @llvm.vp.reduce.or.nxv2i64(i64, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1849 define signext i64 @vpreduce_or_nxv2i64(i64 signext %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1850 ; RV32-LABEL: vpreduce_or_nxv2i64:
1852 ; RV32-NEXT: addi sp, sp, -16
1853 ; RV32-NEXT: .cfi_def_cfa_offset 16
1854 ; RV32-NEXT: sw a0, 8(sp)
1855 ; RV32-NEXT: sw a1, 12(sp)
1856 ; RV32-NEXT: addi a0, sp, 8
1857 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1858 ; RV32-NEXT: vlse64.v v10, (a0), zero
1859 ; RV32-NEXT: li a1, 32
1860 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1861 ; RV32-NEXT: vredor.vs v10, v8, v10, v0.t
1862 ; RV32-NEXT: vmv.x.s a0, v10
1863 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1864 ; RV32-NEXT: vsrl.vx v8, v10, a1
1865 ; RV32-NEXT: vmv.x.s a1, v8
1866 ; RV32-NEXT: addi sp, sp, 16
1867 ; RV32-NEXT: .cfi_def_cfa_offset 0
1870 ; RV64-LABEL: vpreduce_or_nxv2i64:
1872 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1873 ; RV64-NEXT: vmv.s.x v10, a0
1874 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1875 ; RV64-NEXT: vredor.vs v10, v8, v10, v0.t
1876 ; RV64-NEXT: vmv.x.s a0, v10
1878 %r = call i64 @llvm.vp.reduce.or.nxv2i64(i64 %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 %evl)
1882 declare i64 @llvm.vp.reduce.xor.nxv2i64(i64, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1884 define signext i64 @vpreduce_xor_nxv2i64(i64 signext %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1885 ; RV32-LABEL: vpreduce_xor_nxv2i64:
1887 ; RV32-NEXT: addi sp, sp, -16
1888 ; RV32-NEXT: .cfi_def_cfa_offset 16
1889 ; RV32-NEXT: sw a0, 8(sp)
1890 ; RV32-NEXT: sw a1, 12(sp)
1891 ; RV32-NEXT: addi a0, sp, 8
1892 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1893 ; RV32-NEXT: vlse64.v v10, (a0), zero
1894 ; RV32-NEXT: li a1, 32
1895 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1896 ; RV32-NEXT: vredxor.vs v10, v8, v10, v0.t
1897 ; RV32-NEXT: vmv.x.s a0, v10
1898 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1899 ; RV32-NEXT: vsrl.vx v8, v10, a1
1900 ; RV32-NEXT: vmv.x.s a1, v8
1901 ; RV32-NEXT: addi sp, sp, 16
1902 ; RV32-NEXT: .cfi_def_cfa_offset 0
1905 ; RV64-LABEL: vpreduce_xor_nxv2i64:
1907 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1908 ; RV64-NEXT: vmv.s.x v10, a0
1909 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1910 ; RV64-NEXT: vredxor.vs v10, v8, v10, v0.t
1911 ; RV64-NEXT: vmv.x.s a0, v10
1913 %r = call i64 @llvm.vp.reduce.xor.nxv2i64(i64 %s, <vscale x 2 x i64> %v, <vscale x 2 x i1> %m, i32 %evl)
1917 declare i64 @llvm.vp.reduce.add.nxv4i64(i64, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
1919 define signext i64 @vpreduce_add_nxv4i64(i64 signext %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1920 ; RV32-LABEL: vpreduce_add_nxv4i64:
1922 ; RV32-NEXT: addi sp, sp, -16
1923 ; RV32-NEXT: .cfi_def_cfa_offset 16
1924 ; RV32-NEXT: sw a0, 8(sp)
1925 ; RV32-NEXT: sw a1, 12(sp)
1926 ; RV32-NEXT: addi a0, sp, 8
1927 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1928 ; RV32-NEXT: vlse64.v v12, (a0), zero
1929 ; RV32-NEXT: li a1, 32
1930 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
1931 ; RV32-NEXT: vredsum.vs v12, v8, v12, v0.t
1932 ; RV32-NEXT: vmv.x.s a0, v12
1933 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1934 ; RV32-NEXT: vsrl.vx v8, v12, a1
1935 ; RV32-NEXT: vmv.x.s a1, v8
1936 ; RV32-NEXT: addi sp, sp, 16
1937 ; RV32-NEXT: .cfi_def_cfa_offset 0
1940 ; RV64-LABEL: vpreduce_add_nxv4i64:
1942 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1943 ; RV64-NEXT: vmv.s.x v12, a0
1944 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
1945 ; RV64-NEXT: vredsum.vs v12, v8, v12, v0.t
1946 ; RV64-NEXT: vmv.x.s a0, v12
1948 %r = call i64 @llvm.vp.reduce.add.nxv4i64(i64 %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 %evl)
1952 define signext i64 @vpwreduce_add_nxv4i32(i64 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1953 ; RV32-LABEL: vpwreduce_add_nxv4i32:
1955 ; RV32-NEXT: addi sp, sp, -16
1956 ; RV32-NEXT: .cfi_def_cfa_offset 16
1957 ; RV32-NEXT: sw a0, 8(sp)
1958 ; RV32-NEXT: sw a1, 12(sp)
1959 ; RV32-NEXT: addi a0, sp, 8
1960 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1961 ; RV32-NEXT: vlse64.v v10, (a0), zero
1962 ; RV32-NEXT: li a1, 32
1963 ; RV32-NEXT: vsetvli zero, a2, e32, m2, ta, ma
1964 ; RV32-NEXT: vwredsum.vs v10, v8, v10, v0.t
1965 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1966 ; RV32-NEXT: vmv.x.s a0, v10
1967 ; RV32-NEXT: vsrl.vx v8, v10, a1
1968 ; RV32-NEXT: vmv.x.s a1, v8
1969 ; RV32-NEXT: addi sp, sp, 16
1970 ; RV32-NEXT: .cfi_def_cfa_offset 0
1973 ; RV64-LABEL: vpwreduce_add_nxv4i32:
1975 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1976 ; RV64-NEXT: vmv.s.x v10, a0
1977 ; RV64-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1978 ; RV64-NEXT: vwredsum.vs v10, v8, v10, v0.t
1979 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, ma
1980 ; RV64-NEXT: vmv.x.s a0, v10
1982 %e = sext <vscale x 4 x i32> %v to <vscale x 4 x i64>
1983 %r = call i64 @llvm.vp.reduce.add.nxv4i64(i64 %s, <vscale x 4 x i64> %e, <vscale x 4 x i1> %m, i32 %evl)
1987 define signext i64 @vpwreduce_uadd_nxv4i32(i64 signext %s, <vscale x 4 x i32> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1988 ; RV32-LABEL: vpwreduce_uadd_nxv4i32:
1990 ; RV32-NEXT: addi sp, sp, -16
1991 ; RV32-NEXT: .cfi_def_cfa_offset 16
1992 ; RV32-NEXT: sw a0, 8(sp)
1993 ; RV32-NEXT: sw a1, 12(sp)
1994 ; RV32-NEXT: addi a0, sp, 8
1995 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
1996 ; RV32-NEXT: vlse64.v v10, (a0), zero
1997 ; RV32-NEXT: li a1, 32
1998 ; RV32-NEXT: vsetvli zero, a2, e32, m2, ta, ma
1999 ; RV32-NEXT: vwredsumu.vs v10, v8, v10, v0.t
2000 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2001 ; RV32-NEXT: vmv.x.s a0, v10
2002 ; RV32-NEXT: vsrl.vx v8, v10, a1
2003 ; RV32-NEXT: vmv.x.s a1, v8
2004 ; RV32-NEXT: addi sp, sp, 16
2005 ; RV32-NEXT: .cfi_def_cfa_offset 0
2008 ; RV64-LABEL: vpwreduce_uadd_nxv4i32:
2010 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2011 ; RV64-NEXT: vmv.s.x v10, a0
2012 ; RV64-NEXT: vsetvli zero, a1, e32, m2, ta, ma
2013 ; RV64-NEXT: vwredsumu.vs v10, v8, v10, v0.t
2014 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, ma
2015 ; RV64-NEXT: vmv.x.s a0, v10
2017 %e = zext <vscale x 4 x i32> %v to <vscale x 4 x i64>
2018 %r = call i64 @llvm.vp.reduce.add.nxv4i64(i64 %s, <vscale x 4 x i64> %e, <vscale x 4 x i1> %m, i32 %evl)
2022 declare i64 @llvm.vp.reduce.umax.nxv4i64(i64, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
2024 define signext i64 @vpreduce_umax_nxv4i64(i64 signext %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
2025 ; RV32-LABEL: vpreduce_umax_nxv4i64:
2027 ; RV32-NEXT: addi sp, sp, -16
2028 ; RV32-NEXT: .cfi_def_cfa_offset 16
2029 ; RV32-NEXT: sw a0, 8(sp)
2030 ; RV32-NEXT: sw a1, 12(sp)
2031 ; RV32-NEXT: addi a0, sp, 8
2032 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2033 ; RV32-NEXT: vlse64.v v12, (a0), zero
2034 ; RV32-NEXT: li a1, 32
2035 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
2036 ; RV32-NEXT: vredmaxu.vs v12, v8, v12, v0.t
2037 ; RV32-NEXT: vmv.x.s a0, v12
2038 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2039 ; RV32-NEXT: vsrl.vx v8, v12, a1
2040 ; RV32-NEXT: vmv.x.s a1, v8
2041 ; RV32-NEXT: addi sp, sp, 16
2042 ; RV32-NEXT: .cfi_def_cfa_offset 0
2045 ; RV64-LABEL: vpreduce_umax_nxv4i64:
2047 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2048 ; RV64-NEXT: vmv.s.x v12, a0
2049 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
2050 ; RV64-NEXT: vredmaxu.vs v12, v8, v12, v0.t
2051 ; RV64-NEXT: vmv.x.s a0, v12
2053 %r = call i64 @llvm.vp.reduce.umax.nxv4i64(i64 %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 %evl)
2057 declare i64 @llvm.vp.reduce.smax.nxv4i64(i64, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
2059 define signext i64 @vpreduce_smax_nxv4i64(i64 signext %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
2060 ; RV32-LABEL: vpreduce_smax_nxv4i64:
2062 ; RV32-NEXT: addi sp, sp, -16
2063 ; RV32-NEXT: .cfi_def_cfa_offset 16
2064 ; RV32-NEXT: sw a0, 8(sp)
2065 ; RV32-NEXT: sw a1, 12(sp)
2066 ; RV32-NEXT: addi a0, sp, 8
2067 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2068 ; RV32-NEXT: vlse64.v v12, (a0), zero
2069 ; RV32-NEXT: li a1, 32
2070 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
2071 ; RV32-NEXT: vredmax.vs v12, v8, v12, v0.t
2072 ; RV32-NEXT: vmv.x.s a0, v12
2073 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2074 ; RV32-NEXT: vsrl.vx v8, v12, a1
2075 ; RV32-NEXT: vmv.x.s a1, v8
2076 ; RV32-NEXT: addi sp, sp, 16
2077 ; RV32-NEXT: .cfi_def_cfa_offset 0
2080 ; RV64-LABEL: vpreduce_smax_nxv4i64:
2082 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2083 ; RV64-NEXT: vmv.s.x v12, a0
2084 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
2085 ; RV64-NEXT: vredmax.vs v12, v8, v12, v0.t
2086 ; RV64-NEXT: vmv.x.s a0, v12
2088 %r = call i64 @llvm.vp.reduce.smax.nxv4i64(i64 %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 %evl)
2092 declare i64 @llvm.vp.reduce.umin.nxv4i64(i64, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
2094 define signext i64 @vpreduce_umin_nxv4i64(i64 signext %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
2095 ; RV32-LABEL: vpreduce_umin_nxv4i64:
2097 ; RV32-NEXT: addi sp, sp, -16
2098 ; RV32-NEXT: .cfi_def_cfa_offset 16
2099 ; RV32-NEXT: sw a0, 8(sp)
2100 ; RV32-NEXT: sw a1, 12(sp)
2101 ; RV32-NEXT: addi a0, sp, 8
2102 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2103 ; RV32-NEXT: vlse64.v v12, (a0), zero
2104 ; RV32-NEXT: li a1, 32
2105 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
2106 ; RV32-NEXT: vredminu.vs v12, v8, v12, v0.t
2107 ; RV32-NEXT: vmv.x.s a0, v12
2108 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2109 ; RV32-NEXT: vsrl.vx v8, v12, a1
2110 ; RV32-NEXT: vmv.x.s a1, v8
2111 ; RV32-NEXT: addi sp, sp, 16
2112 ; RV32-NEXT: .cfi_def_cfa_offset 0
2115 ; RV64-LABEL: vpreduce_umin_nxv4i64:
2117 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2118 ; RV64-NEXT: vmv.s.x v12, a0
2119 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
2120 ; RV64-NEXT: vredminu.vs v12, v8, v12, v0.t
2121 ; RV64-NEXT: vmv.x.s a0, v12
2123 %r = call i64 @llvm.vp.reduce.umin.nxv4i64(i64 %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 %evl)
2127 declare i64 @llvm.vp.reduce.smin.nxv4i64(i64, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
2129 define signext i64 @vpreduce_smin_nxv4i64(i64 signext %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
2130 ; RV32-LABEL: vpreduce_smin_nxv4i64:
2132 ; RV32-NEXT: addi sp, sp, -16
2133 ; RV32-NEXT: .cfi_def_cfa_offset 16
2134 ; RV32-NEXT: sw a0, 8(sp)
2135 ; RV32-NEXT: sw a1, 12(sp)
2136 ; RV32-NEXT: addi a0, sp, 8
2137 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2138 ; RV32-NEXT: vlse64.v v12, (a0), zero
2139 ; RV32-NEXT: li a1, 32
2140 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
2141 ; RV32-NEXT: vredmin.vs v12, v8, v12, v0.t
2142 ; RV32-NEXT: vmv.x.s a0, v12
2143 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2144 ; RV32-NEXT: vsrl.vx v8, v12, a1
2145 ; RV32-NEXT: vmv.x.s a1, v8
2146 ; RV32-NEXT: addi sp, sp, 16
2147 ; RV32-NEXT: .cfi_def_cfa_offset 0
2150 ; RV64-LABEL: vpreduce_smin_nxv4i64:
2152 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2153 ; RV64-NEXT: vmv.s.x v12, a0
2154 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
2155 ; RV64-NEXT: vredmin.vs v12, v8, v12, v0.t
2156 ; RV64-NEXT: vmv.x.s a0, v12
2158 %r = call i64 @llvm.vp.reduce.smin.nxv4i64(i64 %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 %evl)
2162 declare i64 @llvm.vp.reduce.and.nxv4i64(i64, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
2164 define signext i64 @vpreduce_and_nxv4i64(i64 signext %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
2165 ; RV32-LABEL: vpreduce_and_nxv4i64:
2167 ; RV32-NEXT: addi sp, sp, -16
2168 ; RV32-NEXT: .cfi_def_cfa_offset 16
2169 ; RV32-NEXT: sw a0, 8(sp)
2170 ; RV32-NEXT: sw a1, 12(sp)
2171 ; RV32-NEXT: addi a0, sp, 8
2172 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2173 ; RV32-NEXT: vlse64.v v12, (a0), zero
2174 ; RV32-NEXT: li a1, 32
2175 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
2176 ; RV32-NEXT: vredand.vs v12, v8, v12, v0.t
2177 ; RV32-NEXT: vmv.x.s a0, v12
2178 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2179 ; RV32-NEXT: vsrl.vx v8, v12, a1
2180 ; RV32-NEXT: vmv.x.s a1, v8
2181 ; RV32-NEXT: addi sp, sp, 16
2182 ; RV32-NEXT: .cfi_def_cfa_offset 0
2185 ; RV64-LABEL: vpreduce_and_nxv4i64:
2187 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2188 ; RV64-NEXT: vmv.s.x v12, a0
2189 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
2190 ; RV64-NEXT: vredand.vs v12, v8, v12, v0.t
2191 ; RV64-NEXT: vmv.x.s a0, v12
2193 %r = call i64 @llvm.vp.reduce.and.nxv4i64(i64 %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 %evl)
2197 declare i64 @llvm.vp.reduce.or.nxv4i64(i64, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
2199 define signext i64 @vpreduce_or_nxv4i64(i64 signext %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
2200 ; RV32-LABEL: vpreduce_or_nxv4i64:
2202 ; RV32-NEXT: addi sp, sp, -16
2203 ; RV32-NEXT: .cfi_def_cfa_offset 16
2204 ; RV32-NEXT: sw a0, 8(sp)
2205 ; RV32-NEXT: sw a1, 12(sp)
2206 ; RV32-NEXT: addi a0, sp, 8
2207 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2208 ; RV32-NEXT: vlse64.v v12, (a0), zero
2209 ; RV32-NEXT: li a1, 32
2210 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
2211 ; RV32-NEXT: vredor.vs v12, v8, v12, v0.t
2212 ; RV32-NEXT: vmv.x.s a0, v12
2213 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2214 ; RV32-NEXT: vsrl.vx v8, v12, a1
2215 ; RV32-NEXT: vmv.x.s a1, v8
2216 ; RV32-NEXT: addi sp, sp, 16
2217 ; RV32-NEXT: .cfi_def_cfa_offset 0
2220 ; RV64-LABEL: vpreduce_or_nxv4i64:
2222 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2223 ; RV64-NEXT: vmv.s.x v12, a0
2224 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
2225 ; RV64-NEXT: vredor.vs v12, v8, v12, v0.t
2226 ; RV64-NEXT: vmv.x.s a0, v12
2228 %r = call i64 @llvm.vp.reduce.or.nxv4i64(i64 %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 %evl)
2232 declare i64 @llvm.vp.reduce.xor.nxv4i64(i64, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
2234 define signext i64 @vpreduce_xor_nxv4i64(i64 signext %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 zeroext %evl) {
2235 ; RV32-LABEL: vpreduce_xor_nxv4i64:
2237 ; RV32-NEXT: addi sp, sp, -16
2238 ; RV32-NEXT: .cfi_def_cfa_offset 16
2239 ; RV32-NEXT: sw a0, 8(sp)
2240 ; RV32-NEXT: sw a1, 12(sp)
2241 ; RV32-NEXT: addi a0, sp, 8
2242 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2243 ; RV32-NEXT: vlse64.v v12, (a0), zero
2244 ; RV32-NEXT: li a1, 32
2245 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
2246 ; RV32-NEXT: vredxor.vs v12, v8, v12, v0.t
2247 ; RV32-NEXT: vmv.x.s a0, v12
2248 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2249 ; RV32-NEXT: vsrl.vx v8, v12, a1
2250 ; RV32-NEXT: vmv.x.s a1, v8
2251 ; RV32-NEXT: addi sp, sp, 16
2252 ; RV32-NEXT: .cfi_def_cfa_offset 0
2255 ; RV64-LABEL: vpreduce_xor_nxv4i64:
2257 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
2258 ; RV64-NEXT: vmv.s.x v12, a0
2259 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
2260 ; RV64-NEXT: vredxor.vs v12, v8, v12, v0.t
2261 ; RV64-NEXT: vmv.x.s a0, v12
2263 %r = call i64 @llvm.vp.reduce.xor.nxv4i64(i64 %s, <vscale x 4 x i64> %v, <vscale x 4 x i1> %m, i32 %evl)