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.umin.v8i7(<8 x i7>, <8 x i7>, <8 x i1>, i32)
9 define <8 x i7> @vminu_vv_v8i7(<8 x i7> %va, <8 x i7> %b, <8 x i1> %m, i32 zeroext %evl) {
10 ; CHECK-LABEL: vminu_vv_v8i7:
12 ; CHECK-NEXT: li a1, 127
13 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
14 ; CHECK-NEXT: vand.vx v9, v9, a1, v0.t
15 ; CHECK-NEXT: vand.vx v8, v8, a1, v0.t
16 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
18 %v = call <8 x i7> @llvm.vp.umin.v8i7(<8 x i7> %va, <8 x i7> %b, <8 x i1> %m, i32 %evl)
22 declare <2 x i8> @llvm.vp.umin.v2i8(<2 x i8>, <2 x i8>, <2 x i1>, i32)
24 define <2 x i8> @vminu_vv_v2i8(<2 x i8> %va, <2 x i8> %b, <2 x i1> %m, i32 zeroext %evl) {
25 ; CHECK-LABEL: vminu_vv_v2i8:
27 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
28 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
30 %v = call <2 x i8> @llvm.vp.umin.v2i8(<2 x i8> %va, <2 x i8> %b, <2 x i1> %m, i32 %evl)
34 define <2 x i8> @vminu_vv_v2i8_unmasked(<2 x i8> %va, <2 x i8> %b, i32 zeroext %evl) {
35 ; CHECK-LABEL: vminu_vv_v2i8_unmasked:
37 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
38 ; CHECK-NEXT: vminu.vv v8, v8, v9
40 %v = call <2 x i8> @llvm.vp.umin.v2i8(<2 x i8> %va, <2 x i8> %b, <2 x i1> splat (i1 true), i32 %evl)
44 define <2 x i8> @vminu_vx_v2i8(<2 x i8> %va, i8 %b, <2 x i1> %m, i32 zeroext %evl) {
45 ; CHECK-LABEL: vminu_vx_v2i8:
47 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
48 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
50 %elt.head = insertelement <2 x i8> poison, i8 %b, i32 0
51 %vb = shufflevector <2 x i8> %elt.head, <2 x i8> poison, <2 x i32> zeroinitializer
52 %v = call <2 x i8> @llvm.vp.umin.v2i8(<2 x i8> %va, <2 x i8> %vb, <2 x i1> %m, i32 %evl)
56 define <2 x i8> @vminu_vx_v2i8_unmasked(<2 x i8> %va, i8 %b, i32 zeroext %evl) {
57 ; CHECK-LABEL: vminu_vx_v2i8_unmasked:
59 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
60 ; CHECK-NEXT: vminu.vx v8, v8, a0
62 %elt.head = insertelement <2 x i8> poison, i8 %b, i32 0
63 %vb = shufflevector <2 x i8> %elt.head, <2 x i8> poison, <2 x i32> zeroinitializer
64 %v = call <2 x i8> @llvm.vp.umin.v2i8(<2 x i8> %va, <2 x i8> %vb, <2 x i1> splat (i1 true), i32 %evl)
68 declare <4 x i8> @llvm.vp.umin.v4i8(<4 x i8>, <4 x i8>, <4 x i1>, i32)
70 define <4 x i8> @vminu_vv_v4i8(<4 x i8> %va, <4 x i8> %b, <4 x i1> %m, i32 zeroext %evl) {
71 ; CHECK-LABEL: vminu_vv_v4i8:
73 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
74 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
76 %v = call <4 x i8> @llvm.vp.umin.v4i8(<4 x i8> %va, <4 x i8> %b, <4 x i1> %m, i32 %evl)
80 define <4 x i8> @vminu_vv_v4i8_unmasked(<4 x i8> %va, <4 x i8> %b, i32 zeroext %evl) {
81 ; CHECK-LABEL: vminu_vv_v4i8_unmasked:
83 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
84 ; CHECK-NEXT: vminu.vv v8, v8, v9
86 %v = call <4 x i8> @llvm.vp.umin.v4i8(<4 x i8> %va, <4 x i8> %b, <4 x i1> splat (i1 true), i32 %evl)
90 define <4 x i8> @vminu_vx_v4i8(<4 x i8> %va, i8 %b, <4 x i1> %m, i32 zeroext %evl) {
91 ; CHECK-LABEL: vminu_vx_v4i8:
93 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
94 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
96 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
97 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
98 %v = call <4 x i8> @llvm.vp.umin.v4i8(<4 x i8> %va, <4 x i8> %vb, <4 x i1> %m, i32 %evl)
102 define <4 x i8> @vminu_vx_v4i8_commute(<4 x i8> %va, i8 %b, <4 x i1> %m, i32 zeroext %evl) {
103 ; CHECK-LABEL: vminu_vx_v4i8_commute:
105 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
106 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
108 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
109 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
110 %v = call <4 x i8> @llvm.vp.umin.v4i8(<4 x i8> %vb, <4 x i8> %va, <4 x i1> %m, i32 %evl)
114 define <4 x i8> @vminu_vx_v4i8_unmasked(<4 x i8> %va, i8 %b, i32 zeroext %evl) {
115 ; CHECK-LABEL: vminu_vx_v4i8_unmasked:
117 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
118 ; CHECK-NEXT: vminu.vx v8, v8, a0
120 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
121 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
122 %v = call <4 x i8> @llvm.vp.umin.v4i8(<4 x i8> %va, <4 x i8> %vb, <4 x i1> splat (i1 true), i32 %evl)
126 declare <5 x i8> @llvm.vp.umin.v5i8(<5 x i8>, <5 x i8>, <5 x i1>, i32)
128 define <5 x i8> @vminu_vv_v5i8(<5 x i8> %va, <5 x i8> %b, <5 x i1> %m, i32 zeroext %evl) {
129 ; CHECK-LABEL: vminu_vv_v5i8:
131 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
132 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
134 %v = call <5 x i8> @llvm.vp.umin.v5i8(<5 x i8> %va, <5 x i8> %b, <5 x i1> %m, i32 %evl)
138 define <5 x i8> @vminu_vv_v5i8_unmasked(<5 x i8> %va, <5 x i8> %b, i32 zeroext %evl) {
139 ; CHECK-LABEL: vminu_vv_v5i8_unmasked:
141 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
142 ; CHECK-NEXT: vminu.vv v8, v8, v9
144 %v = call <5 x i8> @llvm.vp.umin.v5i8(<5 x i8> %va, <5 x i8> %b, <5 x i1> splat (i1 true), i32 %evl)
148 define <5 x i8> @vminu_vx_v5i8(<5 x i8> %va, i8 %b, <5 x i1> %m, i32 zeroext %evl) {
149 ; CHECK-LABEL: vminu_vx_v5i8:
151 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
152 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
154 %elt.head = insertelement <5 x i8> poison, i8 %b, i32 0
155 %vb = shufflevector <5 x i8> %elt.head, <5 x i8> poison, <5 x i32> zeroinitializer
156 %v = call <5 x i8> @llvm.vp.umin.v5i8(<5 x i8> %va, <5 x i8> %vb, <5 x i1> %m, i32 %evl)
160 define <5 x i8> @vminu_vx_v5i8_unmasked(<5 x i8> %va, i8 %b, i32 zeroext %evl) {
161 ; CHECK-LABEL: vminu_vx_v5i8_unmasked:
163 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
164 ; CHECK-NEXT: vminu.vx v8, v8, a0
166 %elt.head = insertelement <5 x i8> poison, i8 %b, i32 0
167 %vb = shufflevector <5 x i8> %elt.head, <5 x i8> poison, <5 x i32> zeroinitializer
168 %v = call <5 x i8> @llvm.vp.umin.v5i8(<5 x i8> %va, <5 x i8> %vb, <5 x i1> splat (i1 true), i32 %evl)
172 declare <8 x i8> @llvm.vp.umin.v8i8(<8 x i8>, <8 x i8>, <8 x i1>, i32)
174 define <8 x i8> @vminu_vv_v8i8(<8 x i8> %va, <8 x i8> %b, <8 x i1> %m, i32 zeroext %evl) {
175 ; CHECK-LABEL: vminu_vv_v8i8:
177 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
178 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
180 %v = call <8 x i8> @llvm.vp.umin.v8i8(<8 x i8> %va, <8 x i8> %b, <8 x i1> %m, i32 %evl)
184 define <8 x i8> @vminu_vv_v8i8_unmasked(<8 x i8> %va, <8 x i8> %b, i32 zeroext %evl) {
185 ; CHECK-LABEL: vminu_vv_v8i8_unmasked:
187 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
188 ; CHECK-NEXT: vminu.vv v8, v8, v9
190 %v = call <8 x i8> @llvm.vp.umin.v8i8(<8 x i8> %va, <8 x i8> %b, <8 x i1> splat (i1 true), i32 %evl)
194 define <8 x i8> @vminu_vx_v8i8(<8 x i8> %va, i8 %b, <8 x i1> %m, i32 zeroext %evl) {
195 ; CHECK-LABEL: vminu_vx_v8i8:
197 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
198 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
200 %elt.head = insertelement <8 x i8> poison, i8 %b, i32 0
201 %vb = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
202 %v = call <8 x i8> @llvm.vp.umin.v8i8(<8 x i8> %va, <8 x i8> %vb, <8 x i1> %m, i32 %evl)
206 define <8 x i8> @vminu_vx_v8i8_unmasked(<8 x i8> %va, i8 %b, i32 zeroext %evl) {
207 ; CHECK-LABEL: vminu_vx_v8i8_unmasked:
209 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
210 ; CHECK-NEXT: vminu.vx v8, v8, a0
212 %elt.head = insertelement <8 x i8> poison, i8 %b, i32 0
213 %vb = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
214 %v = call <8 x i8> @llvm.vp.umin.v8i8(<8 x i8> %va, <8 x i8> %vb, <8 x i1> splat (i1 true), i32 %evl)
218 declare <16 x i8> @llvm.vp.umin.v16i8(<16 x i8>, <16 x i8>, <16 x i1>, i32)
220 define <16 x i8> @vminu_vv_v16i8(<16 x i8> %va, <16 x i8> %b, <16 x i1> %m, i32 zeroext %evl) {
221 ; CHECK-LABEL: vminu_vv_v16i8:
223 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
224 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
226 %v = call <16 x i8> @llvm.vp.umin.v16i8(<16 x i8> %va, <16 x i8> %b, <16 x i1> %m, i32 %evl)
230 define <16 x i8> @vminu_vv_v16i8_unmasked(<16 x i8> %va, <16 x i8> %b, i32 zeroext %evl) {
231 ; CHECK-LABEL: vminu_vv_v16i8_unmasked:
233 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
234 ; CHECK-NEXT: vminu.vv v8, v8, v9
236 %v = call <16 x i8> @llvm.vp.umin.v16i8(<16 x i8> %va, <16 x i8> %b, <16 x i1> splat (i1 true), i32 %evl)
240 define <16 x i8> @vminu_vx_v16i8(<16 x i8> %va, i8 %b, <16 x i1> %m, i32 zeroext %evl) {
241 ; CHECK-LABEL: vminu_vx_v16i8:
243 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
244 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
246 %elt.head = insertelement <16 x i8> poison, i8 %b, i32 0
247 %vb = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
248 %v = call <16 x i8> @llvm.vp.umin.v16i8(<16 x i8> %va, <16 x i8> %vb, <16 x i1> %m, i32 %evl)
252 define <16 x i8> @vminu_vx_v16i8_unmasked(<16 x i8> %va, i8 %b, i32 zeroext %evl) {
253 ; CHECK-LABEL: vminu_vx_v16i8_unmasked:
255 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
256 ; CHECK-NEXT: vminu.vx v8, v8, a0
258 %elt.head = insertelement <16 x i8> poison, i8 %b, i32 0
259 %vb = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
260 %v = call <16 x i8> @llvm.vp.umin.v16i8(<16 x i8> %va, <16 x i8> %vb, <16 x i1> splat (i1 true), i32 %evl)
264 declare <256 x i8> @llvm.vp.umin.v258i8(<256 x i8>, <256 x i8>, <256 x i1>, i32)
266 define <256 x i8> @vminu_vx_v258i8(<256 x i8> %va, i8 %b, <256 x i1> %m, i32 zeroext %evl) {
267 ; CHECK-LABEL: vminu_vx_v258i8:
269 ; CHECK-NEXT: vmv1r.v v24, v0
270 ; CHECK-NEXT: li a3, 128
271 ; CHECK-NEXT: vsetvli zero, a3, e8, m8, ta, ma
272 ; CHECK-NEXT: vlm.v v0, (a1)
273 ; CHECK-NEXT: addi a1, a2, -128
274 ; CHECK-NEXT: sltu a4, a2, a1
275 ; CHECK-NEXT: addi a4, a4, -1
276 ; CHECK-NEXT: and a1, a4, a1
277 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
278 ; CHECK-NEXT: vminu.vx v16, v16, a0, v0.t
279 ; CHECK-NEXT: bltu a2, a3, .LBB22_2
280 ; CHECK-NEXT: # %bb.1:
281 ; CHECK-NEXT: li a2, 128
282 ; CHECK-NEXT: .LBB22_2:
283 ; CHECK-NEXT: vmv1r.v v0, v24
284 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
285 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
287 %elt.head = insertelement <256 x i8> poison, i8 %b, i32 0
288 %vb = shufflevector <256 x i8> %elt.head, <256 x i8> poison, <256 x i32> zeroinitializer
289 %v = call <256 x i8> @llvm.vp.umin.v258i8(<256 x i8> %va, <256 x i8> %vb, <256 x i1> %m, i32 %evl)
293 define <256 x i8> @vminu_vx_v258i8_unmasked(<256 x i8> %va, i8 %b, i32 zeroext %evl) {
294 ; CHECK-LABEL: vminu_vx_v258i8_unmasked:
296 ; CHECK-NEXT: li a3, 128
297 ; CHECK-NEXT: mv a2, a1
298 ; CHECK-NEXT: bltu a1, a3, .LBB23_2
299 ; CHECK-NEXT: # %bb.1:
300 ; CHECK-NEXT: li a2, 128
301 ; CHECK-NEXT: .LBB23_2:
302 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
303 ; CHECK-NEXT: vminu.vx v8, v8, a0
304 ; CHECK-NEXT: addi a2, a1, -128
305 ; CHECK-NEXT: sltu a1, a1, a2
306 ; CHECK-NEXT: addi a1, a1, -1
307 ; CHECK-NEXT: and a1, a1, a2
308 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
309 ; CHECK-NEXT: vminu.vx v16, v16, a0
311 %elt.head = insertelement <256 x i8> poison, i8 %b, i32 0
312 %vb = shufflevector <256 x i8> %elt.head, <256 x i8> poison, <256 x i32> zeroinitializer
313 %v = call <256 x i8> @llvm.vp.umin.v258i8(<256 x i8> %va, <256 x i8> %vb, <256 x i1> splat (i1 true), i32 %evl)
317 ; Test splitting when the %evl is a known constant.
319 define <256 x i8> @vminu_vx_v258i8_evl129(<256 x i8> %va, i8 %b, <256 x i1> %m) {
320 ; CHECK-LABEL: vminu_vx_v258i8_evl129:
322 ; CHECK-NEXT: li a2, 128
323 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
324 ; CHECK-NEXT: vlm.v v24, (a1)
325 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
326 ; CHECK-NEXT: vmv1r.v v0, v24
327 ; CHECK-NEXT: vsetivli zero, 1, e8, m8, ta, ma
328 ; CHECK-NEXT: vminu.vx v16, v16, a0, v0.t
330 %elt.head = insertelement <256 x i8> poison, i8 %b, i32 0
331 %vb = shufflevector <256 x i8> %elt.head, <256 x i8> poison, <256 x i32> zeroinitializer
332 %v = call <256 x i8> @llvm.vp.umin.v258i8(<256 x i8> %va, <256 x i8> %vb, <256 x i1> %m, i32 129)
336 ; The upper half is doing nothing.
338 define <256 x i8> @vminu_vx_v258i8_evl128(<256 x i8> %va, i8 %b, <256 x i1> %m) {
339 ; CHECK-LABEL: vminu_vx_v258i8_evl128:
341 ; CHECK-NEXT: li a1, 128
342 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
343 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
345 %elt.head = insertelement <256 x i8> poison, i8 %b, i32 0
346 %vb = shufflevector <256 x i8> %elt.head, <256 x i8> poison, <256 x i32> zeroinitializer
347 %v = call <256 x i8> @llvm.vp.umin.v258i8(<256 x i8> %va, <256 x i8> %vb, <256 x i1> %m, i32 128)
351 declare <2 x i16> @llvm.vp.umin.v2i16(<2 x i16>, <2 x i16>, <2 x i1>, i32)
353 define <2 x i16> @vminu_vv_v2i16(<2 x i16> %va, <2 x i16> %b, <2 x i1> %m, i32 zeroext %evl) {
354 ; CHECK-LABEL: vminu_vv_v2i16:
356 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
357 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
359 %v = call <2 x i16> @llvm.vp.umin.v2i16(<2 x i16> %va, <2 x i16> %b, <2 x i1> %m, i32 %evl)
363 define <2 x i16> @vminu_vv_v2i16_unmasked(<2 x i16> %va, <2 x i16> %b, i32 zeroext %evl) {
364 ; CHECK-LABEL: vminu_vv_v2i16_unmasked:
366 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
367 ; CHECK-NEXT: vminu.vv v8, v8, v9
369 %v = call <2 x i16> @llvm.vp.umin.v2i16(<2 x i16> %va, <2 x i16> %b, <2 x i1> splat (i1 true), i32 %evl)
373 define <2 x i16> @vminu_vx_v2i16(<2 x i16> %va, i16 %b, <2 x i1> %m, i32 zeroext %evl) {
374 ; CHECK-LABEL: vminu_vx_v2i16:
376 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
377 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
379 %elt.head = insertelement <2 x i16> poison, i16 %b, i32 0
380 %vb = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
381 %v = call <2 x i16> @llvm.vp.umin.v2i16(<2 x i16> %va, <2 x i16> %vb, <2 x i1> %m, i32 %evl)
385 define <2 x i16> @vminu_vx_v2i16_unmasked(<2 x i16> %va, i16 %b, i32 zeroext %evl) {
386 ; CHECK-LABEL: vminu_vx_v2i16_unmasked:
388 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
389 ; CHECK-NEXT: vminu.vx v8, v8, a0
391 %elt.head = insertelement <2 x i16> poison, i16 %b, i32 0
392 %vb = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
393 %v = call <2 x i16> @llvm.vp.umin.v2i16(<2 x i16> %va, <2 x i16> %vb, <2 x i1> splat (i1 true), i32 %evl)
397 declare <4 x i16> @llvm.vp.umin.v4i16(<4 x i16>, <4 x i16>, <4 x i1>, i32)
399 define <4 x i16> @vminu_vv_v4i16(<4 x i16> %va, <4 x i16> %b, <4 x i1> %m, i32 zeroext %evl) {
400 ; CHECK-LABEL: vminu_vv_v4i16:
402 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
403 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
405 %v = call <4 x i16> @llvm.vp.umin.v4i16(<4 x i16> %va, <4 x i16> %b, <4 x i1> %m, i32 %evl)
409 define <4 x i16> @vminu_vv_v4i16_unmasked(<4 x i16> %va, <4 x i16> %b, i32 zeroext %evl) {
410 ; CHECK-LABEL: vminu_vv_v4i16_unmasked:
412 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
413 ; CHECK-NEXT: vminu.vv v8, v8, v9
415 %v = call <4 x i16> @llvm.vp.umin.v4i16(<4 x i16> %va, <4 x i16> %b, <4 x i1> splat (i1 true), i32 %evl)
419 define <4 x i16> @vminu_vx_v4i16(<4 x i16> %va, i16 %b, <4 x i1> %m, i32 zeroext %evl) {
420 ; CHECK-LABEL: vminu_vx_v4i16:
422 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
423 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
425 %elt.head = insertelement <4 x i16> poison, i16 %b, i32 0
426 %vb = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
427 %v = call <4 x i16> @llvm.vp.umin.v4i16(<4 x i16> %va, <4 x i16> %vb, <4 x i1> %m, i32 %evl)
431 define <4 x i16> @vminu_vx_v4i16_unmasked(<4 x i16> %va, i16 %b, i32 zeroext %evl) {
432 ; CHECK-LABEL: vminu_vx_v4i16_unmasked:
434 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
435 ; CHECK-NEXT: vminu.vx v8, v8, a0
437 %elt.head = insertelement <4 x i16> poison, i16 %b, i32 0
438 %vb = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
439 %v = call <4 x i16> @llvm.vp.umin.v4i16(<4 x i16> %va, <4 x i16> %vb, <4 x i1> splat (i1 true), i32 %evl)
443 declare <8 x i16> @llvm.vp.umin.v8i16(<8 x i16>, <8 x i16>, <8 x i1>, i32)
445 define <8 x i16> @vminu_vv_v8i16(<8 x i16> %va, <8 x i16> %b, <8 x i1> %m, i32 zeroext %evl) {
446 ; CHECK-LABEL: vminu_vv_v8i16:
448 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
449 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
451 %v = call <8 x i16> @llvm.vp.umin.v8i16(<8 x i16> %va, <8 x i16> %b, <8 x i1> %m, i32 %evl)
455 define <8 x i16> @vminu_vv_v8i16_unmasked(<8 x i16> %va, <8 x i16> %b, i32 zeroext %evl) {
456 ; CHECK-LABEL: vminu_vv_v8i16_unmasked:
458 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
459 ; CHECK-NEXT: vminu.vv v8, v8, v9
461 %v = call <8 x i16> @llvm.vp.umin.v8i16(<8 x i16> %va, <8 x i16> %b, <8 x i1> splat (i1 true), i32 %evl)
465 define <8 x i16> @vminu_vx_v8i16(<8 x i16> %va, i16 %b, <8 x i1> %m, i32 zeroext %evl) {
466 ; CHECK-LABEL: vminu_vx_v8i16:
468 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
469 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
471 %elt.head = insertelement <8 x i16> poison, i16 %b, i32 0
472 %vb = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
473 %v = call <8 x i16> @llvm.vp.umin.v8i16(<8 x i16> %va, <8 x i16> %vb, <8 x i1> %m, i32 %evl)
477 define <8 x i16> @vminu_vx_v8i16_unmasked(<8 x i16> %va, i16 %b, i32 zeroext %evl) {
478 ; CHECK-LABEL: vminu_vx_v8i16_unmasked:
480 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
481 ; CHECK-NEXT: vminu.vx v8, v8, a0
483 %elt.head = insertelement <8 x i16> poison, i16 %b, i32 0
484 %vb = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
485 %v = call <8 x i16> @llvm.vp.umin.v8i16(<8 x i16> %va, <8 x i16> %vb, <8 x i1> splat (i1 true), i32 %evl)
489 declare <16 x i16> @llvm.vp.umin.v16i16(<16 x i16>, <16 x i16>, <16 x i1>, i32)
491 define <16 x i16> @vminu_vv_v16i16(<16 x i16> %va, <16 x i16> %b, <16 x i1> %m, i32 zeroext %evl) {
492 ; CHECK-LABEL: vminu_vv_v16i16:
494 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
495 ; CHECK-NEXT: vminu.vv v8, v8, v10, v0.t
497 %v = call <16 x i16> @llvm.vp.umin.v16i16(<16 x i16> %va, <16 x i16> %b, <16 x i1> %m, i32 %evl)
501 define <16 x i16> @vminu_vv_v16i16_unmasked(<16 x i16> %va, <16 x i16> %b, i32 zeroext %evl) {
502 ; CHECK-LABEL: vminu_vv_v16i16_unmasked:
504 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
505 ; CHECK-NEXT: vminu.vv v8, v8, v10
507 %v = call <16 x i16> @llvm.vp.umin.v16i16(<16 x i16> %va, <16 x i16> %b, <16 x i1> splat (i1 true), i32 %evl)
511 define <16 x i16> @vminu_vx_v16i16(<16 x i16> %va, i16 %b, <16 x i1> %m, i32 zeroext %evl) {
512 ; CHECK-LABEL: vminu_vx_v16i16:
514 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
515 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
517 %elt.head = insertelement <16 x i16> poison, i16 %b, i32 0
518 %vb = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
519 %v = call <16 x i16> @llvm.vp.umin.v16i16(<16 x i16> %va, <16 x i16> %vb, <16 x i1> %m, i32 %evl)
523 define <16 x i16> @vminu_vx_v16i16_unmasked(<16 x i16> %va, i16 %b, i32 zeroext %evl) {
524 ; CHECK-LABEL: vminu_vx_v16i16_unmasked:
526 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
527 ; CHECK-NEXT: vminu.vx v8, v8, a0
529 %elt.head = insertelement <16 x i16> poison, i16 %b, i32 0
530 %vb = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
531 %v = call <16 x i16> @llvm.vp.umin.v16i16(<16 x i16> %va, <16 x i16> %vb, <16 x i1> splat (i1 true), i32 %evl)
535 declare <2 x i32> @llvm.vp.umin.v2i32(<2 x i32>, <2 x i32>, <2 x i1>, i32)
537 define <2 x i32> @vminu_vv_v2i32(<2 x i32> %va, <2 x i32> %b, <2 x i1> %m, i32 zeroext %evl) {
538 ; CHECK-LABEL: vminu_vv_v2i32:
540 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
541 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
543 %v = call <2 x i32> @llvm.vp.umin.v2i32(<2 x i32> %va, <2 x i32> %b, <2 x i1> %m, i32 %evl)
547 define <2 x i32> @vminu_vv_v2i32_unmasked(<2 x i32> %va, <2 x i32> %b, i32 zeroext %evl) {
548 ; CHECK-LABEL: vminu_vv_v2i32_unmasked:
550 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
551 ; CHECK-NEXT: vminu.vv v8, v8, v9
553 %v = call <2 x i32> @llvm.vp.umin.v2i32(<2 x i32> %va, <2 x i32> %b, <2 x i1> splat (i1 true), i32 %evl)
557 define <2 x i32> @vminu_vx_v2i32(<2 x i32> %va, i32 %b, <2 x i1> %m, i32 zeroext %evl) {
558 ; CHECK-LABEL: vminu_vx_v2i32:
560 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
561 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
563 %elt.head = insertelement <2 x i32> poison, i32 %b, i32 0
564 %vb = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
565 %v = call <2 x i32> @llvm.vp.umin.v2i32(<2 x i32> %va, <2 x i32> %vb, <2 x i1> %m, i32 %evl)
569 define <2 x i32> @vminu_vx_v2i32_unmasked(<2 x i32> %va, i32 %b, i32 zeroext %evl) {
570 ; CHECK-LABEL: vminu_vx_v2i32_unmasked:
572 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
573 ; CHECK-NEXT: vminu.vx v8, v8, a0
575 %elt.head = insertelement <2 x i32> poison, i32 %b, i32 0
576 %vb = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
577 %v = call <2 x i32> @llvm.vp.umin.v2i32(<2 x i32> %va, <2 x i32> %vb, <2 x i1> splat (i1 true), i32 %evl)
581 declare <4 x i32> @llvm.vp.umin.v4i32(<4 x i32>, <4 x i32>, <4 x i1>, i32)
583 define <4 x i32> @vminu_vv_v4i32(<4 x i32> %va, <4 x i32> %b, <4 x i1> %m, i32 zeroext %evl) {
584 ; CHECK-LABEL: vminu_vv_v4i32:
586 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
587 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
589 %v = call <4 x i32> @llvm.vp.umin.v4i32(<4 x i32> %va, <4 x i32> %b, <4 x i1> %m, i32 %evl)
593 define <4 x i32> @vminu_vv_v4i32_unmasked(<4 x i32> %va, <4 x i32> %b, i32 zeroext %evl) {
594 ; CHECK-LABEL: vminu_vv_v4i32_unmasked:
596 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
597 ; CHECK-NEXT: vminu.vv v8, v8, v9
599 %v = call <4 x i32> @llvm.vp.umin.v4i32(<4 x i32> %va, <4 x i32> %b, <4 x i1> splat (i1 true), i32 %evl)
603 define <4 x i32> @vminu_vx_v4i32(<4 x i32> %va, i32 %b, <4 x i1> %m, i32 zeroext %evl) {
604 ; CHECK-LABEL: vminu_vx_v4i32:
606 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
607 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
609 %elt.head = insertelement <4 x i32> poison, i32 %b, i32 0
610 %vb = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
611 %v = call <4 x i32> @llvm.vp.umin.v4i32(<4 x i32> %va, <4 x i32> %vb, <4 x i1> %m, i32 %evl)
615 define <4 x i32> @vminu_vx_v4i32_unmasked(<4 x i32> %va, i32 %b, i32 zeroext %evl) {
616 ; CHECK-LABEL: vminu_vx_v4i32_unmasked:
618 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
619 ; CHECK-NEXT: vminu.vx v8, v8, a0
621 %elt.head = insertelement <4 x i32> poison, i32 %b, i32 0
622 %vb = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
623 %v = call <4 x i32> @llvm.vp.umin.v4i32(<4 x i32> %va, <4 x i32> %vb, <4 x i1> splat (i1 true), i32 %evl)
627 declare <8 x i32> @llvm.vp.umin.v8i32(<8 x i32>, <8 x i32>, <8 x i1>, i32)
629 define <8 x i32> @vminu_vv_v8i32(<8 x i32> %va, <8 x i32> %b, <8 x i1> %m, i32 zeroext %evl) {
630 ; CHECK-LABEL: vminu_vv_v8i32:
632 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
633 ; CHECK-NEXT: vminu.vv v8, v8, v10, v0.t
635 %v = call <8 x i32> @llvm.vp.umin.v8i32(<8 x i32> %va, <8 x i32> %b, <8 x i1> %m, i32 %evl)
639 define <8 x i32> @vminu_vv_v8i32_unmasked(<8 x i32> %va, <8 x i32> %b, i32 zeroext %evl) {
640 ; CHECK-LABEL: vminu_vv_v8i32_unmasked:
642 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
643 ; CHECK-NEXT: vminu.vv v8, v8, v10
645 %v = call <8 x i32> @llvm.vp.umin.v8i32(<8 x i32> %va, <8 x i32> %b, <8 x i1> splat (i1 true), i32 %evl)
649 define <8 x i32> @vminu_vx_v8i32(<8 x i32> %va, i32 %b, <8 x i1> %m, i32 zeroext %evl) {
650 ; CHECK-LABEL: vminu_vx_v8i32:
652 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
653 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
655 %elt.head = insertelement <8 x i32> poison, i32 %b, i32 0
656 %vb = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
657 %v = call <8 x i32> @llvm.vp.umin.v8i32(<8 x i32> %va, <8 x i32> %vb, <8 x i1> %m, i32 %evl)
661 define <8 x i32> @vminu_vx_v8i32_unmasked(<8 x i32> %va, i32 %b, i32 zeroext %evl) {
662 ; CHECK-LABEL: vminu_vx_v8i32_unmasked:
664 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
665 ; CHECK-NEXT: vminu.vx v8, v8, a0
667 %elt.head = insertelement <8 x i32> poison, i32 %b, i32 0
668 %vb = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
669 %v = call <8 x i32> @llvm.vp.umin.v8i32(<8 x i32> %va, <8 x i32> %vb, <8 x i1> splat (i1 true), i32 %evl)
673 declare <16 x i32> @llvm.vp.umin.v16i32(<16 x i32>, <16 x i32>, <16 x i1>, i32)
675 define <16 x i32> @vminu_vv_v16i32(<16 x i32> %va, <16 x i32> %b, <16 x i1> %m, i32 zeroext %evl) {
676 ; CHECK-LABEL: vminu_vv_v16i32:
678 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
679 ; CHECK-NEXT: vminu.vv v8, v8, v12, v0.t
681 %v = call <16 x i32> @llvm.vp.umin.v16i32(<16 x i32> %va, <16 x i32> %b, <16 x i1> %m, i32 %evl)
685 define <16 x i32> @vminu_vv_v16i32_unmasked(<16 x i32> %va, <16 x i32> %b, i32 zeroext %evl) {
686 ; CHECK-LABEL: vminu_vv_v16i32_unmasked:
688 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
689 ; CHECK-NEXT: vminu.vv v8, v8, v12
691 %v = call <16 x i32> @llvm.vp.umin.v16i32(<16 x i32> %va, <16 x i32> %b, <16 x i1> splat (i1 true), i32 %evl)
695 define <16 x i32> @vminu_vx_v16i32(<16 x i32> %va, i32 %b, <16 x i1> %m, i32 zeroext %evl) {
696 ; CHECK-LABEL: vminu_vx_v16i32:
698 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
699 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
701 %elt.head = insertelement <16 x i32> poison, i32 %b, i32 0
702 %vb = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
703 %v = call <16 x i32> @llvm.vp.umin.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i1> %m, i32 %evl)
707 define <16 x i32> @vminu_vx_v16i32_unmasked(<16 x i32> %va, i32 %b, i32 zeroext %evl) {
708 ; CHECK-LABEL: vminu_vx_v16i32_unmasked:
710 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
711 ; CHECK-NEXT: vminu.vx v8, v8, a0
713 %elt.head = insertelement <16 x i32> poison, i32 %b, i32 0
714 %vb = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
715 %v = call <16 x i32> @llvm.vp.umin.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i1> splat (i1 true), i32 %evl)
719 declare <2 x i64> @llvm.vp.umin.v2i64(<2 x i64>, <2 x i64>, <2 x i1>, i32)
721 define <2 x i64> @vminu_vv_v2i64(<2 x i64> %va, <2 x i64> %b, <2 x i1> %m, i32 zeroext %evl) {
722 ; CHECK-LABEL: vminu_vv_v2i64:
724 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
725 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
727 %v = call <2 x i64> @llvm.vp.umin.v2i64(<2 x i64> %va, <2 x i64> %b, <2 x i1> %m, i32 %evl)
731 define <2 x i64> @vminu_vv_v2i64_unmasked(<2 x i64> %va, <2 x i64> %b, i32 zeroext %evl) {
732 ; CHECK-LABEL: vminu_vv_v2i64_unmasked:
734 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
735 ; CHECK-NEXT: vminu.vv v8, v8, v9
737 %v = call <2 x i64> @llvm.vp.umin.v2i64(<2 x i64> %va, <2 x i64> %b, <2 x i1> splat (i1 true), i32 %evl)
741 define <2 x i64> @vminu_vx_v2i64(<2 x i64> %va, i64 %b, <2 x i1> %m, i32 zeroext %evl) {
742 ; RV32-LABEL: vminu_vx_v2i64:
744 ; RV32-NEXT: addi sp, sp, -16
745 ; RV32-NEXT: .cfi_def_cfa_offset 16
746 ; RV32-NEXT: sw a1, 12(sp)
747 ; RV32-NEXT: sw a0, 8(sp)
748 ; RV32-NEXT: addi a0, sp, 8
749 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
750 ; RV32-NEXT: vlse64.v v9, (a0), zero
751 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
752 ; RV32-NEXT: vminu.vv v8, v8, v9, v0.t
753 ; RV32-NEXT: addi sp, sp, 16
756 ; RV64-LABEL: vminu_vx_v2i64:
758 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
759 ; RV64-NEXT: vminu.vx v8, v8, a0, v0.t
761 %elt.head = insertelement <2 x i64> poison, i64 %b, i32 0
762 %vb = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
763 %v = call <2 x i64> @llvm.vp.umin.v2i64(<2 x i64> %va, <2 x i64> %vb, <2 x i1> %m, i32 %evl)
767 define <2 x i64> @vminu_vx_v2i64_unmasked(<2 x i64> %va, i64 %b, i32 zeroext %evl) {
768 ; RV32-LABEL: vminu_vx_v2i64_unmasked:
770 ; RV32-NEXT: addi sp, sp, -16
771 ; RV32-NEXT: .cfi_def_cfa_offset 16
772 ; RV32-NEXT: sw a1, 12(sp)
773 ; RV32-NEXT: sw a0, 8(sp)
774 ; RV32-NEXT: addi a0, sp, 8
775 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
776 ; RV32-NEXT: vlse64.v v9, (a0), zero
777 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
778 ; RV32-NEXT: vminu.vv v8, v8, v9
779 ; RV32-NEXT: addi sp, sp, 16
782 ; RV64-LABEL: vminu_vx_v2i64_unmasked:
784 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
785 ; RV64-NEXT: vminu.vx v8, v8, a0
787 %elt.head = insertelement <2 x i64> poison, i64 %b, i32 0
788 %vb = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
789 %v = call <2 x i64> @llvm.vp.umin.v2i64(<2 x i64> %va, <2 x i64> %vb, <2 x i1> splat (i1 true), i32 %evl)
793 declare <4 x i64> @llvm.vp.umin.v4i64(<4 x i64>, <4 x i64>, <4 x i1>, i32)
795 define <4 x i64> @vminu_vv_v4i64(<4 x i64> %va, <4 x i64> %b, <4 x i1> %m, i32 zeroext %evl) {
796 ; CHECK-LABEL: vminu_vv_v4i64:
798 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
799 ; CHECK-NEXT: vminu.vv v8, v8, v10, v0.t
801 %v = call <4 x i64> @llvm.vp.umin.v4i64(<4 x i64> %va, <4 x i64> %b, <4 x i1> %m, i32 %evl)
805 define <4 x i64> @vminu_vv_v4i64_unmasked(<4 x i64> %va, <4 x i64> %b, i32 zeroext %evl) {
806 ; CHECK-LABEL: vminu_vv_v4i64_unmasked:
808 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
809 ; CHECK-NEXT: vminu.vv v8, v8, v10
811 %v = call <4 x i64> @llvm.vp.umin.v4i64(<4 x i64> %va, <4 x i64> %b, <4 x i1> splat (i1 true), i32 %evl)
815 define <4 x i64> @vminu_vx_v4i64(<4 x i64> %va, i64 %b, <4 x i1> %m, i32 zeroext %evl) {
816 ; RV32-LABEL: vminu_vx_v4i64:
818 ; RV32-NEXT: addi sp, sp, -16
819 ; RV32-NEXT: .cfi_def_cfa_offset 16
820 ; RV32-NEXT: sw a1, 12(sp)
821 ; RV32-NEXT: sw a0, 8(sp)
822 ; RV32-NEXT: addi a0, sp, 8
823 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
824 ; RV32-NEXT: vlse64.v v10, (a0), zero
825 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
826 ; RV32-NEXT: vminu.vv v8, v8, v10, v0.t
827 ; RV32-NEXT: addi sp, sp, 16
830 ; RV64-LABEL: vminu_vx_v4i64:
832 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
833 ; RV64-NEXT: vminu.vx v8, v8, a0, v0.t
835 %elt.head = insertelement <4 x i64> poison, i64 %b, i32 0
836 %vb = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
837 %v = call <4 x i64> @llvm.vp.umin.v4i64(<4 x i64> %va, <4 x i64> %vb, <4 x i1> %m, i32 %evl)
841 define <4 x i64> @vminu_vx_v4i64_unmasked(<4 x i64> %va, i64 %b, i32 zeroext %evl) {
842 ; RV32-LABEL: vminu_vx_v4i64_unmasked:
844 ; RV32-NEXT: addi sp, sp, -16
845 ; RV32-NEXT: .cfi_def_cfa_offset 16
846 ; RV32-NEXT: sw a1, 12(sp)
847 ; RV32-NEXT: sw a0, 8(sp)
848 ; RV32-NEXT: addi a0, sp, 8
849 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
850 ; RV32-NEXT: vlse64.v v10, (a0), zero
851 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
852 ; RV32-NEXT: vminu.vv v8, v8, v10
853 ; RV32-NEXT: addi sp, sp, 16
856 ; RV64-LABEL: vminu_vx_v4i64_unmasked:
858 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
859 ; RV64-NEXT: vminu.vx v8, v8, a0
861 %elt.head = insertelement <4 x i64> poison, i64 %b, i32 0
862 %vb = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
863 %v = call <4 x i64> @llvm.vp.umin.v4i64(<4 x i64> %va, <4 x i64> %vb, <4 x i1> splat (i1 true), i32 %evl)
867 declare <8 x i64> @llvm.vp.umin.v8i64(<8 x i64>, <8 x i64>, <8 x i1>, i32)
869 define <8 x i64> @vminu_vv_v8i64(<8 x i64> %va, <8 x i64> %b, <8 x i1> %m, i32 zeroext %evl) {
870 ; CHECK-LABEL: vminu_vv_v8i64:
872 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
873 ; CHECK-NEXT: vminu.vv v8, v8, v12, v0.t
875 %v = call <8 x i64> @llvm.vp.umin.v8i64(<8 x i64> %va, <8 x i64> %b, <8 x i1> %m, i32 %evl)
879 define <8 x i64> @vminu_vv_v8i64_unmasked(<8 x i64> %va, <8 x i64> %b, i32 zeroext %evl) {
880 ; CHECK-LABEL: vminu_vv_v8i64_unmasked:
882 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
883 ; CHECK-NEXT: vminu.vv v8, v8, v12
885 %v = call <8 x i64> @llvm.vp.umin.v8i64(<8 x i64> %va, <8 x i64> %b, <8 x i1> splat (i1 true), i32 %evl)
889 define <8 x i64> @vminu_vx_v8i64(<8 x i64> %va, i64 %b, <8 x i1> %m, i32 zeroext %evl) {
890 ; RV32-LABEL: vminu_vx_v8i64:
892 ; RV32-NEXT: addi sp, sp, -16
893 ; RV32-NEXT: .cfi_def_cfa_offset 16
894 ; RV32-NEXT: sw a1, 12(sp)
895 ; RV32-NEXT: sw a0, 8(sp)
896 ; RV32-NEXT: addi a0, sp, 8
897 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
898 ; RV32-NEXT: vlse64.v v12, (a0), zero
899 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
900 ; RV32-NEXT: vminu.vv v8, v8, v12, v0.t
901 ; RV32-NEXT: addi sp, sp, 16
904 ; RV64-LABEL: vminu_vx_v8i64:
906 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
907 ; RV64-NEXT: vminu.vx v8, v8, a0, v0.t
909 %elt.head = insertelement <8 x i64> poison, i64 %b, i32 0
910 %vb = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
911 %v = call <8 x i64> @llvm.vp.umin.v8i64(<8 x i64> %va, <8 x i64> %vb, <8 x i1> %m, i32 %evl)
915 define <8 x i64> @vminu_vx_v8i64_unmasked(<8 x i64> %va, i64 %b, i32 zeroext %evl) {
916 ; RV32-LABEL: vminu_vx_v8i64_unmasked:
918 ; RV32-NEXT: addi sp, sp, -16
919 ; RV32-NEXT: .cfi_def_cfa_offset 16
920 ; RV32-NEXT: sw a1, 12(sp)
921 ; RV32-NEXT: sw a0, 8(sp)
922 ; RV32-NEXT: addi a0, sp, 8
923 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
924 ; RV32-NEXT: vlse64.v v12, (a0), zero
925 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
926 ; RV32-NEXT: vminu.vv v8, v8, v12
927 ; RV32-NEXT: addi sp, sp, 16
930 ; RV64-LABEL: vminu_vx_v8i64_unmasked:
932 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
933 ; RV64-NEXT: vminu.vx v8, v8, a0
935 %elt.head = insertelement <8 x i64> poison, i64 %b, i32 0
936 %vb = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
937 %v = call <8 x i64> @llvm.vp.umin.v8i64(<8 x i64> %va, <8 x i64> %vb, <8 x i1> splat (i1 true), i32 %evl)
941 declare <16 x i64> @llvm.vp.umin.v16i64(<16 x i64>, <16 x i64>, <16 x i1>, i32)
943 define <16 x i64> @vminu_vv_v16i64(<16 x i64> %va, <16 x i64> %b, <16 x i1> %m, i32 zeroext %evl) {
944 ; CHECK-LABEL: vminu_vv_v16i64:
946 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
947 ; CHECK-NEXT: vminu.vv v8, v8, v16, v0.t
949 %v = call <16 x i64> @llvm.vp.umin.v16i64(<16 x i64> %va, <16 x i64> %b, <16 x i1> %m, i32 %evl)
953 define <16 x i64> @vminu_vv_v16i64_unmasked(<16 x i64> %va, <16 x i64> %b, i32 zeroext %evl) {
954 ; CHECK-LABEL: vminu_vv_v16i64_unmasked:
956 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
957 ; CHECK-NEXT: vminu.vv v8, v8, v16
959 %v = call <16 x i64> @llvm.vp.umin.v16i64(<16 x i64> %va, <16 x i64> %b, <16 x i1> splat (i1 true), i32 %evl)
963 define <16 x i64> @vminu_vx_v16i64(<16 x i64> %va, i64 %b, <16 x i1> %m, i32 zeroext %evl) {
964 ; RV32-LABEL: vminu_vx_v16i64:
966 ; RV32-NEXT: addi sp, sp, -16
967 ; RV32-NEXT: .cfi_def_cfa_offset 16
968 ; RV32-NEXT: sw a1, 12(sp)
969 ; RV32-NEXT: sw a0, 8(sp)
970 ; RV32-NEXT: addi a0, sp, 8
971 ; RV32-NEXT: vsetivli zero, 16, e64, m8, ta, ma
972 ; RV32-NEXT: vlse64.v v16, (a0), zero
973 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
974 ; RV32-NEXT: vminu.vv v8, v8, v16, v0.t
975 ; RV32-NEXT: addi sp, sp, 16
978 ; RV64-LABEL: vminu_vx_v16i64:
980 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
981 ; RV64-NEXT: vminu.vx v8, v8, a0, v0.t
983 %elt.head = insertelement <16 x i64> poison, i64 %b, i32 0
984 %vb = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
985 %v = call <16 x i64> @llvm.vp.umin.v16i64(<16 x i64> %va, <16 x i64> %vb, <16 x i1> %m, i32 %evl)
989 define <16 x i64> @vminu_vx_v16i64_unmasked(<16 x i64> %va, i64 %b, i32 zeroext %evl) {
990 ; RV32-LABEL: vminu_vx_v16i64_unmasked:
992 ; RV32-NEXT: addi sp, sp, -16
993 ; RV32-NEXT: .cfi_def_cfa_offset 16
994 ; RV32-NEXT: sw a1, 12(sp)
995 ; RV32-NEXT: sw a0, 8(sp)
996 ; RV32-NEXT: addi a0, sp, 8
997 ; RV32-NEXT: vsetivli zero, 16, e64, m8, ta, ma
998 ; RV32-NEXT: vlse64.v v16, (a0), zero
999 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1000 ; RV32-NEXT: vminu.vv v8, v8, v16
1001 ; RV32-NEXT: addi sp, sp, 16
1004 ; RV64-LABEL: vminu_vx_v16i64_unmasked:
1006 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1007 ; RV64-NEXT: vminu.vx v8, v8, a0
1009 %elt.head = insertelement <16 x i64> poison, i64 %b, i32 0
1010 %vb = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
1011 %v = call <16 x i64> @llvm.vp.umin.v16i64(<16 x i64> %va, <16 x i64> %vb, <16 x i1> splat (i1 true), i32 %evl)
1015 ; Test that split-legalization works as expected.
1017 declare <32 x i64> @llvm.vp.umin.v32i64(<32 x i64>, <32 x i64>, <32 x i1>, i32)
1019 define <32 x i64> @vminu_vx_v32i64(<32 x i64> %va, <32 x i1> %m, i32 zeroext %evl) {
1020 ; RV32-LABEL: vminu_vx_v32i64:
1022 ; RV32-NEXT: li a2, 16
1023 ; RV32-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
1024 ; RV32-NEXT: vslidedown.vi v7, v0, 2
1025 ; RV32-NEXT: mv a1, a0
1026 ; RV32-NEXT: bltu a0, a2, .LBB74_2
1027 ; RV32-NEXT: # %bb.1:
1028 ; RV32-NEXT: li a1, 16
1029 ; RV32-NEXT: .LBB74_2:
1030 ; RV32-NEXT: li a2, 32
1031 ; RV32-NEXT: vsetvli zero, a2, e32, m8, ta, ma
1032 ; RV32-NEXT: vmv.v.i v24, -1
1033 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1034 ; RV32-NEXT: vminu.vv v8, v8, v24, v0.t
1035 ; RV32-NEXT: addi a1, a0, -16
1036 ; RV32-NEXT: sltu a0, a0, a1
1037 ; RV32-NEXT: addi a0, a0, -1
1038 ; RV32-NEXT: and a0, a0, a1
1039 ; RV32-NEXT: vmv1r.v v0, v7
1040 ; RV32-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1041 ; RV32-NEXT: vminu.vv v16, v16, v24, v0.t
1044 ; RV64-LABEL: vminu_vx_v32i64:
1046 ; RV64-NEXT: li a2, 16
1047 ; RV64-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
1048 ; RV64-NEXT: vslidedown.vi v24, v0, 2
1049 ; RV64-NEXT: mv a1, a0
1050 ; RV64-NEXT: bltu a0, a2, .LBB74_2
1051 ; RV64-NEXT: # %bb.1:
1052 ; RV64-NEXT: li a1, 16
1053 ; RV64-NEXT: .LBB74_2:
1054 ; RV64-NEXT: li a2, -1
1055 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1056 ; RV64-NEXT: vminu.vx v8, v8, a2, v0.t
1057 ; RV64-NEXT: addi a1, a0, -16
1058 ; RV64-NEXT: sltu a0, a0, a1
1059 ; RV64-NEXT: addi a0, a0, -1
1060 ; RV64-NEXT: and a0, a0, a1
1061 ; RV64-NEXT: vmv1r.v v0, v24
1062 ; RV64-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1063 ; RV64-NEXT: vminu.vx v16, v16, a2, v0.t
1065 %v = call <32 x i64> @llvm.vp.umin.v32i64(<32 x i64> %va, <32 x i64> splat (i64 -1), <32 x i1> %m, i32 %evl)