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.umax.nxv8i7(<vscale x 8 x i7>, <vscale x 8 x i7>, <vscale x 8 x i1>, i32)
9 define <vscale x 8 x i7> @vmaxu_vx_nxv8i7(<vscale x 8 x i7> %a, i7 signext %b, <vscale x 8 x i1> %mask, i32 zeroext %evl) {
10 ; CHECK-LABEL: vmaxu_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: vmaxu.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.umax.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.umax.nxv1i8(<vscale x 1 x i8>, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
28 define <vscale x 1 x i8> @vmaxu_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: vmaxu_vv_nxv1i8:
31 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
32 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
34 %v = call <vscale x 1 x i8> @llvm.vp.umax.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> @vmaxu_vv_nxv1i8_unmasked(<vscale x 1 x i8> %va, <vscale x 1 x i8> %b, i32 zeroext %evl) {
39 ; CHECK-LABEL: vmaxu_vv_nxv1i8_unmasked:
41 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
42 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
44 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
45 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
46 %v = call <vscale x 1 x i8> @llvm.vp.umax.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %b, <vscale x 1 x i1> %m, i32 %evl)
47 ret <vscale x 1 x i8> %v
50 define <vscale x 1 x i8> @vmaxu_vx_nxv1i8(<vscale x 1 x i8> %va, i8 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
51 ; CHECK-LABEL: vmaxu_vx_nxv1i8:
53 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
54 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
56 %elt.head = insertelement <vscale x 1 x i8> poison, i8 %b, i32 0
57 %vb = shufflevector <vscale x 1 x i8> %elt.head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
58 %v = call <vscale x 1 x i8> @llvm.vp.umax.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb, <vscale x 1 x i1> %m, i32 %evl)
59 ret <vscale x 1 x i8> %v
62 define <vscale x 1 x i8> @vmaxu_vx_nxv1i8_commute(<vscale x 1 x i8> %va, i8 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
63 ; CHECK-LABEL: vmaxu_vx_nxv1i8_commute:
65 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
66 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
68 %elt.head = insertelement <vscale x 1 x i8> poison, i8 %b, i32 0
69 %vb = shufflevector <vscale x 1 x i8> %elt.head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
70 %v = call <vscale x 1 x i8> @llvm.vp.umax.nxv1i8(<vscale x 1 x i8> %vb, <vscale x 1 x i8> %va, <vscale x 1 x i1> %m, i32 %evl)
71 ret <vscale x 1 x i8> %v
74 define <vscale x 1 x i8> @vmaxu_vx_nxv1i8_unmasked(<vscale x 1 x i8> %va, i8 %b, i32 zeroext %evl) {
75 ; CHECK-LABEL: vmaxu_vx_nxv1i8_unmasked:
77 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
78 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
80 %elt.head = insertelement <vscale x 1 x i8> poison, i8 %b, i32 0
81 %vb = shufflevector <vscale x 1 x i8> %elt.head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
82 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
83 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
84 %v = call <vscale x 1 x i8> @llvm.vp.umax.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb, <vscale x 1 x i1> %m, i32 %evl)
85 ret <vscale x 1 x i8> %v
88 declare <vscale x 2 x i8> @llvm.vp.umax.nxv2i8(<vscale x 2 x i8>, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
90 define <vscale x 2 x i8> @vmaxu_vv_nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
91 ; CHECK-LABEL: vmaxu_vv_nxv2i8:
93 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
94 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
96 %v = call <vscale x 2 x i8> @llvm.vp.umax.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, <vscale x 2 x i1> %m, i32 %evl)
97 ret <vscale x 2 x i8> %v
100 define <vscale x 2 x i8> @vmaxu_vv_nxv2i8_unmasked(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, i32 zeroext %evl) {
101 ; CHECK-LABEL: vmaxu_vv_nxv2i8_unmasked:
103 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
104 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
106 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
107 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
108 %v = call <vscale x 2 x i8> @llvm.vp.umax.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, <vscale x 2 x i1> %m, i32 %evl)
109 ret <vscale x 2 x i8> %v
112 define <vscale x 2 x i8> @vmaxu_vx_nxv2i8(<vscale x 2 x i8> %va, i8 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
113 ; CHECK-LABEL: vmaxu_vx_nxv2i8:
115 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
116 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
118 %elt.head = insertelement <vscale x 2 x i8> poison, i8 %b, i32 0
119 %vb = shufflevector <vscale x 2 x i8> %elt.head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
120 %v = call <vscale x 2 x i8> @llvm.vp.umax.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb, <vscale x 2 x i1> %m, i32 %evl)
121 ret <vscale x 2 x i8> %v
124 define <vscale x 2 x i8> @vmaxu_vx_nxv2i8_unmasked(<vscale x 2 x i8> %va, i8 %b, i32 zeroext %evl) {
125 ; CHECK-LABEL: vmaxu_vx_nxv2i8_unmasked:
127 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
128 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
130 %elt.head = insertelement <vscale x 2 x i8> poison, i8 %b, i32 0
131 %vb = shufflevector <vscale x 2 x i8> %elt.head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
132 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
133 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
134 %v = call <vscale x 2 x i8> @llvm.vp.umax.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb, <vscale x 2 x i1> %m, i32 %evl)
135 ret <vscale x 2 x i8> %v
138 declare <vscale x 3 x i8> @llvm.vp.umax.nxv3i8(<vscale x 3 x i8>, <vscale x 3 x i8>, <vscale x 3 x i1>, i32)
140 define <vscale x 3 x i8> @vmaxu_vv_nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, <vscale x 3 x i1> %m, i32 zeroext %evl) {
141 ; CHECK-LABEL: vmaxu_vv_nxv3i8:
143 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
144 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
146 %v = call <vscale x 3 x i8> @llvm.vp.umax.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, <vscale x 3 x i1> %m, i32 %evl)
147 ret <vscale x 3 x i8> %v
150 define <vscale x 3 x i8> @vmaxu_vv_nxv3i8_unmasked(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, i32 zeroext %evl) {
151 ; CHECK-LABEL: vmaxu_vv_nxv3i8_unmasked:
153 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
154 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
156 %head = insertelement <vscale x 3 x i1> poison, i1 true, i32 0
157 %m = shufflevector <vscale x 3 x i1> %head, <vscale x 3 x i1> poison, <vscale x 3 x i32> zeroinitializer
158 %v = call <vscale x 3 x i8> @llvm.vp.umax.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, <vscale x 3 x i1> %m, i32 %evl)
159 ret <vscale x 3 x i8> %v
162 define <vscale x 3 x i8> @vmaxu_vx_nxv3i8(<vscale x 3 x i8> %va, i8 %b, <vscale x 3 x i1> %m, i32 zeroext %evl) {
163 ; CHECK-LABEL: vmaxu_vx_nxv3i8:
165 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
166 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
168 %elt.head = insertelement <vscale x 3 x i8> poison, i8 %b, i32 0
169 %vb = shufflevector <vscale x 3 x i8> %elt.head, <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer
170 %v = call <vscale x 3 x i8> @llvm.vp.umax.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %vb, <vscale x 3 x i1> %m, i32 %evl)
171 ret <vscale x 3 x i8> %v
174 define <vscale x 3 x i8> @vmaxu_vx_nxv3i8_unmasked(<vscale x 3 x i8> %va, i8 %b, i32 zeroext %evl) {
175 ; CHECK-LABEL: vmaxu_vx_nxv3i8_unmasked:
177 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
178 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
180 %elt.head = insertelement <vscale x 3 x i8> poison, i8 %b, i32 0
181 %vb = shufflevector <vscale x 3 x i8> %elt.head, <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer
182 %head = insertelement <vscale x 3 x i1> poison, i1 true, i32 0
183 %m = shufflevector <vscale x 3 x i1> %head, <vscale x 3 x i1> poison, <vscale x 3 x i32> zeroinitializer
184 %v = call <vscale x 3 x i8> @llvm.vp.umax.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %vb, <vscale x 3 x i1> %m, i32 %evl)
185 ret <vscale x 3 x i8> %v
188 declare <vscale x 4 x i8> @llvm.vp.umax.nxv4i8(<vscale x 4 x i8>, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
190 define <vscale x 4 x i8> @vmaxu_vv_nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
191 ; CHECK-LABEL: vmaxu_vv_nxv4i8:
193 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
194 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
196 %v = call <vscale x 4 x i8> @llvm.vp.umax.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, <vscale x 4 x i1> %m, i32 %evl)
197 ret <vscale x 4 x i8> %v
200 define <vscale x 4 x i8> @vmaxu_vv_nxv4i8_unmasked(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, i32 zeroext %evl) {
201 ; CHECK-LABEL: vmaxu_vv_nxv4i8_unmasked:
203 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
204 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
206 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
207 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
208 %v = call <vscale x 4 x i8> @llvm.vp.umax.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, <vscale x 4 x i1> %m, i32 %evl)
209 ret <vscale x 4 x i8> %v
212 define <vscale x 4 x i8> @vmaxu_vx_nxv4i8(<vscale x 4 x i8> %va, i8 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
213 ; CHECK-LABEL: vmaxu_vx_nxv4i8:
215 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
216 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
218 %elt.head = insertelement <vscale x 4 x i8> poison, i8 %b, i32 0
219 %vb = shufflevector <vscale x 4 x i8> %elt.head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
220 %v = call <vscale x 4 x i8> @llvm.vp.umax.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb, <vscale x 4 x i1> %m, i32 %evl)
221 ret <vscale x 4 x i8> %v
224 define <vscale x 4 x i8> @vmaxu_vx_nxv4i8_unmasked(<vscale x 4 x i8> %va, i8 %b, i32 zeroext %evl) {
225 ; CHECK-LABEL: vmaxu_vx_nxv4i8_unmasked:
227 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
228 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
230 %elt.head = insertelement <vscale x 4 x i8> poison, i8 %b, i32 0
231 %vb = shufflevector <vscale x 4 x i8> %elt.head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
232 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
233 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
234 %v = call <vscale x 4 x i8> @llvm.vp.umax.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb, <vscale x 4 x i1> %m, i32 %evl)
235 ret <vscale x 4 x i8> %v
238 declare <vscale x 8 x i8> @llvm.vp.umax.nxv8i8(<vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i1>, i32)
240 define <vscale x 8 x i8> @vmaxu_vv_nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
241 ; CHECK-LABEL: vmaxu_vv_nxv8i8:
243 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
244 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
246 %v = call <vscale x 8 x i8> @llvm.vp.umax.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, <vscale x 8 x i1> %m, i32 %evl)
247 ret <vscale x 8 x i8> %v
250 define <vscale x 8 x i8> @vmaxu_vv_nxv8i8_unmasked(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, i32 zeroext %evl) {
251 ; CHECK-LABEL: vmaxu_vv_nxv8i8_unmasked:
253 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
254 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
256 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
257 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
258 %v = call <vscale x 8 x i8> @llvm.vp.umax.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, <vscale x 8 x i1> %m, i32 %evl)
259 ret <vscale x 8 x i8> %v
262 define <vscale x 8 x i8> @vmaxu_vx_nxv8i8(<vscale x 8 x i8> %va, i8 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
263 ; CHECK-LABEL: vmaxu_vx_nxv8i8:
265 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
266 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
268 %elt.head = insertelement <vscale x 8 x i8> poison, i8 %b, i32 0
269 %vb = shufflevector <vscale x 8 x i8> %elt.head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
270 %v = call <vscale x 8 x i8> @llvm.vp.umax.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb, <vscale x 8 x i1> %m, i32 %evl)
271 ret <vscale x 8 x i8> %v
274 define <vscale x 8 x i8> @vmaxu_vx_nxv8i8_unmasked(<vscale x 8 x i8> %va, i8 %b, i32 zeroext %evl) {
275 ; CHECK-LABEL: vmaxu_vx_nxv8i8_unmasked:
277 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
278 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
280 %elt.head = insertelement <vscale x 8 x i8> poison, i8 %b, i32 0
281 %vb = shufflevector <vscale x 8 x i8> %elt.head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
282 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
283 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
284 %v = call <vscale x 8 x i8> @llvm.vp.umax.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb, <vscale x 8 x i1> %m, i32 %evl)
285 ret <vscale x 8 x i8> %v
288 declare <vscale x 16 x i8> @llvm.vp.umax.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i1>, i32)
290 define <vscale x 16 x i8> @vmaxu_vv_nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
291 ; CHECK-LABEL: vmaxu_vv_nxv16i8:
293 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
294 ; CHECK-NEXT: vmaxu.vv v8, v8, v10, v0.t
296 %v = call <vscale x 16 x i8> @llvm.vp.umax.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, <vscale x 16 x i1> %m, i32 %evl)
297 ret <vscale x 16 x i8> %v
300 define <vscale x 16 x i8> @vmaxu_vv_nxv16i8_unmasked(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, i32 zeroext %evl) {
301 ; CHECK-LABEL: vmaxu_vv_nxv16i8_unmasked:
303 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
304 ; CHECK-NEXT: vmaxu.vv v8, v8, v10
306 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
307 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
308 %v = call <vscale x 16 x i8> @llvm.vp.umax.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, <vscale x 16 x i1> %m, i32 %evl)
309 ret <vscale x 16 x i8> %v
312 define <vscale x 16 x i8> @vmaxu_vx_nxv16i8(<vscale x 16 x i8> %va, i8 %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
313 ; CHECK-LABEL: vmaxu_vx_nxv16i8:
315 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
316 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
318 %elt.head = insertelement <vscale x 16 x i8> poison, i8 %b, i32 0
319 %vb = shufflevector <vscale x 16 x i8> %elt.head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
320 %v = call <vscale x 16 x i8> @llvm.vp.umax.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb, <vscale x 16 x i1> %m, i32 %evl)
321 ret <vscale x 16 x i8> %v
324 define <vscale x 16 x i8> @vmaxu_vx_nxv16i8_unmasked(<vscale x 16 x i8> %va, i8 %b, i32 zeroext %evl) {
325 ; CHECK-LABEL: vmaxu_vx_nxv16i8_unmasked:
327 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
328 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
330 %elt.head = insertelement <vscale x 16 x i8> poison, i8 %b, i32 0
331 %vb = shufflevector <vscale x 16 x i8> %elt.head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
332 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
333 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
334 %v = call <vscale x 16 x i8> @llvm.vp.umax.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb, <vscale x 16 x i1> %m, i32 %evl)
335 ret <vscale x 16 x i8> %v
338 declare <vscale x 32 x i8> @llvm.vp.umax.nxv32i8(<vscale x 32 x i8>, <vscale x 32 x i8>, <vscale x 32 x i1>, i32)
340 define <vscale x 32 x i8> @vmaxu_vv_nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
341 ; CHECK-LABEL: vmaxu_vv_nxv32i8:
343 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
344 ; CHECK-NEXT: vmaxu.vv v8, v8, v12, v0.t
346 %v = call <vscale x 32 x i8> @llvm.vp.umax.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, <vscale x 32 x i1> %m, i32 %evl)
347 ret <vscale x 32 x i8> %v
350 define <vscale x 32 x i8> @vmaxu_vv_nxv32i8_unmasked(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, i32 zeroext %evl) {
351 ; CHECK-LABEL: vmaxu_vv_nxv32i8_unmasked:
353 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
354 ; CHECK-NEXT: vmaxu.vv v8, v8, v12
356 %head = insertelement <vscale x 32 x i1> poison, i1 true, i32 0
357 %m = shufflevector <vscale x 32 x i1> %head, <vscale x 32 x i1> poison, <vscale x 32 x i32> zeroinitializer
358 %v = call <vscale x 32 x i8> @llvm.vp.umax.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, <vscale x 32 x i1> %m, i32 %evl)
359 ret <vscale x 32 x i8> %v
362 define <vscale x 32 x i8> @vmaxu_vx_nxv32i8(<vscale x 32 x i8> %va, i8 %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
363 ; CHECK-LABEL: vmaxu_vx_nxv32i8:
365 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
366 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
368 %elt.head = insertelement <vscale x 32 x i8> poison, i8 %b, i32 0
369 %vb = shufflevector <vscale x 32 x i8> %elt.head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
370 %v = call <vscale x 32 x i8> @llvm.vp.umax.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb, <vscale x 32 x i1> %m, i32 %evl)
371 ret <vscale x 32 x i8> %v
374 define <vscale x 32 x i8> @vmaxu_vx_nxv32i8_unmasked(<vscale x 32 x i8> %va, i8 %b, i32 zeroext %evl) {
375 ; CHECK-LABEL: vmaxu_vx_nxv32i8_unmasked:
377 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
378 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
380 %elt.head = insertelement <vscale x 32 x i8> poison, i8 %b, i32 0
381 %vb = shufflevector <vscale x 32 x i8> %elt.head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
382 %head = insertelement <vscale x 32 x i1> poison, i1 true, i32 0
383 %m = shufflevector <vscale x 32 x i1> %head, <vscale x 32 x i1> poison, <vscale x 32 x i32> zeroinitializer
384 %v = call <vscale x 32 x i8> @llvm.vp.umax.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb, <vscale x 32 x i1> %m, i32 %evl)
385 ret <vscale x 32 x i8> %v
388 declare <vscale x 64 x i8> @llvm.vp.umax.nxv64i8(<vscale x 64 x i8>, <vscale x 64 x i8>, <vscale x 64 x i1>, i32)
390 define <vscale x 64 x i8> @vmaxu_vv_nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, <vscale x 64 x i1> %m, i32 zeroext %evl) {
391 ; CHECK-LABEL: vmaxu_vv_nxv64i8:
393 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
394 ; CHECK-NEXT: vmaxu.vv v8, v8, v16, v0.t
396 %v = call <vscale x 64 x i8> @llvm.vp.umax.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, <vscale x 64 x i1> %m, i32 %evl)
397 ret <vscale x 64 x i8> %v
400 define <vscale x 64 x i8> @vmaxu_vv_nxv64i8_unmasked(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, i32 zeroext %evl) {
401 ; CHECK-LABEL: vmaxu_vv_nxv64i8_unmasked:
403 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
404 ; CHECK-NEXT: vmaxu.vv v8, v8, v16
406 %head = insertelement <vscale x 64 x i1> poison, i1 true, i32 0
407 %m = shufflevector <vscale x 64 x i1> %head, <vscale x 64 x i1> poison, <vscale x 64 x i32> zeroinitializer
408 %v = call <vscale x 64 x i8> @llvm.vp.umax.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, <vscale x 64 x i1> %m, i32 %evl)
409 ret <vscale x 64 x i8> %v
412 define <vscale x 64 x i8> @vmaxu_vx_nxv64i8(<vscale x 64 x i8> %va, i8 %b, <vscale x 64 x i1> %m, i32 zeroext %evl) {
413 ; CHECK-LABEL: vmaxu_vx_nxv64i8:
415 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
416 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
418 %elt.head = insertelement <vscale x 64 x i8> poison, i8 %b, i32 0
419 %vb = shufflevector <vscale x 64 x i8> %elt.head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
420 %v = call <vscale x 64 x i8> @llvm.vp.umax.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb, <vscale x 64 x i1> %m, i32 %evl)
421 ret <vscale x 64 x i8> %v
424 define <vscale x 64 x i8> @vmaxu_vx_nxv64i8_unmasked(<vscale x 64 x i8> %va, i8 %b, i32 zeroext %evl) {
425 ; CHECK-LABEL: vmaxu_vx_nxv64i8_unmasked:
427 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
428 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
430 %elt.head = insertelement <vscale x 64 x i8> poison, i8 %b, i32 0
431 %vb = shufflevector <vscale x 64 x i8> %elt.head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
432 %head = insertelement <vscale x 64 x i1> poison, i1 true, i32 0
433 %m = shufflevector <vscale x 64 x i1> %head, <vscale x 64 x i1> poison, <vscale x 64 x i32> zeroinitializer
434 %v = call <vscale x 64 x i8> @llvm.vp.umax.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb, <vscale x 64 x i1> %m, i32 %evl)
435 ret <vscale x 64 x i8> %v
438 ; Test that split-legalization works when the mask itself needs splitting.
440 declare <vscale x 128 x i8> @llvm.vp.umax.nxv128i8(<vscale x 128 x i8>, <vscale x 128 x i8>, <vscale x 128 x i1>, i32)
442 define <vscale x 128 x i8> @vmaxu_vx_nxv128i8(<vscale x 128 x i8> %va, i8 %b, <vscale x 128 x i1> %m, i32 zeroext %evl) {
443 ; CHECK-LABEL: vmaxu_vx_nxv128i8:
445 ; CHECK-NEXT: vmv1r.v v24, v0
446 ; CHECK-NEXT: vsetvli a3, zero, e8, m8, ta, ma
447 ; CHECK-NEXT: vlm.v v0, (a1)
448 ; CHECK-NEXT: csrr a1, vlenb
449 ; CHECK-NEXT: slli a1, a1, 3
450 ; CHECK-NEXT: sub a3, a2, a1
451 ; CHECK-NEXT: sltu a4, a2, a3
452 ; CHECK-NEXT: addi a4, a4, -1
453 ; CHECK-NEXT: and a3, a4, a3
454 ; CHECK-NEXT: vsetvli zero, a3, e8, m8, ta, ma
455 ; CHECK-NEXT: vmaxu.vx v16, v16, a0, v0.t
456 ; CHECK-NEXT: bltu a2, a1, .LBB34_2
457 ; CHECK-NEXT: # %bb.1:
458 ; CHECK-NEXT: mv a2, a1
459 ; CHECK-NEXT: .LBB34_2:
460 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
461 ; CHECK-NEXT: vmv1r.v v0, v24
462 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
464 %elt.head = insertelement <vscale x 128 x i8> poison, i8 %b, i32 0
465 %vb = shufflevector <vscale x 128 x i8> %elt.head, <vscale x 128 x i8> poison, <vscale x 128 x i32> zeroinitializer
466 %v = call <vscale x 128 x i8> @llvm.vp.umax.nxv128i8(<vscale x 128 x i8> %va, <vscale x 128 x i8> %vb, <vscale x 128 x i1> %m, i32 %evl)
467 ret <vscale x 128 x i8> %v
470 define <vscale x 128 x i8> @vmaxu_vx_nxv128i8_unmasked(<vscale x 128 x i8> %va, i8 %b, i32 zeroext %evl) {
471 ; CHECK-LABEL: vmaxu_vx_nxv128i8_unmasked:
473 ; CHECK-NEXT: csrr a2, vlenb
474 ; CHECK-NEXT: slli a2, a2, 3
475 ; CHECK-NEXT: sub a3, a1, a2
476 ; CHECK-NEXT: sltu a4, a1, a3
477 ; CHECK-NEXT: addi a4, a4, -1
478 ; CHECK-NEXT: and a3, a4, a3
479 ; CHECK-NEXT: vsetvli zero, a3, e8, m8, ta, ma
480 ; CHECK-NEXT: vmaxu.vx v16, v16, a0
481 ; CHECK-NEXT: bltu a1, a2, .LBB35_2
482 ; CHECK-NEXT: # %bb.1:
483 ; CHECK-NEXT: mv a1, a2
484 ; CHECK-NEXT: .LBB35_2:
485 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
486 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
488 %elt.head = insertelement <vscale x 128 x i8> poison, i8 %b, i32 0
489 %vb = shufflevector <vscale x 128 x i8> %elt.head, <vscale x 128 x i8> poison, <vscale x 128 x i32> zeroinitializer
490 %head = insertelement <vscale x 128 x i1> poison, i1 true, i32 0
491 %m = shufflevector <vscale x 128 x i1> %head, <vscale x 128 x i1> poison, <vscale x 128 x i32> zeroinitializer
492 %v = call <vscale x 128 x i8> @llvm.vp.umax.nxv128i8(<vscale x 128 x i8> %va, <vscale x 128 x i8> %vb, <vscale x 128 x i1> %m, i32 %evl)
493 ret <vscale x 128 x i8> %v
496 declare <vscale x 1 x i16> @llvm.vp.umax.nxv1i16(<vscale x 1 x i16>, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
498 define <vscale x 1 x i16> @vmaxu_vv_nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
499 ; CHECK-LABEL: vmaxu_vv_nxv1i16:
501 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
502 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
504 %v = call <vscale x 1 x i16> @llvm.vp.umax.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, <vscale x 1 x i1> %m, i32 %evl)
505 ret <vscale x 1 x i16> %v
508 define <vscale x 1 x i16> @vmaxu_vv_nxv1i16_unmasked(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, i32 zeroext %evl) {
509 ; CHECK-LABEL: vmaxu_vv_nxv1i16_unmasked:
511 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
512 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
514 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
515 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
516 %v = call <vscale x 1 x i16> @llvm.vp.umax.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, <vscale x 1 x i1> %m, i32 %evl)
517 ret <vscale x 1 x i16> %v
520 define <vscale x 1 x i16> @vmaxu_vx_nxv1i16(<vscale x 1 x i16> %va, i16 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
521 ; CHECK-LABEL: vmaxu_vx_nxv1i16:
523 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
524 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
526 %elt.head = insertelement <vscale x 1 x i16> poison, i16 %b, i32 0
527 %vb = shufflevector <vscale x 1 x i16> %elt.head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
528 %v = call <vscale x 1 x i16> @llvm.vp.umax.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb, <vscale x 1 x i1> %m, i32 %evl)
529 ret <vscale x 1 x i16> %v
532 define <vscale x 1 x i16> @vmaxu_vx_nxv1i16_unmasked(<vscale x 1 x i16> %va, i16 %b, i32 zeroext %evl) {
533 ; CHECK-LABEL: vmaxu_vx_nxv1i16_unmasked:
535 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
536 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
538 %elt.head = insertelement <vscale x 1 x i16> poison, i16 %b, i32 0
539 %vb = shufflevector <vscale x 1 x i16> %elt.head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
540 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
541 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
542 %v = call <vscale x 1 x i16> @llvm.vp.umax.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb, <vscale x 1 x i1> %m, i32 %evl)
543 ret <vscale x 1 x i16> %v
546 declare <vscale x 2 x i16> @llvm.vp.umax.nxv2i16(<vscale x 2 x i16>, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
548 define <vscale x 2 x i16> @vmaxu_vv_nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
549 ; CHECK-LABEL: vmaxu_vv_nxv2i16:
551 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
552 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
554 %v = call <vscale x 2 x i16> @llvm.vp.umax.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, <vscale x 2 x i1> %m, i32 %evl)
555 ret <vscale x 2 x i16> %v
558 define <vscale x 2 x i16> @vmaxu_vv_nxv2i16_unmasked(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, i32 zeroext %evl) {
559 ; CHECK-LABEL: vmaxu_vv_nxv2i16_unmasked:
561 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
562 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
564 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
565 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
566 %v = call <vscale x 2 x i16> @llvm.vp.umax.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, <vscale x 2 x i1> %m, i32 %evl)
567 ret <vscale x 2 x i16> %v
570 define <vscale x 2 x i16> @vmaxu_vx_nxv2i16(<vscale x 2 x i16> %va, i16 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
571 ; CHECK-LABEL: vmaxu_vx_nxv2i16:
573 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
574 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
576 %elt.head = insertelement <vscale x 2 x i16> poison, i16 %b, i32 0
577 %vb = shufflevector <vscale x 2 x i16> %elt.head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
578 %v = call <vscale x 2 x i16> @llvm.vp.umax.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb, <vscale x 2 x i1> %m, i32 %evl)
579 ret <vscale x 2 x i16> %v
582 define <vscale x 2 x i16> @vmaxu_vx_nxv2i16_unmasked(<vscale x 2 x i16> %va, i16 %b, i32 zeroext %evl) {
583 ; CHECK-LABEL: vmaxu_vx_nxv2i16_unmasked:
585 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
586 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
588 %elt.head = insertelement <vscale x 2 x i16> poison, i16 %b, i32 0
589 %vb = shufflevector <vscale x 2 x i16> %elt.head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
590 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
591 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
592 %v = call <vscale x 2 x i16> @llvm.vp.umax.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb, <vscale x 2 x i1> %m, i32 %evl)
593 ret <vscale x 2 x i16> %v
596 declare <vscale x 4 x i16> @llvm.vp.umax.nxv4i16(<vscale x 4 x i16>, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
598 define <vscale x 4 x i16> @vmaxu_vv_nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
599 ; CHECK-LABEL: vmaxu_vv_nxv4i16:
601 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
602 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
604 %v = call <vscale x 4 x i16> @llvm.vp.umax.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, <vscale x 4 x i1> %m, i32 %evl)
605 ret <vscale x 4 x i16> %v
608 define <vscale x 4 x i16> @vmaxu_vv_nxv4i16_unmasked(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, i32 zeroext %evl) {
609 ; CHECK-LABEL: vmaxu_vv_nxv4i16_unmasked:
611 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
612 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
614 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
615 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
616 %v = call <vscale x 4 x i16> @llvm.vp.umax.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, <vscale x 4 x i1> %m, i32 %evl)
617 ret <vscale x 4 x i16> %v
620 define <vscale x 4 x i16> @vmaxu_vx_nxv4i16(<vscale x 4 x i16> %va, i16 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
621 ; CHECK-LABEL: vmaxu_vx_nxv4i16:
623 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
624 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
626 %elt.head = insertelement <vscale x 4 x i16> poison, i16 %b, i32 0
627 %vb = shufflevector <vscale x 4 x i16> %elt.head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
628 %v = call <vscale x 4 x i16> @llvm.vp.umax.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb, <vscale x 4 x i1> %m, i32 %evl)
629 ret <vscale x 4 x i16> %v
632 define <vscale x 4 x i16> @vmaxu_vx_nxv4i16_unmasked(<vscale x 4 x i16> %va, i16 %b, i32 zeroext %evl) {
633 ; CHECK-LABEL: vmaxu_vx_nxv4i16_unmasked:
635 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
636 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
638 %elt.head = insertelement <vscale x 4 x i16> poison, i16 %b, i32 0
639 %vb = shufflevector <vscale x 4 x i16> %elt.head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
640 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
641 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
642 %v = call <vscale x 4 x i16> @llvm.vp.umax.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb, <vscale x 4 x i1> %m, i32 %evl)
643 ret <vscale x 4 x i16> %v
646 declare <vscale x 8 x i16> @llvm.vp.umax.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i1>, i32)
648 define <vscale x 8 x i16> @vmaxu_vv_nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
649 ; CHECK-LABEL: vmaxu_vv_nxv8i16:
651 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
652 ; CHECK-NEXT: vmaxu.vv v8, v8, v10, v0.t
654 %v = call <vscale x 8 x i16> @llvm.vp.umax.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, <vscale x 8 x i1> %m, i32 %evl)
655 ret <vscale x 8 x i16> %v
658 define <vscale x 8 x i16> @vmaxu_vv_nxv8i16_unmasked(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, i32 zeroext %evl) {
659 ; CHECK-LABEL: vmaxu_vv_nxv8i16_unmasked:
661 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
662 ; CHECK-NEXT: vmaxu.vv v8, v8, v10
664 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
665 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
666 %v = call <vscale x 8 x i16> @llvm.vp.umax.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, <vscale x 8 x i1> %m, i32 %evl)
667 ret <vscale x 8 x i16> %v
670 define <vscale x 8 x i16> @vmaxu_vx_nxv8i16(<vscale x 8 x i16> %va, i16 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
671 ; CHECK-LABEL: vmaxu_vx_nxv8i16:
673 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
674 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
676 %elt.head = insertelement <vscale x 8 x i16> poison, i16 %b, i32 0
677 %vb = shufflevector <vscale x 8 x i16> %elt.head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
678 %v = call <vscale x 8 x i16> @llvm.vp.umax.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb, <vscale x 8 x i1> %m, i32 %evl)
679 ret <vscale x 8 x i16> %v
682 define <vscale x 8 x i16> @vmaxu_vx_nxv8i16_unmasked(<vscale x 8 x i16> %va, i16 %b, i32 zeroext %evl) {
683 ; CHECK-LABEL: vmaxu_vx_nxv8i16_unmasked:
685 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
686 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
688 %elt.head = insertelement <vscale x 8 x i16> poison, i16 %b, i32 0
689 %vb = shufflevector <vscale x 8 x i16> %elt.head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
690 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
691 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
692 %v = call <vscale x 8 x i16> @llvm.vp.umax.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb, <vscale x 8 x i1> %m, i32 %evl)
693 ret <vscale x 8 x i16> %v
696 declare <vscale x 16 x i16> @llvm.vp.umax.nxv16i16(<vscale x 16 x i16>, <vscale x 16 x i16>, <vscale x 16 x i1>, i32)
698 define <vscale x 16 x i16> @vmaxu_vv_nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
699 ; CHECK-LABEL: vmaxu_vv_nxv16i16:
701 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
702 ; CHECK-NEXT: vmaxu.vv v8, v8, v12, v0.t
704 %v = call <vscale x 16 x i16> @llvm.vp.umax.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, <vscale x 16 x i1> %m, i32 %evl)
705 ret <vscale x 16 x i16> %v
708 define <vscale x 16 x i16> @vmaxu_vv_nxv16i16_unmasked(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, i32 zeroext %evl) {
709 ; CHECK-LABEL: vmaxu_vv_nxv16i16_unmasked:
711 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
712 ; CHECK-NEXT: vmaxu.vv v8, v8, v12
714 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
715 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
716 %v = call <vscale x 16 x i16> @llvm.vp.umax.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, <vscale x 16 x i1> %m, i32 %evl)
717 ret <vscale x 16 x i16> %v
720 define <vscale x 16 x i16> @vmaxu_vx_nxv16i16(<vscale x 16 x i16> %va, i16 %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
721 ; CHECK-LABEL: vmaxu_vx_nxv16i16:
723 ; CHECK-NEXT: vsetvli zero, a1, e16, m4, ta, ma
724 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
726 %elt.head = insertelement <vscale x 16 x i16> poison, i16 %b, i32 0
727 %vb = shufflevector <vscale x 16 x i16> %elt.head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
728 %v = call <vscale x 16 x i16> @llvm.vp.umax.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb, <vscale x 16 x i1> %m, i32 %evl)
729 ret <vscale x 16 x i16> %v
732 define <vscale x 16 x i16> @vmaxu_vx_nxv16i16_unmasked(<vscale x 16 x i16> %va, i16 %b, i32 zeroext %evl) {
733 ; CHECK-LABEL: vmaxu_vx_nxv16i16_unmasked:
735 ; CHECK-NEXT: vsetvli zero, a1, e16, m4, ta, ma
736 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
738 %elt.head = insertelement <vscale x 16 x i16> poison, i16 %b, i32 0
739 %vb = shufflevector <vscale x 16 x i16> %elt.head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
740 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
741 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
742 %v = call <vscale x 16 x i16> @llvm.vp.umax.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb, <vscale x 16 x i1> %m, i32 %evl)
743 ret <vscale x 16 x i16> %v
746 declare <vscale x 32 x i16> @llvm.vp.umax.nxv32i16(<vscale x 32 x i16>, <vscale x 32 x i16>, <vscale x 32 x i1>, i32)
748 define <vscale x 32 x i16> @vmaxu_vv_nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
749 ; CHECK-LABEL: vmaxu_vv_nxv32i16:
751 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
752 ; CHECK-NEXT: vmaxu.vv v8, v8, v16, v0.t
754 %v = call <vscale x 32 x i16> @llvm.vp.umax.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, <vscale x 32 x i1> %m, i32 %evl)
755 ret <vscale x 32 x i16> %v
758 define <vscale x 32 x i16> @vmaxu_vv_nxv32i16_unmasked(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, i32 zeroext %evl) {
759 ; CHECK-LABEL: vmaxu_vv_nxv32i16_unmasked:
761 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
762 ; CHECK-NEXT: vmaxu.vv v8, v8, v16
764 %head = insertelement <vscale x 32 x i1> poison, i1 true, i32 0
765 %m = shufflevector <vscale x 32 x i1> %head, <vscale x 32 x i1> poison, <vscale x 32 x i32> zeroinitializer
766 %v = call <vscale x 32 x i16> @llvm.vp.umax.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, <vscale x 32 x i1> %m, i32 %evl)
767 ret <vscale x 32 x i16> %v
770 define <vscale x 32 x i16> @vmaxu_vx_nxv32i16(<vscale x 32 x i16> %va, i16 %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
771 ; CHECK-LABEL: vmaxu_vx_nxv32i16:
773 ; CHECK-NEXT: vsetvli zero, a1, e16, m8, ta, ma
774 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
776 %elt.head = insertelement <vscale x 32 x i16> poison, i16 %b, i32 0
777 %vb = shufflevector <vscale x 32 x i16> %elt.head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
778 %v = call <vscale x 32 x i16> @llvm.vp.umax.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb, <vscale x 32 x i1> %m, i32 %evl)
779 ret <vscale x 32 x i16> %v
782 define <vscale x 32 x i16> @vmaxu_vx_nxv32i16_unmasked(<vscale x 32 x i16> %va, i16 %b, i32 zeroext %evl) {
783 ; CHECK-LABEL: vmaxu_vx_nxv32i16_unmasked:
785 ; CHECK-NEXT: vsetvli zero, a1, e16, m8, ta, ma
786 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
788 %elt.head = insertelement <vscale x 32 x i16> poison, i16 %b, i32 0
789 %vb = shufflevector <vscale x 32 x i16> %elt.head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
790 %head = insertelement <vscale x 32 x i1> poison, i1 true, i32 0
791 %m = shufflevector <vscale x 32 x i1> %head, <vscale x 32 x i1> poison, <vscale x 32 x i32> zeroinitializer
792 %v = call <vscale x 32 x i16> @llvm.vp.umax.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb, <vscale x 32 x i1> %m, i32 %evl)
793 ret <vscale x 32 x i16> %v
796 declare <vscale x 1 x i32> @llvm.vp.umax.nxv1i32(<vscale x 1 x i32>, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
798 define <vscale x 1 x i32> @vmaxu_vv_nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
799 ; CHECK-LABEL: vmaxu_vv_nxv1i32:
801 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
802 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
804 %v = call <vscale x 1 x i32> @llvm.vp.umax.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, <vscale x 1 x i1> %m, i32 %evl)
805 ret <vscale x 1 x i32> %v
808 define <vscale x 1 x i32> @vmaxu_vv_nxv1i32_unmasked(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, i32 zeroext %evl) {
809 ; CHECK-LABEL: vmaxu_vv_nxv1i32_unmasked:
811 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
812 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
814 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
815 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
816 %v = call <vscale x 1 x i32> @llvm.vp.umax.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, <vscale x 1 x i1> %m, i32 %evl)
817 ret <vscale x 1 x i32> %v
820 define <vscale x 1 x i32> @vmaxu_vx_nxv1i32(<vscale x 1 x i32> %va, i32 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
821 ; CHECK-LABEL: vmaxu_vx_nxv1i32:
823 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
824 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
826 %elt.head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
827 %vb = shufflevector <vscale x 1 x i32> %elt.head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
828 %v = call <vscale x 1 x i32> @llvm.vp.umax.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb, <vscale x 1 x i1> %m, i32 %evl)
829 ret <vscale x 1 x i32> %v
832 define <vscale x 1 x i32> @vmaxu_vx_nxv1i32_unmasked(<vscale x 1 x i32> %va, i32 %b, i32 zeroext %evl) {
833 ; CHECK-LABEL: vmaxu_vx_nxv1i32_unmasked:
835 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
836 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
838 %elt.head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
839 %vb = shufflevector <vscale x 1 x i32> %elt.head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
840 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
841 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
842 %v = call <vscale x 1 x i32> @llvm.vp.umax.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb, <vscale x 1 x i1> %m, i32 %evl)
843 ret <vscale x 1 x i32> %v
846 declare <vscale x 2 x i32> @llvm.vp.umax.nxv2i32(<vscale x 2 x i32>, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
848 define <vscale x 2 x i32> @vmaxu_vv_nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
849 ; CHECK-LABEL: vmaxu_vv_nxv2i32:
851 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
852 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
854 %v = call <vscale x 2 x i32> @llvm.vp.umax.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, <vscale x 2 x i1> %m, i32 %evl)
855 ret <vscale x 2 x i32> %v
858 define <vscale x 2 x i32> @vmaxu_vv_nxv2i32_unmasked(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, i32 zeroext %evl) {
859 ; CHECK-LABEL: vmaxu_vv_nxv2i32_unmasked:
861 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
862 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
864 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
865 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
866 %v = call <vscale x 2 x i32> @llvm.vp.umax.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, <vscale x 2 x i1> %m, i32 %evl)
867 ret <vscale x 2 x i32> %v
870 define <vscale x 2 x i32> @vmaxu_vx_nxv2i32(<vscale x 2 x i32> %va, i32 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
871 ; CHECK-LABEL: vmaxu_vx_nxv2i32:
873 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
874 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
876 %elt.head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
877 %vb = shufflevector <vscale x 2 x i32> %elt.head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
878 %v = call <vscale x 2 x i32> @llvm.vp.umax.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb, <vscale x 2 x i1> %m, i32 %evl)
879 ret <vscale x 2 x i32> %v
882 define <vscale x 2 x i32> @vmaxu_vx_nxv2i32_unmasked(<vscale x 2 x i32> %va, i32 %b, i32 zeroext %evl) {
883 ; CHECK-LABEL: vmaxu_vx_nxv2i32_unmasked:
885 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
886 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
888 %elt.head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
889 %vb = shufflevector <vscale x 2 x i32> %elt.head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
890 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
891 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
892 %v = call <vscale x 2 x i32> @llvm.vp.umax.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb, <vscale x 2 x i1> %m, i32 %evl)
893 ret <vscale x 2 x i32> %v
896 declare <vscale x 4 x i32> @llvm.vp.umax.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
898 define <vscale x 4 x i32> @vmaxu_vv_nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
899 ; CHECK-LABEL: vmaxu_vv_nxv4i32:
901 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
902 ; CHECK-NEXT: vmaxu.vv v8, v8, v10, v0.t
904 %v = call <vscale x 4 x i32> @llvm.vp.umax.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, <vscale x 4 x i1> %m, i32 %evl)
905 ret <vscale x 4 x i32> %v
908 define <vscale x 4 x i32> @vmaxu_vv_nxv4i32_unmasked(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, i32 zeroext %evl) {
909 ; CHECK-LABEL: vmaxu_vv_nxv4i32_unmasked:
911 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
912 ; CHECK-NEXT: vmaxu.vv v8, v8, v10
914 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
915 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
916 %v = call <vscale x 4 x i32> @llvm.vp.umax.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, <vscale x 4 x i1> %m, i32 %evl)
917 ret <vscale x 4 x i32> %v
920 define <vscale x 4 x i32> @vmaxu_vx_nxv4i32(<vscale x 4 x i32> %va, i32 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
921 ; CHECK-LABEL: vmaxu_vx_nxv4i32:
923 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
924 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
926 %elt.head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
927 %vb = shufflevector <vscale x 4 x i32> %elt.head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
928 %v = call <vscale x 4 x i32> @llvm.vp.umax.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb, <vscale x 4 x i1> %m, i32 %evl)
929 ret <vscale x 4 x i32> %v
932 define <vscale x 4 x i32> @vmaxu_vx_nxv4i32_unmasked(<vscale x 4 x i32> %va, i32 %b, i32 zeroext %evl) {
933 ; CHECK-LABEL: vmaxu_vx_nxv4i32_unmasked:
935 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
936 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
938 %elt.head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
939 %vb = shufflevector <vscale x 4 x i32> %elt.head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
940 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
941 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
942 %v = call <vscale x 4 x i32> @llvm.vp.umax.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb, <vscale x 4 x i1> %m, i32 %evl)
943 ret <vscale x 4 x i32> %v
946 declare <vscale x 8 x i32> @llvm.vp.umax.nxv8i32(<vscale x 8 x i32>, <vscale x 8 x i32>, <vscale x 8 x i1>, i32)
948 define <vscale x 8 x i32> @vmaxu_vv_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
949 ; CHECK-LABEL: vmaxu_vv_nxv8i32:
951 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
952 ; CHECK-NEXT: vmaxu.vv v8, v8, v12, v0.t
954 %v = call <vscale x 8 x i32> @llvm.vp.umax.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, <vscale x 8 x i1> %m, i32 %evl)
955 ret <vscale x 8 x i32> %v
958 define <vscale x 8 x i32> @vmaxu_vv_nxv8i32_unmasked(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, i32 zeroext %evl) {
959 ; CHECK-LABEL: vmaxu_vv_nxv8i32_unmasked:
961 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
962 ; CHECK-NEXT: vmaxu.vv v8, v8, v12
964 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
965 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
966 %v = call <vscale x 8 x i32> @llvm.vp.umax.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, <vscale x 8 x i1> %m, i32 %evl)
967 ret <vscale x 8 x i32> %v
970 define <vscale x 8 x i32> @vmaxu_vx_nxv8i32(<vscale x 8 x i32> %va, i32 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
971 ; CHECK-LABEL: vmaxu_vx_nxv8i32:
973 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
974 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
976 %elt.head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
977 %vb = shufflevector <vscale x 8 x i32> %elt.head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
978 %v = call <vscale x 8 x i32> @llvm.vp.umax.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, <vscale x 8 x i1> %m, i32 %evl)
979 ret <vscale x 8 x i32> %v
982 define <vscale x 8 x i32> @vmaxu_vx_nxv8i32_unmasked(<vscale x 8 x i32> %va, i32 %b, i32 zeroext %evl) {
983 ; CHECK-LABEL: vmaxu_vx_nxv8i32_unmasked:
985 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
986 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
988 %elt.head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
989 %vb = shufflevector <vscale x 8 x i32> %elt.head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
990 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
991 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
992 %v = call <vscale x 8 x i32> @llvm.vp.umax.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, <vscale x 8 x i1> %m, i32 %evl)
993 ret <vscale x 8 x i32> %v
996 declare <vscale x 16 x i32> @llvm.vp.umax.nxv16i32(<vscale x 16 x i32>, <vscale x 16 x i32>, <vscale x 16 x i1>, i32)
998 define <vscale x 16 x i32> @vmaxu_vv_nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
999 ; CHECK-LABEL: vmaxu_vv_nxv16i32:
1001 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1002 ; CHECK-NEXT: vmaxu.vv v8, v8, v16, v0.t
1004 %v = call <vscale x 16 x i32> @llvm.vp.umax.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, <vscale x 16 x i1> %m, i32 %evl)
1005 ret <vscale x 16 x i32> %v
1008 define <vscale x 16 x i32> @vmaxu_vv_nxv16i32_unmasked(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, i32 zeroext %evl) {
1009 ; CHECK-LABEL: vmaxu_vv_nxv16i32_unmasked:
1011 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1012 ; CHECK-NEXT: vmaxu.vv v8, v8, v16
1014 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
1015 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
1016 %v = call <vscale x 16 x i32> @llvm.vp.umax.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, <vscale x 16 x i1> %m, i32 %evl)
1017 ret <vscale x 16 x i32> %v
1020 define <vscale x 16 x i32> @vmaxu_vx_nxv16i32(<vscale x 16 x i32> %va, i32 %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1021 ; CHECK-LABEL: vmaxu_vx_nxv16i32:
1023 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1024 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
1026 %elt.head = insertelement <vscale x 16 x i32> poison, i32 %b, i32 0
1027 %vb = shufflevector <vscale x 16 x i32> %elt.head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
1028 %v = call <vscale x 16 x i32> @llvm.vp.umax.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb, <vscale x 16 x i1> %m, i32 %evl)
1029 ret <vscale x 16 x i32> %v
1032 define <vscale x 16 x i32> @vmaxu_vx_nxv16i32_unmasked(<vscale x 16 x i32> %va, i32 %b, i32 zeroext %evl) {
1033 ; CHECK-LABEL: vmaxu_vx_nxv16i32_unmasked:
1035 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1036 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
1038 %elt.head = insertelement <vscale x 16 x i32> poison, i32 %b, i32 0
1039 %vb = shufflevector <vscale x 16 x i32> %elt.head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
1040 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
1041 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
1042 %v = call <vscale x 16 x i32> @llvm.vp.umax.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb, <vscale x 16 x i1> %m, i32 %evl)
1043 ret <vscale x 16 x i32> %v
1046 ; Test that split-legalization works then the mask needs manual splitting.
1048 declare <vscale x 32 x i32> @llvm.vp.umax.nxv32i32(<vscale x 32 x i32>, <vscale x 32 x i32>, <vscale x 32 x i1>, i32)
1050 define <vscale x 32 x i32> @vmaxu_vx_nxv32i32(<vscale x 32 x i32> %va, i32 %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
1051 ; CHECK-LABEL: vmaxu_vx_nxv32i32:
1053 ; CHECK-NEXT: vmv1r.v v24, v0
1054 ; CHECK-NEXT: csrr a2, vlenb
1055 ; CHECK-NEXT: srli a3, a2, 2
1056 ; CHECK-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
1057 ; CHECK-NEXT: vslidedown.vx v0, v0, a3
1058 ; CHECK-NEXT: slli a2, a2, 1
1059 ; CHECK-NEXT: sub a3, a1, a2
1060 ; CHECK-NEXT: sltu a4, a1, a3
1061 ; CHECK-NEXT: addi a4, a4, -1
1062 ; CHECK-NEXT: and a3, a4, a3
1063 ; CHECK-NEXT: vsetvli zero, a3, e32, m8, ta, ma
1064 ; CHECK-NEXT: vmaxu.vx v16, v16, a0, v0.t
1065 ; CHECK-NEXT: bltu a1, a2, .LBB80_2
1066 ; CHECK-NEXT: # %bb.1:
1067 ; CHECK-NEXT: mv a1, a2
1068 ; CHECK-NEXT: .LBB80_2:
1069 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1070 ; CHECK-NEXT: vmv1r.v v0, v24
1071 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
1073 %elt.head = insertelement <vscale x 32 x i32> poison, i32 %b, i32 0
1074 %vb = shufflevector <vscale x 32 x i32> %elt.head, <vscale x 32 x i32> poison, <vscale x 32 x i32> zeroinitializer
1075 %v = call <vscale x 32 x i32> @llvm.vp.umax.nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i32> %vb, <vscale x 32 x i1> %m, i32 %evl)
1076 ret <vscale x 32 x i32> %v
1079 define <vscale x 32 x i32> @vmaxu_vx_nxv32i32_unmasked(<vscale x 32 x i32> %va, i32 %b, i32 zeroext %evl) {
1080 ; CHECK-LABEL: vmaxu_vx_nxv32i32_unmasked:
1082 ; CHECK-NEXT: csrr a2, vlenb
1083 ; CHECK-NEXT: slli a2, a2, 1
1084 ; CHECK-NEXT: sub a3, a1, a2
1085 ; CHECK-NEXT: sltu a4, a1, a3
1086 ; CHECK-NEXT: addi a4, a4, -1
1087 ; CHECK-NEXT: and a3, a4, a3
1088 ; CHECK-NEXT: vsetvli zero, a3, e32, m8, ta, ma
1089 ; CHECK-NEXT: vmaxu.vx v16, v16, a0
1090 ; CHECK-NEXT: bltu a1, a2, .LBB81_2
1091 ; CHECK-NEXT: # %bb.1:
1092 ; CHECK-NEXT: mv a1, a2
1093 ; CHECK-NEXT: .LBB81_2:
1094 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1095 ; CHECK-NEXT: vmaxu.vx v8, v8, a0
1097 %elt.head = insertelement <vscale x 32 x i32> poison, i32 %b, i32 0
1098 %vb = shufflevector <vscale x 32 x i32> %elt.head, <vscale x 32 x i32> poison, <vscale x 32 x i32> zeroinitializer
1099 %head = insertelement <vscale x 32 x i1> poison, i1 true, i32 0
1100 %m = shufflevector <vscale x 32 x i1> %head, <vscale x 32 x i1> poison, <vscale x 32 x i32> zeroinitializer
1101 %v = call <vscale x 32 x i32> @llvm.vp.umax.nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i32> %vb, <vscale x 32 x i1> %m, i32 %evl)
1102 ret <vscale x 32 x i32> %v
1105 ; Test splitting when the %evl is a constant (albeit an unknown one).
1107 declare i32 @llvm.vscale.i32()
1109 ; FIXME: The upper half of the operation is doing nothing.
1110 ; FIXME: The branches comparing vscale vs. vscale should be constant-foldable.
1112 define <vscale x 32 x i32> @vmaxu_vx_nxv32i32_evl_nx8(<vscale x 32 x i32> %va, i32 %b, <vscale x 32 x i1> %m) {
1113 ; CHECK-LABEL: vmaxu_vx_nxv32i32_evl_nx8:
1115 ; CHECK-NEXT: vmv1r.v v24, v0
1116 ; CHECK-NEXT: csrr a1, vlenb
1117 ; CHECK-NEXT: srli a2, a1, 2
1118 ; CHECK-NEXT: vsetvli a3, zero, e8, mf2, ta, ma
1119 ; CHECK-NEXT: vslidedown.vx v0, v0, a2
1120 ; CHECK-NEXT: slli a2, a1, 1
1121 ; CHECK-NEXT: sub a3, a1, a2
1122 ; CHECK-NEXT: sltu a4, a1, a3
1123 ; CHECK-NEXT: addi a4, a4, -1
1124 ; CHECK-NEXT: and a3, a4, a3
1125 ; CHECK-NEXT: vsetvli zero, a3, e32, m8, ta, ma
1126 ; CHECK-NEXT: vmaxu.vx v16, v16, a0, v0.t
1127 ; CHECK-NEXT: bltu a1, a2, .LBB82_2
1128 ; CHECK-NEXT: # %bb.1:
1129 ; CHECK-NEXT: mv a1, a2
1130 ; CHECK-NEXT: .LBB82_2:
1131 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1132 ; CHECK-NEXT: vmv1r.v v0, v24
1133 ; CHECK-NEXT: vmaxu.vx v8, v8, a0, v0.t
1135 %elt.head = insertelement <vscale x 32 x i32> poison, i32 %b, i32 0
1136 %vb = shufflevector <vscale x 32 x i32> %elt.head, <vscale x 32 x i32> poison, <vscale x 32 x i32> zeroinitializer
1137 %evl = call i32 @llvm.vscale.i32()
1138 %evl0 = mul i32 %evl, 8
1139 %v = call <vscale x 32 x i32> @llvm.vp.umax.nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i32> %vb, <vscale x 32 x i1> %m, i32 %evl0)
1140 ret <vscale x 32 x i32> %v
1143 ; FIXME: The first vmaxu.vx should be able to infer that its AVL is equivalent to VLMAX.
1144 ; FIXME: The upper half of the operation is doing nothing but we don't catch
1145 ; that on RV64; we issue a usubsat(and (vscale x 16), 0xffffffff, vscale x 16)
1146 ; (the "original" %evl is the "and", due to known-bits issues with legalizing
1147 ; the i32 %evl to i64) and this isn't detected as 0.
1148 ; This could be resolved in the future with more detailed KnownBits analysis
1151 define <vscale x 32 x i32> @vmaxu_vx_nxv32i32_evl_nx16(<vscale x 32 x i32> %va, i32 %b, <vscale x 32 x i1> %m) {
1152 ; RV32-LABEL: vmaxu_vx_nxv32i32_evl_nx16:
1154 ; RV32-NEXT: csrr a1, vlenb
1155 ; RV32-NEXT: slli a1, a1, 1
1156 ; RV32-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1157 ; RV32-NEXT: vmaxu.vx v8, v8, a0, v0.t
1160 ; RV64-LABEL: vmaxu_vx_nxv32i32_evl_nx16:
1162 ; RV64-NEXT: csrr a1, vlenb
1163 ; RV64-NEXT: srli a2, a1, 2
1164 ; RV64-NEXT: vsetvli a3, zero, e8, mf2, ta, ma
1165 ; RV64-NEXT: vslidedown.vx v24, v0, a2
1166 ; RV64-NEXT: slli a1, a1, 1
1167 ; RV64-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1168 ; RV64-NEXT: vmaxu.vx v8, v8, a0, v0.t
1169 ; RV64-NEXT: vsetivli zero, 0, e32, m8, ta, ma
1170 ; RV64-NEXT: vmv1r.v v0, v24
1171 ; RV64-NEXT: vmaxu.vx v16, v16, a0, v0.t
1173 %elt.head = insertelement <vscale x 32 x i32> poison, i32 %b, i32 0
1174 %vb = shufflevector <vscale x 32 x i32> %elt.head, <vscale x 32 x i32> poison, <vscale x 32 x i32> zeroinitializer
1175 %evl = call i32 @llvm.vscale.i32()
1176 %evl0 = mul i32 %evl, 16
1177 %v = call <vscale x 32 x i32> @llvm.vp.umax.nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i32> %vb, <vscale x 32 x i1> %m, i32 %evl0)
1178 ret <vscale x 32 x i32> %v
1181 declare <vscale x 1 x i64> @llvm.vp.umax.nxv1i64(<vscale x 1 x i64>, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1183 define <vscale x 1 x i64> @vmaxu_vv_nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1184 ; CHECK-LABEL: vmaxu_vv_nxv1i64:
1186 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1187 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
1189 %v = call <vscale x 1 x i64> @llvm.vp.umax.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, <vscale x 1 x i1> %m, i32 %evl)
1190 ret <vscale x 1 x i64> %v
1193 define <vscale x 1 x i64> @vmaxu_vv_nxv1i64_unmasked(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, i32 zeroext %evl) {
1194 ; CHECK-LABEL: vmaxu_vv_nxv1i64_unmasked:
1196 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1197 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
1199 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
1200 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
1201 %v = call <vscale x 1 x i64> @llvm.vp.umax.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, <vscale x 1 x i1> %m, i32 %evl)
1202 ret <vscale x 1 x i64> %v
1205 define <vscale x 1 x i64> @vmaxu_vx_nxv1i64(<vscale x 1 x i64> %va, i64 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1206 ; RV32-LABEL: vmaxu_vx_nxv1i64:
1208 ; RV32-NEXT: addi sp, sp, -16
1209 ; RV32-NEXT: .cfi_def_cfa_offset 16
1210 ; RV32-NEXT: sw a1, 12(sp)
1211 ; RV32-NEXT: sw a0, 8(sp)
1212 ; RV32-NEXT: addi a0, sp, 8
1213 ; RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1214 ; RV32-NEXT: vlse64.v v9, (a0), zero
1215 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1216 ; RV32-NEXT: vmaxu.vv v8, v8, v9, v0.t
1217 ; RV32-NEXT: addi sp, sp, 16
1220 ; RV64-LABEL: vmaxu_vx_nxv1i64:
1222 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1223 ; RV64-NEXT: vmaxu.vx v8, v8, a0, v0.t
1225 %elt.head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
1226 %vb = shufflevector <vscale x 1 x i64> %elt.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
1227 %v = call <vscale x 1 x i64> @llvm.vp.umax.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb, <vscale x 1 x i1> %m, i32 %evl)
1228 ret <vscale x 1 x i64> %v
1231 define <vscale x 1 x i64> @vmaxu_vx_nxv1i64_unmasked(<vscale x 1 x i64> %va, i64 %b, i32 zeroext %evl) {
1232 ; RV32-LABEL: vmaxu_vx_nxv1i64_unmasked:
1234 ; RV32-NEXT: addi sp, sp, -16
1235 ; RV32-NEXT: .cfi_def_cfa_offset 16
1236 ; RV32-NEXT: sw a1, 12(sp)
1237 ; RV32-NEXT: sw a0, 8(sp)
1238 ; RV32-NEXT: addi a0, sp, 8
1239 ; RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1240 ; RV32-NEXT: vlse64.v v9, (a0), zero
1241 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1242 ; RV32-NEXT: vmaxu.vv v8, v8, v9
1243 ; RV32-NEXT: addi sp, sp, 16
1246 ; RV64-LABEL: vmaxu_vx_nxv1i64_unmasked:
1248 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1249 ; RV64-NEXT: vmaxu.vx v8, v8, a0
1251 %elt.head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
1252 %vb = shufflevector <vscale x 1 x i64> %elt.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
1253 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
1254 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
1255 %v = call <vscale x 1 x i64> @llvm.vp.umax.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb, <vscale x 1 x i1> %m, i32 %evl)
1256 ret <vscale x 1 x i64> %v
1259 declare <vscale x 2 x i64> @llvm.vp.umax.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1261 define <vscale x 2 x i64> @vmaxu_vv_nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1262 ; CHECK-LABEL: vmaxu_vv_nxv2i64:
1264 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1265 ; CHECK-NEXT: vmaxu.vv v8, v8, v10, v0.t
1267 %v = call <vscale x 2 x i64> @llvm.vp.umax.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, <vscale x 2 x i1> %m, i32 %evl)
1268 ret <vscale x 2 x i64> %v
1271 define <vscale x 2 x i64> @vmaxu_vv_nxv2i64_unmasked(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, i32 zeroext %evl) {
1272 ; CHECK-LABEL: vmaxu_vv_nxv2i64_unmasked:
1274 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1275 ; CHECK-NEXT: vmaxu.vv v8, v8, v10
1277 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
1278 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
1279 %v = call <vscale x 2 x i64> @llvm.vp.umax.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, <vscale x 2 x i1> %m, i32 %evl)
1280 ret <vscale x 2 x i64> %v
1283 define <vscale x 2 x i64> @vmaxu_vx_nxv2i64(<vscale x 2 x i64> %va, i64 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1284 ; RV32-LABEL: vmaxu_vx_nxv2i64:
1286 ; RV32-NEXT: addi sp, sp, -16
1287 ; RV32-NEXT: .cfi_def_cfa_offset 16
1288 ; RV32-NEXT: sw a1, 12(sp)
1289 ; RV32-NEXT: sw a0, 8(sp)
1290 ; RV32-NEXT: addi a0, sp, 8
1291 ; RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1292 ; RV32-NEXT: vlse64.v v10, (a0), zero
1293 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1294 ; RV32-NEXT: vmaxu.vv v8, v8, v10, v0.t
1295 ; RV32-NEXT: addi sp, sp, 16
1298 ; RV64-LABEL: vmaxu_vx_nxv2i64:
1300 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1301 ; RV64-NEXT: vmaxu.vx v8, v8, a0, v0.t
1303 %elt.head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
1304 %vb = shufflevector <vscale x 2 x i64> %elt.head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
1305 %v = call <vscale x 2 x i64> @llvm.vp.umax.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb, <vscale x 2 x i1> %m, i32 %evl)
1306 ret <vscale x 2 x i64> %v
1309 define <vscale x 2 x i64> @vmaxu_vx_nxv2i64_unmasked(<vscale x 2 x i64> %va, i64 %b, i32 zeroext %evl) {
1310 ; RV32-LABEL: vmaxu_vx_nxv2i64_unmasked:
1312 ; RV32-NEXT: addi sp, sp, -16
1313 ; RV32-NEXT: .cfi_def_cfa_offset 16
1314 ; RV32-NEXT: sw a1, 12(sp)
1315 ; RV32-NEXT: sw a0, 8(sp)
1316 ; RV32-NEXT: addi a0, sp, 8
1317 ; RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1318 ; RV32-NEXT: vlse64.v v10, (a0), zero
1319 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1320 ; RV32-NEXT: vmaxu.vv v8, v8, v10
1321 ; RV32-NEXT: addi sp, sp, 16
1324 ; RV64-LABEL: vmaxu_vx_nxv2i64_unmasked:
1326 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1327 ; RV64-NEXT: vmaxu.vx v8, v8, a0
1329 %elt.head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
1330 %vb = shufflevector <vscale x 2 x i64> %elt.head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
1331 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
1332 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
1333 %v = call <vscale x 2 x i64> @llvm.vp.umax.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb, <vscale x 2 x i1> %m, i32 %evl)
1334 ret <vscale x 2 x i64> %v
1337 declare <vscale x 4 x i64> @llvm.vp.umax.nxv4i64(<vscale x 4 x i64>, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
1339 define <vscale x 4 x i64> @vmaxu_vv_nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1340 ; CHECK-LABEL: vmaxu_vv_nxv4i64:
1342 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1343 ; CHECK-NEXT: vmaxu.vv v8, v8, v12, v0.t
1345 %v = call <vscale x 4 x i64> @llvm.vp.umax.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, <vscale x 4 x i1> %m, i32 %evl)
1346 ret <vscale x 4 x i64> %v
1349 define <vscale x 4 x i64> @vmaxu_vv_nxv4i64_unmasked(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, i32 zeroext %evl) {
1350 ; CHECK-LABEL: vmaxu_vv_nxv4i64_unmasked:
1352 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1353 ; CHECK-NEXT: vmaxu.vv v8, v8, v12
1355 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
1356 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
1357 %v = call <vscale x 4 x i64> @llvm.vp.umax.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, <vscale x 4 x i1> %m, i32 %evl)
1358 ret <vscale x 4 x i64> %v
1361 define <vscale x 4 x i64> @vmaxu_vx_nxv4i64(<vscale x 4 x i64> %va, i64 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1362 ; RV32-LABEL: vmaxu_vx_nxv4i64:
1364 ; RV32-NEXT: addi sp, sp, -16
1365 ; RV32-NEXT: .cfi_def_cfa_offset 16
1366 ; RV32-NEXT: sw a1, 12(sp)
1367 ; RV32-NEXT: sw a0, 8(sp)
1368 ; RV32-NEXT: addi a0, sp, 8
1369 ; RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1370 ; RV32-NEXT: vlse64.v v12, (a0), zero
1371 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
1372 ; RV32-NEXT: vmaxu.vv v8, v8, v12, v0.t
1373 ; RV32-NEXT: addi sp, sp, 16
1376 ; RV64-LABEL: vmaxu_vx_nxv4i64:
1378 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
1379 ; RV64-NEXT: vmaxu.vx v8, v8, a0, v0.t
1381 %elt.head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
1382 %vb = shufflevector <vscale x 4 x i64> %elt.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
1383 %v = call <vscale x 4 x i64> @llvm.vp.umax.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb, <vscale x 4 x i1> %m, i32 %evl)
1384 ret <vscale x 4 x i64> %v
1387 define <vscale x 4 x i64> @vmaxu_vx_nxv4i64_unmasked(<vscale x 4 x i64> %va, i64 %b, i32 zeroext %evl) {
1388 ; RV32-LABEL: vmaxu_vx_nxv4i64_unmasked:
1390 ; RV32-NEXT: addi sp, sp, -16
1391 ; RV32-NEXT: .cfi_def_cfa_offset 16
1392 ; RV32-NEXT: sw a1, 12(sp)
1393 ; RV32-NEXT: sw a0, 8(sp)
1394 ; RV32-NEXT: addi a0, sp, 8
1395 ; RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1396 ; RV32-NEXT: vlse64.v v12, (a0), zero
1397 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
1398 ; RV32-NEXT: vmaxu.vv v8, v8, v12
1399 ; RV32-NEXT: addi sp, sp, 16
1402 ; RV64-LABEL: vmaxu_vx_nxv4i64_unmasked:
1404 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
1405 ; RV64-NEXT: vmaxu.vx v8, v8, a0
1407 %elt.head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
1408 %vb = shufflevector <vscale x 4 x i64> %elt.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
1409 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
1410 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
1411 %v = call <vscale x 4 x i64> @llvm.vp.umax.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb, <vscale x 4 x i1> %m, i32 %evl)
1412 ret <vscale x 4 x i64> %v
1415 declare <vscale x 8 x i64> @llvm.vp.umax.nxv8i64(<vscale x 8 x i64>, <vscale x 8 x i64>, <vscale x 8 x i1>, i32)
1417 define <vscale x 8 x i64> @vmaxu_vv_nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1418 ; CHECK-LABEL: vmaxu_vv_nxv8i64:
1420 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1421 ; CHECK-NEXT: vmaxu.vv v8, v8, v16, v0.t
1423 %v = call <vscale x 8 x i64> @llvm.vp.umax.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, <vscale x 8 x i1> %m, i32 %evl)
1424 ret <vscale x 8 x i64> %v
1427 define <vscale x 8 x i64> @vmaxu_vv_nxv8i64_unmasked(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, i32 zeroext %evl) {
1428 ; CHECK-LABEL: vmaxu_vv_nxv8i64_unmasked:
1430 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1431 ; CHECK-NEXT: vmaxu.vv v8, v8, v16
1433 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
1434 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
1435 %v = call <vscale x 8 x i64> @llvm.vp.umax.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, <vscale x 8 x i1> %m, i32 %evl)
1436 ret <vscale x 8 x i64> %v
1439 define <vscale x 8 x i64> @vmaxu_vx_nxv8i64(<vscale x 8 x i64> %va, i64 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1440 ; RV32-LABEL: vmaxu_vx_nxv8i64:
1442 ; RV32-NEXT: addi sp, sp, -16
1443 ; RV32-NEXT: .cfi_def_cfa_offset 16
1444 ; RV32-NEXT: sw a1, 12(sp)
1445 ; RV32-NEXT: sw a0, 8(sp)
1446 ; RV32-NEXT: addi a0, sp, 8
1447 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1448 ; RV32-NEXT: vlse64.v v16, (a0), zero
1449 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1450 ; RV32-NEXT: vmaxu.vv v8, v8, v16, v0.t
1451 ; RV32-NEXT: addi sp, sp, 16
1454 ; RV64-LABEL: vmaxu_vx_nxv8i64:
1456 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1457 ; RV64-NEXT: vmaxu.vx v8, v8, a0, v0.t
1459 %elt.head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
1460 %vb = shufflevector <vscale x 8 x i64> %elt.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
1461 %v = call <vscale x 8 x i64> @llvm.vp.umax.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb, <vscale x 8 x i1> %m, i32 %evl)
1462 ret <vscale x 8 x i64> %v
1465 define <vscale x 8 x i64> @vmaxu_vx_nxv8i64_unmasked(<vscale x 8 x i64> %va, i64 %b, i32 zeroext %evl) {
1466 ; RV32-LABEL: vmaxu_vx_nxv8i64_unmasked:
1468 ; RV32-NEXT: addi sp, sp, -16
1469 ; RV32-NEXT: .cfi_def_cfa_offset 16
1470 ; RV32-NEXT: sw a1, 12(sp)
1471 ; RV32-NEXT: sw a0, 8(sp)
1472 ; RV32-NEXT: addi a0, sp, 8
1473 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1474 ; RV32-NEXT: vlse64.v v16, (a0), zero
1475 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1476 ; RV32-NEXT: vmaxu.vv v8, v8, v16
1477 ; RV32-NEXT: addi sp, sp, 16
1480 ; RV64-LABEL: vmaxu_vx_nxv8i64_unmasked:
1482 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1483 ; RV64-NEXT: vmaxu.vx v8, v8, a0
1485 %elt.head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
1486 %vb = shufflevector <vscale x 8 x i64> %elt.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
1487 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
1488 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
1489 %v = call <vscale x 8 x i64> @llvm.vp.umax.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb, <vscale x 8 x i1> %m, i32 %evl)
1490 ret <vscale x 8 x i64> %v