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: vmv.v.x v9, a0
15 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
16 ; CHECK-NEXT: vand.vx v8, v8, a2, v0.t
17 ; CHECK-NEXT: vand.vx v9, v9, a2, v0.t
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 %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> splat (i1 true), i32 %evl)
45 ret <vscale x 1 x i8> %v
48 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) {
49 ; CHECK-LABEL: vmaxu_vx_nxv1i8:
51 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
52 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv1i8_commute(<vscale x 1 x i8> %va, i8 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
61 ; CHECK-LABEL: vmaxu_vx_nxv1i8_commute:
63 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
64 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv1i8_unmasked(<vscale x 1 x i8> %va, i8 %b, i32 zeroext %evl) {
73 ; CHECK-LABEL: vmaxu_vx_nxv1i8_unmasked:
75 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
76 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv2i8(<vscale x 2 x i8>, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
86 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) {
87 ; CHECK-LABEL: vmaxu_vv_nxv2i8:
89 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
90 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
92 %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)
93 ret <vscale x 2 x i8> %v
96 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) {
97 ; CHECK-LABEL: vmaxu_vv_nxv2i8_unmasked:
99 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
100 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
102 %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> splat (i1 true), i32 %evl)
103 ret <vscale x 2 x i8> %v
106 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) {
107 ; CHECK-LABEL: vmaxu_vx_nxv2i8:
109 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
110 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv2i8_unmasked(<vscale x 2 x i8> %va, i8 %b, i32 zeroext %evl) {
119 ; CHECK-LABEL: vmaxu_vx_nxv2i8_unmasked:
121 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
122 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv3i8(<vscale x 3 x i8>, <vscale x 3 x i8>, <vscale x 3 x i1>, i32)
132 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) {
133 ; CHECK-LABEL: vmaxu_vv_nxv3i8:
135 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
136 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
138 %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)
139 ret <vscale x 3 x i8> %v
142 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) {
143 ; CHECK-LABEL: vmaxu_vv_nxv3i8_unmasked:
145 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
146 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
148 %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> splat (i1 true), i32 %evl)
149 ret <vscale x 3 x i8> %v
152 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) {
153 ; CHECK-LABEL: vmaxu_vx_nxv3i8:
155 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
156 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv3i8_unmasked(<vscale x 3 x i8> %va, i8 %b, i32 zeroext %evl) {
165 ; CHECK-LABEL: vmaxu_vx_nxv3i8_unmasked:
167 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
168 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv4i8(<vscale x 4 x i8>, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
178 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) {
179 ; CHECK-LABEL: vmaxu_vv_nxv4i8:
181 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
182 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
184 %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)
185 ret <vscale x 4 x i8> %v
188 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) {
189 ; CHECK-LABEL: vmaxu_vv_nxv4i8_unmasked:
191 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
192 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
194 %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> splat (i1 true), i32 %evl)
195 ret <vscale x 4 x i8> %v
198 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) {
199 ; CHECK-LABEL: vmaxu_vx_nxv4i8:
201 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
202 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv4i8_unmasked(<vscale x 4 x i8> %va, i8 %b, i32 zeroext %evl) {
211 ; CHECK-LABEL: vmaxu_vx_nxv4i8_unmasked:
213 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
214 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv8i8(<vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i1>, i32)
224 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) {
225 ; CHECK-LABEL: vmaxu_vv_nxv8i8:
227 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
228 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
230 %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)
231 ret <vscale x 8 x i8> %v
234 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) {
235 ; CHECK-LABEL: vmaxu_vv_nxv8i8_unmasked:
237 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
238 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
240 %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> splat (i1 true), i32 %evl)
241 ret <vscale x 8 x i8> %v
244 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) {
245 ; CHECK-LABEL: vmaxu_vx_nxv8i8:
247 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
248 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv8i8_unmasked(<vscale x 8 x i8> %va, i8 %b, i32 zeroext %evl) {
257 ; CHECK-LABEL: vmaxu_vx_nxv8i8_unmasked:
259 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
260 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i1>, i32)
270 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) {
271 ; CHECK-LABEL: vmaxu_vv_nxv16i8:
273 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
274 ; CHECK-NEXT: vmaxu.vv v8, v8, v10, v0.t
276 %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)
277 ret <vscale x 16 x i8> %v
280 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) {
281 ; CHECK-LABEL: vmaxu_vv_nxv16i8_unmasked:
283 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
284 ; CHECK-NEXT: vmaxu.vv v8, v8, v10
286 %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> splat (i1 true), i32 %evl)
287 ret <vscale x 16 x i8> %v
290 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) {
291 ; CHECK-LABEL: vmaxu_vx_nxv16i8:
293 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
294 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv16i8_unmasked(<vscale x 16 x i8> %va, i8 %b, i32 zeroext %evl) {
303 ; CHECK-LABEL: vmaxu_vx_nxv16i8_unmasked:
305 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
306 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv32i8(<vscale x 32 x i8>, <vscale x 32 x i8>, <vscale x 32 x i1>, i32)
316 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) {
317 ; CHECK-LABEL: vmaxu_vv_nxv32i8:
319 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
320 ; CHECK-NEXT: vmaxu.vv v8, v8, v12, v0.t
322 %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)
323 ret <vscale x 32 x i8> %v
326 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) {
327 ; CHECK-LABEL: vmaxu_vv_nxv32i8_unmasked:
329 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
330 ; CHECK-NEXT: vmaxu.vv v8, v8, v12
332 %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> splat (i1 true), i32 %evl)
333 ret <vscale x 32 x i8> %v
336 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) {
337 ; CHECK-LABEL: vmaxu_vx_nxv32i8:
339 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
340 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv32i8_unmasked(<vscale x 32 x i8> %va, i8 %b, i32 zeroext %evl) {
349 ; CHECK-LABEL: vmaxu_vx_nxv32i8_unmasked:
351 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
352 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv64i8(<vscale x 64 x i8>, <vscale x 64 x i8>, <vscale x 64 x i1>, i32)
362 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) {
363 ; CHECK-LABEL: vmaxu_vv_nxv64i8:
365 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
366 ; CHECK-NEXT: vmaxu.vv v8, v8, v16, v0.t
368 %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)
369 ret <vscale x 64 x i8> %v
372 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) {
373 ; CHECK-LABEL: vmaxu_vv_nxv64i8_unmasked:
375 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
376 ; CHECK-NEXT: vmaxu.vv v8, v8, v16
378 %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> splat (i1 true), i32 %evl)
379 ret <vscale x 64 x i8> %v
382 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) {
383 ; CHECK-LABEL: vmaxu_vx_nxv64i8:
385 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
386 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv64i8_unmasked(<vscale x 64 x i8> %va, i8 %b, i32 zeroext %evl) {
395 ; CHECK-LABEL: vmaxu_vx_nxv64i8_unmasked:
397 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
398 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv128i8(<vscale x 128 x i8>, <vscale x 128 x i8>, <vscale x 128 x i1>, i32)
410 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) {
411 ; CHECK-LABEL: vmaxu_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: vmaxu.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: vmaxu.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.umax.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> @vmaxu_vx_nxv128i8_unmasked(<vscale x 128 x i8> %va, i8 %b, i32 zeroext %evl) {
439 ; CHECK-LABEL: vmaxu_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: vmaxu.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: vmaxu.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.umax.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.umax.nxv1i16(<vscale x 1 x i16>, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
464 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) {
465 ; CHECK-LABEL: vmaxu_vv_nxv1i16:
467 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
468 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
470 %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)
471 ret <vscale x 1 x i16> %v
474 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) {
475 ; CHECK-LABEL: vmaxu_vv_nxv1i16_unmasked:
477 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
478 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
480 %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> splat (i1 true), i32 %evl)
481 ret <vscale x 1 x i16> %v
484 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) {
485 ; CHECK-LABEL: vmaxu_vx_nxv1i16:
487 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
488 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv1i16_unmasked(<vscale x 1 x i16> %va, i16 %b, i32 zeroext %evl) {
497 ; CHECK-LABEL: vmaxu_vx_nxv1i16_unmasked:
499 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
500 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv2i16(<vscale x 2 x i16>, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
510 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) {
511 ; CHECK-LABEL: vmaxu_vv_nxv2i16:
513 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
514 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
516 %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)
517 ret <vscale x 2 x i16> %v
520 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) {
521 ; CHECK-LABEL: vmaxu_vv_nxv2i16_unmasked:
523 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
524 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
526 %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> splat (i1 true), i32 %evl)
527 ret <vscale x 2 x i16> %v
530 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) {
531 ; CHECK-LABEL: vmaxu_vx_nxv2i16:
533 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
534 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv2i16_unmasked(<vscale x 2 x i16> %va, i16 %b, i32 zeroext %evl) {
543 ; CHECK-LABEL: vmaxu_vx_nxv2i16_unmasked:
545 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
546 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv4i16(<vscale x 4 x i16>, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
556 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) {
557 ; CHECK-LABEL: vmaxu_vv_nxv4i16:
559 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
560 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
562 %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)
563 ret <vscale x 4 x i16> %v
566 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) {
567 ; CHECK-LABEL: vmaxu_vv_nxv4i16_unmasked:
569 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
570 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
572 %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> splat (i1 true), i32 %evl)
573 ret <vscale x 4 x i16> %v
576 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) {
577 ; CHECK-LABEL: vmaxu_vx_nxv4i16:
579 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
580 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv4i16_unmasked(<vscale x 4 x i16> %va, i16 %b, i32 zeroext %evl) {
589 ; CHECK-LABEL: vmaxu_vx_nxv4i16_unmasked:
591 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
592 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i1>, i32)
602 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) {
603 ; CHECK-LABEL: vmaxu_vv_nxv8i16:
605 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
606 ; CHECK-NEXT: vmaxu.vv v8, v8, v10, v0.t
608 %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)
609 ret <vscale x 8 x i16> %v
612 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) {
613 ; CHECK-LABEL: vmaxu_vv_nxv8i16_unmasked:
615 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
616 ; CHECK-NEXT: vmaxu.vv v8, v8, v10
618 %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> splat (i1 true), i32 %evl)
619 ret <vscale x 8 x i16> %v
622 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) {
623 ; CHECK-LABEL: vmaxu_vx_nxv8i16:
625 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
626 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv8i16_unmasked(<vscale x 8 x i16> %va, i16 %b, i32 zeroext %evl) {
635 ; CHECK-LABEL: vmaxu_vx_nxv8i16_unmasked:
637 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
638 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv16i16(<vscale x 16 x i16>, <vscale x 16 x i16>, <vscale x 16 x i1>, i32)
648 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) {
649 ; CHECK-LABEL: vmaxu_vv_nxv16i16:
651 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
652 ; CHECK-NEXT: vmaxu.vv v8, v8, v12, v0.t
654 %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)
655 ret <vscale x 16 x i16> %v
658 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) {
659 ; CHECK-LABEL: vmaxu_vv_nxv16i16_unmasked:
661 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
662 ; CHECK-NEXT: vmaxu.vv v8, v8, v12
664 %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> splat (i1 true), i32 %evl)
665 ret <vscale x 16 x i16> %v
668 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) {
669 ; CHECK-LABEL: vmaxu_vx_nxv16i16:
671 ; CHECK-NEXT: vsetvli zero, a1, e16, m4, ta, ma
672 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv16i16_unmasked(<vscale x 16 x i16> %va, i16 %b, i32 zeroext %evl) {
681 ; CHECK-LABEL: vmaxu_vx_nxv16i16_unmasked:
683 ; CHECK-NEXT: vsetvli zero, a1, e16, m4, ta, ma
684 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv32i16(<vscale x 32 x i16>, <vscale x 32 x i16>, <vscale x 32 x i1>, i32)
694 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) {
695 ; CHECK-LABEL: vmaxu_vv_nxv32i16:
697 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
698 ; CHECK-NEXT: vmaxu.vv v8, v8, v16, v0.t
700 %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)
701 ret <vscale x 32 x i16> %v
704 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) {
705 ; CHECK-LABEL: vmaxu_vv_nxv32i16_unmasked:
707 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
708 ; CHECK-NEXT: vmaxu.vv v8, v8, v16
710 %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> splat (i1 true), i32 %evl)
711 ret <vscale x 32 x i16> %v
714 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) {
715 ; CHECK-LABEL: vmaxu_vx_nxv32i16:
717 ; CHECK-NEXT: vsetvli zero, a1, e16, m8, ta, ma
718 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv32i16_unmasked(<vscale x 32 x i16> %va, i16 %b, i32 zeroext %evl) {
727 ; CHECK-LABEL: vmaxu_vx_nxv32i16_unmasked:
729 ; CHECK-NEXT: vsetvli zero, a1, e16, m8, ta, ma
730 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv1i32(<vscale x 1 x i32>, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
740 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) {
741 ; CHECK-LABEL: vmaxu_vv_nxv1i32:
743 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
744 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
746 %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)
747 ret <vscale x 1 x i32> %v
750 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) {
751 ; CHECK-LABEL: vmaxu_vv_nxv1i32_unmasked:
753 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
754 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
756 %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> splat (i1 true), i32 %evl)
757 ret <vscale x 1 x i32> %v
760 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) {
761 ; CHECK-LABEL: vmaxu_vx_nxv1i32:
763 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
764 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv1i32_unmasked(<vscale x 1 x i32> %va, i32 %b, i32 zeroext %evl) {
773 ; CHECK-LABEL: vmaxu_vx_nxv1i32_unmasked:
775 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
776 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv2i32(<vscale x 2 x i32>, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
786 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) {
787 ; CHECK-LABEL: vmaxu_vv_nxv2i32:
789 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
790 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
792 %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)
793 ret <vscale x 2 x i32> %v
796 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) {
797 ; CHECK-LABEL: vmaxu_vv_nxv2i32_unmasked:
799 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
800 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
802 %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> splat (i1 true), i32 %evl)
803 ret <vscale x 2 x i32> %v
806 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) {
807 ; CHECK-LABEL: vmaxu_vx_nxv2i32:
809 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
810 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv2i32_unmasked(<vscale x 2 x i32> %va, i32 %b, i32 zeroext %evl) {
819 ; CHECK-LABEL: vmaxu_vx_nxv2i32_unmasked:
821 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
822 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
832 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) {
833 ; CHECK-LABEL: vmaxu_vv_nxv4i32:
835 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
836 ; CHECK-NEXT: vmaxu.vv v8, v8, v10, v0.t
838 %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)
839 ret <vscale x 4 x i32> %v
842 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) {
843 ; CHECK-LABEL: vmaxu_vv_nxv4i32_unmasked:
845 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
846 ; CHECK-NEXT: vmaxu.vv v8, v8, v10
848 %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> splat (i1 true), i32 %evl)
849 ret <vscale x 4 x i32> %v
852 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) {
853 ; CHECK-LABEL: vmaxu_vx_nxv4i32:
855 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
856 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv4i32_unmasked(<vscale x 4 x i32> %va, i32 %b, i32 zeroext %evl) {
865 ; CHECK-LABEL: vmaxu_vx_nxv4i32_unmasked:
867 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
868 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv8i32(<vscale x 8 x i32>, <vscale x 8 x i32>, <vscale x 8 x i1>, i32)
878 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) {
879 ; CHECK-LABEL: vmaxu_vv_nxv8i32:
881 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
882 ; CHECK-NEXT: vmaxu.vv v8, v8, v12, v0.t
884 %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)
885 ret <vscale x 8 x i32> %v
888 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) {
889 ; CHECK-LABEL: vmaxu_vv_nxv8i32_unmasked:
891 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
892 ; CHECK-NEXT: vmaxu.vv v8, v8, v12
894 %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> splat (i1 true), i32 %evl)
895 ret <vscale x 8 x i32> %v
898 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) {
899 ; CHECK-LABEL: vmaxu_vx_nxv8i32:
901 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
902 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv8i32_unmasked(<vscale x 8 x i32> %va, i32 %b, i32 zeroext %evl) {
911 ; CHECK-LABEL: vmaxu_vx_nxv8i32_unmasked:
913 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
914 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv16i32(<vscale x 16 x i32>, <vscale x 16 x i32>, <vscale x 16 x i1>, i32)
924 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) {
925 ; CHECK-LABEL: vmaxu_vv_nxv16i32:
927 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
928 ; CHECK-NEXT: vmaxu.vv v8, v8, v16, v0.t
930 %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)
931 ret <vscale x 16 x i32> %v
934 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) {
935 ; CHECK-LABEL: vmaxu_vv_nxv16i32_unmasked:
937 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
938 ; CHECK-NEXT: vmaxu.vv v8, v8, v16
940 %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> splat (i1 true), i32 %evl)
941 ret <vscale x 16 x i32> %v
944 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) {
945 ; CHECK-LABEL: vmaxu_vx_nxv16i32:
947 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
948 ; CHECK-NEXT: vmaxu.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.umax.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> @vmaxu_vx_nxv16i32_unmasked(<vscale x 16 x i32> %va, i32 %b, i32 zeroext %evl) {
957 ; CHECK-LABEL: vmaxu_vx_nxv16i32_unmasked:
959 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
960 ; CHECK-NEXT: vmaxu.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.umax.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.umax.nxv32i32(<vscale x 32 x i32>, <vscale x 32 x i32>, <vscale x 32 x i1>, i32)
972 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) {
973 ; CHECK-LABEL: vmaxu_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: slli a2, a2, 1
979 ; CHECK-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
980 ; CHECK-NEXT: vslidedown.vx v0, v0, a3
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: vmaxu.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: vmaxu.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.umax.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> @vmaxu_vx_nxv32i32_unmasked(<vscale x 32 x i32> %va, i32 %b, i32 zeroext %evl) {
1002 ; CHECK-LABEL: vmaxu_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: vmaxu.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: vmaxu.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.umax.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> @vmaxu_vx_nxv32i32_evl_nx8(<vscale x 32 x i32> %va, i32 %b, <vscale x 32 x i1> %m) {
1033 ; CHECK-LABEL: vmaxu_vx_nxv32i32_evl_nx8:
1035 ; CHECK-NEXT: vmv1r.v v24, v0
1036 ; CHECK-NEXT: csrr a1, vlenb
1037 ; CHECK-NEXT: srli a3, a1, 2
1038 ; CHECK-NEXT: slli a2, a1, 1
1039 ; CHECK-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
1040 ; CHECK-NEXT: vslidedown.vx v0, v0, a3
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: vmaxu.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: vmaxu.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.umax.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 upper half of the operation is doing nothing but we don't catch
1064 ; that on RV64; we issue a usubsat(and (vscale x 16), 0xffffffff, vscale x 16)
1065 ; (the "original" %evl is the "and", due to known-bits issues with legalizing
1066 ; the i32 %evl to i64) and this isn't detected as 0.
1067 ; This could be resolved in the future with more detailed KnownBits analysis
1070 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) {
1071 ; RV32-LABEL: vmaxu_vx_nxv32i32_evl_nx16:
1073 ; RV32-NEXT: vsetvli a1, zero, e32, m8, ta, ma
1074 ; RV32-NEXT: vmaxu.vx v8, v8, a0, v0.t
1077 ; RV64-LABEL: vmaxu_vx_nxv32i32_evl_nx16:
1079 ; RV64-NEXT: csrr a1, vlenb
1080 ; RV64-NEXT: srli a1, a1, 2
1081 ; RV64-NEXT: vsetvli a2, zero, e8, mf2, ta, ma
1082 ; RV64-NEXT: vslidedown.vx v24, v0, a1
1083 ; RV64-NEXT: vsetvli a1, zero, e32, m8, ta, ma
1084 ; RV64-NEXT: vmaxu.vx v8, v8, a0, v0.t
1085 ; RV64-NEXT: vmv1r.v v0, v24
1086 ; RV64-NEXT: vsetivli zero, 0, e32, m8, ta, ma
1087 ; RV64-NEXT: vmaxu.vx v16, v16, a0, v0.t
1089 %elt.head = insertelement <vscale x 32 x i32> poison, i32 %b, i32 0
1090 %vb = shufflevector <vscale x 32 x i32> %elt.head, <vscale x 32 x i32> poison, <vscale x 32 x i32> zeroinitializer
1091 %evl = call i32 @llvm.vscale.i32()
1092 %evl0 = mul i32 %evl, 16
1093 %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)
1094 ret <vscale x 32 x i32> %v
1097 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)
1099 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) {
1100 ; CHECK-LABEL: vmaxu_vv_nxv1i64:
1102 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1103 ; CHECK-NEXT: vmaxu.vv v8, v8, v9, v0.t
1105 %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)
1106 ret <vscale x 1 x i64> %v
1109 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) {
1110 ; CHECK-LABEL: vmaxu_vv_nxv1i64_unmasked:
1112 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1113 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
1115 %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> splat (i1 true), i32 %evl)
1116 ret <vscale x 1 x i64> %v
1119 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) {
1120 ; RV32-LABEL: vmaxu_vx_nxv1i64:
1122 ; RV32-NEXT: addi sp, sp, -16
1123 ; RV32-NEXT: .cfi_def_cfa_offset 16
1124 ; RV32-NEXT: sw a0, 8(sp)
1125 ; RV32-NEXT: sw a1, 12(sp)
1126 ; RV32-NEXT: addi a0, sp, 8
1127 ; RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1128 ; RV32-NEXT: vlse64.v v9, (a0), zero
1129 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1130 ; RV32-NEXT: vmaxu.vv v8, v8, v9, v0.t
1131 ; RV32-NEXT: addi sp, sp, 16
1132 ; RV32-NEXT: .cfi_def_cfa_offset 0
1135 ; RV64-LABEL: vmaxu_vx_nxv1i64:
1137 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1138 ; RV64-NEXT: vmaxu.vx v8, v8, a0, v0.t
1140 %elt.head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
1141 %vb = shufflevector <vscale x 1 x i64> %elt.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
1142 %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)
1143 ret <vscale x 1 x i64> %v
1146 define <vscale x 1 x i64> @vmaxu_vx_nxv1i64_unmasked(<vscale x 1 x i64> %va, i64 %b, i32 zeroext %evl) {
1147 ; RV32-LABEL: vmaxu_vx_nxv1i64_unmasked:
1149 ; RV32-NEXT: addi sp, sp, -16
1150 ; RV32-NEXT: .cfi_def_cfa_offset 16
1151 ; RV32-NEXT: sw a0, 8(sp)
1152 ; RV32-NEXT: sw a1, 12(sp)
1153 ; RV32-NEXT: addi a0, sp, 8
1154 ; RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1155 ; RV32-NEXT: vlse64.v v9, (a0), zero
1156 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1157 ; RV32-NEXT: vmaxu.vv v8, v8, v9
1158 ; RV32-NEXT: addi sp, sp, 16
1159 ; RV32-NEXT: .cfi_def_cfa_offset 0
1162 ; RV64-LABEL: vmaxu_vx_nxv1i64_unmasked:
1164 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1165 ; RV64-NEXT: vmaxu.vx v8, v8, a0
1167 %elt.head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
1168 %vb = shufflevector <vscale x 1 x i64> %elt.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
1169 %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> splat (i1 true), i32 %evl)
1170 ret <vscale x 1 x i64> %v
1173 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)
1175 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) {
1176 ; CHECK-LABEL: vmaxu_vv_nxv2i64:
1178 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1179 ; CHECK-NEXT: vmaxu.vv v8, v8, v10, v0.t
1181 %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)
1182 ret <vscale x 2 x i64> %v
1185 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) {
1186 ; CHECK-LABEL: vmaxu_vv_nxv2i64_unmasked:
1188 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1189 ; CHECK-NEXT: vmaxu.vv v8, v8, v10
1191 %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> splat (i1 true), i32 %evl)
1192 ret <vscale x 2 x i64> %v
1195 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) {
1196 ; RV32-LABEL: vmaxu_vx_nxv2i64:
1198 ; RV32-NEXT: addi sp, sp, -16
1199 ; RV32-NEXT: .cfi_def_cfa_offset 16
1200 ; RV32-NEXT: sw a0, 8(sp)
1201 ; RV32-NEXT: sw a1, 12(sp)
1202 ; RV32-NEXT: addi a0, sp, 8
1203 ; RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1204 ; RV32-NEXT: vlse64.v v10, (a0), zero
1205 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1206 ; RV32-NEXT: vmaxu.vv v8, v8, v10, v0.t
1207 ; RV32-NEXT: addi sp, sp, 16
1208 ; RV32-NEXT: .cfi_def_cfa_offset 0
1211 ; RV64-LABEL: vmaxu_vx_nxv2i64:
1213 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1214 ; RV64-NEXT: vmaxu.vx v8, v8, a0, v0.t
1216 %elt.head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
1217 %vb = shufflevector <vscale x 2 x i64> %elt.head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
1218 %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)
1219 ret <vscale x 2 x i64> %v
1222 define <vscale x 2 x i64> @vmaxu_vx_nxv2i64_unmasked(<vscale x 2 x i64> %va, i64 %b, i32 zeroext %evl) {
1223 ; RV32-LABEL: vmaxu_vx_nxv2i64_unmasked:
1225 ; RV32-NEXT: addi sp, sp, -16
1226 ; RV32-NEXT: .cfi_def_cfa_offset 16
1227 ; RV32-NEXT: sw a0, 8(sp)
1228 ; RV32-NEXT: sw a1, 12(sp)
1229 ; RV32-NEXT: addi a0, sp, 8
1230 ; RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1231 ; RV32-NEXT: vlse64.v v10, (a0), zero
1232 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1233 ; RV32-NEXT: vmaxu.vv v8, v8, v10
1234 ; RV32-NEXT: addi sp, sp, 16
1235 ; RV32-NEXT: .cfi_def_cfa_offset 0
1238 ; RV64-LABEL: vmaxu_vx_nxv2i64_unmasked:
1240 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1241 ; RV64-NEXT: vmaxu.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.umax.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.umax.nxv4i64(<vscale x 4 x i64>, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
1251 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) {
1252 ; CHECK-LABEL: vmaxu_vv_nxv4i64:
1254 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1255 ; CHECK-NEXT: vmaxu.vv v8, v8, v12, v0.t
1257 %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)
1258 ret <vscale x 4 x i64> %v
1261 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) {
1262 ; CHECK-LABEL: vmaxu_vv_nxv4i64_unmasked:
1264 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1265 ; CHECK-NEXT: vmaxu.vv v8, v8, v12
1267 %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> splat (i1 true), i32 %evl)
1268 ret <vscale x 4 x i64> %v
1271 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) {
1272 ; RV32-LABEL: vmaxu_vx_nxv4i64:
1274 ; RV32-NEXT: addi sp, sp, -16
1275 ; RV32-NEXT: .cfi_def_cfa_offset 16
1276 ; RV32-NEXT: sw a0, 8(sp)
1277 ; RV32-NEXT: sw a1, 12(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: vmaxu.vv v8, v8, v12, v0.t
1283 ; RV32-NEXT: addi sp, sp, 16
1284 ; RV32-NEXT: .cfi_def_cfa_offset 0
1287 ; RV64-LABEL: vmaxu_vx_nxv4i64:
1289 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
1290 ; RV64-NEXT: vmaxu.vx v8, v8, a0, v0.t
1292 %elt.head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
1293 %vb = shufflevector <vscale x 4 x i64> %elt.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
1294 %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)
1295 ret <vscale x 4 x i64> %v
1298 define <vscale x 4 x i64> @vmaxu_vx_nxv4i64_unmasked(<vscale x 4 x i64> %va, i64 %b, i32 zeroext %evl) {
1299 ; RV32-LABEL: vmaxu_vx_nxv4i64_unmasked:
1301 ; RV32-NEXT: addi sp, sp, -16
1302 ; RV32-NEXT: .cfi_def_cfa_offset 16
1303 ; RV32-NEXT: sw a0, 8(sp)
1304 ; RV32-NEXT: sw a1, 12(sp)
1305 ; RV32-NEXT: addi a0, sp, 8
1306 ; RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1307 ; RV32-NEXT: vlse64.v v12, (a0), zero
1308 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
1309 ; RV32-NEXT: vmaxu.vv v8, v8, v12
1310 ; RV32-NEXT: addi sp, sp, 16
1311 ; RV32-NEXT: .cfi_def_cfa_offset 0
1314 ; RV64-LABEL: vmaxu_vx_nxv4i64_unmasked:
1316 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
1317 ; RV64-NEXT: vmaxu.vx v8, v8, a0
1319 %elt.head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
1320 %vb = shufflevector <vscale x 4 x i64> %elt.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
1321 %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> splat (i1 true), i32 %evl)
1322 ret <vscale x 4 x i64> %v
1325 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)
1327 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) {
1328 ; CHECK-LABEL: vmaxu_vv_nxv8i64:
1330 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1331 ; CHECK-NEXT: vmaxu.vv v8, v8, v16, v0.t
1333 %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)
1334 ret <vscale x 8 x i64> %v
1337 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) {
1338 ; CHECK-LABEL: vmaxu_vv_nxv8i64_unmasked:
1340 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1341 ; CHECK-NEXT: vmaxu.vv v8, v8, v16
1343 %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> splat (i1 true), i32 %evl)
1344 ret <vscale x 8 x i64> %v
1347 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) {
1348 ; RV32-LABEL: vmaxu_vx_nxv8i64:
1350 ; RV32-NEXT: addi sp, sp, -16
1351 ; RV32-NEXT: .cfi_def_cfa_offset 16
1352 ; RV32-NEXT: sw a0, 8(sp)
1353 ; RV32-NEXT: sw a1, 12(sp)
1354 ; RV32-NEXT: addi a0, sp, 8
1355 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1356 ; RV32-NEXT: vlse64.v v16, (a0), zero
1357 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1358 ; RV32-NEXT: vmaxu.vv v8, v8, v16, v0.t
1359 ; RV32-NEXT: addi sp, sp, 16
1360 ; RV32-NEXT: .cfi_def_cfa_offset 0
1363 ; RV64-LABEL: vmaxu_vx_nxv8i64:
1365 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1366 ; RV64-NEXT: vmaxu.vx v8, v8, a0, v0.t
1368 %elt.head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
1369 %vb = shufflevector <vscale x 8 x i64> %elt.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
1370 %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)
1371 ret <vscale x 8 x i64> %v
1374 define <vscale x 8 x i64> @vmaxu_vx_nxv8i64_unmasked(<vscale x 8 x i64> %va, i64 %b, i32 zeroext %evl) {
1375 ; RV32-LABEL: vmaxu_vx_nxv8i64_unmasked:
1377 ; RV32-NEXT: addi sp, sp, -16
1378 ; RV32-NEXT: .cfi_def_cfa_offset 16
1379 ; RV32-NEXT: sw a0, 8(sp)
1380 ; RV32-NEXT: sw a1, 12(sp)
1381 ; RV32-NEXT: addi a0, sp, 8
1382 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1383 ; RV32-NEXT: vlse64.v v16, (a0), zero
1384 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1385 ; RV32-NEXT: vmaxu.vv v8, v8, v16
1386 ; RV32-NEXT: addi sp, sp, 16
1387 ; RV32-NEXT: .cfi_def_cfa_offset 0
1390 ; RV64-LABEL: vmaxu_vx_nxv8i64_unmasked:
1392 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1393 ; RV64-NEXT: vmaxu.vx v8, v8, a0
1395 %elt.head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
1396 %vb = shufflevector <vscale x 8 x i64> %elt.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
1397 %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> splat (i1 true), i32 %evl)
1398 ret <vscale x 8 x i64> %v