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 <8 x i7> @llvm.vp.umax.v8i7(<8 x i7>, <8 x i7>, <8 x i1>, i32)
9 define <8 x i7> @vmaxu_vv_v8i7(<8 x i7> %va, <8 x i7> %b, <8 x i1> %m, i32 zeroext %evl) {
10 ; CHECK-LABEL: vmaxu_vv_v8i7:
12 ; CHECK-NEXT: li a1, 127
13 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
14 ; CHECK-NEXT: vand.vx v9, v9, a1
15 ; CHECK-NEXT: vand.vx v8, v8, a1
16 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
17 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
19 %v = call <8 x i7> @llvm.vp.umax.v8i7(<8 x i7> %va, <8 x i7> %b, <8 x i1> %m, i32 %evl)
23 declare <2 x i8> @llvm.vp.umax.v2i8(<2 x i8>, <2 x i8>, <2 x i1>, i32)
25 define <2 x i8> @vmaxu_vv_v2i8(<2 x i8> %va, <2 x i8> %b, <2 x i1> %m, i32 zeroext %evl) {
26 ; CHECK-LABEL: vmaxu_vv_v2i8:
28 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
29 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
31 %v = call <2 x i8> @llvm.vp.umax.v2i8(<2 x i8> %va, <2 x i8> %b, <2 x i1> %m, i32 %evl)
35 define <2 x i8> @vmaxu_vv_v2i8_unmasked(<2 x i8> %va, <2 x i8> %b, i32 zeroext %evl) {
36 ; CHECK-LABEL: vmaxu_vv_v2i8_unmasked:
38 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
39 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
41 %head = insertelement <2 x i1> poison, i1 true, i32 0
42 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
43 %v = call <2 x i8> @llvm.vp.umax.v2i8(<2 x i8> %va, <2 x i8> %b, <2 x i1> %m, i32 %evl)
47 define <2 x i8> @vmaxu_vx_v2i8(<2 x i8> %va, i8 %b, <2 x i1> %m, i32 zeroext %evl) {
48 ; CHECK-LABEL: vmaxu_vx_v2i8:
50 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
51 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
53 %elt.head = insertelement <2 x i8> poison, i8 %b, i32 0
54 %vb = shufflevector <2 x i8> %elt.head, <2 x i8> poison, <2 x i32> zeroinitializer
55 %v = call <2 x i8> @llvm.vp.umax.v2i8(<2 x i8> %va, <2 x i8> %vb, <2 x i1> %m, i32 %evl)
59 define <2 x i8> @vmaxu_vx_v2i8_unmasked(<2 x i8> %va, i8 %b, i32 zeroext %evl) {
60 ; CHECK-LABEL: vmaxu_vx_v2i8_unmasked:
62 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
63 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
65 %elt.head = insertelement <2 x i8> poison, i8 %b, i32 0
66 %vb = shufflevector <2 x i8> %elt.head, <2 x i8> poison, <2 x i32> zeroinitializer
67 %head = insertelement <2 x i1> poison, i1 true, i32 0
68 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
69 %v = call <2 x i8> @llvm.vp.umax.v2i8(<2 x i8> %va, <2 x i8> %vb, <2 x i1> %m, i32 %evl)
73 declare <4 x i8> @llvm.vp.umax.v4i8(<4 x i8>, <4 x i8>, <4 x i1>, i32)
75 define <4 x i8> @vmaxu_vv_v4i8(<4 x i8> %va, <4 x i8> %b, <4 x i1> %m, i32 zeroext %evl) {
76 ; CHECK-LABEL: vmaxu_vv_v4i8:
78 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
79 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
81 %v = call <4 x i8> @llvm.vp.umax.v4i8(<4 x i8> %va, <4 x i8> %b, <4 x i1> %m, i32 %evl)
85 define <4 x i8> @vmaxu_vv_v4i8_unmasked(<4 x i8> %va, <4 x i8> %b, i32 zeroext %evl) {
86 ; CHECK-LABEL: vmaxu_vv_v4i8_unmasked:
88 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
89 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
91 %head = insertelement <4 x i1> poison, i1 true, i32 0
92 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
93 %v = call <4 x i8> @llvm.vp.umax.v4i8(<4 x i8> %va, <4 x i8> %b, <4 x i1> %m, i32 %evl)
97 define <4 x i8> @vmaxu_vx_v4i8(<4 x i8> %va, i8 %b, <4 x i1> %m, i32 zeroext %evl) {
98 ; CHECK-LABEL: vmaxu_vx_v4i8:
100 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
101 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
103 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
104 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
105 %v = call <4 x i8> @llvm.vp.umax.v4i8(<4 x i8> %va, <4 x i8> %vb, <4 x i1> %m, i32 %evl)
109 define <4 x i8> @vmaxu_vx_v4i8_commute(<4 x i8> %va, i8 %b, <4 x i1> %m, i32 zeroext %evl) {
110 ; CHECK-LABEL: vmaxu_vx_v4i8_commute:
112 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
113 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
115 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
116 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
117 %v = call <4 x i8> @llvm.vp.umax.v4i8(<4 x i8> %vb, <4 x i8> %va, <4 x i1> %m, i32 %evl)
121 define <4 x i8> @vmaxu_vx_v4i8_unmasked(<4 x i8> %va, i8 %b, i32 zeroext %evl) {
122 ; CHECK-LABEL: vmaxu_vx_v4i8_unmasked:
124 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
125 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
127 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
128 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
129 %head = insertelement <4 x i1> poison, i1 true, i32 0
130 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
131 %v = call <4 x i8> @llvm.vp.umax.v4i8(<4 x i8> %va, <4 x i8> %vb, <4 x i1> %m, i32 %evl)
135 declare <5 x i8> @llvm.vp.umax.v5i8(<5 x i8>, <5 x i8>, <5 x i1>, i32)
137 define <5 x i8> @vmaxu_vv_v5i8(<5 x i8> %va, <5 x i8> %b, <5 x i1> %m, i32 zeroext %evl) {
138 ; CHECK-LABEL: vmaxu_vv_v5i8:
140 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
141 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
143 %v = call <5 x i8> @llvm.vp.umax.v5i8(<5 x i8> %va, <5 x i8> %b, <5 x i1> %m, i32 %evl)
147 define <5 x i8> @vmaxu_vv_v5i8_unmasked(<5 x i8> %va, <5 x i8> %b, i32 zeroext %evl) {
148 ; CHECK-LABEL: vmaxu_vv_v5i8_unmasked:
150 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
151 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
153 %head = insertelement <5 x i1> poison, i1 true, i32 0
154 %m = shufflevector <5 x i1> %head, <5 x i1> poison, <5 x i32> zeroinitializer
155 %v = call <5 x i8> @llvm.vp.umax.v5i8(<5 x i8> %va, <5 x i8> %b, <5 x i1> %m, i32 %evl)
159 define <5 x i8> @vmaxu_vx_v5i8(<5 x i8> %va, i8 %b, <5 x i1> %m, i32 zeroext %evl) {
160 ; CHECK-LABEL: vmaxu_vx_v5i8:
162 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
163 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
165 %elt.head = insertelement <5 x i8> poison, i8 %b, i32 0
166 %vb = shufflevector <5 x i8> %elt.head, <5 x i8> poison, <5 x i32> zeroinitializer
167 %v = call <5 x i8> @llvm.vp.umax.v5i8(<5 x i8> %va, <5 x i8> %vb, <5 x i1> %m, i32 %evl)
171 define <5 x i8> @vmaxu_vx_v5i8_unmasked(<5 x i8> %va, i8 %b, i32 zeroext %evl) {
172 ; CHECK-LABEL: vmaxu_vx_v5i8_unmasked:
174 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
175 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
177 %elt.head = insertelement <5 x i8> poison, i8 %b, i32 0
178 %vb = shufflevector <5 x i8> %elt.head, <5 x i8> poison, <5 x i32> zeroinitializer
179 %head = insertelement <5 x i1> poison, i1 true, i32 0
180 %m = shufflevector <5 x i1> %head, <5 x i1> poison, <5 x i32> zeroinitializer
181 %v = call <5 x i8> @llvm.vp.umax.v5i8(<5 x i8> %va, <5 x i8> %vb, <5 x i1> %m, i32 %evl)
185 declare <8 x i8> @llvm.vp.umax.v8i8(<8 x i8>, <8 x i8>, <8 x i1>, i32)
187 define <8 x i8> @vmaxu_vv_v8i8(<8 x i8> %va, <8 x i8> %b, <8 x i1> %m, i32 zeroext %evl) {
188 ; CHECK-LABEL: vmaxu_vv_v8i8:
190 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
191 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
193 %v = call <8 x i8> @llvm.vp.umax.v8i8(<8 x i8> %va, <8 x i8> %b, <8 x i1> %m, i32 %evl)
197 define <8 x i8> @vmaxu_vv_v8i8_unmasked(<8 x i8> %va, <8 x i8> %b, i32 zeroext %evl) {
198 ; CHECK-LABEL: vmaxu_vv_v8i8_unmasked:
200 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
201 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
203 %head = insertelement <8 x i1> poison, i1 true, i32 0
204 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
205 %v = call <8 x i8> @llvm.vp.umax.v8i8(<8 x i8> %va, <8 x i8> %b, <8 x i1> %m, i32 %evl)
209 define <8 x i8> @vmaxu_vx_v8i8(<8 x i8> %va, i8 %b, <8 x i1> %m, i32 zeroext %evl) {
210 ; CHECK-LABEL: vmaxu_vx_v8i8:
212 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
213 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
215 %elt.head = insertelement <8 x i8> poison, i8 %b, i32 0
216 %vb = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
217 %v = call <8 x i8> @llvm.vp.umax.v8i8(<8 x i8> %va, <8 x i8> %vb, <8 x i1> %m, i32 %evl)
221 define <8 x i8> @vmaxu_vx_v8i8_unmasked(<8 x i8> %va, i8 %b, i32 zeroext %evl) {
222 ; CHECK-LABEL: vmaxu_vx_v8i8_unmasked:
224 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
225 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
227 %elt.head = insertelement <8 x i8> poison, i8 %b, i32 0
228 %vb = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
229 %head = insertelement <8 x i1> poison, i1 true, i32 0
230 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
231 %v = call <8 x i8> @llvm.vp.umax.v8i8(<8 x i8> %va, <8 x i8> %vb, <8 x i1> %m, i32 %evl)
235 declare <16 x i8> @llvm.vp.umax.v16i8(<16 x i8>, <16 x i8>, <16 x i1>, i32)
237 define <16 x i8> @vmaxu_vv_v16i8(<16 x i8> %va, <16 x i8> %b, <16 x i1> %m, i32 zeroext %evl) {
238 ; CHECK-LABEL: vmaxu_vv_v16i8:
240 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
241 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
243 %v = call <16 x i8> @llvm.vp.umax.v16i8(<16 x i8> %va, <16 x i8> %b, <16 x i1> %m, i32 %evl)
247 define <16 x i8> @vmaxu_vv_v16i8_unmasked(<16 x i8> %va, <16 x i8> %b, i32 zeroext %evl) {
248 ; CHECK-LABEL: vmaxu_vv_v16i8_unmasked:
250 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
251 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
253 %head = insertelement <16 x i1> poison, i1 true, i32 0
254 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
255 %v = call <16 x i8> @llvm.vp.umax.v16i8(<16 x i8> %va, <16 x i8> %b, <16 x i1> %m, i32 %evl)
259 define <16 x i8> @vmaxu_vx_v16i8(<16 x i8> %va, i8 %b, <16 x i1> %m, i32 zeroext %evl) {
260 ; CHECK-LABEL: vmaxu_vx_v16i8:
262 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
263 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
265 %elt.head = insertelement <16 x i8> poison, i8 %b, i32 0
266 %vb = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
267 %v = call <16 x i8> @llvm.vp.umax.v16i8(<16 x i8> %va, <16 x i8> %vb, <16 x i1> %m, i32 %evl)
271 define <16 x i8> @vmaxu_vx_v16i8_unmasked(<16 x i8> %va, i8 %b, i32 zeroext %evl) {
272 ; CHECK-LABEL: vmaxu_vx_v16i8_unmasked:
274 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
275 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
277 %elt.head = insertelement <16 x i8> poison, i8 %b, i32 0
278 %vb = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
279 %head = insertelement <16 x i1> poison, i1 true, i32 0
280 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
281 %v = call <16 x i8> @llvm.vp.umax.v16i8(<16 x i8> %va, <16 x i8> %vb, <16 x i1> %m, i32 %evl)
285 declare <256 x i8> @llvm.vp.umax.v258i8(<256 x i8>, <256 x i8>, <256 x i1>, i32)
287 define <256 x i8> @vmaxu_vx_v258i8(<256 x i8> %va, i8 %b, <256 x i1> %m, i32 zeroext %evl) {
288 ; CHECK-LABEL: vmaxu_vx_v258i8:
290 ; CHECK-NEXT: vmv1r.v v24, v0
291 ; CHECK-NEXT: li a3, 128
292 ; CHECK-NEXT: vsetvli zero, a3, e8, m8, ta, ma
293 ; CHECK-NEXT: vlm.v v0, (a1)
294 ; CHECK-NEXT: addi a1, a2, -128
295 ; CHECK-NEXT: sltu a4, a2, a1
296 ; CHECK-NEXT: addi a4, a4, -1
297 ; CHECK-NEXT: and a1, a4, a1
298 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
299 ; CHECK-NEXT: vmaxu.vx v16, v16, a0, v0.t
300 ; CHECK-NEXT: bltu a2, a3, .LBB22_2
301 ; CHECK-NEXT: # %bb.1:
302 ; CHECK-NEXT: li a2, 128
303 ; CHECK-NEXT: .LBB22_2:
304 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
305 ; CHECK-NEXT: vmv1r.v v0, v24
306 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
308 %elt.head = insertelement <256 x i8> poison, i8 %b, i32 0
309 %vb = shufflevector <256 x i8> %elt.head, <256 x i8> poison, <256 x i32> zeroinitializer
310 %v = call <256 x i8> @llvm.vp.umax.v258i8(<256 x i8> %va, <256 x i8> %vb, <256 x i1> %m, i32 %evl)
314 define <256 x i8> @vmaxu_vx_v258i8_unmasked(<256 x i8> %va, i8 %b, i32 zeroext %evl) {
315 ; CHECK-LABEL: vmaxu_vx_v258i8_unmasked:
317 ; CHECK-NEXT: li a3, 128
318 ; CHECK-NEXT: mv a2, a1
319 ; CHECK-NEXT: bltu a1, a3, .LBB23_2
320 ; CHECK-NEXT: # %bb.1:
321 ; CHECK-NEXT: li a2, 128
322 ; CHECK-NEXT: .LBB23_2:
323 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
324 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
325 ; CHECK-NEXT: addi a2, a1, -128
326 ; CHECK-NEXT: sltu a1, a1, a2
327 ; CHECK-NEXT: addi a1, a1, -1
328 ; CHECK-NEXT: and a1, a1, a2
329 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
330 ; CHECK-NEXT: vmaxu.vx v16, v16, a0
332 %elt.head = insertelement <256 x i8> poison, i8 %b, i32 0
333 %vb = shufflevector <256 x i8> %elt.head, <256 x i8> poison, <256 x i32> zeroinitializer
334 %head = insertelement <256 x i1> poison, i1 true, i32 0
335 %m = shufflevector <256 x i1> %head, <256 x i1> poison, <256 x i32> zeroinitializer
336 %v = call <256 x i8> @llvm.vp.umax.v258i8(<256 x i8> %va, <256 x i8> %vb, <256 x i1> %m, i32 %evl)
340 ; Test splitting when the %evl is a known constant.
342 define <256 x i8> @vmaxu_vx_v258i8_evl129(<256 x i8> %va, i8 %b, <256 x i1> %m) {
343 ; CHECK-LABEL: vmaxu_vx_v258i8_evl129:
345 ; CHECK-NEXT: li a2, 128
346 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
347 ; CHECK-NEXT: vlm.v v24, (a1)
348 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
349 ; CHECK-NEXT: vsetivli zero, 1, e8, m8, ta, ma
350 ; CHECK-NEXT: vmv1r.v v0, v24
351 ; CHECK-NEXT: vmaxu.vx v16, v16, a0, v0.t
353 %elt.head = insertelement <256 x i8> poison, i8 %b, i32 0
354 %vb = shufflevector <256 x i8> %elt.head, <256 x i8> poison, <256 x i32> zeroinitializer
355 %v = call <256 x i8> @llvm.vp.umax.v258i8(<256 x i8> %va, <256 x i8> %vb, <256 x i1> %m, i32 129)
359 ; The upper half is doing nothing.
361 define <256 x i8> @vmaxu_vx_v258i8_evl128(<256 x i8> %va, i8 %b, <256 x i1> %m) {
362 ; CHECK-LABEL: vmaxu_vx_v258i8_evl128:
364 ; CHECK-NEXT: li a1, 128
365 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
366 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
368 %elt.head = insertelement <256 x i8> poison, i8 %b, i32 0
369 %vb = shufflevector <256 x i8> %elt.head, <256 x i8> poison, <256 x i32> zeroinitializer
370 %v = call <256 x i8> @llvm.vp.umax.v258i8(<256 x i8> %va, <256 x i8> %vb, <256 x i1> %m, i32 128)
374 declare <2 x i16> @llvm.vp.umax.v2i16(<2 x i16>, <2 x i16>, <2 x i1>, i32)
376 define <2 x i16> @vmaxu_vv_v2i16(<2 x i16> %va, <2 x i16> %b, <2 x i1> %m, i32 zeroext %evl) {
377 ; CHECK-LABEL: vmaxu_vv_v2i16:
379 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
380 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
382 %v = call <2 x i16> @llvm.vp.umax.v2i16(<2 x i16> %va, <2 x i16> %b, <2 x i1> %m, i32 %evl)
386 define <2 x i16> @vmaxu_vv_v2i16_unmasked(<2 x i16> %va, <2 x i16> %b, i32 zeroext %evl) {
387 ; CHECK-LABEL: vmaxu_vv_v2i16_unmasked:
389 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
390 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
392 %head = insertelement <2 x i1> poison, i1 true, i32 0
393 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
394 %v = call <2 x i16> @llvm.vp.umax.v2i16(<2 x i16> %va, <2 x i16> %b, <2 x i1> %m, i32 %evl)
398 define <2 x i16> @vmaxu_vx_v2i16(<2 x i16> %va, i16 %b, <2 x i1> %m, i32 zeroext %evl) {
399 ; CHECK-LABEL: vmaxu_vx_v2i16:
401 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
402 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
404 %elt.head = insertelement <2 x i16> poison, i16 %b, i32 0
405 %vb = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
406 %v = call <2 x i16> @llvm.vp.umax.v2i16(<2 x i16> %va, <2 x i16> %vb, <2 x i1> %m, i32 %evl)
410 define <2 x i16> @vmaxu_vx_v2i16_unmasked(<2 x i16> %va, i16 %b, i32 zeroext %evl) {
411 ; CHECK-LABEL: vmaxu_vx_v2i16_unmasked:
413 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
414 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
416 %elt.head = insertelement <2 x i16> poison, i16 %b, i32 0
417 %vb = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
418 %head = insertelement <2 x i1> poison, i1 true, i32 0
419 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
420 %v = call <2 x i16> @llvm.vp.umax.v2i16(<2 x i16> %va, <2 x i16> %vb, <2 x i1> %m, i32 %evl)
424 declare <4 x i16> @llvm.vp.umax.v4i16(<4 x i16>, <4 x i16>, <4 x i1>, i32)
426 define <4 x i16> @vmaxu_vv_v4i16(<4 x i16> %va, <4 x i16> %b, <4 x i1> %m, i32 zeroext %evl) {
427 ; CHECK-LABEL: vmaxu_vv_v4i16:
429 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
430 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
432 %v = call <4 x i16> @llvm.vp.umax.v4i16(<4 x i16> %va, <4 x i16> %b, <4 x i1> %m, i32 %evl)
436 define <4 x i16> @vmaxu_vv_v4i16_unmasked(<4 x i16> %va, <4 x i16> %b, i32 zeroext %evl) {
437 ; CHECK-LABEL: vmaxu_vv_v4i16_unmasked:
439 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
440 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
442 %head = insertelement <4 x i1> poison, i1 true, i32 0
443 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
444 %v = call <4 x i16> @llvm.vp.umax.v4i16(<4 x i16> %va, <4 x i16> %b, <4 x i1> %m, i32 %evl)
448 define <4 x i16> @vmaxu_vx_v4i16(<4 x i16> %va, i16 %b, <4 x i1> %m, i32 zeroext %evl) {
449 ; CHECK-LABEL: vmaxu_vx_v4i16:
451 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
452 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
454 %elt.head = insertelement <4 x i16> poison, i16 %b, i32 0
455 %vb = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
456 %v = call <4 x i16> @llvm.vp.umax.v4i16(<4 x i16> %va, <4 x i16> %vb, <4 x i1> %m, i32 %evl)
460 define <4 x i16> @vmaxu_vx_v4i16_unmasked(<4 x i16> %va, i16 %b, i32 zeroext %evl) {
461 ; CHECK-LABEL: vmaxu_vx_v4i16_unmasked:
463 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
464 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
466 %elt.head = insertelement <4 x i16> poison, i16 %b, i32 0
467 %vb = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
468 %head = insertelement <4 x i1> poison, i1 true, i32 0
469 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
470 %v = call <4 x i16> @llvm.vp.umax.v4i16(<4 x i16> %va, <4 x i16> %vb, <4 x i1> %m, i32 %evl)
474 declare <8 x i16> @llvm.vp.umax.v8i16(<8 x i16>, <8 x i16>, <8 x i1>, i32)
476 define <8 x i16> @vmaxu_vv_v8i16(<8 x i16> %va, <8 x i16> %b, <8 x i1> %m, i32 zeroext %evl) {
477 ; CHECK-LABEL: vmaxu_vv_v8i16:
479 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
480 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
482 %v = call <8 x i16> @llvm.vp.umax.v8i16(<8 x i16> %va, <8 x i16> %b, <8 x i1> %m, i32 %evl)
486 define <8 x i16> @vmaxu_vv_v8i16_unmasked(<8 x i16> %va, <8 x i16> %b, i32 zeroext %evl) {
487 ; CHECK-LABEL: vmaxu_vv_v8i16_unmasked:
489 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
490 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
492 %head = insertelement <8 x i1> poison, i1 true, i32 0
493 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
494 %v = call <8 x i16> @llvm.vp.umax.v8i16(<8 x i16> %va, <8 x i16> %b, <8 x i1> %m, i32 %evl)
498 define <8 x i16> @vmaxu_vx_v8i16(<8 x i16> %va, i16 %b, <8 x i1> %m, i32 zeroext %evl) {
499 ; CHECK-LABEL: vmaxu_vx_v8i16:
501 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
502 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
504 %elt.head = insertelement <8 x i16> poison, i16 %b, i32 0
505 %vb = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
506 %v = call <8 x i16> @llvm.vp.umax.v8i16(<8 x i16> %va, <8 x i16> %vb, <8 x i1> %m, i32 %evl)
510 define <8 x i16> @vmaxu_vx_v8i16_unmasked(<8 x i16> %va, i16 %b, i32 zeroext %evl) {
511 ; CHECK-LABEL: vmaxu_vx_v8i16_unmasked:
513 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
514 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
516 %elt.head = insertelement <8 x i16> poison, i16 %b, i32 0
517 %vb = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
518 %head = insertelement <8 x i1> poison, i1 true, i32 0
519 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
520 %v = call <8 x i16> @llvm.vp.umax.v8i16(<8 x i16> %va, <8 x i16> %vb, <8 x i1> %m, i32 %evl)
524 declare <16 x i16> @llvm.vp.umax.v16i16(<16 x i16>, <16 x i16>, <16 x i1>, i32)
526 define <16 x i16> @vmaxu_vv_v16i16(<16 x i16> %va, <16 x i16> %b, <16 x i1> %m, i32 zeroext %evl) {
527 ; CHECK-LABEL: vmaxu_vv_v16i16:
529 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
530 ; CHECK-NEXT: vmaxu.vv v8, v8, v10, v0.t
532 %v = call <16 x i16> @llvm.vp.umax.v16i16(<16 x i16> %va, <16 x i16> %b, <16 x i1> %m, i32 %evl)
536 define <16 x i16> @vmaxu_vv_v16i16_unmasked(<16 x i16> %va, <16 x i16> %b, i32 zeroext %evl) {
537 ; CHECK-LABEL: vmaxu_vv_v16i16_unmasked:
539 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
540 ; CHECK-NEXT: vmaxu.vv v8, v8, v10
542 %head = insertelement <16 x i1> poison, i1 true, i32 0
543 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
544 %v = call <16 x i16> @llvm.vp.umax.v16i16(<16 x i16> %va, <16 x i16> %b, <16 x i1> %m, i32 %evl)
548 define <16 x i16> @vmaxu_vx_v16i16(<16 x i16> %va, i16 %b, <16 x i1> %m, i32 zeroext %evl) {
549 ; CHECK-LABEL: vmaxu_vx_v16i16:
551 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
552 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
554 %elt.head = insertelement <16 x i16> poison, i16 %b, i32 0
555 %vb = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
556 %v = call <16 x i16> @llvm.vp.umax.v16i16(<16 x i16> %va, <16 x i16> %vb, <16 x i1> %m, i32 %evl)
560 define <16 x i16> @vmaxu_vx_v16i16_unmasked(<16 x i16> %va, i16 %b, i32 zeroext %evl) {
561 ; CHECK-LABEL: vmaxu_vx_v16i16_unmasked:
563 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
564 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
566 %elt.head = insertelement <16 x i16> poison, i16 %b, i32 0
567 %vb = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
568 %head = insertelement <16 x i1> poison, i1 true, i32 0
569 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
570 %v = call <16 x i16> @llvm.vp.umax.v16i16(<16 x i16> %va, <16 x i16> %vb, <16 x i1> %m, i32 %evl)
574 declare <2 x i32> @llvm.vp.umax.v2i32(<2 x i32>, <2 x i32>, <2 x i1>, i32)
576 define <2 x i32> @vmaxu_vv_v2i32(<2 x i32> %va, <2 x i32> %b, <2 x i1> %m, i32 zeroext %evl) {
577 ; CHECK-LABEL: vmaxu_vv_v2i32:
579 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
580 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
582 %v = call <2 x i32> @llvm.vp.umax.v2i32(<2 x i32> %va, <2 x i32> %b, <2 x i1> %m, i32 %evl)
586 define <2 x i32> @vmaxu_vv_v2i32_unmasked(<2 x i32> %va, <2 x i32> %b, i32 zeroext %evl) {
587 ; CHECK-LABEL: vmaxu_vv_v2i32_unmasked:
589 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
590 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
592 %head = insertelement <2 x i1> poison, i1 true, i32 0
593 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
594 %v = call <2 x i32> @llvm.vp.umax.v2i32(<2 x i32> %va, <2 x i32> %b, <2 x i1> %m, i32 %evl)
598 define <2 x i32> @vmaxu_vx_v2i32(<2 x i32> %va, i32 %b, <2 x i1> %m, i32 zeroext %evl) {
599 ; CHECK-LABEL: vmaxu_vx_v2i32:
601 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
602 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
604 %elt.head = insertelement <2 x i32> poison, i32 %b, i32 0
605 %vb = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
606 %v = call <2 x i32> @llvm.vp.umax.v2i32(<2 x i32> %va, <2 x i32> %vb, <2 x i1> %m, i32 %evl)
610 define <2 x i32> @vmaxu_vx_v2i32_unmasked(<2 x i32> %va, i32 %b, i32 zeroext %evl) {
611 ; CHECK-LABEL: vmaxu_vx_v2i32_unmasked:
613 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
614 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
616 %elt.head = insertelement <2 x i32> poison, i32 %b, i32 0
617 %vb = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
618 %head = insertelement <2 x i1> poison, i1 true, i32 0
619 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
620 %v = call <2 x i32> @llvm.vp.umax.v2i32(<2 x i32> %va, <2 x i32> %vb, <2 x i1> %m, i32 %evl)
624 declare <4 x i32> @llvm.vp.umax.v4i32(<4 x i32>, <4 x i32>, <4 x i1>, i32)
626 define <4 x i32> @vmaxu_vv_v4i32(<4 x i32> %va, <4 x i32> %b, <4 x i1> %m, i32 zeroext %evl) {
627 ; CHECK-LABEL: vmaxu_vv_v4i32:
629 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
630 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
632 %v = call <4 x i32> @llvm.vp.umax.v4i32(<4 x i32> %va, <4 x i32> %b, <4 x i1> %m, i32 %evl)
636 define <4 x i32> @vmaxu_vv_v4i32_unmasked(<4 x i32> %va, <4 x i32> %b, i32 zeroext %evl) {
637 ; CHECK-LABEL: vmaxu_vv_v4i32_unmasked:
639 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
640 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
642 %head = insertelement <4 x i1> poison, i1 true, i32 0
643 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
644 %v = call <4 x i32> @llvm.vp.umax.v4i32(<4 x i32> %va, <4 x i32> %b, <4 x i1> %m, i32 %evl)
648 define <4 x i32> @vmaxu_vx_v4i32(<4 x i32> %va, i32 %b, <4 x i1> %m, i32 zeroext %evl) {
649 ; CHECK-LABEL: vmaxu_vx_v4i32:
651 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
652 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
654 %elt.head = insertelement <4 x i32> poison, i32 %b, i32 0
655 %vb = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
656 %v = call <4 x i32> @llvm.vp.umax.v4i32(<4 x i32> %va, <4 x i32> %vb, <4 x i1> %m, i32 %evl)
660 define <4 x i32> @vmaxu_vx_v4i32_unmasked(<4 x i32> %va, i32 %b, i32 zeroext %evl) {
661 ; CHECK-LABEL: vmaxu_vx_v4i32_unmasked:
663 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
664 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
666 %elt.head = insertelement <4 x i32> poison, i32 %b, i32 0
667 %vb = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
668 %head = insertelement <4 x i1> poison, i1 true, i32 0
669 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
670 %v = call <4 x i32> @llvm.vp.umax.v4i32(<4 x i32> %va, <4 x i32> %vb, <4 x i1> %m, i32 %evl)
674 declare <8 x i32> @llvm.vp.umax.v8i32(<8 x i32>, <8 x i32>, <8 x i1>, i32)
676 define <8 x i32> @vmaxu_vv_v8i32(<8 x i32> %va, <8 x i32> %b, <8 x i1> %m, i32 zeroext %evl) {
677 ; CHECK-LABEL: vmaxu_vv_v8i32:
679 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
680 ; CHECK-NEXT: vmaxu.vv v8, v8, v10, v0.t
682 %v = call <8 x i32> @llvm.vp.umax.v8i32(<8 x i32> %va, <8 x i32> %b, <8 x i1> %m, i32 %evl)
686 define <8 x i32> @vmaxu_vv_v8i32_unmasked(<8 x i32> %va, <8 x i32> %b, i32 zeroext %evl) {
687 ; CHECK-LABEL: vmaxu_vv_v8i32_unmasked:
689 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
690 ; CHECK-NEXT: vmaxu.vv v8, v8, v10
692 %head = insertelement <8 x i1> poison, i1 true, i32 0
693 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
694 %v = call <8 x i32> @llvm.vp.umax.v8i32(<8 x i32> %va, <8 x i32> %b, <8 x i1> %m, i32 %evl)
698 define <8 x i32> @vmaxu_vx_v8i32(<8 x i32> %va, i32 %b, <8 x i1> %m, i32 zeroext %evl) {
699 ; CHECK-LABEL: vmaxu_vx_v8i32:
701 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
702 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
704 %elt.head = insertelement <8 x i32> poison, i32 %b, i32 0
705 %vb = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
706 %v = call <8 x i32> @llvm.vp.umax.v8i32(<8 x i32> %va, <8 x i32> %vb, <8 x i1> %m, i32 %evl)
710 define <8 x i32> @vmaxu_vx_v8i32_unmasked(<8 x i32> %va, i32 %b, i32 zeroext %evl) {
711 ; CHECK-LABEL: vmaxu_vx_v8i32_unmasked:
713 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
714 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
716 %elt.head = insertelement <8 x i32> poison, i32 %b, i32 0
717 %vb = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
718 %head = insertelement <8 x i1> poison, i1 true, i32 0
719 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
720 %v = call <8 x i32> @llvm.vp.umax.v8i32(<8 x i32> %va, <8 x i32> %vb, <8 x i1> %m, i32 %evl)
724 declare <16 x i32> @llvm.vp.umax.v16i32(<16 x i32>, <16 x i32>, <16 x i1>, i32)
726 define <16 x i32> @vmaxu_vv_v16i32(<16 x i32> %va, <16 x i32> %b, <16 x i1> %m, i32 zeroext %evl) {
727 ; CHECK-LABEL: vmaxu_vv_v16i32:
729 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
730 ; CHECK-NEXT: vmaxu.vv v8, v8, v12, v0.t
732 %v = call <16 x i32> @llvm.vp.umax.v16i32(<16 x i32> %va, <16 x i32> %b, <16 x i1> %m, i32 %evl)
736 define <16 x i32> @vmaxu_vv_v16i32_unmasked(<16 x i32> %va, <16 x i32> %b, i32 zeroext %evl) {
737 ; CHECK-LABEL: vmaxu_vv_v16i32_unmasked:
739 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
740 ; CHECK-NEXT: vmaxu.vv v8, v8, v12
742 %head = insertelement <16 x i1> poison, i1 true, i32 0
743 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
744 %v = call <16 x i32> @llvm.vp.umax.v16i32(<16 x i32> %va, <16 x i32> %b, <16 x i1> %m, i32 %evl)
748 define <16 x i32> @vmaxu_vx_v16i32(<16 x i32> %va, i32 %b, <16 x i1> %m, i32 zeroext %evl) {
749 ; CHECK-LABEL: vmaxu_vx_v16i32:
751 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
752 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
754 %elt.head = insertelement <16 x i32> poison, i32 %b, i32 0
755 %vb = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
756 %v = call <16 x i32> @llvm.vp.umax.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i1> %m, i32 %evl)
760 define <16 x i32> @vmaxu_vx_v16i32_unmasked(<16 x i32> %va, i32 %b, i32 zeroext %evl) {
761 ; CHECK-LABEL: vmaxu_vx_v16i32_unmasked:
763 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
764 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
766 %elt.head = insertelement <16 x i32> poison, i32 %b, i32 0
767 %vb = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
768 %head = insertelement <16 x i1> poison, i1 true, i32 0
769 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
770 %v = call <16 x i32> @llvm.vp.umax.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i1> %m, i32 %evl)
774 declare <2 x i64> @llvm.vp.umax.v2i64(<2 x i64>, <2 x i64>, <2 x i1>, i32)
776 define <2 x i64> @vmaxu_vv_v2i64(<2 x i64> %va, <2 x i64> %b, <2 x i1> %m, i32 zeroext %evl) {
777 ; CHECK-LABEL: vmaxu_vv_v2i64:
779 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
780 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
782 %v = call <2 x i64> @llvm.vp.umax.v2i64(<2 x i64> %va, <2 x i64> %b, <2 x i1> %m, i32 %evl)
786 define <2 x i64> @vmaxu_vv_v2i64_unmasked(<2 x i64> %va, <2 x i64> %b, i32 zeroext %evl) {
787 ; CHECK-LABEL: vmaxu_vv_v2i64_unmasked:
789 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
790 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
792 %head = insertelement <2 x i1> poison, i1 true, i32 0
793 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
794 %v = call <2 x i64> @llvm.vp.umax.v2i64(<2 x i64> %va, <2 x i64> %b, <2 x i1> %m, i32 %evl)
798 define <2 x i64> @vmaxu_vx_v2i64(<2 x i64> %va, i64 %b, <2 x i1> %m, i32 zeroext %evl) {
799 ; RV32-LABEL: vmaxu_vx_v2i64:
801 ; RV32-NEXT: addi sp, sp, -16
802 ; RV32-NEXT: .cfi_def_cfa_offset 16
803 ; RV32-NEXT: sw a1, 12(sp)
804 ; RV32-NEXT: sw a0, 8(sp)
805 ; RV32-NEXT: addi a0, sp, 8
806 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
807 ; RV32-NEXT: vlse64.v v9, (a0), zero
808 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
809 ; RV32-NEXT: vmaxu.vv v8, v8, v9, v0.t
810 ; RV32-NEXT: addi sp, sp, 16
813 ; RV64-LABEL: vmaxu_vx_v2i64:
815 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
816 ; RV64-NEXT: vmaxu.vx v8, v8, a0, v0.t
818 %elt.head = insertelement <2 x i64> poison, i64 %b, i32 0
819 %vb = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
820 %v = call <2 x i64> @llvm.vp.umax.v2i64(<2 x i64> %va, <2 x i64> %vb, <2 x i1> %m, i32 %evl)
824 define <2 x i64> @vmaxu_vx_v2i64_unmasked(<2 x i64> %va, i64 %b, i32 zeroext %evl) {
825 ; RV32-LABEL: vmaxu_vx_v2i64_unmasked:
827 ; RV32-NEXT: addi sp, sp, -16
828 ; RV32-NEXT: .cfi_def_cfa_offset 16
829 ; RV32-NEXT: sw a1, 12(sp)
830 ; RV32-NEXT: sw a0, 8(sp)
831 ; RV32-NEXT: addi a0, sp, 8
832 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
833 ; RV32-NEXT: vlse64.v v9, (a0), zero
834 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
835 ; RV32-NEXT: vmaxu.vv v8, v8, v9
836 ; RV32-NEXT: addi sp, sp, 16
839 ; RV64-LABEL: vmaxu_vx_v2i64_unmasked:
841 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
842 ; RV64-NEXT: vmaxu.vx v8, v8, a0
844 %elt.head = insertelement <2 x i64> poison, i64 %b, i32 0
845 %vb = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
846 %head = insertelement <2 x i1> poison, i1 true, i32 0
847 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
848 %v = call <2 x i64> @llvm.vp.umax.v2i64(<2 x i64> %va, <2 x i64> %vb, <2 x i1> %m, i32 %evl)
852 declare <4 x i64> @llvm.vp.umax.v4i64(<4 x i64>, <4 x i64>, <4 x i1>, i32)
854 define <4 x i64> @vmaxu_vv_v4i64(<4 x i64> %va, <4 x i64> %b, <4 x i1> %m, i32 zeroext %evl) {
855 ; CHECK-LABEL: vmaxu_vv_v4i64:
857 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
858 ; CHECK-NEXT: vmaxu.vv v8, v8, v10, v0.t
860 %v = call <4 x i64> @llvm.vp.umax.v4i64(<4 x i64> %va, <4 x i64> %b, <4 x i1> %m, i32 %evl)
864 define <4 x i64> @vmaxu_vv_v4i64_unmasked(<4 x i64> %va, <4 x i64> %b, i32 zeroext %evl) {
865 ; CHECK-LABEL: vmaxu_vv_v4i64_unmasked:
867 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
868 ; CHECK-NEXT: vmaxu.vv v8, v8, v10
870 %head = insertelement <4 x i1> poison, i1 true, i32 0
871 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
872 %v = call <4 x i64> @llvm.vp.umax.v4i64(<4 x i64> %va, <4 x i64> %b, <4 x i1> %m, i32 %evl)
876 define <4 x i64> @vmaxu_vx_v4i64(<4 x i64> %va, i64 %b, <4 x i1> %m, i32 zeroext %evl) {
877 ; RV32-LABEL: vmaxu_vx_v4i64:
879 ; RV32-NEXT: addi sp, sp, -16
880 ; RV32-NEXT: .cfi_def_cfa_offset 16
881 ; RV32-NEXT: sw a1, 12(sp)
882 ; RV32-NEXT: sw a0, 8(sp)
883 ; RV32-NEXT: addi a0, sp, 8
884 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
885 ; RV32-NEXT: vlse64.v v10, (a0), zero
886 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
887 ; RV32-NEXT: vmaxu.vv v8, v8, v10, v0.t
888 ; RV32-NEXT: addi sp, sp, 16
891 ; RV64-LABEL: vmaxu_vx_v4i64:
893 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
894 ; RV64-NEXT: vmaxu.vx v8, v8, a0, v0.t
896 %elt.head = insertelement <4 x i64> poison, i64 %b, i32 0
897 %vb = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
898 %v = call <4 x i64> @llvm.vp.umax.v4i64(<4 x i64> %va, <4 x i64> %vb, <4 x i1> %m, i32 %evl)
902 define <4 x i64> @vmaxu_vx_v4i64_unmasked(<4 x i64> %va, i64 %b, i32 zeroext %evl) {
903 ; RV32-LABEL: vmaxu_vx_v4i64_unmasked:
905 ; RV32-NEXT: addi sp, sp, -16
906 ; RV32-NEXT: .cfi_def_cfa_offset 16
907 ; RV32-NEXT: sw a1, 12(sp)
908 ; RV32-NEXT: sw a0, 8(sp)
909 ; RV32-NEXT: addi a0, sp, 8
910 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
911 ; RV32-NEXT: vlse64.v v10, (a0), zero
912 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
913 ; RV32-NEXT: vmaxu.vv v8, v8, v10
914 ; RV32-NEXT: addi sp, sp, 16
917 ; RV64-LABEL: vmaxu_vx_v4i64_unmasked:
919 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
920 ; RV64-NEXT: vmaxu.vx v8, v8, a0
922 %elt.head = insertelement <4 x i64> poison, i64 %b, i32 0
923 %vb = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
924 %head = insertelement <4 x i1> poison, i1 true, i32 0
925 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
926 %v = call <4 x i64> @llvm.vp.umax.v4i64(<4 x i64> %va, <4 x i64> %vb, <4 x i1> %m, i32 %evl)
930 declare <8 x i64> @llvm.vp.umax.v8i64(<8 x i64>, <8 x i64>, <8 x i1>, i32)
932 define <8 x i64> @vmaxu_vv_v8i64(<8 x i64> %va, <8 x i64> %b, <8 x i1> %m, i32 zeroext %evl) {
933 ; CHECK-LABEL: vmaxu_vv_v8i64:
935 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
936 ; CHECK-NEXT: vmaxu.vv v8, v8, v12, v0.t
938 %v = call <8 x i64> @llvm.vp.umax.v8i64(<8 x i64> %va, <8 x i64> %b, <8 x i1> %m, i32 %evl)
942 define <8 x i64> @vmaxu_vv_v8i64_unmasked(<8 x i64> %va, <8 x i64> %b, i32 zeroext %evl) {
943 ; CHECK-LABEL: vmaxu_vv_v8i64_unmasked:
945 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
946 ; CHECK-NEXT: vmaxu.vv v8, v8, v12
948 %head = insertelement <8 x i1> poison, i1 true, i32 0
949 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
950 %v = call <8 x i64> @llvm.vp.umax.v8i64(<8 x i64> %va, <8 x i64> %b, <8 x i1> %m, i32 %evl)
954 define <8 x i64> @vmaxu_vx_v8i64(<8 x i64> %va, i64 %b, <8 x i1> %m, i32 zeroext %evl) {
955 ; RV32-LABEL: vmaxu_vx_v8i64:
957 ; RV32-NEXT: addi sp, sp, -16
958 ; RV32-NEXT: .cfi_def_cfa_offset 16
959 ; RV32-NEXT: sw a1, 12(sp)
960 ; RV32-NEXT: sw a0, 8(sp)
961 ; RV32-NEXT: addi a0, sp, 8
962 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
963 ; RV32-NEXT: vlse64.v v12, (a0), zero
964 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
965 ; RV32-NEXT: vmaxu.vv v8, v8, v12, v0.t
966 ; RV32-NEXT: addi sp, sp, 16
969 ; RV64-LABEL: vmaxu_vx_v8i64:
971 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
972 ; RV64-NEXT: vmaxu.vx v8, v8, a0, v0.t
974 %elt.head = insertelement <8 x i64> poison, i64 %b, i32 0
975 %vb = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
976 %v = call <8 x i64> @llvm.vp.umax.v8i64(<8 x i64> %va, <8 x i64> %vb, <8 x i1> %m, i32 %evl)
980 define <8 x i64> @vmaxu_vx_v8i64_unmasked(<8 x i64> %va, i64 %b, i32 zeroext %evl) {
981 ; RV32-LABEL: vmaxu_vx_v8i64_unmasked:
983 ; RV32-NEXT: addi sp, sp, -16
984 ; RV32-NEXT: .cfi_def_cfa_offset 16
985 ; RV32-NEXT: sw a1, 12(sp)
986 ; RV32-NEXT: sw a0, 8(sp)
987 ; RV32-NEXT: addi a0, sp, 8
988 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
989 ; RV32-NEXT: vlse64.v v12, (a0), zero
990 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
991 ; RV32-NEXT: vmaxu.vv v8, v8, v12
992 ; RV32-NEXT: addi sp, sp, 16
995 ; RV64-LABEL: vmaxu_vx_v8i64_unmasked:
997 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
998 ; RV64-NEXT: vmaxu.vx v8, v8, a0
1000 %elt.head = insertelement <8 x i64> poison, i64 %b, i32 0
1001 %vb = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
1002 %head = insertelement <8 x i1> poison, i1 true, i32 0
1003 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
1004 %v = call <8 x i64> @llvm.vp.umax.v8i64(<8 x i64> %va, <8 x i64> %vb, <8 x i1> %m, i32 %evl)
1008 declare <16 x i64> @llvm.vp.umax.v16i64(<16 x i64>, <16 x i64>, <16 x i1>, i32)
1010 define <16 x i64> @vmaxu_vv_v16i64(<16 x i64> %va, <16 x i64> %b, <16 x i1> %m, i32 zeroext %evl) {
1011 ; CHECK-LABEL: vmaxu_vv_v16i64:
1013 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1014 ; CHECK-NEXT: vmaxu.vv v8, v8, v16, v0.t
1016 %v = call <16 x i64> @llvm.vp.umax.v16i64(<16 x i64> %va, <16 x i64> %b, <16 x i1> %m, i32 %evl)
1020 define <16 x i64> @vmaxu_vv_v16i64_unmasked(<16 x i64> %va, <16 x i64> %b, i32 zeroext %evl) {
1021 ; CHECK-LABEL: vmaxu_vv_v16i64_unmasked:
1023 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1024 ; CHECK-NEXT: vmaxu.vv v8, v8, v16
1026 %head = insertelement <16 x i1> poison, i1 true, i32 0
1027 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
1028 %v = call <16 x i64> @llvm.vp.umax.v16i64(<16 x i64> %va, <16 x i64> %b, <16 x i1> %m, i32 %evl)
1032 define <16 x i64> @vmaxu_vx_v16i64(<16 x i64> %va, i64 %b, <16 x i1> %m, i32 zeroext %evl) {
1033 ; RV32-LABEL: vmaxu_vx_v16i64:
1035 ; RV32-NEXT: addi sp, sp, -16
1036 ; RV32-NEXT: .cfi_def_cfa_offset 16
1037 ; RV32-NEXT: sw a1, 12(sp)
1038 ; RV32-NEXT: sw a0, 8(sp)
1039 ; RV32-NEXT: addi a0, sp, 8
1040 ; RV32-NEXT: vsetivli zero, 16, e64, m8, ta, ma
1041 ; RV32-NEXT: vlse64.v v16, (a0), zero
1042 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1043 ; RV32-NEXT: vmaxu.vv v8, v8, v16, v0.t
1044 ; RV32-NEXT: addi sp, sp, 16
1047 ; RV64-LABEL: vmaxu_vx_v16i64:
1049 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1050 ; RV64-NEXT: vmaxu.vx v8, v8, a0, v0.t
1052 %elt.head = insertelement <16 x i64> poison, i64 %b, i32 0
1053 %vb = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
1054 %v = call <16 x i64> @llvm.vp.umax.v16i64(<16 x i64> %va, <16 x i64> %vb, <16 x i1> %m, i32 %evl)
1058 define <16 x i64> @vmaxu_vx_v16i64_unmasked(<16 x i64> %va, i64 %b, i32 zeroext %evl) {
1059 ; RV32-LABEL: vmaxu_vx_v16i64_unmasked:
1061 ; RV32-NEXT: addi sp, sp, -16
1062 ; RV32-NEXT: .cfi_def_cfa_offset 16
1063 ; RV32-NEXT: sw a1, 12(sp)
1064 ; RV32-NEXT: sw a0, 8(sp)
1065 ; RV32-NEXT: addi a0, sp, 8
1066 ; RV32-NEXT: vsetivli zero, 16, e64, m8, ta, ma
1067 ; RV32-NEXT: vlse64.v v16, (a0), zero
1068 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1069 ; RV32-NEXT: vmaxu.vv v8, v8, v16
1070 ; RV32-NEXT: addi sp, sp, 16
1073 ; RV64-LABEL: vmaxu_vx_v16i64_unmasked:
1075 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1076 ; RV64-NEXT: vmaxu.vx v8, v8, a0
1078 %elt.head = insertelement <16 x i64> poison, i64 %b, i32 0
1079 %vb = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
1080 %head = insertelement <16 x i1> poison, i1 true, i32 0
1081 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
1082 %v = call <16 x i64> @llvm.vp.umax.v16i64(<16 x i64> %va, <16 x i64> %vb, <16 x i1> %m, i32 %evl)
1086 ; Test that split-legalization works as expected.
1088 declare <32 x i64> @llvm.vp.umax.v32i64(<32 x i64>, <32 x i64>, <32 x i1>, i32)
1090 define <32 x i64> @vmaxu_vx_v32i64(<32 x i64> %va, <32 x i1> %m, i32 zeroext %evl) {
1091 ; RV32-LABEL: vmaxu_vx_v32i64:
1093 ; RV32-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
1094 ; RV32-NEXT: vslidedown.vi v1, v0, 2
1095 ; RV32-NEXT: li a1, 32
1096 ; RV32-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1097 ; RV32-NEXT: li a2, 16
1098 ; RV32-NEXT: vmv.v.i v24, -1
1099 ; RV32-NEXT: mv a1, a0
1100 ; RV32-NEXT: bltu a0, a2, .LBB74_2
1101 ; RV32-NEXT: # %bb.1:
1102 ; RV32-NEXT: li a1, 16
1103 ; RV32-NEXT: .LBB74_2:
1104 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1105 ; RV32-NEXT: vmaxu.vv v8, v8, v24, v0.t
1106 ; RV32-NEXT: addi a1, a0, -16
1107 ; RV32-NEXT: sltu a0, a0, a1
1108 ; RV32-NEXT: addi a0, a0, -1
1109 ; RV32-NEXT: and a0, a0, a1
1110 ; RV32-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1111 ; RV32-NEXT: vmv1r.v v0, v1
1112 ; RV32-NEXT: vmaxu.vv v16, v16, v24, v0.t
1115 ; RV64-LABEL: vmaxu_vx_v32i64:
1117 ; RV64-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
1118 ; RV64-NEXT: li a2, 16
1119 ; RV64-NEXT: vslidedown.vi v24, v0, 2
1120 ; RV64-NEXT: mv a1, a0
1121 ; RV64-NEXT: bltu a0, a2, .LBB74_2
1122 ; RV64-NEXT: # %bb.1:
1123 ; RV64-NEXT: li a1, 16
1124 ; RV64-NEXT: .LBB74_2:
1125 ; RV64-NEXT: li a2, -1
1126 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1127 ; RV64-NEXT: vmaxu.vx v8, v8, a2, v0.t
1128 ; RV64-NEXT: addi a1, a0, -16
1129 ; RV64-NEXT: sltu a0, a0, a1
1130 ; RV64-NEXT: addi a0, a0, -1
1131 ; RV64-NEXT: and a0, a0, a1
1132 ; RV64-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1133 ; RV64-NEXT: vmv1r.v v0, v24
1134 ; RV64-NEXT: vmaxu.vx v16, v16, a2, v0.t
1136 %elt.head = insertelement <32 x i64> poison, i64 -1, i32 0
1137 %vb = shufflevector <32 x i64> %elt.head, <32 x i64> poison, <32 x i32> zeroinitializer
1138 %v = call <32 x i64> @llvm.vp.umax.v32i64(<32 x i64> %va, <32 x i64> %vb, <32 x i1> %m, i32 %evl)