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 <vscale x 8 x i7> @llvm.vp.umin.nxv8i7(<vscale x 8 x i7>, <vscale x 8 x i7>, <vscale x 8 x i1>, i32)
9 define <vscale x 8 x i7> @vminu_vx_nxv8i7(<vscale x 8 x i7> %a, i7 signext %b, <vscale x 8 x i1> %mask, i32 zeroext %evl) {
10 ; CHECK-LABEL: vminu_vx_nxv8i7:
12 ; CHECK-NEXT: li a2, 127
13 ; CHECK-NEXT: vsetvli a3, zero, e8, m1, ta, ma
14 ; CHECK-NEXT: vand.vx v8, v8, a2
15 ; CHECK-NEXT: vmv.v.x v9, a0
16 ; CHECK-NEXT: vand.vx v9, v9, a2
17 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
18 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
20 %elt.head = insertelement <vscale x 8 x i7> poison, i7 %b, i32 0
21 %vb = shufflevector <vscale x 8 x i7> %elt.head, <vscale x 8 x i7> poison, <vscale x 8 x i32> zeroinitializer
22 %v = call <vscale x 8 x i7> @llvm.vp.umin.nxv8i7(<vscale x 8 x i7> %a, <vscale x 8 x i7> %vb, <vscale x 8 x i1> %mask, i32 %evl)
23 ret <vscale x 8 x i7> %v
26 declare <vscale x 1 x i8> @llvm.vp.umin.nxv1i8(<vscale x 1 x i8>, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
28 define <vscale x 1 x i8> @vminu_vv_nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
29 ; CHECK-LABEL: vminu_vv_nxv1i8:
31 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
32 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
34 %v = call <vscale x 1 x i8> @llvm.vp.umin.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %b, <vscale x 1 x i1> %m, i32 %evl)
35 ret <vscale x 1 x i8> %v
38 define <vscale x 1 x i8> @vminu_vv_nxv1i8_unmasked(<vscale x 1 x i8> %va, <vscale x 1 x i8> %b, i32 zeroext %evl) {
39 ; CHECK-LABEL: vminu_vv_nxv1i8_unmasked:
41 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
42 ; CHECK-NEXT: vminu.vv v8, v8, v9
44 %v = call <vscale x 1 x i8> @llvm.vp.umin.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %b, <vscale x 1 x i1> splat (i1 true), i32 %evl)
45 ret <vscale x 1 x i8> %v
48 define <vscale x 1 x i8> @vminu_vx_nxv1i8(<vscale x 1 x i8> %va, i8 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
49 ; CHECK-LABEL: vminu_vx_nxv1i8:
51 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
52 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
54 %elt.head = insertelement <vscale x 1 x i8> poison, i8 %b, i32 0
55 %vb = shufflevector <vscale x 1 x i8> %elt.head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
56 %v = call <vscale x 1 x i8> @llvm.vp.umin.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb, <vscale x 1 x i1> %m, i32 %evl)
57 ret <vscale x 1 x i8> %v
60 define <vscale x 1 x i8> @vminu_vx_nxv1i8_commute(<vscale x 1 x i8> %va, i8 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
61 ; CHECK-LABEL: vminu_vx_nxv1i8_commute:
63 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
64 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
66 %elt.head = insertelement <vscale x 1 x i8> poison, i8 %b, i32 0
67 %vb = shufflevector <vscale x 1 x i8> %elt.head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
68 %v = call <vscale x 1 x i8> @llvm.vp.umin.nxv1i8(<vscale x 1 x i8> %vb, <vscale x 1 x i8> %va, <vscale x 1 x i1> %m, i32 %evl)
69 ret <vscale x 1 x i8> %v
72 define <vscale x 1 x i8> @vminu_vx_nxv1i8_unmasked(<vscale x 1 x i8> %va, i8 %b, i32 zeroext %evl) {
73 ; CHECK-LABEL: vminu_vx_nxv1i8_unmasked:
75 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
76 ; CHECK-NEXT: vminu.vx v8, v8, a0
78 %elt.head = insertelement <vscale x 1 x i8> poison, i8 %b, i32 0
79 %vb = shufflevector <vscale x 1 x i8> %elt.head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
80 %v = call <vscale x 1 x i8> @llvm.vp.umin.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb, <vscale x 1 x i1> splat (i1 true), i32 %evl)
81 ret <vscale x 1 x i8> %v
84 declare <vscale x 2 x i8> @llvm.vp.umin.nxv2i8(<vscale x 2 x i8>, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
86 define <vscale x 2 x i8> @vminu_vv_nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
87 ; CHECK-LABEL: vminu_vv_nxv2i8:
89 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
90 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
92 %v = call <vscale x 2 x i8> @llvm.vp.umin.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, <vscale x 2 x i1> %m, i32 %evl)
93 ret <vscale x 2 x i8> %v
96 define <vscale x 2 x i8> @vminu_vv_nxv2i8_unmasked(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, i32 zeroext %evl) {
97 ; CHECK-LABEL: vminu_vv_nxv2i8_unmasked:
99 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
100 ; CHECK-NEXT: vminu.vv v8, v8, v9
102 %v = call <vscale x 2 x i8> @llvm.vp.umin.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, <vscale x 2 x i1> splat (i1 true), i32 %evl)
103 ret <vscale x 2 x i8> %v
106 define <vscale x 2 x i8> @vminu_vx_nxv2i8(<vscale x 2 x i8> %va, i8 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
107 ; CHECK-LABEL: vminu_vx_nxv2i8:
109 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
110 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
112 %elt.head = insertelement <vscale x 2 x i8> poison, i8 %b, i32 0
113 %vb = shufflevector <vscale x 2 x i8> %elt.head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
114 %v = call <vscale x 2 x i8> @llvm.vp.umin.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb, <vscale x 2 x i1> %m, i32 %evl)
115 ret <vscale x 2 x i8> %v
118 define <vscale x 2 x i8> @vminu_vx_nxv2i8_unmasked(<vscale x 2 x i8> %va, i8 %b, i32 zeroext %evl) {
119 ; CHECK-LABEL: vminu_vx_nxv2i8_unmasked:
121 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
122 ; CHECK-NEXT: vminu.vx v8, v8, a0
124 %elt.head = insertelement <vscale x 2 x i8> poison, i8 %b, i32 0
125 %vb = shufflevector <vscale x 2 x i8> %elt.head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
126 %v = call <vscale x 2 x i8> @llvm.vp.umin.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb, <vscale x 2 x i1> splat (i1 true), i32 %evl)
127 ret <vscale x 2 x i8> %v
130 declare <vscale x 3 x i8> @llvm.vp.umin.nxv3i8(<vscale x 3 x i8>, <vscale x 3 x i8>, <vscale x 3 x i1>, i32)
132 define <vscale x 3 x i8> @vminu_vv_nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, <vscale x 3 x i1> %m, i32 zeroext %evl) {
133 ; CHECK-LABEL: vminu_vv_nxv3i8:
135 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
136 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
138 %v = call <vscale x 3 x i8> @llvm.vp.umin.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, <vscale x 3 x i1> %m, i32 %evl)
139 ret <vscale x 3 x i8> %v
142 define <vscale x 3 x i8> @vminu_vv_nxv3i8_unmasked(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, i32 zeroext %evl) {
143 ; CHECK-LABEL: vminu_vv_nxv3i8_unmasked:
145 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
146 ; CHECK-NEXT: vminu.vv v8, v8, v9
148 %v = call <vscale x 3 x i8> @llvm.vp.umin.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, <vscale x 3 x i1> splat (i1 true), i32 %evl)
149 ret <vscale x 3 x i8> %v
152 define <vscale x 3 x i8> @vminu_vx_nxv3i8(<vscale x 3 x i8> %va, i8 %b, <vscale x 3 x i1> %m, i32 zeroext %evl) {
153 ; CHECK-LABEL: vminu_vx_nxv3i8:
155 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
156 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
158 %elt.head = insertelement <vscale x 3 x i8> poison, i8 %b, i32 0
159 %vb = shufflevector <vscale x 3 x i8> %elt.head, <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer
160 %v = call <vscale x 3 x i8> @llvm.vp.umin.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %vb, <vscale x 3 x i1> %m, i32 %evl)
161 ret <vscale x 3 x i8> %v
164 define <vscale x 3 x i8> @vminu_vx_nxv3i8_unmasked(<vscale x 3 x i8> %va, i8 %b, i32 zeroext %evl) {
165 ; CHECK-LABEL: vminu_vx_nxv3i8_unmasked:
167 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
168 ; CHECK-NEXT: vminu.vx v8, v8, a0
170 %elt.head = insertelement <vscale x 3 x i8> poison, i8 %b, i32 0
171 %vb = shufflevector <vscale x 3 x i8> %elt.head, <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer
172 %v = call <vscale x 3 x i8> @llvm.vp.umin.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %vb, <vscale x 3 x i1> splat (i1 true), i32 %evl)
173 ret <vscale x 3 x i8> %v
176 declare <vscale x 4 x i8> @llvm.vp.umin.nxv4i8(<vscale x 4 x i8>, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
178 define <vscale x 4 x i8> @vminu_vv_nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
179 ; CHECK-LABEL: vminu_vv_nxv4i8:
181 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
182 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
184 %v = call <vscale x 4 x i8> @llvm.vp.umin.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, <vscale x 4 x i1> %m, i32 %evl)
185 ret <vscale x 4 x i8> %v
188 define <vscale x 4 x i8> @vminu_vv_nxv4i8_unmasked(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, i32 zeroext %evl) {
189 ; CHECK-LABEL: vminu_vv_nxv4i8_unmasked:
191 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
192 ; CHECK-NEXT: vminu.vv v8, v8, v9
194 %v = call <vscale x 4 x i8> @llvm.vp.umin.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, <vscale x 4 x i1> splat (i1 true), i32 %evl)
195 ret <vscale x 4 x i8> %v
198 define <vscale x 4 x i8> @vminu_vx_nxv4i8(<vscale x 4 x i8> %va, i8 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
199 ; CHECK-LABEL: vminu_vx_nxv4i8:
201 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
202 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
204 %elt.head = insertelement <vscale x 4 x i8> poison, i8 %b, i32 0
205 %vb = shufflevector <vscale x 4 x i8> %elt.head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
206 %v = call <vscale x 4 x i8> @llvm.vp.umin.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb, <vscale x 4 x i1> %m, i32 %evl)
207 ret <vscale x 4 x i8> %v
210 define <vscale x 4 x i8> @vminu_vx_nxv4i8_unmasked(<vscale x 4 x i8> %va, i8 %b, i32 zeroext %evl) {
211 ; CHECK-LABEL: vminu_vx_nxv4i8_unmasked:
213 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
214 ; CHECK-NEXT: vminu.vx v8, v8, a0
216 %elt.head = insertelement <vscale x 4 x i8> poison, i8 %b, i32 0
217 %vb = shufflevector <vscale x 4 x i8> %elt.head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
218 %v = call <vscale x 4 x i8> @llvm.vp.umin.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb, <vscale x 4 x i1> splat (i1 true), i32 %evl)
219 ret <vscale x 4 x i8> %v
222 declare <vscale x 8 x i8> @llvm.vp.umin.nxv8i8(<vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i1>, i32)
224 define <vscale x 8 x i8> @vminu_vv_nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
225 ; CHECK-LABEL: vminu_vv_nxv8i8:
227 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
228 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
230 %v = call <vscale x 8 x i8> @llvm.vp.umin.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, <vscale x 8 x i1> %m, i32 %evl)
231 ret <vscale x 8 x i8> %v
234 define <vscale x 8 x i8> @vminu_vv_nxv8i8_unmasked(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, i32 zeroext %evl) {
235 ; CHECK-LABEL: vminu_vv_nxv8i8_unmasked:
237 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
238 ; CHECK-NEXT: vminu.vv v8, v8, v9
240 %v = call <vscale x 8 x i8> @llvm.vp.umin.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, <vscale x 8 x i1> splat (i1 true), i32 %evl)
241 ret <vscale x 8 x i8> %v
244 define <vscale x 8 x i8> @vminu_vx_nxv8i8(<vscale x 8 x i8> %va, i8 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
245 ; CHECK-LABEL: vminu_vx_nxv8i8:
247 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
248 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
250 %elt.head = insertelement <vscale x 8 x i8> poison, i8 %b, i32 0
251 %vb = shufflevector <vscale x 8 x i8> %elt.head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
252 %v = call <vscale x 8 x i8> @llvm.vp.umin.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb, <vscale x 8 x i1> %m, i32 %evl)
253 ret <vscale x 8 x i8> %v
256 define <vscale x 8 x i8> @vminu_vx_nxv8i8_unmasked(<vscale x 8 x i8> %va, i8 %b, i32 zeroext %evl) {
257 ; CHECK-LABEL: vminu_vx_nxv8i8_unmasked:
259 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
260 ; CHECK-NEXT: vminu.vx v8, v8, a0
262 %elt.head = insertelement <vscale x 8 x i8> poison, i8 %b, i32 0
263 %vb = shufflevector <vscale x 8 x i8> %elt.head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
264 %v = call <vscale x 8 x i8> @llvm.vp.umin.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb, <vscale x 8 x i1> splat (i1 true), i32 %evl)
265 ret <vscale x 8 x i8> %v
268 declare <vscale x 16 x i8> @llvm.vp.umin.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i1>, i32)
270 define <vscale x 16 x i8> @vminu_vv_nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
271 ; CHECK-LABEL: vminu_vv_nxv16i8:
273 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
274 ; CHECK-NEXT: vminu.vv v8, v8, v10, v0.t
276 %v = call <vscale x 16 x i8> @llvm.vp.umin.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, <vscale x 16 x i1> %m, i32 %evl)
277 ret <vscale x 16 x i8> %v
280 define <vscale x 16 x i8> @vminu_vv_nxv16i8_unmasked(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, i32 zeroext %evl) {
281 ; CHECK-LABEL: vminu_vv_nxv16i8_unmasked:
283 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
284 ; CHECK-NEXT: vminu.vv v8, v8, v10
286 %v = call <vscale x 16 x i8> @llvm.vp.umin.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, <vscale x 16 x i1> splat (i1 true), i32 %evl)
287 ret <vscale x 16 x i8> %v
290 define <vscale x 16 x i8> @vminu_vx_nxv16i8(<vscale x 16 x i8> %va, i8 %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
291 ; CHECK-LABEL: vminu_vx_nxv16i8:
293 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
294 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
296 %elt.head = insertelement <vscale x 16 x i8> poison, i8 %b, i32 0
297 %vb = shufflevector <vscale x 16 x i8> %elt.head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
298 %v = call <vscale x 16 x i8> @llvm.vp.umin.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb, <vscale x 16 x i1> %m, i32 %evl)
299 ret <vscale x 16 x i8> %v
302 define <vscale x 16 x i8> @vminu_vx_nxv16i8_unmasked(<vscale x 16 x i8> %va, i8 %b, i32 zeroext %evl) {
303 ; CHECK-LABEL: vminu_vx_nxv16i8_unmasked:
305 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
306 ; CHECK-NEXT: vminu.vx v8, v8, a0
308 %elt.head = insertelement <vscale x 16 x i8> poison, i8 %b, i32 0
309 %vb = shufflevector <vscale x 16 x i8> %elt.head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
310 %v = call <vscale x 16 x i8> @llvm.vp.umin.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb, <vscale x 16 x i1> splat (i1 true), i32 %evl)
311 ret <vscale x 16 x i8> %v
314 declare <vscale x 32 x i8> @llvm.vp.umin.nxv32i8(<vscale x 32 x i8>, <vscale x 32 x i8>, <vscale x 32 x i1>, i32)
316 define <vscale x 32 x i8> @vminu_vv_nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
317 ; CHECK-LABEL: vminu_vv_nxv32i8:
319 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
320 ; CHECK-NEXT: vminu.vv v8, v8, v12, v0.t
322 %v = call <vscale x 32 x i8> @llvm.vp.umin.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, <vscale x 32 x i1> %m, i32 %evl)
323 ret <vscale x 32 x i8> %v
326 define <vscale x 32 x i8> @vminu_vv_nxv32i8_unmasked(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, i32 zeroext %evl) {
327 ; CHECK-LABEL: vminu_vv_nxv32i8_unmasked:
329 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
330 ; CHECK-NEXT: vminu.vv v8, v8, v12
332 %v = call <vscale x 32 x i8> @llvm.vp.umin.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, <vscale x 32 x i1> splat (i1 true), i32 %evl)
333 ret <vscale x 32 x i8> %v
336 define <vscale x 32 x i8> @vminu_vx_nxv32i8(<vscale x 32 x i8> %va, i8 %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
337 ; CHECK-LABEL: vminu_vx_nxv32i8:
339 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
340 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
342 %elt.head = insertelement <vscale x 32 x i8> poison, i8 %b, i32 0
343 %vb = shufflevector <vscale x 32 x i8> %elt.head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
344 %v = call <vscale x 32 x i8> @llvm.vp.umin.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb, <vscale x 32 x i1> %m, i32 %evl)
345 ret <vscale x 32 x i8> %v
348 define <vscale x 32 x i8> @vminu_vx_nxv32i8_unmasked(<vscale x 32 x i8> %va, i8 %b, i32 zeroext %evl) {
349 ; CHECK-LABEL: vminu_vx_nxv32i8_unmasked:
351 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
352 ; CHECK-NEXT: vminu.vx v8, v8, a0
354 %elt.head = insertelement <vscale x 32 x i8> poison, i8 %b, i32 0
355 %vb = shufflevector <vscale x 32 x i8> %elt.head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
356 %v = call <vscale x 32 x i8> @llvm.vp.umin.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb, <vscale x 32 x i1> splat (i1 true), i32 %evl)
357 ret <vscale x 32 x i8> %v
360 declare <vscale x 64 x i8> @llvm.vp.umin.nxv64i8(<vscale x 64 x i8>, <vscale x 64 x i8>, <vscale x 64 x i1>, i32)
362 define <vscale x 64 x i8> @vminu_vv_nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, <vscale x 64 x i1> %m, i32 zeroext %evl) {
363 ; CHECK-LABEL: vminu_vv_nxv64i8:
365 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
366 ; CHECK-NEXT: vminu.vv v8, v8, v16, v0.t
368 %v = call <vscale x 64 x i8> @llvm.vp.umin.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, <vscale x 64 x i1> %m, i32 %evl)
369 ret <vscale x 64 x i8> %v
372 define <vscale x 64 x i8> @vminu_vv_nxv64i8_unmasked(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, i32 zeroext %evl) {
373 ; CHECK-LABEL: vminu_vv_nxv64i8_unmasked:
375 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
376 ; CHECK-NEXT: vminu.vv v8, v8, v16
378 %v = call <vscale x 64 x i8> @llvm.vp.umin.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, <vscale x 64 x i1> splat (i1 true), i32 %evl)
379 ret <vscale x 64 x i8> %v
382 define <vscale x 64 x i8> @vminu_vx_nxv64i8(<vscale x 64 x i8> %va, i8 %b, <vscale x 64 x i1> %m, i32 zeroext %evl) {
383 ; CHECK-LABEL: vminu_vx_nxv64i8:
385 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
386 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
388 %elt.head = insertelement <vscale x 64 x i8> poison, i8 %b, i32 0
389 %vb = shufflevector <vscale x 64 x i8> %elt.head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
390 %v = call <vscale x 64 x i8> @llvm.vp.umin.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb, <vscale x 64 x i1> %m, i32 %evl)
391 ret <vscale x 64 x i8> %v
394 define <vscale x 64 x i8> @vminu_vx_nxv64i8_unmasked(<vscale x 64 x i8> %va, i8 %b, i32 zeroext %evl) {
395 ; CHECK-LABEL: vminu_vx_nxv64i8_unmasked:
397 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
398 ; CHECK-NEXT: vminu.vx v8, v8, a0
400 %elt.head = insertelement <vscale x 64 x i8> poison, i8 %b, i32 0
401 %vb = shufflevector <vscale x 64 x i8> %elt.head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
402 %v = call <vscale x 64 x i8> @llvm.vp.umin.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb, <vscale x 64 x i1> splat (i1 true), i32 %evl)
403 ret <vscale x 64 x i8> %v
406 ; Test that split-legalization works when the mask itself needs splitting.
408 declare <vscale x 128 x i8> @llvm.vp.umin.nxv128i8(<vscale x 128 x i8>, <vscale x 128 x i8>, <vscale x 128 x i1>, i32)
410 define <vscale x 128 x i8> @vminu_vx_nxv128i8(<vscale x 128 x i8> %va, i8 %b, <vscale x 128 x i1> %m, i32 zeroext %evl) {
411 ; CHECK-LABEL: vminu_vx_nxv128i8:
413 ; CHECK-NEXT: vmv1r.v v24, v0
414 ; CHECK-NEXT: vsetvli a3, zero, e8, m8, ta, ma
415 ; CHECK-NEXT: vlm.v v0, (a1)
416 ; CHECK-NEXT: csrr a1, vlenb
417 ; CHECK-NEXT: slli a1, a1, 3
418 ; CHECK-NEXT: sub a3, a2, a1
419 ; CHECK-NEXT: sltu a4, a2, a3
420 ; CHECK-NEXT: addi a4, a4, -1
421 ; CHECK-NEXT: and a3, a4, a3
422 ; CHECK-NEXT: vsetvli zero, a3, e8, m8, ta, ma
423 ; CHECK-NEXT: vminu.vx v16, v16, a0, v0.t
424 ; CHECK-NEXT: bltu a2, a1, .LBB34_2
425 ; CHECK-NEXT: # %bb.1:
426 ; CHECK-NEXT: mv a2, a1
427 ; CHECK-NEXT: .LBB34_2:
428 ; CHECK-NEXT: vmv1r.v v0, v24
429 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
430 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
432 %elt.head = insertelement <vscale x 128 x i8> poison, i8 %b, i32 0
433 %vb = shufflevector <vscale x 128 x i8> %elt.head, <vscale x 128 x i8> poison, <vscale x 128 x i32> zeroinitializer
434 %v = call <vscale x 128 x i8> @llvm.vp.umin.nxv128i8(<vscale x 128 x i8> %va, <vscale x 128 x i8> %vb, <vscale x 128 x i1> %m, i32 %evl)
435 ret <vscale x 128 x i8> %v
438 define <vscale x 128 x i8> @vminu_vx_nxv128i8_unmasked(<vscale x 128 x i8> %va, i8 %b, i32 zeroext %evl) {
439 ; CHECK-LABEL: vminu_vx_nxv128i8_unmasked:
441 ; CHECK-NEXT: csrr a2, vlenb
442 ; CHECK-NEXT: slli a2, a2, 3
443 ; CHECK-NEXT: sub a3, a1, a2
444 ; CHECK-NEXT: sltu a4, a1, a3
445 ; CHECK-NEXT: addi a4, a4, -1
446 ; CHECK-NEXT: and a3, a4, a3
447 ; CHECK-NEXT: vsetvli zero, a3, e8, m8, ta, ma
448 ; CHECK-NEXT: vminu.vx v16, v16, a0
449 ; CHECK-NEXT: bltu a1, a2, .LBB35_2
450 ; CHECK-NEXT: # %bb.1:
451 ; CHECK-NEXT: mv a1, a2
452 ; CHECK-NEXT: .LBB35_2:
453 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
454 ; CHECK-NEXT: vminu.vx v8, v8, a0
456 %elt.head = insertelement <vscale x 128 x i8> poison, i8 %b, i32 0
457 %vb = shufflevector <vscale x 128 x i8> %elt.head, <vscale x 128 x i8> poison, <vscale x 128 x i32> zeroinitializer
458 %v = call <vscale x 128 x i8> @llvm.vp.umin.nxv128i8(<vscale x 128 x i8> %va, <vscale x 128 x i8> %vb, <vscale x 128 x i1> splat (i1 true), i32 %evl)
459 ret <vscale x 128 x i8> %v
462 declare <vscale x 1 x i16> @llvm.vp.umin.nxv1i16(<vscale x 1 x i16>, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
464 define <vscale x 1 x i16> @vminu_vv_nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
465 ; CHECK-LABEL: vminu_vv_nxv1i16:
467 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
468 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
470 %v = call <vscale x 1 x i16> @llvm.vp.umin.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, <vscale x 1 x i1> %m, i32 %evl)
471 ret <vscale x 1 x i16> %v
474 define <vscale x 1 x i16> @vminu_vv_nxv1i16_unmasked(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, i32 zeroext %evl) {
475 ; CHECK-LABEL: vminu_vv_nxv1i16_unmasked:
477 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
478 ; CHECK-NEXT: vminu.vv v8, v8, v9
480 %v = call <vscale x 1 x i16> @llvm.vp.umin.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, <vscale x 1 x i1> splat (i1 true), i32 %evl)
481 ret <vscale x 1 x i16> %v
484 define <vscale x 1 x i16> @vminu_vx_nxv1i16(<vscale x 1 x i16> %va, i16 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
485 ; CHECK-LABEL: vminu_vx_nxv1i16:
487 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
488 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
490 %elt.head = insertelement <vscale x 1 x i16> poison, i16 %b, i32 0
491 %vb = shufflevector <vscale x 1 x i16> %elt.head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
492 %v = call <vscale x 1 x i16> @llvm.vp.umin.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb, <vscale x 1 x i1> %m, i32 %evl)
493 ret <vscale x 1 x i16> %v
496 define <vscale x 1 x i16> @vminu_vx_nxv1i16_unmasked(<vscale x 1 x i16> %va, i16 %b, i32 zeroext %evl) {
497 ; CHECK-LABEL: vminu_vx_nxv1i16_unmasked:
499 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
500 ; CHECK-NEXT: vminu.vx v8, v8, a0
502 %elt.head = insertelement <vscale x 1 x i16> poison, i16 %b, i32 0
503 %vb = shufflevector <vscale x 1 x i16> %elt.head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
504 %v = call <vscale x 1 x i16> @llvm.vp.umin.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb, <vscale x 1 x i1> splat (i1 true), i32 %evl)
505 ret <vscale x 1 x i16> %v
508 declare <vscale x 2 x i16> @llvm.vp.umin.nxv2i16(<vscale x 2 x i16>, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
510 define <vscale x 2 x i16> @vminu_vv_nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
511 ; CHECK-LABEL: vminu_vv_nxv2i16:
513 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
514 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
516 %v = call <vscale x 2 x i16> @llvm.vp.umin.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, <vscale x 2 x i1> %m, i32 %evl)
517 ret <vscale x 2 x i16> %v
520 define <vscale x 2 x i16> @vminu_vv_nxv2i16_unmasked(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, i32 zeroext %evl) {
521 ; CHECK-LABEL: vminu_vv_nxv2i16_unmasked:
523 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
524 ; CHECK-NEXT: vminu.vv v8, v8, v9
526 %v = call <vscale x 2 x i16> @llvm.vp.umin.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, <vscale x 2 x i1> splat (i1 true), i32 %evl)
527 ret <vscale x 2 x i16> %v
530 define <vscale x 2 x i16> @vminu_vx_nxv2i16(<vscale x 2 x i16> %va, i16 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
531 ; CHECK-LABEL: vminu_vx_nxv2i16:
533 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
534 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
536 %elt.head = insertelement <vscale x 2 x i16> poison, i16 %b, i32 0
537 %vb = shufflevector <vscale x 2 x i16> %elt.head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
538 %v = call <vscale x 2 x i16> @llvm.vp.umin.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb, <vscale x 2 x i1> %m, i32 %evl)
539 ret <vscale x 2 x i16> %v
542 define <vscale x 2 x i16> @vminu_vx_nxv2i16_unmasked(<vscale x 2 x i16> %va, i16 %b, i32 zeroext %evl) {
543 ; CHECK-LABEL: vminu_vx_nxv2i16_unmasked:
545 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
546 ; CHECK-NEXT: vminu.vx v8, v8, a0
548 %elt.head = insertelement <vscale x 2 x i16> poison, i16 %b, i32 0
549 %vb = shufflevector <vscale x 2 x i16> %elt.head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
550 %v = call <vscale x 2 x i16> @llvm.vp.umin.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb, <vscale x 2 x i1> splat (i1 true), i32 %evl)
551 ret <vscale x 2 x i16> %v
554 declare <vscale x 4 x i16> @llvm.vp.umin.nxv4i16(<vscale x 4 x i16>, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
556 define <vscale x 4 x i16> @vminu_vv_nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
557 ; CHECK-LABEL: vminu_vv_nxv4i16:
559 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
560 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
562 %v = call <vscale x 4 x i16> @llvm.vp.umin.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, <vscale x 4 x i1> %m, i32 %evl)
563 ret <vscale x 4 x i16> %v
566 define <vscale x 4 x i16> @vminu_vv_nxv4i16_unmasked(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, i32 zeroext %evl) {
567 ; CHECK-LABEL: vminu_vv_nxv4i16_unmasked:
569 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
570 ; CHECK-NEXT: vminu.vv v8, v8, v9
572 %v = call <vscale x 4 x i16> @llvm.vp.umin.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, <vscale x 4 x i1> splat (i1 true), i32 %evl)
573 ret <vscale x 4 x i16> %v
576 define <vscale x 4 x i16> @vminu_vx_nxv4i16(<vscale x 4 x i16> %va, i16 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
577 ; CHECK-LABEL: vminu_vx_nxv4i16:
579 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
580 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
582 %elt.head = insertelement <vscale x 4 x i16> poison, i16 %b, i32 0
583 %vb = shufflevector <vscale x 4 x i16> %elt.head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
584 %v = call <vscale x 4 x i16> @llvm.vp.umin.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb, <vscale x 4 x i1> %m, i32 %evl)
585 ret <vscale x 4 x i16> %v
588 define <vscale x 4 x i16> @vminu_vx_nxv4i16_unmasked(<vscale x 4 x i16> %va, i16 %b, i32 zeroext %evl) {
589 ; CHECK-LABEL: vminu_vx_nxv4i16_unmasked:
591 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
592 ; CHECK-NEXT: vminu.vx v8, v8, a0
594 %elt.head = insertelement <vscale x 4 x i16> poison, i16 %b, i32 0
595 %vb = shufflevector <vscale x 4 x i16> %elt.head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
596 %v = call <vscale x 4 x i16> @llvm.vp.umin.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb, <vscale x 4 x i1> splat (i1 true), i32 %evl)
597 ret <vscale x 4 x i16> %v
600 declare <vscale x 8 x i16> @llvm.vp.umin.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i1>, i32)
602 define <vscale x 8 x i16> @vminu_vv_nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
603 ; CHECK-LABEL: vminu_vv_nxv8i16:
605 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
606 ; CHECK-NEXT: vminu.vv v8, v8, v10, v0.t
608 %v = call <vscale x 8 x i16> @llvm.vp.umin.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, <vscale x 8 x i1> %m, i32 %evl)
609 ret <vscale x 8 x i16> %v
612 define <vscale x 8 x i16> @vminu_vv_nxv8i16_unmasked(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, i32 zeroext %evl) {
613 ; CHECK-LABEL: vminu_vv_nxv8i16_unmasked:
615 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
616 ; CHECK-NEXT: vminu.vv v8, v8, v10
618 %v = call <vscale x 8 x i16> @llvm.vp.umin.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, <vscale x 8 x i1> splat (i1 true), i32 %evl)
619 ret <vscale x 8 x i16> %v
622 define <vscale x 8 x i16> @vminu_vx_nxv8i16(<vscale x 8 x i16> %va, i16 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
623 ; CHECK-LABEL: vminu_vx_nxv8i16:
625 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
626 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
628 %elt.head = insertelement <vscale x 8 x i16> poison, i16 %b, i32 0
629 %vb = shufflevector <vscale x 8 x i16> %elt.head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
630 %v = call <vscale x 8 x i16> @llvm.vp.umin.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb, <vscale x 8 x i1> %m, i32 %evl)
631 ret <vscale x 8 x i16> %v
634 define <vscale x 8 x i16> @vminu_vx_nxv8i16_unmasked(<vscale x 8 x i16> %va, i16 %b, i32 zeroext %evl) {
635 ; CHECK-LABEL: vminu_vx_nxv8i16_unmasked:
637 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
638 ; CHECK-NEXT: vminu.vx v8, v8, a0
640 %elt.head = insertelement <vscale x 8 x i16> poison, i16 %b, i32 0
641 %vb = shufflevector <vscale x 8 x i16> %elt.head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
642 %v = call <vscale x 8 x i16> @llvm.vp.umin.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb, <vscale x 8 x i1> splat (i1 true), i32 %evl)
643 ret <vscale x 8 x i16> %v
646 declare <vscale x 16 x i16> @llvm.vp.umin.nxv16i16(<vscale x 16 x i16>, <vscale x 16 x i16>, <vscale x 16 x i1>, i32)
648 define <vscale x 16 x i16> @vminu_vv_nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
649 ; CHECK-LABEL: vminu_vv_nxv16i16:
651 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
652 ; CHECK-NEXT: vminu.vv v8, v8, v12, v0.t
654 %v = call <vscale x 16 x i16> @llvm.vp.umin.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, <vscale x 16 x i1> %m, i32 %evl)
655 ret <vscale x 16 x i16> %v
658 define <vscale x 16 x i16> @vminu_vv_nxv16i16_unmasked(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, i32 zeroext %evl) {
659 ; CHECK-LABEL: vminu_vv_nxv16i16_unmasked:
661 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
662 ; CHECK-NEXT: vminu.vv v8, v8, v12
664 %v = call <vscale x 16 x i16> @llvm.vp.umin.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, <vscale x 16 x i1> splat (i1 true), i32 %evl)
665 ret <vscale x 16 x i16> %v
668 define <vscale x 16 x i16> @vminu_vx_nxv16i16(<vscale x 16 x i16> %va, i16 %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
669 ; CHECK-LABEL: vminu_vx_nxv16i16:
671 ; CHECK-NEXT: vsetvli zero, a1, e16, m4, ta, ma
672 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
674 %elt.head = insertelement <vscale x 16 x i16> poison, i16 %b, i32 0
675 %vb = shufflevector <vscale x 16 x i16> %elt.head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
676 %v = call <vscale x 16 x i16> @llvm.vp.umin.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb, <vscale x 16 x i1> %m, i32 %evl)
677 ret <vscale x 16 x i16> %v
680 define <vscale x 16 x i16> @vminu_vx_nxv16i16_unmasked(<vscale x 16 x i16> %va, i16 %b, i32 zeroext %evl) {
681 ; CHECK-LABEL: vminu_vx_nxv16i16_unmasked:
683 ; CHECK-NEXT: vsetvli zero, a1, e16, m4, ta, ma
684 ; CHECK-NEXT: vminu.vx v8, v8, a0
686 %elt.head = insertelement <vscale x 16 x i16> poison, i16 %b, i32 0
687 %vb = shufflevector <vscale x 16 x i16> %elt.head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
688 %v = call <vscale x 16 x i16> @llvm.vp.umin.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb, <vscale x 16 x i1> splat (i1 true), i32 %evl)
689 ret <vscale x 16 x i16> %v
692 declare <vscale x 32 x i16> @llvm.vp.umin.nxv32i16(<vscale x 32 x i16>, <vscale x 32 x i16>, <vscale x 32 x i1>, i32)
694 define <vscale x 32 x i16> @vminu_vv_nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
695 ; CHECK-LABEL: vminu_vv_nxv32i16:
697 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
698 ; CHECK-NEXT: vminu.vv v8, v8, v16, v0.t
700 %v = call <vscale x 32 x i16> @llvm.vp.umin.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, <vscale x 32 x i1> %m, i32 %evl)
701 ret <vscale x 32 x i16> %v
704 define <vscale x 32 x i16> @vminu_vv_nxv32i16_unmasked(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, i32 zeroext %evl) {
705 ; CHECK-LABEL: vminu_vv_nxv32i16_unmasked:
707 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
708 ; CHECK-NEXT: vminu.vv v8, v8, v16
710 %v = call <vscale x 32 x i16> @llvm.vp.umin.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, <vscale x 32 x i1> splat (i1 true), i32 %evl)
711 ret <vscale x 32 x i16> %v
714 define <vscale x 32 x i16> @vminu_vx_nxv32i16(<vscale x 32 x i16> %va, i16 %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
715 ; CHECK-LABEL: vminu_vx_nxv32i16:
717 ; CHECK-NEXT: vsetvli zero, a1, e16, m8, ta, ma
718 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
720 %elt.head = insertelement <vscale x 32 x i16> poison, i16 %b, i32 0
721 %vb = shufflevector <vscale x 32 x i16> %elt.head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
722 %v = call <vscale x 32 x i16> @llvm.vp.umin.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb, <vscale x 32 x i1> %m, i32 %evl)
723 ret <vscale x 32 x i16> %v
726 define <vscale x 32 x i16> @vminu_vx_nxv32i16_unmasked(<vscale x 32 x i16> %va, i16 %b, i32 zeroext %evl) {
727 ; CHECK-LABEL: vminu_vx_nxv32i16_unmasked:
729 ; CHECK-NEXT: vsetvli zero, a1, e16, m8, ta, ma
730 ; CHECK-NEXT: vminu.vx v8, v8, a0
732 %elt.head = insertelement <vscale x 32 x i16> poison, i16 %b, i32 0
733 %vb = shufflevector <vscale x 32 x i16> %elt.head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
734 %v = call <vscale x 32 x i16> @llvm.vp.umin.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb, <vscale x 32 x i1> splat (i1 true), i32 %evl)
735 ret <vscale x 32 x i16> %v
738 declare <vscale x 1 x i32> @llvm.vp.umin.nxv1i32(<vscale x 1 x i32>, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
740 define <vscale x 1 x i32> @vminu_vv_nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
741 ; CHECK-LABEL: vminu_vv_nxv1i32:
743 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
744 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
746 %v = call <vscale x 1 x i32> @llvm.vp.umin.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, <vscale x 1 x i1> %m, i32 %evl)
747 ret <vscale x 1 x i32> %v
750 define <vscale x 1 x i32> @vminu_vv_nxv1i32_unmasked(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, i32 zeroext %evl) {
751 ; CHECK-LABEL: vminu_vv_nxv1i32_unmasked:
753 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
754 ; CHECK-NEXT: vminu.vv v8, v8, v9
756 %v = call <vscale x 1 x i32> @llvm.vp.umin.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, <vscale x 1 x i1> splat (i1 true), i32 %evl)
757 ret <vscale x 1 x i32> %v
760 define <vscale x 1 x i32> @vminu_vx_nxv1i32(<vscale x 1 x i32> %va, i32 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
761 ; CHECK-LABEL: vminu_vx_nxv1i32:
763 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
764 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
766 %elt.head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
767 %vb = shufflevector <vscale x 1 x i32> %elt.head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
768 %v = call <vscale x 1 x i32> @llvm.vp.umin.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb, <vscale x 1 x i1> %m, i32 %evl)
769 ret <vscale x 1 x i32> %v
772 define <vscale x 1 x i32> @vminu_vx_nxv1i32_unmasked(<vscale x 1 x i32> %va, i32 %b, i32 zeroext %evl) {
773 ; CHECK-LABEL: vminu_vx_nxv1i32_unmasked:
775 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
776 ; CHECK-NEXT: vminu.vx v8, v8, a0
778 %elt.head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
779 %vb = shufflevector <vscale x 1 x i32> %elt.head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
780 %v = call <vscale x 1 x i32> @llvm.vp.umin.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb, <vscale x 1 x i1> splat (i1 true), i32 %evl)
781 ret <vscale x 1 x i32> %v
784 declare <vscale x 2 x i32> @llvm.vp.umin.nxv2i32(<vscale x 2 x i32>, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
786 define <vscale x 2 x i32> @vminu_vv_nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
787 ; CHECK-LABEL: vminu_vv_nxv2i32:
789 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
790 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
792 %v = call <vscale x 2 x i32> @llvm.vp.umin.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, <vscale x 2 x i1> %m, i32 %evl)
793 ret <vscale x 2 x i32> %v
796 define <vscale x 2 x i32> @vminu_vv_nxv2i32_unmasked(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, i32 zeroext %evl) {
797 ; CHECK-LABEL: vminu_vv_nxv2i32_unmasked:
799 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
800 ; CHECK-NEXT: vminu.vv v8, v8, v9
802 %v = call <vscale x 2 x i32> @llvm.vp.umin.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, <vscale x 2 x i1> splat (i1 true), i32 %evl)
803 ret <vscale x 2 x i32> %v
806 define <vscale x 2 x i32> @vminu_vx_nxv2i32(<vscale x 2 x i32> %va, i32 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
807 ; CHECK-LABEL: vminu_vx_nxv2i32:
809 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
810 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
812 %elt.head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
813 %vb = shufflevector <vscale x 2 x i32> %elt.head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
814 %v = call <vscale x 2 x i32> @llvm.vp.umin.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb, <vscale x 2 x i1> %m, i32 %evl)
815 ret <vscale x 2 x i32> %v
818 define <vscale x 2 x i32> @vminu_vx_nxv2i32_unmasked(<vscale x 2 x i32> %va, i32 %b, i32 zeroext %evl) {
819 ; CHECK-LABEL: vminu_vx_nxv2i32_unmasked:
821 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
822 ; CHECK-NEXT: vminu.vx v8, v8, a0
824 %elt.head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
825 %vb = shufflevector <vscale x 2 x i32> %elt.head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
826 %v = call <vscale x 2 x i32> @llvm.vp.umin.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb, <vscale x 2 x i1> splat (i1 true), i32 %evl)
827 ret <vscale x 2 x i32> %v
830 declare <vscale x 4 x i32> @llvm.vp.umin.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
832 define <vscale x 4 x i32> @vminu_vv_nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
833 ; CHECK-LABEL: vminu_vv_nxv4i32:
835 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
836 ; CHECK-NEXT: vminu.vv v8, v8, v10, v0.t
838 %v = call <vscale x 4 x i32> @llvm.vp.umin.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, <vscale x 4 x i1> %m, i32 %evl)
839 ret <vscale x 4 x i32> %v
842 define <vscale x 4 x i32> @vminu_vv_nxv4i32_unmasked(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, i32 zeroext %evl) {
843 ; CHECK-LABEL: vminu_vv_nxv4i32_unmasked:
845 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
846 ; CHECK-NEXT: vminu.vv v8, v8, v10
848 %v = call <vscale x 4 x i32> @llvm.vp.umin.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, <vscale x 4 x i1> splat (i1 true), i32 %evl)
849 ret <vscale x 4 x i32> %v
852 define <vscale x 4 x i32> @vminu_vx_nxv4i32(<vscale x 4 x i32> %va, i32 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
853 ; CHECK-LABEL: vminu_vx_nxv4i32:
855 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
856 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
858 %elt.head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
859 %vb = shufflevector <vscale x 4 x i32> %elt.head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
860 %v = call <vscale x 4 x i32> @llvm.vp.umin.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb, <vscale x 4 x i1> %m, i32 %evl)
861 ret <vscale x 4 x i32> %v
864 define <vscale x 4 x i32> @vminu_vx_nxv4i32_unmasked(<vscale x 4 x i32> %va, i32 %b, i32 zeroext %evl) {
865 ; CHECK-LABEL: vminu_vx_nxv4i32_unmasked:
867 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
868 ; CHECK-NEXT: vminu.vx v8, v8, a0
870 %elt.head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
871 %vb = shufflevector <vscale x 4 x i32> %elt.head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
872 %v = call <vscale x 4 x i32> @llvm.vp.umin.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb, <vscale x 4 x i1> splat (i1 true), i32 %evl)
873 ret <vscale x 4 x i32> %v
876 declare <vscale x 8 x i32> @llvm.vp.umin.nxv8i32(<vscale x 8 x i32>, <vscale x 8 x i32>, <vscale x 8 x i1>, i32)
878 define <vscale x 8 x i32> @vminu_vv_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
879 ; CHECK-LABEL: vminu_vv_nxv8i32:
881 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
882 ; CHECK-NEXT: vminu.vv v8, v8, v12, v0.t
884 %v = call <vscale x 8 x i32> @llvm.vp.umin.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, <vscale x 8 x i1> %m, i32 %evl)
885 ret <vscale x 8 x i32> %v
888 define <vscale x 8 x i32> @vminu_vv_nxv8i32_unmasked(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, i32 zeroext %evl) {
889 ; CHECK-LABEL: vminu_vv_nxv8i32_unmasked:
891 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
892 ; CHECK-NEXT: vminu.vv v8, v8, v12
894 %v = call <vscale x 8 x i32> @llvm.vp.umin.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, <vscale x 8 x i1> splat (i1 true), i32 %evl)
895 ret <vscale x 8 x i32> %v
898 define <vscale x 8 x i32> @vminu_vx_nxv8i32(<vscale x 8 x i32> %va, i32 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
899 ; CHECK-LABEL: vminu_vx_nxv8i32:
901 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
902 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
904 %elt.head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
905 %vb = shufflevector <vscale x 8 x i32> %elt.head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
906 %v = call <vscale x 8 x i32> @llvm.vp.umin.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, <vscale x 8 x i1> %m, i32 %evl)
907 ret <vscale x 8 x i32> %v
910 define <vscale x 8 x i32> @vminu_vx_nxv8i32_unmasked(<vscale x 8 x i32> %va, i32 %b, i32 zeroext %evl) {
911 ; CHECK-LABEL: vminu_vx_nxv8i32_unmasked:
913 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
914 ; CHECK-NEXT: vminu.vx v8, v8, a0
916 %elt.head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
917 %vb = shufflevector <vscale x 8 x i32> %elt.head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
918 %v = call <vscale x 8 x i32> @llvm.vp.umin.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, <vscale x 8 x i1> splat (i1 true), i32 %evl)
919 ret <vscale x 8 x i32> %v
922 declare <vscale x 16 x i32> @llvm.vp.umin.nxv16i32(<vscale x 16 x i32>, <vscale x 16 x i32>, <vscale x 16 x i1>, i32)
924 define <vscale x 16 x i32> @vminu_vv_nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
925 ; CHECK-LABEL: vminu_vv_nxv16i32:
927 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
928 ; CHECK-NEXT: vminu.vv v8, v8, v16, v0.t
930 %v = call <vscale x 16 x i32> @llvm.vp.umin.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, <vscale x 16 x i1> %m, i32 %evl)
931 ret <vscale x 16 x i32> %v
934 define <vscale x 16 x i32> @vminu_vv_nxv16i32_unmasked(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, i32 zeroext %evl) {
935 ; CHECK-LABEL: vminu_vv_nxv16i32_unmasked:
937 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
938 ; CHECK-NEXT: vminu.vv v8, v8, v16
940 %v = call <vscale x 16 x i32> @llvm.vp.umin.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, <vscale x 16 x i1> splat (i1 true), i32 %evl)
941 ret <vscale x 16 x i32> %v
944 define <vscale x 16 x i32> @vminu_vx_nxv16i32(<vscale x 16 x i32> %va, i32 %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
945 ; CHECK-LABEL: vminu_vx_nxv16i32:
947 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
948 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
950 %elt.head = insertelement <vscale x 16 x i32> poison, i32 %b, i32 0
951 %vb = shufflevector <vscale x 16 x i32> %elt.head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
952 %v = call <vscale x 16 x i32> @llvm.vp.umin.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb, <vscale x 16 x i1> %m, i32 %evl)
953 ret <vscale x 16 x i32> %v
956 define <vscale x 16 x i32> @vminu_vx_nxv16i32_unmasked(<vscale x 16 x i32> %va, i32 %b, i32 zeroext %evl) {
957 ; CHECK-LABEL: vminu_vx_nxv16i32_unmasked:
959 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
960 ; CHECK-NEXT: vminu.vx v8, v8, a0
962 %elt.head = insertelement <vscale x 16 x i32> poison, i32 %b, i32 0
963 %vb = shufflevector <vscale x 16 x i32> %elt.head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
964 %v = call <vscale x 16 x i32> @llvm.vp.umin.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb, <vscale x 16 x i1> splat (i1 true), i32 %evl)
965 ret <vscale x 16 x i32> %v
968 ; Test that split-legalization works then the mask needs manual splitting.
970 declare <vscale x 32 x i32> @llvm.vp.umin.nxv32i32(<vscale x 32 x i32>, <vscale x 32 x i32>, <vscale x 32 x i1>, i32)
972 define <vscale x 32 x i32> @vminu_vx_nxv32i32(<vscale x 32 x i32> %va, i32 %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
973 ; CHECK-LABEL: vminu_vx_nxv32i32:
975 ; CHECK-NEXT: vmv1r.v v24, v0
976 ; CHECK-NEXT: csrr a2, vlenb
977 ; CHECK-NEXT: srli a3, a2, 2
978 ; CHECK-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
979 ; CHECK-NEXT: vslidedown.vx v0, v0, a3
980 ; CHECK-NEXT: slli a2, a2, 1
981 ; CHECK-NEXT: sub a3, a1, a2
982 ; CHECK-NEXT: sltu a4, a1, a3
983 ; CHECK-NEXT: addi a4, a4, -1
984 ; CHECK-NEXT: and a3, a4, a3
985 ; CHECK-NEXT: vsetvli zero, a3, e32, m8, ta, ma
986 ; CHECK-NEXT: vminu.vx v16, v16, a0, v0.t
987 ; CHECK-NEXT: bltu a1, a2, .LBB80_2
988 ; CHECK-NEXT: # %bb.1:
989 ; CHECK-NEXT: mv a1, a2
990 ; CHECK-NEXT: .LBB80_2:
991 ; CHECK-NEXT: vmv1r.v v0, v24
992 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
993 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
995 %elt.head = insertelement <vscale x 32 x i32> poison, i32 %b, i32 0
996 %vb = shufflevector <vscale x 32 x i32> %elt.head, <vscale x 32 x i32> poison, <vscale x 32 x i32> zeroinitializer
997 %v = call <vscale x 32 x i32> @llvm.vp.umin.nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i32> %vb, <vscale x 32 x i1> %m, i32 %evl)
998 ret <vscale x 32 x i32> %v
1001 define <vscale x 32 x i32> @vminu_vx_nxv32i32_unmasked(<vscale x 32 x i32> %va, i32 %b, i32 zeroext %evl) {
1002 ; CHECK-LABEL: vminu_vx_nxv32i32_unmasked:
1004 ; CHECK-NEXT: csrr a2, vlenb
1005 ; CHECK-NEXT: slli a2, a2, 1
1006 ; CHECK-NEXT: sub a3, a1, a2
1007 ; CHECK-NEXT: sltu a4, a1, a3
1008 ; CHECK-NEXT: addi a4, a4, -1
1009 ; CHECK-NEXT: and a3, a4, a3
1010 ; CHECK-NEXT: vsetvli zero, a3, e32, m8, ta, ma
1011 ; CHECK-NEXT: vminu.vx v16, v16, a0
1012 ; CHECK-NEXT: bltu a1, a2, .LBB81_2
1013 ; CHECK-NEXT: # %bb.1:
1014 ; CHECK-NEXT: mv a1, a2
1015 ; CHECK-NEXT: .LBB81_2:
1016 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1017 ; CHECK-NEXT: vminu.vx v8, v8, a0
1019 %elt.head = insertelement <vscale x 32 x i32> poison, i32 %b, i32 0
1020 %vb = shufflevector <vscale x 32 x i32> %elt.head, <vscale x 32 x i32> poison, <vscale x 32 x i32> zeroinitializer
1021 %v = call <vscale x 32 x i32> @llvm.vp.umin.nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i32> %vb, <vscale x 32 x i1> splat (i1 true), i32 %evl)
1022 ret <vscale x 32 x i32> %v
1025 ; Test splitting when the %evl is a constant (albeit an unknown one).
1027 declare i32 @llvm.vscale.i32()
1029 ; FIXME: The upper half of the operation is doing nothing.
1030 ; FIXME: The branches comparing vscale vs. vscale should be constant-foldable.
1032 define <vscale x 32 x i32> @vminu_vx_nxv32i32_evl_nx8(<vscale x 32 x i32> %va, i32 %b, <vscale x 32 x i1> %m) {
1033 ; CHECK-LABEL: vminu_vx_nxv32i32_evl_nx8:
1035 ; CHECK-NEXT: vmv1r.v v24, v0
1036 ; CHECK-NEXT: csrr a1, vlenb
1037 ; CHECK-NEXT: srli a2, a1, 2
1038 ; CHECK-NEXT: vsetvli a3, zero, e8, mf2, ta, ma
1039 ; CHECK-NEXT: vslidedown.vx v0, v0, a2
1040 ; CHECK-NEXT: slli a2, a1, 1
1041 ; CHECK-NEXT: sub a3, a1, a2
1042 ; CHECK-NEXT: sltu a4, a1, a3
1043 ; CHECK-NEXT: addi a4, a4, -1
1044 ; CHECK-NEXT: and a3, a4, a3
1045 ; CHECK-NEXT: vsetvli zero, a3, e32, m8, ta, ma
1046 ; CHECK-NEXT: vminu.vx v16, v16, a0, v0.t
1047 ; CHECK-NEXT: bltu a1, a2, .LBB82_2
1048 ; CHECK-NEXT: # %bb.1:
1049 ; CHECK-NEXT: mv a1, a2
1050 ; CHECK-NEXT: .LBB82_2:
1051 ; CHECK-NEXT: vmv1r.v v0, v24
1052 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1053 ; CHECK-NEXT: vminu.vx v8, v8, a0, v0.t
1055 %elt.head = insertelement <vscale x 32 x i32> poison, i32 %b, i32 0
1056 %vb = shufflevector <vscale x 32 x i32> %elt.head, <vscale x 32 x i32> poison, <vscale x 32 x i32> zeroinitializer
1057 %evl = call i32 @llvm.vscale.i32()
1058 %evl0 = mul i32 %evl, 8
1059 %v = call <vscale x 32 x i32> @llvm.vp.umin.nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i32> %vb, <vscale x 32 x i1> %m, i32 %evl0)
1060 ret <vscale x 32 x i32> %v
1063 ; FIXME: The first vminu.vx should be able to infer that its AVL is equivalent to VLMAX.
1064 ; FIXME: The upper half of the operation is doing nothing but we don't catch
1065 ; that on RV64; we issue a usubsat(and (vscale x 16), 0xffffffff, vscale x 16)
1066 ; (the "original" %evl is the "and", due to known-bits issues with legalizing
1067 ; the i32 %evl to i64) and this isn't detected as 0.
1068 ; This could be resolved in the future with more detailed KnownBits analysis
1071 define <vscale x 32 x i32> @vminu_vx_nxv32i32_evl_nx16(<vscale x 32 x i32> %va, i32 %b, <vscale x 32 x i1> %m) {
1072 ; RV32-LABEL: vminu_vx_nxv32i32_evl_nx16:
1074 ; RV32-NEXT: csrr a1, vlenb
1075 ; RV32-NEXT: slli a1, a1, 1
1076 ; RV32-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1077 ; RV32-NEXT: vminu.vx v8, v8, a0, v0.t
1080 ; RV64-LABEL: vminu_vx_nxv32i32_evl_nx16:
1082 ; RV64-NEXT: csrr a1, vlenb
1083 ; RV64-NEXT: srli a2, a1, 2
1084 ; RV64-NEXT: vsetvli a3, zero, e8, mf2, ta, ma
1085 ; RV64-NEXT: vslidedown.vx v24, v0, a2
1086 ; RV64-NEXT: slli a1, a1, 1
1087 ; RV64-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1088 ; RV64-NEXT: vminu.vx v8, v8, a0, v0.t
1089 ; RV64-NEXT: vmv1r.v v0, v24
1090 ; RV64-NEXT: vsetivli zero, 0, e32, m8, ta, ma
1091 ; RV64-NEXT: vminu.vx v16, v16, a0, v0.t
1093 %elt.head = insertelement <vscale x 32 x i32> poison, i32 %b, i32 0
1094 %vb = shufflevector <vscale x 32 x i32> %elt.head, <vscale x 32 x i32> poison, <vscale x 32 x i32> zeroinitializer
1095 %evl = call i32 @llvm.vscale.i32()
1096 %evl0 = mul i32 %evl, 16
1097 %v = call <vscale x 32 x i32> @llvm.vp.umin.nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i32> %vb, <vscale x 32 x i1> %m, i32 %evl0)
1098 ret <vscale x 32 x i32> %v
1101 declare <vscale x 1 x i64> @llvm.vp.umin.nxv1i64(<vscale x 1 x i64>, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1103 define <vscale x 1 x i64> @vminu_vv_nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1104 ; CHECK-LABEL: vminu_vv_nxv1i64:
1106 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1107 ; CHECK-NEXT: vminu.vv v8, v8, v9, v0.t
1109 %v = call <vscale x 1 x i64> @llvm.vp.umin.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, <vscale x 1 x i1> %m, i32 %evl)
1110 ret <vscale x 1 x i64> %v
1113 define <vscale x 1 x i64> @vminu_vv_nxv1i64_unmasked(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, i32 zeroext %evl) {
1114 ; CHECK-LABEL: vminu_vv_nxv1i64_unmasked:
1116 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1117 ; CHECK-NEXT: vminu.vv v8, v8, v9
1119 %v = call <vscale x 1 x i64> @llvm.vp.umin.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, <vscale x 1 x i1> splat (i1 true), i32 %evl)
1120 ret <vscale x 1 x i64> %v
1123 define <vscale x 1 x i64> @vminu_vx_nxv1i64(<vscale x 1 x i64> %va, i64 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1124 ; RV32-LABEL: vminu_vx_nxv1i64:
1126 ; RV32-NEXT: addi sp, sp, -16
1127 ; RV32-NEXT: .cfi_def_cfa_offset 16
1128 ; RV32-NEXT: sw a1, 12(sp)
1129 ; RV32-NEXT: sw a0, 8(sp)
1130 ; RV32-NEXT: addi a0, sp, 8
1131 ; RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1132 ; RV32-NEXT: vlse64.v v9, (a0), zero
1133 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1134 ; RV32-NEXT: vminu.vv v8, v8, v9, v0.t
1135 ; RV32-NEXT: addi sp, sp, 16
1138 ; RV64-LABEL: vminu_vx_nxv1i64:
1140 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1141 ; RV64-NEXT: vminu.vx v8, v8, a0, v0.t
1143 %elt.head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
1144 %vb = shufflevector <vscale x 1 x i64> %elt.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
1145 %v = call <vscale x 1 x i64> @llvm.vp.umin.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb, <vscale x 1 x i1> %m, i32 %evl)
1146 ret <vscale x 1 x i64> %v
1149 define <vscale x 1 x i64> @vminu_vx_nxv1i64_unmasked(<vscale x 1 x i64> %va, i64 %b, i32 zeroext %evl) {
1150 ; RV32-LABEL: vminu_vx_nxv1i64_unmasked:
1152 ; RV32-NEXT: addi sp, sp, -16
1153 ; RV32-NEXT: .cfi_def_cfa_offset 16
1154 ; RV32-NEXT: sw a1, 12(sp)
1155 ; RV32-NEXT: sw a0, 8(sp)
1156 ; RV32-NEXT: addi a0, sp, 8
1157 ; RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1158 ; RV32-NEXT: vlse64.v v9, (a0), zero
1159 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1160 ; RV32-NEXT: vminu.vv v8, v8, v9
1161 ; RV32-NEXT: addi sp, sp, 16
1164 ; RV64-LABEL: vminu_vx_nxv1i64_unmasked:
1166 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1167 ; RV64-NEXT: vminu.vx v8, v8, a0
1169 %elt.head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
1170 %vb = shufflevector <vscale x 1 x i64> %elt.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
1171 %v = call <vscale x 1 x i64> @llvm.vp.umin.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb, <vscale x 1 x i1> splat (i1 true), i32 %evl)
1172 ret <vscale x 1 x i64> %v
1175 declare <vscale x 2 x i64> @llvm.vp.umin.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1177 define <vscale x 2 x i64> @vminu_vv_nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1178 ; CHECK-LABEL: vminu_vv_nxv2i64:
1180 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1181 ; CHECK-NEXT: vminu.vv v8, v8, v10, v0.t
1183 %v = call <vscale x 2 x i64> @llvm.vp.umin.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, <vscale x 2 x i1> %m, i32 %evl)
1184 ret <vscale x 2 x i64> %v
1187 define <vscale x 2 x i64> @vminu_vv_nxv2i64_unmasked(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, i32 zeroext %evl) {
1188 ; CHECK-LABEL: vminu_vv_nxv2i64_unmasked:
1190 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1191 ; CHECK-NEXT: vminu.vv v8, v8, v10
1193 %v = call <vscale x 2 x i64> @llvm.vp.umin.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, <vscale x 2 x i1> splat (i1 true), i32 %evl)
1194 ret <vscale x 2 x i64> %v
1197 define <vscale x 2 x i64> @vminu_vx_nxv2i64(<vscale x 2 x i64> %va, i64 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1198 ; RV32-LABEL: vminu_vx_nxv2i64:
1200 ; RV32-NEXT: addi sp, sp, -16
1201 ; RV32-NEXT: .cfi_def_cfa_offset 16
1202 ; RV32-NEXT: sw a1, 12(sp)
1203 ; RV32-NEXT: sw a0, 8(sp)
1204 ; RV32-NEXT: addi a0, sp, 8
1205 ; RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1206 ; RV32-NEXT: vlse64.v v10, (a0), zero
1207 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1208 ; RV32-NEXT: vminu.vv v8, v8, v10, v0.t
1209 ; RV32-NEXT: addi sp, sp, 16
1212 ; RV64-LABEL: vminu_vx_nxv2i64:
1214 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1215 ; RV64-NEXT: vminu.vx v8, v8, a0, v0.t
1217 %elt.head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
1218 %vb = shufflevector <vscale x 2 x i64> %elt.head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
1219 %v = call <vscale x 2 x i64> @llvm.vp.umin.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb, <vscale x 2 x i1> %m, i32 %evl)
1220 ret <vscale x 2 x i64> %v
1223 define <vscale x 2 x i64> @vminu_vx_nxv2i64_unmasked(<vscale x 2 x i64> %va, i64 %b, i32 zeroext %evl) {
1224 ; RV32-LABEL: vminu_vx_nxv2i64_unmasked:
1226 ; RV32-NEXT: addi sp, sp, -16
1227 ; RV32-NEXT: .cfi_def_cfa_offset 16
1228 ; RV32-NEXT: sw a1, 12(sp)
1229 ; RV32-NEXT: sw a0, 8(sp)
1230 ; RV32-NEXT: addi a0, sp, 8
1231 ; RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1232 ; RV32-NEXT: vlse64.v v10, (a0), zero
1233 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1234 ; RV32-NEXT: vminu.vv v8, v8, v10
1235 ; RV32-NEXT: addi sp, sp, 16
1238 ; RV64-LABEL: vminu_vx_nxv2i64_unmasked:
1240 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1241 ; RV64-NEXT: vminu.vx v8, v8, a0
1243 %elt.head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
1244 %vb = shufflevector <vscale x 2 x i64> %elt.head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
1245 %v = call <vscale x 2 x i64> @llvm.vp.umin.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb, <vscale x 2 x i1> splat (i1 true), i32 %evl)
1246 ret <vscale x 2 x i64> %v
1249 declare <vscale x 4 x i64> @llvm.vp.umin.nxv4i64(<vscale x 4 x i64>, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
1251 define <vscale x 4 x i64> @vminu_vv_nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1252 ; CHECK-LABEL: vminu_vv_nxv4i64:
1254 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1255 ; CHECK-NEXT: vminu.vv v8, v8, v12, v0.t
1257 %v = call <vscale x 4 x i64> @llvm.vp.umin.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, <vscale x 4 x i1> %m, i32 %evl)
1258 ret <vscale x 4 x i64> %v
1261 define <vscale x 4 x i64> @vminu_vv_nxv4i64_unmasked(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, i32 zeroext %evl) {
1262 ; CHECK-LABEL: vminu_vv_nxv4i64_unmasked:
1264 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1265 ; CHECK-NEXT: vminu.vv v8, v8, v12
1267 %v = call <vscale x 4 x i64> @llvm.vp.umin.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, <vscale x 4 x i1> splat (i1 true), i32 %evl)
1268 ret <vscale x 4 x i64> %v
1271 define <vscale x 4 x i64> @vminu_vx_nxv4i64(<vscale x 4 x i64> %va, i64 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1272 ; RV32-LABEL: vminu_vx_nxv4i64:
1274 ; RV32-NEXT: addi sp, sp, -16
1275 ; RV32-NEXT: .cfi_def_cfa_offset 16
1276 ; RV32-NEXT: sw a1, 12(sp)
1277 ; RV32-NEXT: sw a0, 8(sp)
1278 ; RV32-NEXT: addi a0, sp, 8
1279 ; RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1280 ; RV32-NEXT: vlse64.v v12, (a0), zero
1281 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
1282 ; RV32-NEXT: vminu.vv v8, v8, v12, v0.t
1283 ; RV32-NEXT: addi sp, sp, 16
1286 ; RV64-LABEL: vminu_vx_nxv4i64:
1288 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
1289 ; RV64-NEXT: vminu.vx v8, v8, a0, v0.t
1291 %elt.head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
1292 %vb = shufflevector <vscale x 4 x i64> %elt.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
1293 %v = call <vscale x 4 x i64> @llvm.vp.umin.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb, <vscale x 4 x i1> %m, i32 %evl)
1294 ret <vscale x 4 x i64> %v
1297 define <vscale x 4 x i64> @vminu_vx_nxv4i64_unmasked(<vscale x 4 x i64> %va, i64 %b, i32 zeroext %evl) {
1298 ; RV32-LABEL: vminu_vx_nxv4i64_unmasked:
1300 ; RV32-NEXT: addi sp, sp, -16
1301 ; RV32-NEXT: .cfi_def_cfa_offset 16
1302 ; RV32-NEXT: sw a1, 12(sp)
1303 ; RV32-NEXT: sw a0, 8(sp)
1304 ; RV32-NEXT: addi a0, sp, 8
1305 ; RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1306 ; RV32-NEXT: vlse64.v v12, (a0), zero
1307 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
1308 ; RV32-NEXT: vminu.vv v8, v8, v12
1309 ; RV32-NEXT: addi sp, sp, 16
1312 ; RV64-LABEL: vminu_vx_nxv4i64_unmasked:
1314 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
1315 ; RV64-NEXT: vminu.vx v8, v8, a0
1317 %elt.head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
1318 %vb = shufflevector <vscale x 4 x i64> %elt.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
1319 %v = call <vscale x 4 x i64> @llvm.vp.umin.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb, <vscale x 4 x i1> splat (i1 true), i32 %evl)
1320 ret <vscale x 4 x i64> %v
1323 declare <vscale x 8 x i64> @llvm.vp.umin.nxv8i64(<vscale x 8 x i64>, <vscale x 8 x i64>, <vscale x 8 x i1>, i32)
1325 define <vscale x 8 x i64> @vminu_vv_nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1326 ; CHECK-LABEL: vminu_vv_nxv8i64:
1328 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1329 ; CHECK-NEXT: vminu.vv v8, v8, v16, v0.t
1331 %v = call <vscale x 8 x i64> @llvm.vp.umin.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, <vscale x 8 x i1> %m, i32 %evl)
1332 ret <vscale x 8 x i64> %v
1335 define <vscale x 8 x i64> @vminu_vv_nxv8i64_unmasked(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, i32 zeroext %evl) {
1336 ; CHECK-LABEL: vminu_vv_nxv8i64_unmasked:
1338 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1339 ; CHECK-NEXT: vminu.vv v8, v8, v16
1341 %v = call <vscale x 8 x i64> @llvm.vp.umin.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, <vscale x 8 x i1> splat (i1 true), i32 %evl)
1342 ret <vscale x 8 x i64> %v
1345 define <vscale x 8 x i64> @vminu_vx_nxv8i64(<vscale x 8 x i64> %va, i64 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1346 ; RV32-LABEL: vminu_vx_nxv8i64:
1348 ; RV32-NEXT: addi sp, sp, -16
1349 ; RV32-NEXT: .cfi_def_cfa_offset 16
1350 ; RV32-NEXT: sw a1, 12(sp)
1351 ; RV32-NEXT: sw a0, 8(sp)
1352 ; RV32-NEXT: addi a0, sp, 8
1353 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1354 ; RV32-NEXT: vlse64.v v16, (a0), zero
1355 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1356 ; RV32-NEXT: vminu.vv v8, v8, v16, v0.t
1357 ; RV32-NEXT: addi sp, sp, 16
1360 ; RV64-LABEL: vminu_vx_nxv8i64:
1362 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1363 ; RV64-NEXT: vminu.vx v8, v8, a0, v0.t
1365 %elt.head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
1366 %vb = shufflevector <vscale x 8 x i64> %elt.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
1367 %v = call <vscale x 8 x i64> @llvm.vp.umin.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb, <vscale x 8 x i1> %m, i32 %evl)
1368 ret <vscale x 8 x i64> %v
1371 define <vscale x 8 x i64> @vminu_vx_nxv8i64_unmasked(<vscale x 8 x i64> %va, i64 %b, i32 zeroext %evl) {
1372 ; RV32-LABEL: vminu_vx_nxv8i64_unmasked:
1374 ; RV32-NEXT: addi sp, sp, -16
1375 ; RV32-NEXT: .cfi_def_cfa_offset 16
1376 ; RV32-NEXT: sw a1, 12(sp)
1377 ; RV32-NEXT: sw a0, 8(sp)
1378 ; RV32-NEXT: addi a0, sp, 8
1379 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1380 ; RV32-NEXT: vlse64.v v16, (a0), zero
1381 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1382 ; RV32-NEXT: vminu.vv v8, v8, v16
1383 ; RV32-NEXT: addi sp, sp, 16
1386 ; RV64-LABEL: vminu_vx_nxv8i64_unmasked:
1388 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1389 ; RV64-NEXT: vminu.vx v8, v8, a0
1391 %elt.head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
1392 %vb = shufflevector <vscale x 8 x i64> %elt.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
1393 %v = call <vscale x 8 x i64> @llvm.vp.umin.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb, <vscale x 8 x i1> splat (i1 true), i32 %evl)
1394 ret <vscale x 8 x i64> %v