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.smin.v8i7(<8 x i7>, <8 x i7>, <8 x i1>, i32)
9 define <8 x i7> @vmin_vv_v8i7(<8 x i7> %va, <8 x i7> %b, <8 x i1> %m, i32 zeroext %evl) {
10 ; CHECK-LABEL: vmin_vv_v8i7:
12 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
13 ; CHECK-NEXT: vadd.vv v9, v9, v9
14 ; CHECK-NEXT: vsra.vi v9, v9, 1
15 ; CHECK-NEXT: vadd.vv v8, v8, v8
16 ; CHECK-NEXT: vsra.vi v8, v8, 1
17 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
18 ; CHECK-NEXT: vmin.vv v8, v8, v9, v0.t
20 %v = call <8 x i7> @llvm.vp.smin.v8i7(<8 x i7> %va, <8 x i7> %b, <8 x i1> %m, i32 %evl)
24 declare <2 x i8> @llvm.vp.smin.v2i8(<2 x i8>, <2 x i8>, <2 x i1>, i32)
26 define <2 x i8> @vmin_vv_v2i8(<2 x i8> %va, <2 x i8> %b, <2 x i1> %m, i32 zeroext %evl) {
27 ; CHECK-LABEL: vmin_vv_v2i8:
29 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
30 ; CHECK-NEXT: vmin.vv v8, v8, v9, v0.t
32 %v = call <2 x i8> @llvm.vp.smin.v2i8(<2 x i8> %va, <2 x i8> %b, <2 x i1> %m, i32 %evl)
36 define <2 x i8> @vmin_vv_v2i8_unmasked(<2 x i8> %va, <2 x i8> %b, i32 zeroext %evl) {
37 ; CHECK-LABEL: vmin_vv_v2i8_unmasked:
39 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
40 ; CHECK-NEXT: vmin.vv v8, v8, v9
42 %head = insertelement <2 x i1> poison, i1 true, i32 0
43 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
44 %v = call <2 x i8> @llvm.vp.smin.v2i8(<2 x i8> %va, <2 x i8> %b, <2 x i1> %m, i32 %evl)
48 define <2 x i8> @vmin_vx_v2i8(<2 x i8> %va, i8 %b, <2 x i1> %m, i32 zeroext %evl) {
49 ; CHECK-LABEL: vmin_vx_v2i8:
51 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
52 ; CHECK-NEXT: vmin.vx v8, v8, a0, v0.t
54 %elt.head = insertelement <2 x i8> poison, i8 %b, i32 0
55 %vb = shufflevector <2 x i8> %elt.head, <2 x i8> poison, <2 x i32> zeroinitializer
56 %v = call <2 x i8> @llvm.vp.smin.v2i8(<2 x i8> %va, <2 x i8> %vb, <2 x i1> %m, i32 %evl)
60 define <2 x i8> @vmin_vx_v2i8_unmasked(<2 x i8> %va, i8 %b, i32 zeroext %evl) {
61 ; CHECK-LABEL: vmin_vx_v2i8_unmasked:
63 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
64 ; CHECK-NEXT: vmin.vx v8, v8, a0
66 %elt.head = insertelement <2 x i8> poison, i8 %b, i32 0
67 %vb = shufflevector <2 x i8> %elt.head, <2 x i8> poison, <2 x i32> zeroinitializer
68 %head = insertelement <2 x i1> poison, i1 true, i32 0
69 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
70 %v = call <2 x i8> @llvm.vp.smin.v2i8(<2 x i8> %va, <2 x i8> %vb, <2 x i1> %m, i32 %evl)
74 declare <4 x i8> @llvm.vp.smin.v4i8(<4 x i8>, <4 x i8>, <4 x i1>, i32)
76 define <4 x i8> @vmin_vv_v4i8(<4 x i8> %va, <4 x i8> %b, <4 x i1> %m, i32 zeroext %evl) {
77 ; CHECK-LABEL: vmin_vv_v4i8:
79 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
80 ; CHECK-NEXT: vmin.vv v8, v8, v9, v0.t
82 %v = call <4 x i8> @llvm.vp.smin.v4i8(<4 x i8> %va, <4 x i8> %b, <4 x i1> %m, i32 %evl)
86 define <4 x i8> @vmin_vv_v4i8_unmasked(<4 x i8> %va, <4 x i8> %b, i32 zeroext %evl) {
87 ; CHECK-LABEL: vmin_vv_v4i8_unmasked:
89 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
90 ; CHECK-NEXT: vmin.vv v8, v8, v9
92 %head = insertelement <4 x i1> poison, i1 true, i32 0
93 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
94 %v = call <4 x i8> @llvm.vp.smin.v4i8(<4 x i8> %va, <4 x i8> %b, <4 x i1> %m, i32 %evl)
98 define <4 x i8> @vmin_vx_v4i8(<4 x i8> %va, i8 %b, <4 x i1> %m, i32 zeroext %evl) {
99 ; CHECK-LABEL: vmin_vx_v4i8:
101 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
102 ; CHECK-NEXT: vmin.vx v8, v8, a0, v0.t
104 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
105 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
106 %v = call <4 x i8> @llvm.vp.smin.v4i8(<4 x i8> %va, <4 x i8> %vb, <4 x i1> %m, i32 %evl)
110 define <4 x i8> @vmin_vx_v4i8_commute(<4 x i8> %va, i8 %b, <4 x i1> %m, i32 zeroext %evl) {
111 ; CHECK-LABEL: vmin_vx_v4i8_commute:
113 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
114 ; CHECK-NEXT: vmin.vx v8, v8, a0, v0.t
116 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
117 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
118 %v = call <4 x i8> @llvm.vp.smin.v4i8(<4 x i8> %vb, <4 x i8> %va, <4 x i1> %m, i32 %evl)
122 define <4 x i8> @vmin_vx_v4i8_unmasked(<4 x i8> %va, i8 %b, i32 zeroext %evl) {
123 ; CHECK-LABEL: vmin_vx_v4i8_unmasked:
125 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
126 ; CHECK-NEXT: vmin.vx v8, v8, a0
128 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
129 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
130 %head = insertelement <4 x i1> poison, i1 true, i32 0
131 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
132 %v = call <4 x i8> @llvm.vp.smin.v4i8(<4 x i8> %va, <4 x i8> %vb, <4 x i1> %m, i32 %evl)
136 declare <5 x i8> @llvm.vp.smin.v5i8(<5 x i8>, <5 x i8>, <5 x i1>, i32)
138 define <5 x i8> @vmin_vv_v5i8(<5 x i8> %va, <5 x i8> %b, <5 x i1> %m, i32 zeroext %evl) {
139 ; CHECK-LABEL: vmin_vv_v5i8:
141 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
142 ; CHECK-NEXT: vmin.vv v8, v8, v9, v0.t
144 %v = call <5 x i8> @llvm.vp.smin.v5i8(<5 x i8> %va, <5 x i8> %b, <5 x i1> %m, i32 %evl)
148 define <5 x i8> @vmin_vv_v5i8_unmasked(<5 x i8> %va, <5 x i8> %b, i32 zeroext %evl) {
149 ; CHECK-LABEL: vmin_vv_v5i8_unmasked:
151 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
152 ; CHECK-NEXT: vmin.vv v8, v8, v9
154 %head = insertelement <5 x i1> poison, i1 true, i32 0
155 %m = shufflevector <5 x i1> %head, <5 x i1> poison, <5 x i32> zeroinitializer
156 %v = call <5 x i8> @llvm.vp.smin.v5i8(<5 x i8> %va, <5 x i8> %b, <5 x i1> %m, i32 %evl)
160 define <5 x i8> @vmin_vx_v5i8(<5 x i8> %va, i8 %b, <5 x i1> %m, i32 zeroext %evl) {
161 ; CHECK-LABEL: vmin_vx_v5i8:
163 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
164 ; CHECK-NEXT: vmin.vx v8, v8, a0, v0.t
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.smin.v5i8(<5 x i8> %va, <5 x i8> %vb, <5 x i1> %m, i32 %evl)
172 define <5 x i8> @vmin_vx_v5i8_unmasked(<5 x i8> %va, i8 %b, i32 zeroext %evl) {
173 ; CHECK-LABEL: vmin_vx_v5i8_unmasked:
175 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
176 ; CHECK-NEXT: vmin.vx v8, v8, a0
178 %elt.head = insertelement <5 x i8> poison, i8 %b, i32 0
179 %vb = shufflevector <5 x i8> %elt.head, <5 x i8> poison, <5 x i32> zeroinitializer
180 %head = insertelement <5 x i1> poison, i1 true, i32 0
181 %m = shufflevector <5 x i1> %head, <5 x i1> poison, <5 x i32> zeroinitializer
182 %v = call <5 x i8> @llvm.vp.smin.v5i8(<5 x i8> %va, <5 x i8> %vb, <5 x i1> %m, i32 %evl)
186 declare <8 x i8> @llvm.vp.smin.v8i8(<8 x i8>, <8 x i8>, <8 x i1>, i32)
188 define <8 x i8> @vmin_vv_v8i8(<8 x i8> %va, <8 x i8> %b, <8 x i1> %m, i32 zeroext %evl) {
189 ; CHECK-LABEL: vmin_vv_v8i8:
191 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
192 ; CHECK-NEXT: vmin.vv v8, v8, v9, v0.t
194 %v = call <8 x i8> @llvm.vp.smin.v8i8(<8 x i8> %va, <8 x i8> %b, <8 x i1> %m, i32 %evl)
198 define <8 x i8> @vmin_vv_v8i8_unmasked(<8 x i8> %va, <8 x i8> %b, i32 zeroext %evl) {
199 ; CHECK-LABEL: vmin_vv_v8i8_unmasked:
201 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
202 ; CHECK-NEXT: vmin.vv v8, v8, v9
204 %head = insertelement <8 x i1> poison, i1 true, i32 0
205 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
206 %v = call <8 x i8> @llvm.vp.smin.v8i8(<8 x i8> %va, <8 x i8> %b, <8 x i1> %m, i32 %evl)
210 define <8 x i8> @vmin_vx_v8i8(<8 x i8> %va, i8 %b, <8 x i1> %m, i32 zeroext %evl) {
211 ; CHECK-LABEL: vmin_vx_v8i8:
213 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
214 ; CHECK-NEXT: vmin.vx v8, v8, a0, v0.t
216 %elt.head = insertelement <8 x i8> poison, i8 %b, i32 0
217 %vb = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
218 %v = call <8 x i8> @llvm.vp.smin.v8i8(<8 x i8> %va, <8 x i8> %vb, <8 x i1> %m, i32 %evl)
222 define <8 x i8> @vmin_vx_v8i8_unmasked(<8 x i8> %va, i8 %b, i32 zeroext %evl) {
223 ; CHECK-LABEL: vmin_vx_v8i8_unmasked:
225 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
226 ; CHECK-NEXT: vmin.vx v8, v8, a0
228 %elt.head = insertelement <8 x i8> poison, i8 %b, i32 0
229 %vb = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
230 %head = insertelement <8 x i1> poison, i1 true, i32 0
231 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
232 %v = call <8 x i8> @llvm.vp.smin.v8i8(<8 x i8> %va, <8 x i8> %vb, <8 x i1> %m, i32 %evl)
236 declare <16 x i8> @llvm.vp.smin.v16i8(<16 x i8>, <16 x i8>, <16 x i1>, i32)
238 define <16 x i8> @vmin_vv_v16i8(<16 x i8> %va, <16 x i8> %b, <16 x i1> %m, i32 zeroext %evl) {
239 ; CHECK-LABEL: vmin_vv_v16i8:
241 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
242 ; CHECK-NEXT: vmin.vv v8, v8, v9, v0.t
244 %v = call <16 x i8> @llvm.vp.smin.v16i8(<16 x i8> %va, <16 x i8> %b, <16 x i1> %m, i32 %evl)
248 define <16 x i8> @vmin_vv_v16i8_unmasked(<16 x i8> %va, <16 x i8> %b, i32 zeroext %evl) {
249 ; CHECK-LABEL: vmin_vv_v16i8_unmasked:
251 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
252 ; CHECK-NEXT: vmin.vv v8, v8, v9
254 %head = insertelement <16 x i1> poison, i1 true, i32 0
255 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
256 %v = call <16 x i8> @llvm.vp.smin.v16i8(<16 x i8> %va, <16 x i8> %b, <16 x i1> %m, i32 %evl)
260 define <16 x i8> @vmin_vx_v16i8(<16 x i8> %va, i8 %b, <16 x i1> %m, i32 zeroext %evl) {
261 ; CHECK-LABEL: vmin_vx_v16i8:
263 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
264 ; CHECK-NEXT: vmin.vx v8, v8, a0, v0.t
266 %elt.head = insertelement <16 x i8> poison, i8 %b, i32 0
267 %vb = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
268 %v = call <16 x i8> @llvm.vp.smin.v16i8(<16 x i8> %va, <16 x i8> %vb, <16 x i1> %m, i32 %evl)
272 define <16 x i8> @vmin_vx_v16i8_unmasked(<16 x i8> %va, i8 %b, i32 zeroext %evl) {
273 ; CHECK-LABEL: vmin_vx_v16i8_unmasked:
275 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
276 ; CHECK-NEXT: vmin.vx v8, v8, a0
278 %elt.head = insertelement <16 x i8> poison, i8 %b, i32 0
279 %vb = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
280 %head = insertelement <16 x i1> poison, i1 true, i32 0
281 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
282 %v = call <16 x i8> @llvm.vp.smin.v16i8(<16 x i8> %va, <16 x i8> %vb, <16 x i1> %m, i32 %evl)
286 declare <256 x i8> @llvm.vp.smin.v258i8(<256 x i8>, <256 x i8>, <256 x i1>, i32)
288 define <256 x i8> @vmin_vx_v258i8(<256 x i8> %va, i8 %b, <256 x i1> %m, i32 zeroext %evl) {
289 ; CHECK-LABEL: vmin_vx_v258i8:
291 ; CHECK-NEXT: vmv1r.v v24, v0
292 ; CHECK-NEXT: li a3, 128
293 ; CHECK-NEXT: vsetvli zero, a3, e8, m8, ta, ma
294 ; CHECK-NEXT: vlm.v v0, (a1)
295 ; CHECK-NEXT: addi a1, a2, -128
296 ; CHECK-NEXT: sltu a4, a2, a1
297 ; CHECK-NEXT: addi a4, a4, -1
298 ; CHECK-NEXT: and a1, a4, a1
299 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
300 ; CHECK-NEXT: vmin.vx v16, v16, a0, v0.t
301 ; CHECK-NEXT: bltu a2, a3, .LBB22_2
302 ; CHECK-NEXT: # %bb.1:
303 ; CHECK-NEXT: li a2, 128
304 ; CHECK-NEXT: .LBB22_2:
305 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
306 ; CHECK-NEXT: vmv1r.v v0, v24
307 ; CHECK-NEXT: vmin.vx v8, v8, a0, v0.t
309 %elt.head = insertelement <256 x i8> poison, i8 %b, i32 0
310 %vb = shufflevector <256 x i8> %elt.head, <256 x i8> poison, <256 x i32> zeroinitializer
311 %v = call <256 x i8> @llvm.vp.smin.v258i8(<256 x i8> %va, <256 x i8> %vb, <256 x i1> %m, i32 %evl)
315 define <256 x i8> @vmin_vx_v258i8_unmasked(<256 x i8> %va, i8 %b, i32 zeroext %evl) {
316 ; CHECK-LABEL: vmin_vx_v258i8_unmasked:
318 ; CHECK-NEXT: li a3, 128
319 ; CHECK-NEXT: mv a2, a1
320 ; CHECK-NEXT: bltu a1, a3, .LBB23_2
321 ; CHECK-NEXT: # %bb.1:
322 ; CHECK-NEXT: li a2, 128
323 ; CHECK-NEXT: .LBB23_2:
324 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
325 ; CHECK-NEXT: vmin.vx v8, v8, a0
326 ; CHECK-NEXT: addi a2, a1, -128
327 ; CHECK-NEXT: sltu a1, a1, a2
328 ; CHECK-NEXT: addi a1, a1, -1
329 ; CHECK-NEXT: and a1, a1, a2
330 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
331 ; CHECK-NEXT: vmin.vx v16, v16, a0
333 %elt.head = insertelement <256 x i8> poison, i8 %b, i32 0
334 %vb = shufflevector <256 x i8> %elt.head, <256 x i8> poison, <256 x i32> zeroinitializer
335 %head = insertelement <256 x i1> poison, i1 true, i32 0
336 %m = shufflevector <256 x i1> %head, <256 x i1> poison, <256 x i32> zeroinitializer
337 %v = call <256 x i8> @llvm.vp.smin.v258i8(<256 x i8> %va, <256 x i8> %vb, <256 x i1> %m, i32 %evl)
341 ; Test splitting when the %evl is a known constant.
343 define <256 x i8> @vmin_vx_v258i8_evl129(<256 x i8> %va, i8 %b, <256 x i1> %m) {
344 ; CHECK-LABEL: vmin_vx_v258i8_evl129:
346 ; CHECK-NEXT: li a2, 128
347 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
348 ; CHECK-NEXT: vlm.v v24, (a1)
349 ; CHECK-NEXT: vmin.vx v8, v8, a0, v0.t
350 ; CHECK-NEXT: vsetivli zero, 1, e8, m8, ta, ma
351 ; CHECK-NEXT: vmv1r.v v0, v24
352 ; CHECK-NEXT: vmin.vx v16, v16, a0, v0.t
354 %elt.head = insertelement <256 x i8> poison, i8 %b, i32 0
355 %vb = shufflevector <256 x i8> %elt.head, <256 x i8> poison, <256 x i32> zeroinitializer
356 %v = call <256 x i8> @llvm.vp.smin.v258i8(<256 x i8> %va, <256 x i8> %vb, <256 x i1> %m, i32 129)
360 ; The upper half is doing nothing.
362 define <256 x i8> @vmin_vx_v258i8_evl128(<256 x i8> %va, i8 %b, <256 x i1> %m) {
363 ; CHECK-LABEL: vmin_vx_v258i8_evl128:
365 ; CHECK-NEXT: li a1, 128
366 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
367 ; CHECK-NEXT: vmin.vx v8, v8, a0, v0.t
369 %elt.head = insertelement <256 x i8> poison, i8 %b, i32 0
370 %vb = shufflevector <256 x i8> %elt.head, <256 x i8> poison, <256 x i32> zeroinitializer
371 %v = call <256 x i8> @llvm.vp.smin.v258i8(<256 x i8> %va, <256 x i8> %vb, <256 x i1> %m, i32 128)
375 declare <2 x i16> @llvm.vp.smin.v2i16(<2 x i16>, <2 x i16>, <2 x i1>, i32)
377 define <2 x i16> @vmin_vv_v2i16(<2 x i16> %va, <2 x i16> %b, <2 x i1> %m, i32 zeroext %evl) {
378 ; CHECK-LABEL: vmin_vv_v2i16:
380 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
381 ; CHECK-NEXT: vmin.vv v8, v8, v9, v0.t
383 %v = call <2 x i16> @llvm.vp.smin.v2i16(<2 x i16> %va, <2 x i16> %b, <2 x i1> %m, i32 %evl)
387 define <2 x i16> @vmin_vv_v2i16_unmasked(<2 x i16> %va, <2 x i16> %b, i32 zeroext %evl) {
388 ; CHECK-LABEL: vmin_vv_v2i16_unmasked:
390 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
391 ; CHECK-NEXT: vmin.vv v8, v8, v9
393 %head = insertelement <2 x i1> poison, i1 true, i32 0
394 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
395 %v = call <2 x i16> @llvm.vp.smin.v2i16(<2 x i16> %va, <2 x i16> %b, <2 x i1> %m, i32 %evl)
399 define <2 x i16> @vmin_vx_v2i16(<2 x i16> %va, i16 %b, <2 x i1> %m, i32 zeroext %evl) {
400 ; CHECK-LABEL: vmin_vx_v2i16:
402 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
403 ; CHECK-NEXT: vmin.vx v8, v8, a0, v0.t
405 %elt.head = insertelement <2 x i16> poison, i16 %b, i32 0
406 %vb = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
407 %v = call <2 x i16> @llvm.vp.smin.v2i16(<2 x i16> %va, <2 x i16> %vb, <2 x i1> %m, i32 %evl)
411 define <2 x i16> @vmin_vx_v2i16_unmasked(<2 x i16> %va, i16 %b, i32 zeroext %evl) {
412 ; CHECK-LABEL: vmin_vx_v2i16_unmasked:
414 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
415 ; CHECK-NEXT: vmin.vx v8, v8, a0
417 %elt.head = insertelement <2 x i16> poison, i16 %b, i32 0
418 %vb = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
419 %head = insertelement <2 x i1> poison, i1 true, i32 0
420 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
421 %v = call <2 x i16> @llvm.vp.smin.v2i16(<2 x i16> %va, <2 x i16> %vb, <2 x i1> %m, i32 %evl)
425 declare <4 x i16> @llvm.vp.smin.v4i16(<4 x i16>, <4 x i16>, <4 x i1>, i32)
427 define <4 x i16> @vmin_vv_v4i16(<4 x i16> %va, <4 x i16> %b, <4 x i1> %m, i32 zeroext %evl) {
428 ; CHECK-LABEL: vmin_vv_v4i16:
430 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
431 ; CHECK-NEXT: vmin.vv v8, v8, v9, v0.t
433 %v = call <4 x i16> @llvm.vp.smin.v4i16(<4 x i16> %va, <4 x i16> %b, <4 x i1> %m, i32 %evl)
437 define <4 x i16> @vmin_vv_v4i16_unmasked(<4 x i16> %va, <4 x i16> %b, i32 zeroext %evl) {
438 ; CHECK-LABEL: vmin_vv_v4i16_unmasked:
440 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
441 ; CHECK-NEXT: vmin.vv v8, v8, v9
443 %head = insertelement <4 x i1> poison, i1 true, i32 0
444 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
445 %v = call <4 x i16> @llvm.vp.smin.v4i16(<4 x i16> %va, <4 x i16> %b, <4 x i1> %m, i32 %evl)
449 define <4 x i16> @vmin_vx_v4i16(<4 x i16> %va, i16 %b, <4 x i1> %m, i32 zeroext %evl) {
450 ; CHECK-LABEL: vmin_vx_v4i16:
452 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
453 ; CHECK-NEXT: vmin.vx v8, v8, a0, v0.t
455 %elt.head = insertelement <4 x i16> poison, i16 %b, i32 0
456 %vb = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
457 %v = call <4 x i16> @llvm.vp.smin.v4i16(<4 x i16> %va, <4 x i16> %vb, <4 x i1> %m, i32 %evl)
461 define <4 x i16> @vmin_vx_v4i16_unmasked(<4 x i16> %va, i16 %b, i32 zeroext %evl) {
462 ; CHECK-LABEL: vmin_vx_v4i16_unmasked:
464 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
465 ; CHECK-NEXT: vmin.vx v8, v8, a0
467 %elt.head = insertelement <4 x i16> poison, i16 %b, i32 0
468 %vb = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
469 %head = insertelement <4 x i1> poison, i1 true, i32 0
470 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
471 %v = call <4 x i16> @llvm.vp.smin.v4i16(<4 x i16> %va, <4 x i16> %vb, <4 x i1> %m, i32 %evl)
475 declare <8 x i16> @llvm.vp.smin.v8i16(<8 x i16>, <8 x i16>, <8 x i1>, i32)
477 define <8 x i16> @vmin_vv_v8i16(<8 x i16> %va, <8 x i16> %b, <8 x i1> %m, i32 zeroext %evl) {
478 ; CHECK-LABEL: vmin_vv_v8i16:
480 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
481 ; CHECK-NEXT: vmin.vv v8, v8, v9, v0.t
483 %v = call <8 x i16> @llvm.vp.smin.v8i16(<8 x i16> %va, <8 x i16> %b, <8 x i1> %m, i32 %evl)
487 define <8 x i16> @vmin_vv_v8i16_unmasked(<8 x i16> %va, <8 x i16> %b, i32 zeroext %evl) {
488 ; CHECK-LABEL: vmin_vv_v8i16_unmasked:
490 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
491 ; CHECK-NEXT: vmin.vv v8, v8, v9
493 %head = insertelement <8 x i1> poison, i1 true, i32 0
494 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
495 %v = call <8 x i16> @llvm.vp.smin.v8i16(<8 x i16> %va, <8 x i16> %b, <8 x i1> %m, i32 %evl)
499 define <8 x i16> @vmin_vx_v8i16(<8 x i16> %va, i16 %b, <8 x i1> %m, i32 zeroext %evl) {
500 ; CHECK-LABEL: vmin_vx_v8i16:
502 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
503 ; CHECK-NEXT: vmin.vx v8, v8, a0, v0.t
505 %elt.head = insertelement <8 x i16> poison, i16 %b, i32 0
506 %vb = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
507 %v = call <8 x i16> @llvm.vp.smin.v8i16(<8 x i16> %va, <8 x i16> %vb, <8 x i1> %m, i32 %evl)
511 define <8 x i16> @vmin_vx_v8i16_unmasked(<8 x i16> %va, i16 %b, i32 zeroext %evl) {
512 ; CHECK-LABEL: vmin_vx_v8i16_unmasked:
514 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
515 ; CHECK-NEXT: vmin.vx v8, v8, a0
517 %elt.head = insertelement <8 x i16> poison, i16 %b, i32 0
518 %vb = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
519 %head = insertelement <8 x i1> poison, i1 true, i32 0
520 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
521 %v = call <8 x i16> @llvm.vp.smin.v8i16(<8 x i16> %va, <8 x i16> %vb, <8 x i1> %m, i32 %evl)
525 declare <16 x i16> @llvm.vp.smin.v16i16(<16 x i16>, <16 x i16>, <16 x i1>, i32)
527 define <16 x i16> @vmin_vv_v16i16(<16 x i16> %va, <16 x i16> %b, <16 x i1> %m, i32 zeroext %evl) {
528 ; CHECK-LABEL: vmin_vv_v16i16:
530 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
531 ; CHECK-NEXT: vmin.vv v8, v8, v10, v0.t
533 %v = call <16 x i16> @llvm.vp.smin.v16i16(<16 x i16> %va, <16 x i16> %b, <16 x i1> %m, i32 %evl)
537 define <16 x i16> @vmin_vv_v16i16_unmasked(<16 x i16> %va, <16 x i16> %b, i32 zeroext %evl) {
538 ; CHECK-LABEL: vmin_vv_v16i16_unmasked:
540 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
541 ; CHECK-NEXT: vmin.vv v8, v8, v10
543 %head = insertelement <16 x i1> poison, i1 true, i32 0
544 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
545 %v = call <16 x i16> @llvm.vp.smin.v16i16(<16 x i16> %va, <16 x i16> %b, <16 x i1> %m, i32 %evl)
549 define <16 x i16> @vmin_vx_v16i16(<16 x i16> %va, i16 %b, <16 x i1> %m, i32 zeroext %evl) {
550 ; CHECK-LABEL: vmin_vx_v16i16:
552 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
553 ; CHECK-NEXT: vmin.vx v8, v8, a0, v0.t
555 %elt.head = insertelement <16 x i16> poison, i16 %b, i32 0
556 %vb = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
557 %v = call <16 x i16> @llvm.vp.smin.v16i16(<16 x i16> %va, <16 x i16> %vb, <16 x i1> %m, i32 %evl)
561 define <16 x i16> @vmin_vx_v16i16_unmasked(<16 x i16> %va, i16 %b, i32 zeroext %evl) {
562 ; CHECK-LABEL: vmin_vx_v16i16_unmasked:
564 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
565 ; CHECK-NEXT: vmin.vx v8, v8, a0
567 %elt.head = insertelement <16 x i16> poison, i16 %b, i32 0
568 %vb = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
569 %head = insertelement <16 x i1> poison, i1 true, i32 0
570 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
571 %v = call <16 x i16> @llvm.vp.smin.v16i16(<16 x i16> %va, <16 x i16> %vb, <16 x i1> %m, i32 %evl)
575 declare <2 x i32> @llvm.vp.smin.v2i32(<2 x i32>, <2 x i32>, <2 x i1>, i32)
577 define <2 x i32> @vmin_vv_v2i32(<2 x i32> %va, <2 x i32> %b, <2 x i1> %m, i32 zeroext %evl) {
578 ; CHECK-LABEL: vmin_vv_v2i32:
580 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
581 ; CHECK-NEXT: vmin.vv v8, v8, v9, v0.t
583 %v = call <2 x i32> @llvm.vp.smin.v2i32(<2 x i32> %va, <2 x i32> %b, <2 x i1> %m, i32 %evl)
587 define <2 x i32> @vmin_vv_v2i32_unmasked(<2 x i32> %va, <2 x i32> %b, i32 zeroext %evl) {
588 ; CHECK-LABEL: vmin_vv_v2i32_unmasked:
590 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
591 ; CHECK-NEXT: vmin.vv v8, v8, v9
593 %head = insertelement <2 x i1> poison, i1 true, i32 0
594 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
595 %v = call <2 x i32> @llvm.vp.smin.v2i32(<2 x i32> %va, <2 x i32> %b, <2 x i1> %m, i32 %evl)
599 define <2 x i32> @vmin_vx_v2i32(<2 x i32> %va, i32 %b, <2 x i1> %m, i32 zeroext %evl) {
600 ; CHECK-LABEL: vmin_vx_v2i32:
602 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
603 ; CHECK-NEXT: vmin.vx v8, v8, a0, v0.t
605 %elt.head = insertelement <2 x i32> poison, i32 %b, i32 0
606 %vb = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
607 %v = call <2 x i32> @llvm.vp.smin.v2i32(<2 x i32> %va, <2 x i32> %vb, <2 x i1> %m, i32 %evl)
611 define <2 x i32> @vmin_vx_v2i32_unmasked(<2 x i32> %va, i32 %b, i32 zeroext %evl) {
612 ; CHECK-LABEL: vmin_vx_v2i32_unmasked:
614 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
615 ; CHECK-NEXT: vmin.vx v8, v8, a0
617 %elt.head = insertelement <2 x i32> poison, i32 %b, i32 0
618 %vb = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
619 %head = insertelement <2 x i1> poison, i1 true, i32 0
620 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
621 %v = call <2 x i32> @llvm.vp.smin.v2i32(<2 x i32> %va, <2 x i32> %vb, <2 x i1> %m, i32 %evl)
625 declare <4 x i32> @llvm.vp.smin.v4i32(<4 x i32>, <4 x i32>, <4 x i1>, i32)
627 define <4 x i32> @vmin_vv_v4i32(<4 x i32> %va, <4 x i32> %b, <4 x i1> %m, i32 zeroext %evl) {
628 ; CHECK-LABEL: vmin_vv_v4i32:
630 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
631 ; CHECK-NEXT: vmin.vv v8, v8, v9, v0.t
633 %v = call <4 x i32> @llvm.vp.smin.v4i32(<4 x i32> %va, <4 x i32> %b, <4 x i1> %m, i32 %evl)
637 define <4 x i32> @vmin_vv_v4i32_unmasked(<4 x i32> %va, <4 x i32> %b, i32 zeroext %evl) {
638 ; CHECK-LABEL: vmin_vv_v4i32_unmasked:
640 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
641 ; CHECK-NEXT: vmin.vv v8, v8, v9
643 %head = insertelement <4 x i1> poison, i1 true, i32 0
644 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
645 %v = call <4 x i32> @llvm.vp.smin.v4i32(<4 x i32> %va, <4 x i32> %b, <4 x i1> %m, i32 %evl)
649 define <4 x i32> @vmin_vx_v4i32(<4 x i32> %va, i32 %b, <4 x i1> %m, i32 zeroext %evl) {
650 ; CHECK-LABEL: vmin_vx_v4i32:
652 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
653 ; CHECK-NEXT: vmin.vx v8, v8, a0, v0.t
655 %elt.head = insertelement <4 x i32> poison, i32 %b, i32 0
656 %vb = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
657 %v = call <4 x i32> @llvm.vp.smin.v4i32(<4 x i32> %va, <4 x i32> %vb, <4 x i1> %m, i32 %evl)
661 define <4 x i32> @vmin_vx_v4i32_unmasked(<4 x i32> %va, i32 %b, i32 zeroext %evl) {
662 ; CHECK-LABEL: vmin_vx_v4i32_unmasked:
664 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
665 ; CHECK-NEXT: vmin.vx v8, v8, a0
667 %elt.head = insertelement <4 x i32> poison, i32 %b, i32 0
668 %vb = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
669 %head = insertelement <4 x i1> poison, i1 true, i32 0
670 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
671 %v = call <4 x i32> @llvm.vp.smin.v4i32(<4 x i32> %va, <4 x i32> %vb, <4 x i1> %m, i32 %evl)
675 declare <8 x i32> @llvm.vp.smin.v8i32(<8 x i32>, <8 x i32>, <8 x i1>, i32)
677 define <8 x i32> @vmin_vv_v8i32(<8 x i32> %va, <8 x i32> %b, <8 x i1> %m, i32 zeroext %evl) {
678 ; CHECK-LABEL: vmin_vv_v8i32:
680 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
681 ; CHECK-NEXT: vmin.vv v8, v8, v10, v0.t
683 %v = call <8 x i32> @llvm.vp.smin.v8i32(<8 x i32> %va, <8 x i32> %b, <8 x i1> %m, i32 %evl)
687 define <8 x i32> @vmin_vv_v8i32_unmasked(<8 x i32> %va, <8 x i32> %b, i32 zeroext %evl) {
688 ; CHECK-LABEL: vmin_vv_v8i32_unmasked:
690 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
691 ; CHECK-NEXT: vmin.vv v8, v8, v10
693 %head = insertelement <8 x i1> poison, i1 true, i32 0
694 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
695 %v = call <8 x i32> @llvm.vp.smin.v8i32(<8 x i32> %va, <8 x i32> %b, <8 x i1> %m, i32 %evl)
699 define <8 x i32> @vmin_vx_v8i32(<8 x i32> %va, i32 %b, <8 x i1> %m, i32 zeroext %evl) {
700 ; CHECK-LABEL: vmin_vx_v8i32:
702 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
703 ; CHECK-NEXT: vmin.vx v8, v8, a0, v0.t
705 %elt.head = insertelement <8 x i32> poison, i32 %b, i32 0
706 %vb = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
707 %v = call <8 x i32> @llvm.vp.smin.v8i32(<8 x i32> %va, <8 x i32> %vb, <8 x i1> %m, i32 %evl)
711 define <8 x i32> @vmin_vx_v8i32_unmasked(<8 x i32> %va, i32 %b, i32 zeroext %evl) {
712 ; CHECK-LABEL: vmin_vx_v8i32_unmasked:
714 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
715 ; CHECK-NEXT: vmin.vx v8, v8, a0
717 %elt.head = insertelement <8 x i32> poison, i32 %b, i32 0
718 %vb = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
719 %head = insertelement <8 x i1> poison, i1 true, i32 0
720 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
721 %v = call <8 x i32> @llvm.vp.smin.v8i32(<8 x i32> %va, <8 x i32> %vb, <8 x i1> %m, i32 %evl)
725 declare <16 x i32> @llvm.vp.smin.v16i32(<16 x i32>, <16 x i32>, <16 x i1>, i32)
727 define <16 x i32> @vmin_vv_v16i32(<16 x i32> %va, <16 x i32> %b, <16 x i1> %m, i32 zeroext %evl) {
728 ; CHECK-LABEL: vmin_vv_v16i32:
730 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
731 ; CHECK-NEXT: vmin.vv v8, v8, v12, v0.t
733 %v = call <16 x i32> @llvm.vp.smin.v16i32(<16 x i32> %va, <16 x i32> %b, <16 x i1> %m, i32 %evl)
737 define <16 x i32> @vmin_vv_v16i32_unmasked(<16 x i32> %va, <16 x i32> %b, i32 zeroext %evl) {
738 ; CHECK-LABEL: vmin_vv_v16i32_unmasked:
740 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
741 ; CHECK-NEXT: vmin.vv v8, v8, v12
743 %head = insertelement <16 x i1> poison, i1 true, i32 0
744 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
745 %v = call <16 x i32> @llvm.vp.smin.v16i32(<16 x i32> %va, <16 x i32> %b, <16 x i1> %m, i32 %evl)
749 define <16 x i32> @vmin_vx_v16i32(<16 x i32> %va, i32 %b, <16 x i1> %m, i32 zeroext %evl) {
750 ; CHECK-LABEL: vmin_vx_v16i32:
752 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
753 ; CHECK-NEXT: vmin.vx v8, v8, a0, v0.t
755 %elt.head = insertelement <16 x i32> poison, i32 %b, i32 0
756 %vb = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
757 %v = call <16 x i32> @llvm.vp.smin.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i1> %m, i32 %evl)
761 define <16 x i32> @vmin_vx_v16i32_unmasked(<16 x i32> %va, i32 %b, i32 zeroext %evl) {
762 ; CHECK-LABEL: vmin_vx_v16i32_unmasked:
764 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
765 ; CHECK-NEXT: vmin.vx v8, v8, a0
767 %elt.head = insertelement <16 x i32> poison, i32 %b, i32 0
768 %vb = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
769 %head = insertelement <16 x i1> poison, i1 true, i32 0
770 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
771 %v = call <16 x i32> @llvm.vp.smin.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i1> %m, i32 %evl)
775 declare <2 x i64> @llvm.vp.smin.v2i64(<2 x i64>, <2 x i64>, <2 x i1>, i32)
777 define <2 x i64> @vmin_vv_v2i64(<2 x i64> %va, <2 x i64> %b, <2 x i1> %m, i32 zeroext %evl) {
778 ; CHECK-LABEL: vmin_vv_v2i64:
780 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
781 ; CHECK-NEXT: vmin.vv v8, v8, v9, v0.t
783 %v = call <2 x i64> @llvm.vp.smin.v2i64(<2 x i64> %va, <2 x i64> %b, <2 x i1> %m, i32 %evl)
787 define <2 x i64> @vmin_vv_v2i64_unmasked(<2 x i64> %va, <2 x i64> %b, i32 zeroext %evl) {
788 ; CHECK-LABEL: vmin_vv_v2i64_unmasked:
790 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
791 ; CHECK-NEXT: vmin.vv v8, v8, v9
793 %head = insertelement <2 x i1> poison, i1 true, i32 0
794 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
795 %v = call <2 x i64> @llvm.vp.smin.v2i64(<2 x i64> %va, <2 x i64> %b, <2 x i1> %m, i32 %evl)
799 define <2 x i64> @vmin_vx_v2i64(<2 x i64> %va, i64 %b, <2 x i1> %m, i32 zeroext %evl) {
800 ; RV32-LABEL: vmin_vx_v2i64:
802 ; RV32-NEXT: addi sp, sp, -16
803 ; RV32-NEXT: .cfi_def_cfa_offset 16
804 ; RV32-NEXT: sw a1, 12(sp)
805 ; RV32-NEXT: sw a0, 8(sp)
806 ; RV32-NEXT: addi a0, sp, 8
807 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
808 ; RV32-NEXT: vlse64.v v9, (a0), zero
809 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
810 ; RV32-NEXT: vmin.vv v8, v8, v9, v0.t
811 ; RV32-NEXT: addi sp, sp, 16
814 ; RV64-LABEL: vmin_vx_v2i64:
816 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
817 ; RV64-NEXT: vmin.vx v8, v8, a0, v0.t
819 %elt.head = insertelement <2 x i64> poison, i64 %b, i32 0
820 %vb = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
821 %v = call <2 x i64> @llvm.vp.smin.v2i64(<2 x i64> %va, <2 x i64> %vb, <2 x i1> %m, i32 %evl)
825 define <2 x i64> @vmin_vx_v2i64_unmasked(<2 x i64> %va, i64 %b, i32 zeroext %evl) {
826 ; RV32-LABEL: vmin_vx_v2i64_unmasked:
828 ; RV32-NEXT: addi sp, sp, -16
829 ; RV32-NEXT: .cfi_def_cfa_offset 16
830 ; RV32-NEXT: sw a1, 12(sp)
831 ; RV32-NEXT: sw a0, 8(sp)
832 ; RV32-NEXT: addi a0, sp, 8
833 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
834 ; RV32-NEXT: vlse64.v v9, (a0), zero
835 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
836 ; RV32-NEXT: vmin.vv v8, v8, v9
837 ; RV32-NEXT: addi sp, sp, 16
840 ; RV64-LABEL: vmin_vx_v2i64_unmasked:
842 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
843 ; RV64-NEXT: vmin.vx v8, v8, a0
845 %elt.head = insertelement <2 x i64> poison, i64 %b, i32 0
846 %vb = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
847 %head = insertelement <2 x i1> poison, i1 true, i32 0
848 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
849 %v = call <2 x i64> @llvm.vp.smin.v2i64(<2 x i64> %va, <2 x i64> %vb, <2 x i1> %m, i32 %evl)
853 declare <4 x i64> @llvm.vp.smin.v4i64(<4 x i64>, <4 x i64>, <4 x i1>, i32)
855 define <4 x i64> @vmin_vv_v4i64(<4 x i64> %va, <4 x i64> %b, <4 x i1> %m, i32 zeroext %evl) {
856 ; CHECK-LABEL: vmin_vv_v4i64:
858 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
859 ; CHECK-NEXT: vmin.vv v8, v8, v10, v0.t
861 %v = call <4 x i64> @llvm.vp.smin.v4i64(<4 x i64> %va, <4 x i64> %b, <4 x i1> %m, i32 %evl)
865 define <4 x i64> @vmin_vv_v4i64_unmasked(<4 x i64> %va, <4 x i64> %b, i32 zeroext %evl) {
866 ; CHECK-LABEL: vmin_vv_v4i64_unmasked:
868 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
869 ; CHECK-NEXT: vmin.vv v8, v8, v10
871 %head = insertelement <4 x i1> poison, i1 true, i32 0
872 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
873 %v = call <4 x i64> @llvm.vp.smin.v4i64(<4 x i64> %va, <4 x i64> %b, <4 x i1> %m, i32 %evl)
877 define <4 x i64> @vmin_vx_v4i64(<4 x i64> %va, i64 %b, <4 x i1> %m, i32 zeroext %evl) {
878 ; RV32-LABEL: vmin_vx_v4i64:
880 ; RV32-NEXT: addi sp, sp, -16
881 ; RV32-NEXT: .cfi_def_cfa_offset 16
882 ; RV32-NEXT: sw a1, 12(sp)
883 ; RV32-NEXT: sw a0, 8(sp)
884 ; RV32-NEXT: addi a0, sp, 8
885 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
886 ; RV32-NEXT: vlse64.v v10, (a0), zero
887 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
888 ; RV32-NEXT: vmin.vv v8, v8, v10, v0.t
889 ; RV32-NEXT: addi sp, sp, 16
892 ; RV64-LABEL: vmin_vx_v4i64:
894 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
895 ; RV64-NEXT: vmin.vx v8, v8, a0, v0.t
897 %elt.head = insertelement <4 x i64> poison, i64 %b, i32 0
898 %vb = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
899 %v = call <4 x i64> @llvm.vp.smin.v4i64(<4 x i64> %va, <4 x i64> %vb, <4 x i1> %m, i32 %evl)
903 define <4 x i64> @vmin_vx_v4i64_unmasked(<4 x i64> %va, i64 %b, i32 zeroext %evl) {
904 ; RV32-LABEL: vmin_vx_v4i64_unmasked:
906 ; RV32-NEXT: addi sp, sp, -16
907 ; RV32-NEXT: .cfi_def_cfa_offset 16
908 ; RV32-NEXT: sw a1, 12(sp)
909 ; RV32-NEXT: sw a0, 8(sp)
910 ; RV32-NEXT: addi a0, sp, 8
911 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
912 ; RV32-NEXT: vlse64.v v10, (a0), zero
913 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
914 ; RV32-NEXT: vmin.vv v8, v8, v10
915 ; RV32-NEXT: addi sp, sp, 16
918 ; RV64-LABEL: vmin_vx_v4i64_unmasked:
920 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
921 ; RV64-NEXT: vmin.vx v8, v8, a0
923 %elt.head = insertelement <4 x i64> poison, i64 %b, i32 0
924 %vb = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
925 %head = insertelement <4 x i1> poison, i1 true, i32 0
926 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
927 %v = call <4 x i64> @llvm.vp.smin.v4i64(<4 x i64> %va, <4 x i64> %vb, <4 x i1> %m, i32 %evl)
931 declare <8 x i64> @llvm.vp.smin.v8i64(<8 x i64>, <8 x i64>, <8 x i1>, i32)
933 define <8 x i64> @vmin_vv_v8i64(<8 x i64> %va, <8 x i64> %b, <8 x i1> %m, i32 zeroext %evl) {
934 ; CHECK-LABEL: vmin_vv_v8i64:
936 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
937 ; CHECK-NEXT: vmin.vv v8, v8, v12, v0.t
939 %v = call <8 x i64> @llvm.vp.smin.v8i64(<8 x i64> %va, <8 x i64> %b, <8 x i1> %m, i32 %evl)
943 define <8 x i64> @vmin_vv_v8i64_unmasked(<8 x i64> %va, <8 x i64> %b, i32 zeroext %evl) {
944 ; CHECK-LABEL: vmin_vv_v8i64_unmasked:
946 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
947 ; CHECK-NEXT: vmin.vv v8, v8, v12
949 %head = insertelement <8 x i1> poison, i1 true, i32 0
950 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
951 %v = call <8 x i64> @llvm.vp.smin.v8i64(<8 x i64> %va, <8 x i64> %b, <8 x i1> %m, i32 %evl)
955 define <8 x i64> @vmin_vx_v8i64(<8 x i64> %va, i64 %b, <8 x i1> %m, i32 zeroext %evl) {
956 ; RV32-LABEL: vmin_vx_v8i64:
958 ; RV32-NEXT: addi sp, sp, -16
959 ; RV32-NEXT: .cfi_def_cfa_offset 16
960 ; RV32-NEXT: sw a1, 12(sp)
961 ; RV32-NEXT: sw a0, 8(sp)
962 ; RV32-NEXT: addi a0, sp, 8
963 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
964 ; RV32-NEXT: vlse64.v v12, (a0), zero
965 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
966 ; RV32-NEXT: vmin.vv v8, v8, v12, v0.t
967 ; RV32-NEXT: addi sp, sp, 16
970 ; RV64-LABEL: vmin_vx_v8i64:
972 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
973 ; RV64-NEXT: vmin.vx v8, v8, a0, v0.t
975 %elt.head = insertelement <8 x i64> poison, i64 %b, i32 0
976 %vb = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
977 %v = call <8 x i64> @llvm.vp.smin.v8i64(<8 x i64> %va, <8 x i64> %vb, <8 x i1> %m, i32 %evl)
981 define <8 x i64> @vmin_vx_v8i64_unmasked(<8 x i64> %va, i64 %b, i32 zeroext %evl) {
982 ; RV32-LABEL: vmin_vx_v8i64_unmasked:
984 ; RV32-NEXT: addi sp, sp, -16
985 ; RV32-NEXT: .cfi_def_cfa_offset 16
986 ; RV32-NEXT: sw a1, 12(sp)
987 ; RV32-NEXT: sw a0, 8(sp)
988 ; RV32-NEXT: addi a0, sp, 8
989 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
990 ; RV32-NEXT: vlse64.v v12, (a0), zero
991 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
992 ; RV32-NEXT: vmin.vv v8, v8, v12
993 ; RV32-NEXT: addi sp, sp, 16
996 ; RV64-LABEL: vmin_vx_v8i64_unmasked:
998 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
999 ; RV64-NEXT: vmin.vx v8, v8, a0
1001 %elt.head = insertelement <8 x i64> poison, i64 %b, i32 0
1002 %vb = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
1003 %head = insertelement <8 x i1> poison, i1 true, i32 0
1004 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
1005 %v = call <8 x i64> @llvm.vp.smin.v8i64(<8 x i64> %va, <8 x i64> %vb, <8 x i1> %m, i32 %evl)
1009 declare <16 x i64> @llvm.vp.smin.v16i64(<16 x i64>, <16 x i64>, <16 x i1>, i32)
1011 define <16 x i64> @vmin_vv_v16i64(<16 x i64> %va, <16 x i64> %b, <16 x i1> %m, i32 zeroext %evl) {
1012 ; CHECK-LABEL: vmin_vv_v16i64:
1014 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1015 ; CHECK-NEXT: vmin.vv v8, v8, v16, v0.t
1017 %v = call <16 x i64> @llvm.vp.smin.v16i64(<16 x i64> %va, <16 x i64> %b, <16 x i1> %m, i32 %evl)
1021 define <16 x i64> @vmin_vv_v16i64_unmasked(<16 x i64> %va, <16 x i64> %b, i32 zeroext %evl) {
1022 ; CHECK-LABEL: vmin_vv_v16i64_unmasked:
1024 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1025 ; CHECK-NEXT: vmin.vv v8, v8, v16
1027 %head = insertelement <16 x i1> poison, i1 true, i32 0
1028 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
1029 %v = call <16 x i64> @llvm.vp.smin.v16i64(<16 x i64> %va, <16 x i64> %b, <16 x i1> %m, i32 %evl)
1033 define <16 x i64> @vmin_vx_v16i64(<16 x i64> %va, i64 %b, <16 x i1> %m, i32 zeroext %evl) {
1034 ; RV32-LABEL: vmin_vx_v16i64:
1036 ; RV32-NEXT: addi sp, sp, -16
1037 ; RV32-NEXT: .cfi_def_cfa_offset 16
1038 ; RV32-NEXT: sw a1, 12(sp)
1039 ; RV32-NEXT: sw a0, 8(sp)
1040 ; RV32-NEXT: addi a0, sp, 8
1041 ; RV32-NEXT: vsetivli zero, 16, e64, m8, ta, ma
1042 ; RV32-NEXT: vlse64.v v16, (a0), zero
1043 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1044 ; RV32-NEXT: vmin.vv v8, v8, v16, v0.t
1045 ; RV32-NEXT: addi sp, sp, 16
1048 ; RV64-LABEL: vmin_vx_v16i64:
1050 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1051 ; RV64-NEXT: vmin.vx v8, v8, a0, v0.t
1053 %elt.head = insertelement <16 x i64> poison, i64 %b, i32 0
1054 %vb = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
1055 %v = call <16 x i64> @llvm.vp.smin.v16i64(<16 x i64> %va, <16 x i64> %vb, <16 x i1> %m, i32 %evl)
1059 define <16 x i64> @vmin_vx_v16i64_unmasked(<16 x i64> %va, i64 %b, i32 zeroext %evl) {
1060 ; RV32-LABEL: vmin_vx_v16i64_unmasked:
1062 ; RV32-NEXT: addi sp, sp, -16
1063 ; RV32-NEXT: .cfi_def_cfa_offset 16
1064 ; RV32-NEXT: sw a1, 12(sp)
1065 ; RV32-NEXT: sw a0, 8(sp)
1066 ; RV32-NEXT: addi a0, sp, 8
1067 ; RV32-NEXT: vsetivli zero, 16, e64, m8, ta, ma
1068 ; RV32-NEXT: vlse64.v v16, (a0), zero
1069 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1070 ; RV32-NEXT: vmin.vv v8, v8, v16
1071 ; RV32-NEXT: addi sp, sp, 16
1074 ; RV64-LABEL: vmin_vx_v16i64_unmasked:
1076 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1077 ; RV64-NEXT: vmin.vx v8, v8, a0
1079 %elt.head = insertelement <16 x i64> poison, i64 %b, i32 0
1080 %vb = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
1081 %head = insertelement <16 x i1> poison, i1 true, i32 0
1082 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
1083 %v = call <16 x i64> @llvm.vp.smin.v16i64(<16 x i64> %va, <16 x i64> %vb, <16 x i1> %m, i32 %evl)
1087 ; Test that split-legalization works as expected.
1089 declare <32 x i64> @llvm.vp.smin.v32i64(<32 x i64>, <32 x i64>, <32 x i1>, i32)
1091 define <32 x i64> @vmin_vx_v32i64(<32 x i64> %va, <32 x i1> %m, i32 zeroext %evl) {
1092 ; RV32-LABEL: vmin_vx_v32i64:
1094 ; RV32-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
1095 ; RV32-NEXT: vslidedown.vi v1, v0, 2
1096 ; RV32-NEXT: li a1, 32
1097 ; RV32-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1098 ; RV32-NEXT: li a2, 16
1099 ; RV32-NEXT: vmv.v.i v24, -1
1100 ; RV32-NEXT: mv a1, a0
1101 ; RV32-NEXT: bltu a0, a2, .LBB74_2
1102 ; RV32-NEXT: # %bb.1:
1103 ; RV32-NEXT: li a1, 16
1104 ; RV32-NEXT: .LBB74_2:
1105 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1106 ; RV32-NEXT: vmin.vv v8, v8, v24, v0.t
1107 ; RV32-NEXT: addi a1, a0, -16
1108 ; RV32-NEXT: sltu a0, a0, a1
1109 ; RV32-NEXT: addi a0, a0, -1
1110 ; RV32-NEXT: and a0, a0, a1
1111 ; RV32-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1112 ; RV32-NEXT: vmv1r.v v0, v1
1113 ; RV32-NEXT: vmin.vv v16, v16, v24, v0.t
1116 ; RV64-LABEL: vmin_vx_v32i64:
1118 ; RV64-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
1119 ; RV64-NEXT: li a2, 16
1120 ; RV64-NEXT: vslidedown.vi v24, v0, 2
1121 ; RV64-NEXT: mv a1, a0
1122 ; RV64-NEXT: bltu a0, a2, .LBB74_2
1123 ; RV64-NEXT: # %bb.1:
1124 ; RV64-NEXT: li a1, 16
1125 ; RV64-NEXT: .LBB74_2:
1126 ; RV64-NEXT: li a2, -1
1127 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1128 ; RV64-NEXT: vmin.vx v8, v8, a2, v0.t
1129 ; RV64-NEXT: addi a1, a0, -16
1130 ; RV64-NEXT: sltu a0, a0, a1
1131 ; RV64-NEXT: addi a0, a0, -1
1132 ; RV64-NEXT: and a0, a0, a1
1133 ; RV64-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1134 ; RV64-NEXT: vmv1r.v v0, v24
1135 ; RV64-NEXT: vmin.vx v16, v16, a2, v0.t
1137 %elt.head = insertelement <32 x i64> poison, i64 -1, i32 0
1138 %vb = shufflevector <32 x i64> %elt.head, <32 x i64> poison, <32 x i32> zeroinitializer
1139 %v = call <32 x i64> @llvm.vp.smin.v32i64(<32 x i64> %va, <32 x i64> %vb, <32 x i1> %m, i32 %evl)