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.usub.sat.nxv8i7(<vscale x 8 x i7>, <vscale x 8 x i7>, <vscale x 8 x i1>, i32)
9 define <vscale x 8 x i7> @vssubu_vx_nxv8i7(<vscale x 8 x i7> %a, i7 signext %b, <vscale x 8 x i1> %mask, i32 zeroext %evl) {
10 ; CHECK-LABEL: vssubu_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: vssubu.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.usub.sat.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.usub.sat.nxv1i8(<vscale x 1 x i8>, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
28 define <vscale x 1 x i8> @vssubu_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: vssubu_vv_nxv1i8:
31 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
32 ; CHECK-NEXT: vssubu.vv v8, v8, v9, v0.t
34 %v = call <vscale x 1 x i8> @llvm.vp.usub.sat.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> @vssubu_vv_nxv1i8_unmasked(<vscale x 1 x i8> %va, <vscale x 1 x i8> %b, i32 zeroext %evl) {
39 ; CHECK-LABEL: vssubu_vv_nxv1i8_unmasked:
41 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
42 ; CHECK-NEXT: vssubu.vv v8, v8, v9
44 %v = call <vscale x 1 x i8> @llvm.vp.usub.sat.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> @vssubu_vx_nxv1i8(<vscale x 1 x i8> %va, i8 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
49 ; CHECK-LABEL: vssubu_vx_nxv1i8:
51 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
52 ; CHECK-NEXT: vssubu.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.usub.sat.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> @vssubu_vx_nxv1i8_commute(<vscale x 1 x i8> %va, i8 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
61 ; CHECK-LABEL: vssubu_vx_nxv1i8_commute:
63 ; CHECK-NEXT: vsetvli a2, zero, e8, mf8, ta, ma
64 ; CHECK-NEXT: vmv.v.x v9, a0
65 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
66 ; CHECK-NEXT: vssubu.vv v8, v9, v8, 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.usub.sat.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> @vssubu_vx_nxv1i8_unmasked(<vscale x 1 x i8> %va, i8 %b, i32 zeroext %evl) {
75 ; CHECK-LABEL: vssubu_vx_nxv1i8_unmasked:
77 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
78 ; CHECK-NEXT: vssubu.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 %v = call <vscale x 1 x i8> @llvm.vp.usub.sat.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb, <vscale x 1 x i1> splat (i1 true), i32 %evl)
83 ret <vscale x 1 x i8> %v
86 define <vscale x 1 x i8> @vssubu_vi_nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
87 ; CHECK-LABEL: vssubu_vi_nxv1i8:
89 ; CHECK-NEXT: li a1, -1
90 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
91 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
93 %v = call <vscale x 1 x i8> @llvm.vp.usub.sat.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> splat (i8 -1), <vscale x 1 x i1> %m, i32 %evl)
94 ret <vscale x 1 x i8> %v
97 define <vscale x 1 x i8> @vssubu_vi_nxv1i8_unmasked(<vscale x 1 x i8> %va, i32 zeroext %evl) {
98 ; CHECK-LABEL: vssubu_vi_nxv1i8_unmasked:
100 ; CHECK-NEXT: li a1, -1
101 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
102 ; CHECK-NEXT: vssubu.vx v8, v8, a1
104 %v = call <vscale x 1 x i8> @llvm.vp.usub.sat.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> splat (i8 -1), <vscale x 1 x i1> splat (i1 true), i32 %evl)
105 ret <vscale x 1 x i8> %v
108 declare <vscale x 2 x i8> @llvm.vp.usub.sat.nxv2i8(<vscale x 2 x i8>, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
110 define <vscale x 2 x i8> @vssubu_vv_nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
111 ; CHECK-LABEL: vssubu_vv_nxv2i8:
113 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
114 ; CHECK-NEXT: vssubu.vv v8, v8, v9, v0.t
116 %v = call <vscale x 2 x i8> @llvm.vp.usub.sat.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, <vscale x 2 x i1> %m, i32 %evl)
117 ret <vscale x 2 x i8> %v
120 define <vscale x 2 x i8> @vssubu_vv_nxv2i8_unmasked(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, i32 zeroext %evl) {
121 ; CHECK-LABEL: vssubu_vv_nxv2i8_unmasked:
123 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
124 ; CHECK-NEXT: vssubu.vv v8, v8, v9
126 %v = call <vscale x 2 x i8> @llvm.vp.usub.sat.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, <vscale x 2 x i1> splat (i1 true), i32 %evl)
127 ret <vscale x 2 x i8> %v
130 define <vscale x 2 x i8> @vssubu_vx_nxv2i8(<vscale x 2 x i8> %va, i8 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
131 ; CHECK-LABEL: vssubu_vx_nxv2i8:
133 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
134 ; CHECK-NEXT: vssubu.vx v8, v8, a0, v0.t
136 %elt.head = insertelement <vscale x 2 x i8> poison, i8 %b, i32 0
137 %vb = shufflevector <vscale x 2 x i8> %elt.head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
138 %v = call <vscale x 2 x i8> @llvm.vp.usub.sat.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb, <vscale x 2 x i1> %m, i32 %evl)
139 ret <vscale x 2 x i8> %v
142 define <vscale x 2 x i8> @vssubu_vx_nxv2i8_unmasked(<vscale x 2 x i8> %va, i8 %b, i32 zeroext %evl) {
143 ; CHECK-LABEL: vssubu_vx_nxv2i8_unmasked:
145 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
146 ; CHECK-NEXT: vssubu.vx v8, v8, a0
148 %elt.head = insertelement <vscale x 2 x i8> poison, i8 %b, i32 0
149 %vb = shufflevector <vscale x 2 x i8> %elt.head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
150 %v = call <vscale x 2 x i8> @llvm.vp.usub.sat.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb, <vscale x 2 x i1> splat (i1 true), i32 %evl)
151 ret <vscale x 2 x i8> %v
154 define <vscale x 2 x i8> @vssubu_vi_nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
155 ; CHECK-LABEL: vssubu_vi_nxv2i8:
157 ; CHECK-NEXT: li a1, -1
158 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
159 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
161 %v = call <vscale x 2 x i8> @llvm.vp.usub.sat.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> splat (i8 -1), <vscale x 2 x i1> %m, i32 %evl)
162 ret <vscale x 2 x i8> %v
165 define <vscale x 2 x i8> @vssubu_vi_nxv2i8_unmasked(<vscale x 2 x i8> %va, i32 zeroext %evl) {
166 ; CHECK-LABEL: vssubu_vi_nxv2i8_unmasked:
168 ; CHECK-NEXT: li a1, -1
169 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
170 ; CHECK-NEXT: vssubu.vx v8, v8, a1
172 %v = call <vscale x 2 x i8> @llvm.vp.usub.sat.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> splat (i8 -1), <vscale x 2 x i1> splat (i1 true), i32 %evl)
173 ret <vscale x 2 x i8> %v
176 declare <vscale x 3 x i8> @llvm.vp.usub.sat.nxv3i8(<vscale x 3 x i8>, <vscale x 3 x i8>, <vscale x 3 x i1>, i32)
178 define <vscale x 3 x i8> @vssubu_vv_nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, <vscale x 3 x i1> %m, i32 zeroext %evl) {
179 ; CHECK-LABEL: vssubu_vv_nxv3i8:
181 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
182 ; CHECK-NEXT: vssubu.vv v8, v8, v9, v0.t
184 %v = call <vscale x 3 x i8> @llvm.vp.usub.sat.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, <vscale x 3 x i1> %m, i32 %evl)
185 ret <vscale x 3 x i8> %v
188 define <vscale x 3 x i8> @vssubu_vv_nxv3i8_unmasked(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, i32 zeroext %evl) {
189 ; CHECK-LABEL: vssubu_vv_nxv3i8_unmasked:
191 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
192 ; CHECK-NEXT: vssubu.vv v8, v8, v9
194 %v = call <vscale x 3 x i8> @llvm.vp.usub.sat.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, <vscale x 3 x i1> splat (i1 true), i32 %evl)
195 ret <vscale x 3 x i8> %v
198 define <vscale x 3 x i8> @vssubu_vx_nxv3i8(<vscale x 3 x i8> %va, i8 %b, <vscale x 3 x i1> %m, i32 zeroext %evl) {
199 ; CHECK-LABEL: vssubu_vx_nxv3i8:
201 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
202 ; CHECK-NEXT: vssubu.vx v8, v8, a0, v0.t
204 %elt.head = insertelement <vscale x 3 x i8> poison, i8 %b, i32 0
205 %vb = shufflevector <vscale x 3 x i8> %elt.head, <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer
206 %v = call <vscale x 3 x i8> @llvm.vp.usub.sat.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %vb, <vscale x 3 x i1> %m, i32 %evl)
207 ret <vscale x 3 x i8> %v
210 define <vscale x 3 x i8> @vssubu_vx_nxv3i8_unmasked(<vscale x 3 x i8> %va, i8 %b, i32 zeroext %evl) {
211 ; CHECK-LABEL: vssubu_vx_nxv3i8_unmasked:
213 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
214 ; CHECK-NEXT: vssubu.vx v8, v8, a0
216 %elt.head = insertelement <vscale x 3 x i8> poison, i8 %b, i32 0
217 %vb = shufflevector <vscale x 3 x i8> %elt.head, <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer
218 %v = call <vscale x 3 x i8> @llvm.vp.usub.sat.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %vb, <vscale x 3 x i1> splat (i1 true), i32 %evl)
219 ret <vscale x 3 x i8> %v
222 define <vscale x 3 x i8> @vssubu_vi_nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i1> %m, i32 zeroext %evl) {
223 ; CHECK-LABEL: vssubu_vi_nxv3i8:
225 ; CHECK-NEXT: li a1, -1
226 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
227 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
229 %v = call <vscale x 3 x i8> @llvm.vp.usub.sat.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> splat (i8 -1), <vscale x 3 x i1> %m, i32 %evl)
230 ret <vscale x 3 x i8> %v
233 define <vscale x 3 x i8> @vssubu_vi_nxv3i8_unmasked(<vscale x 3 x i8> %va, i32 zeroext %evl) {
234 ; CHECK-LABEL: vssubu_vi_nxv3i8_unmasked:
236 ; CHECK-NEXT: li a1, -1
237 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
238 ; CHECK-NEXT: vssubu.vx v8, v8, a1
240 %v = call <vscale x 3 x i8> @llvm.vp.usub.sat.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> splat (i8 -1), <vscale x 3 x i1> splat (i1 true), i32 %evl)
241 ret <vscale x 3 x i8> %v
244 declare <vscale x 4 x i8> @llvm.vp.usub.sat.nxv4i8(<vscale x 4 x i8>, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
246 define <vscale x 4 x i8> @vssubu_vv_nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
247 ; CHECK-LABEL: vssubu_vv_nxv4i8:
249 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
250 ; CHECK-NEXT: vssubu.vv v8, v8, v9, v0.t
252 %v = call <vscale x 4 x i8> @llvm.vp.usub.sat.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, <vscale x 4 x i1> %m, i32 %evl)
253 ret <vscale x 4 x i8> %v
256 define <vscale x 4 x i8> @vssubu_vv_nxv4i8_unmasked(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, i32 zeroext %evl) {
257 ; CHECK-LABEL: vssubu_vv_nxv4i8_unmasked:
259 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
260 ; CHECK-NEXT: vssubu.vv v8, v8, v9
262 %v = call <vscale x 4 x i8> @llvm.vp.usub.sat.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, <vscale x 4 x i1> splat (i1 true), i32 %evl)
263 ret <vscale x 4 x i8> %v
266 define <vscale x 4 x i8> @vssubu_vx_nxv4i8(<vscale x 4 x i8> %va, i8 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
267 ; CHECK-LABEL: vssubu_vx_nxv4i8:
269 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
270 ; CHECK-NEXT: vssubu.vx v8, v8, a0, v0.t
272 %elt.head = insertelement <vscale x 4 x i8> poison, i8 %b, i32 0
273 %vb = shufflevector <vscale x 4 x i8> %elt.head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
274 %v = call <vscale x 4 x i8> @llvm.vp.usub.sat.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb, <vscale x 4 x i1> %m, i32 %evl)
275 ret <vscale x 4 x i8> %v
278 define <vscale x 4 x i8> @vssubu_vx_nxv4i8_unmasked(<vscale x 4 x i8> %va, i8 %b, i32 zeroext %evl) {
279 ; CHECK-LABEL: vssubu_vx_nxv4i8_unmasked:
281 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
282 ; CHECK-NEXT: vssubu.vx v8, v8, a0
284 %elt.head = insertelement <vscale x 4 x i8> poison, i8 %b, i32 0
285 %vb = shufflevector <vscale x 4 x i8> %elt.head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
286 %v = call <vscale x 4 x i8> @llvm.vp.usub.sat.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb, <vscale x 4 x i1> splat (i1 true), i32 %evl)
287 ret <vscale x 4 x i8> %v
290 define <vscale x 4 x i8> @vssubu_vi_nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
291 ; CHECK-LABEL: vssubu_vi_nxv4i8:
293 ; CHECK-NEXT: li a1, -1
294 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
295 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
297 %v = call <vscale x 4 x i8> @llvm.vp.usub.sat.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> splat (i8 -1), <vscale x 4 x i1> %m, i32 %evl)
298 ret <vscale x 4 x i8> %v
301 define <vscale x 4 x i8> @vssubu_vi_nxv4i8_unmasked(<vscale x 4 x i8> %va, i32 zeroext %evl) {
302 ; CHECK-LABEL: vssubu_vi_nxv4i8_unmasked:
304 ; CHECK-NEXT: li a1, -1
305 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
306 ; CHECK-NEXT: vssubu.vx v8, v8, a1
308 %v = call <vscale x 4 x i8> @llvm.vp.usub.sat.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> splat (i8 -1), <vscale x 4 x i1> splat (i1 true), i32 %evl)
309 ret <vscale x 4 x i8> %v
312 declare <vscale x 8 x i8> @llvm.vp.usub.sat.nxv8i8(<vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i1>, i32)
314 define <vscale x 8 x i8> @vssubu_vv_nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
315 ; CHECK-LABEL: vssubu_vv_nxv8i8:
317 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
318 ; CHECK-NEXT: vssubu.vv v8, v8, v9, v0.t
320 %v = call <vscale x 8 x i8> @llvm.vp.usub.sat.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, <vscale x 8 x i1> %m, i32 %evl)
321 ret <vscale x 8 x i8> %v
324 define <vscale x 8 x i8> @vssubu_vv_nxv8i8_unmasked(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, i32 zeroext %evl) {
325 ; CHECK-LABEL: vssubu_vv_nxv8i8_unmasked:
327 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
328 ; CHECK-NEXT: vssubu.vv v8, v8, v9
330 %v = call <vscale x 8 x i8> @llvm.vp.usub.sat.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, <vscale x 8 x i1> splat (i1 true), i32 %evl)
331 ret <vscale x 8 x i8> %v
334 define <vscale x 8 x i8> @vssubu_vx_nxv8i8(<vscale x 8 x i8> %va, i8 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
335 ; CHECK-LABEL: vssubu_vx_nxv8i8:
337 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
338 ; CHECK-NEXT: vssubu.vx v8, v8, a0, v0.t
340 %elt.head = insertelement <vscale x 8 x i8> poison, i8 %b, i32 0
341 %vb = shufflevector <vscale x 8 x i8> %elt.head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
342 %v = call <vscale x 8 x i8> @llvm.vp.usub.sat.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb, <vscale x 8 x i1> %m, i32 %evl)
343 ret <vscale x 8 x i8> %v
346 define <vscale x 8 x i8> @vssubu_vx_nxv8i8_unmasked(<vscale x 8 x i8> %va, i8 %b, i32 zeroext %evl) {
347 ; CHECK-LABEL: vssubu_vx_nxv8i8_unmasked:
349 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
350 ; CHECK-NEXT: vssubu.vx v8, v8, a0
352 %elt.head = insertelement <vscale x 8 x i8> poison, i8 %b, i32 0
353 %vb = shufflevector <vscale x 8 x i8> %elt.head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
354 %v = call <vscale x 8 x i8> @llvm.vp.usub.sat.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb, <vscale x 8 x i1> splat (i1 true), i32 %evl)
355 ret <vscale x 8 x i8> %v
358 define <vscale x 8 x i8> @vssubu_vi_nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
359 ; CHECK-LABEL: vssubu_vi_nxv8i8:
361 ; CHECK-NEXT: li a1, -1
362 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
363 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
365 %v = call <vscale x 8 x i8> @llvm.vp.usub.sat.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> splat (i8 -1), <vscale x 8 x i1> %m, i32 %evl)
366 ret <vscale x 8 x i8> %v
369 define <vscale x 8 x i8> @vssubu_vi_nxv8i8_unmasked(<vscale x 8 x i8> %va, i32 zeroext %evl) {
370 ; CHECK-LABEL: vssubu_vi_nxv8i8_unmasked:
372 ; CHECK-NEXT: li a1, -1
373 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
374 ; CHECK-NEXT: vssubu.vx v8, v8, a1
376 %v = call <vscale x 8 x i8> @llvm.vp.usub.sat.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> splat (i8 -1), <vscale x 8 x i1> splat (i1 true), i32 %evl)
377 ret <vscale x 8 x i8> %v
380 declare <vscale x 16 x i8> @llvm.vp.usub.sat.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i1>, i32)
382 define <vscale x 16 x i8> @vssubu_vv_nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
383 ; CHECK-LABEL: vssubu_vv_nxv16i8:
385 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
386 ; CHECK-NEXT: vssubu.vv v8, v8, v10, v0.t
388 %v = call <vscale x 16 x i8> @llvm.vp.usub.sat.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, <vscale x 16 x i1> %m, i32 %evl)
389 ret <vscale x 16 x i8> %v
392 define <vscale x 16 x i8> @vssubu_vv_nxv16i8_unmasked(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, i32 zeroext %evl) {
393 ; CHECK-LABEL: vssubu_vv_nxv16i8_unmasked:
395 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
396 ; CHECK-NEXT: vssubu.vv v8, v8, v10
398 %v = call <vscale x 16 x i8> @llvm.vp.usub.sat.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, <vscale x 16 x i1> splat (i1 true), i32 %evl)
399 ret <vscale x 16 x i8> %v
402 define <vscale x 16 x i8> @vssubu_vx_nxv16i8(<vscale x 16 x i8> %va, i8 %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
403 ; CHECK-LABEL: vssubu_vx_nxv16i8:
405 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
406 ; CHECK-NEXT: vssubu.vx v8, v8, a0, v0.t
408 %elt.head = insertelement <vscale x 16 x i8> poison, i8 %b, i32 0
409 %vb = shufflevector <vscale x 16 x i8> %elt.head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
410 %v = call <vscale x 16 x i8> @llvm.vp.usub.sat.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb, <vscale x 16 x i1> %m, i32 %evl)
411 ret <vscale x 16 x i8> %v
414 define <vscale x 16 x i8> @vssubu_vx_nxv16i8_unmasked(<vscale x 16 x i8> %va, i8 %b, i32 zeroext %evl) {
415 ; CHECK-LABEL: vssubu_vx_nxv16i8_unmasked:
417 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
418 ; CHECK-NEXT: vssubu.vx v8, v8, a0
420 %elt.head = insertelement <vscale x 16 x i8> poison, i8 %b, i32 0
421 %vb = shufflevector <vscale x 16 x i8> %elt.head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
422 %v = call <vscale x 16 x i8> @llvm.vp.usub.sat.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb, <vscale x 16 x i1> splat (i1 true), i32 %evl)
423 ret <vscale x 16 x i8> %v
426 define <vscale x 16 x i8> @vssubu_vi_nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
427 ; CHECK-LABEL: vssubu_vi_nxv16i8:
429 ; CHECK-NEXT: li a1, -1
430 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
431 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
433 %v = call <vscale x 16 x i8> @llvm.vp.usub.sat.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> splat (i8 -1), <vscale x 16 x i1> %m, i32 %evl)
434 ret <vscale x 16 x i8> %v
437 define <vscale x 16 x i8> @vssubu_vi_nxv16i8_unmasked(<vscale x 16 x i8> %va, i32 zeroext %evl) {
438 ; CHECK-LABEL: vssubu_vi_nxv16i8_unmasked:
440 ; CHECK-NEXT: li a1, -1
441 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
442 ; CHECK-NEXT: vssubu.vx v8, v8, a1
444 %v = call <vscale x 16 x i8> @llvm.vp.usub.sat.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> splat (i8 -1), <vscale x 16 x i1> splat (i1 true), i32 %evl)
445 ret <vscale x 16 x i8> %v
448 declare <vscale x 32 x i8> @llvm.vp.usub.sat.nxv32i8(<vscale x 32 x i8>, <vscale x 32 x i8>, <vscale x 32 x i1>, i32)
450 define <vscale x 32 x i8> @vssubu_vv_nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
451 ; CHECK-LABEL: vssubu_vv_nxv32i8:
453 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
454 ; CHECK-NEXT: vssubu.vv v8, v8, v12, v0.t
456 %v = call <vscale x 32 x i8> @llvm.vp.usub.sat.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, <vscale x 32 x i1> %m, i32 %evl)
457 ret <vscale x 32 x i8> %v
460 define <vscale x 32 x i8> @vssubu_vv_nxv32i8_unmasked(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, i32 zeroext %evl) {
461 ; CHECK-LABEL: vssubu_vv_nxv32i8_unmasked:
463 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
464 ; CHECK-NEXT: vssubu.vv v8, v8, v12
466 %v = call <vscale x 32 x i8> @llvm.vp.usub.sat.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, <vscale x 32 x i1> splat (i1 true), i32 %evl)
467 ret <vscale x 32 x i8> %v
470 define <vscale x 32 x i8> @vssubu_vx_nxv32i8(<vscale x 32 x i8> %va, i8 %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
471 ; CHECK-LABEL: vssubu_vx_nxv32i8:
473 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
474 ; CHECK-NEXT: vssubu.vx v8, v8, a0, v0.t
476 %elt.head = insertelement <vscale x 32 x i8> poison, i8 %b, i32 0
477 %vb = shufflevector <vscale x 32 x i8> %elt.head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
478 %v = call <vscale x 32 x i8> @llvm.vp.usub.sat.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb, <vscale x 32 x i1> %m, i32 %evl)
479 ret <vscale x 32 x i8> %v
482 define <vscale x 32 x i8> @vssubu_vx_nxv32i8_unmasked(<vscale x 32 x i8> %va, i8 %b, i32 zeroext %evl) {
483 ; CHECK-LABEL: vssubu_vx_nxv32i8_unmasked:
485 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
486 ; CHECK-NEXT: vssubu.vx v8, v8, a0
488 %elt.head = insertelement <vscale x 32 x i8> poison, i8 %b, i32 0
489 %vb = shufflevector <vscale x 32 x i8> %elt.head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
490 %v = call <vscale x 32 x i8> @llvm.vp.usub.sat.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb, <vscale x 32 x i1> splat (i1 true), i32 %evl)
491 ret <vscale x 32 x i8> %v
494 define <vscale x 32 x i8> @vssubu_vi_nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i1> %m, i32 zeroext %evl) {
495 ; CHECK-LABEL: vssubu_vi_nxv32i8:
497 ; CHECK-NEXT: li a1, -1
498 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
499 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
501 %v = call <vscale x 32 x i8> @llvm.vp.usub.sat.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> splat (i8 -1), <vscale x 32 x i1> %m, i32 %evl)
502 ret <vscale x 32 x i8> %v
505 define <vscale x 32 x i8> @vssubu_vi_nxv32i8_unmasked(<vscale x 32 x i8> %va, i32 zeroext %evl) {
506 ; CHECK-LABEL: vssubu_vi_nxv32i8_unmasked:
508 ; CHECK-NEXT: li a1, -1
509 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
510 ; CHECK-NEXT: vssubu.vx v8, v8, a1
512 %v = call <vscale x 32 x i8> @llvm.vp.usub.sat.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> splat (i8 -1), <vscale x 32 x i1> splat (i1 true), i32 %evl)
513 ret <vscale x 32 x i8> %v
516 declare <vscale x 64 x i8> @llvm.vp.usub.sat.nxv64i8(<vscale x 64 x i8>, <vscale x 64 x i8>, <vscale x 64 x i1>, i32)
518 define <vscale x 64 x i8> @vssubu_vv_nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, <vscale x 64 x i1> %m, i32 zeroext %evl) {
519 ; CHECK-LABEL: vssubu_vv_nxv64i8:
521 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
522 ; CHECK-NEXT: vssubu.vv v8, v8, v16, v0.t
524 %v = call <vscale x 64 x i8> @llvm.vp.usub.sat.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, <vscale x 64 x i1> %m, i32 %evl)
525 ret <vscale x 64 x i8> %v
528 define <vscale x 64 x i8> @vssubu_vv_nxv64i8_unmasked(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, i32 zeroext %evl) {
529 ; CHECK-LABEL: vssubu_vv_nxv64i8_unmasked:
531 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
532 ; CHECK-NEXT: vssubu.vv v8, v8, v16
534 %v = call <vscale x 64 x i8> @llvm.vp.usub.sat.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, <vscale x 64 x i1> splat (i1 true), i32 %evl)
535 ret <vscale x 64 x i8> %v
538 define <vscale x 64 x i8> @vssubu_vx_nxv64i8(<vscale x 64 x i8> %va, i8 %b, <vscale x 64 x i1> %m, i32 zeroext %evl) {
539 ; CHECK-LABEL: vssubu_vx_nxv64i8:
541 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
542 ; CHECK-NEXT: vssubu.vx v8, v8, a0, v0.t
544 %elt.head = insertelement <vscale x 64 x i8> poison, i8 %b, i32 0
545 %vb = shufflevector <vscale x 64 x i8> %elt.head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
546 %v = call <vscale x 64 x i8> @llvm.vp.usub.sat.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb, <vscale x 64 x i1> %m, i32 %evl)
547 ret <vscale x 64 x i8> %v
550 define <vscale x 64 x i8> @vssubu_vx_nxv64i8_unmasked(<vscale x 64 x i8> %va, i8 %b, i32 zeroext %evl) {
551 ; CHECK-LABEL: vssubu_vx_nxv64i8_unmasked:
553 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
554 ; CHECK-NEXT: vssubu.vx v8, v8, a0
556 %elt.head = insertelement <vscale x 64 x i8> poison, i8 %b, i32 0
557 %vb = shufflevector <vscale x 64 x i8> %elt.head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
558 %v = call <vscale x 64 x i8> @llvm.vp.usub.sat.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb, <vscale x 64 x i1> splat (i1 true), i32 %evl)
559 ret <vscale x 64 x i8> %v
562 define <vscale x 64 x i8> @vssubu_vi_nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i1> %m, i32 zeroext %evl) {
563 ; CHECK-LABEL: vssubu_vi_nxv64i8:
565 ; CHECK-NEXT: li a1, -1
566 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
567 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
569 %v = call <vscale x 64 x i8> @llvm.vp.usub.sat.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> splat (i8 -1), <vscale x 64 x i1> %m, i32 %evl)
570 ret <vscale x 64 x i8> %v
573 define <vscale x 64 x i8> @vssubu_vi_nxv64i8_unmasked(<vscale x 64 x i8> %va, i32 zeroext %evl) {
574 ; CHECK-LABEL: vssubu_vi_nxv64i8_unmasked:
576 ; CHECK-NEXT: li a1, -1
577 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
578 ; CHECK-NEXT: vssubu.vx v8, v8, a1
580 %v = call <vscale x 64 x i8> @llvm.vp.usub.sat.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> splat (i8 -1), <vscale x 64 x i1> splat (i1 true), i32 %evl)
581 ret <vscale x 64 x i8> %v
584 ; Test that split-legalization works when the mask itself needs splitting.
586 declare <vscale x 128 x i8> @llvm.vp.usub.sat.nxv128i8(<vscale x 128 x i8>, <vscale x 128 x i8>, <vscale x 128 x i1>, i32)
588 define <vscale x 128 x i8> @vssubu_vi_nxv128i8(<vscale x 128 x i8> %va, <vscale x 128 x i1> %m, i32 zeroext %evl) {
589 ; CHECK-LABEL: vssubu_vi_nxv128i8:
591 ; CHECK-NEXT: vmv1r.v v24, v0
592 ; CHECK-NEXT: vsetvli a2, zero, e8, m8, ta, ma
593 ; CHECK-NEXT: vlm.v v0, (a0)
594 ; CHECK-NEXT: csrr a0, vlenb
595 ; CHECK-NEXT: slli a0, a0, 3
596 ; CHECK-NEXT: sub a2, a1, a0
597 ; CHECK-NEXT: sltu a3, a1, a2
598 ; CHECK-NEXT: addi a3, a3, -1
599 ; CHECK-NEXT: and a3, a3, a2
600 ; CHECK-NEXT: li a2, -1
601 ; CHECK-NEXT: vsetvli zero, a3, e8, m8, ta, ma
602 ; CHECK-NEXT: vssubu.vx v16, v16, a2, v0.t
603 ; CHECK-NEXT: bltu a1, a0, .LBB50_2
604 ; CHECK-NEXT: # %bb.1:
605 ; CHECK-NEXT: mv a1, a0
606 ; CHECK-NEXT: .LBB50_2:
607 ; CHECK-NEXT: vmv1r.v v0, v24
608 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
609 ; CHECK-NEXT: vssubu.vx v8, v8, a2, v0.t
611 %v = call <vscale x 128 x i8> @llvm.vp.usub.sat.nxv128i8(<vscale x 128 x i8> %va, <vscale x 128 x i8> splat (i8 -1), <vscale x 128 x i1> %m, i32 %evl)
612 ret <vscale x 128 x i8> %v
615 define <vscale x 128 x i8> @vssubu_vi_nxv128i8_unmasked(<vscale x 128 x i8> %va, i32 zeroext %evl) {
616 ; CHECK-LABEL: vssubu_vi_nxv128i8_unmasked:
618 ; CHECK-NEXT: csrr a1, vlenb
619 ; CHECK-NEXT: slli a1, a1, 3
620 ; CHECK-NEXT: sub a2, a0, a1
621 ; CHECK-NEXT: sltu a3, a0, a2
622 ; CHECK-NEXT: addi a3, a3, -1
623 ; CHECK-NEXT: and a3, a3, a2
624 ; CHECK-NEXT: li a2, -1
625 ; CHECK-NEXT: vsetvli zero, a3, e8, m8, ta, ma
626 ; CHECK-NEXT: vssubu.vx v16, v16, a2
627 ; CHECK-NEXT: bltu a0, a1, .LBB51_2
628 ; CHECK-NEXT: # %bb.1:
629 ; CHECK-NEXT: mv a0, a1
630 ; CHECK-NEXT: .LBB51_2:
631 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
632 ; CHECK-NEXT: vssubu.vx v8, v8, a2
634 %v = call <vscale x 128 x i8> @llvm.vp.usub.sat.nxv128i8(<vscale x 128 x i8> %va, <vscale x 128 x i8> splat (i8 -1), <vscale x 128 x i1> splat (i1 true), i32 %evl)
635 ret <vscale x 128 x i8> %v
638 declare <vscale x 1 x i16> @llvm.vp.usub.sat.nxv1i16(<vscale x 1 x i16>, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
640 define <vscale x 1 x i16> @vssubu_vv_nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
641 ; CHECK-LABEL: vssubu_vv_nxv1i16:
643 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
644 ; CHECK-NEXT: vssubu.vv v8, v8, v9, v0.t
646 %v = call <vscale x 1 x i16> @llvm.vp.usub.sat.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, <vscale x 1 x i1> %m, i32 %evl)
647 ret <vscale x 1 x i16> %v
650 define <vscale x 1 x i16> @vssubu_vv_nxv1i16_unmasked(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, i32 zeroext %evl) {
651 ; CHECK-LABEL: vssubu_vv_nxv1i16_unmasked:
653 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
654 ; CHECK-NEXT: vssubu.vv v8, v8, v9
656 %v = call <vscale x 1 x i16> @llvm.vp.usub.sat.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, <vscale x 1 x i1> splat (i1 true), i32 %evl)
657 ret <vscale x 1 x i16> %v
660 define <vscale x 1 x i16> @vssubu_vx_nxv1i16(<vscale x 1 x i16> %va, i16 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
661 ; CHECK-LABEL: vssubu_vx_nxv1i16:
663 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
664 ; CHECK-NEXT: vssubu.vx v8, v8, a0, v0.t
666 %elt.head = insertelement <vscale x 1 x i16> poison, i16 %b, i32 0
667 %vb = shufflevector <vscale x 1 x i16> %elt.head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
668 %v = call <vscale x 1 x i16> @llvm.vp.usub.sat.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb, <vscale x 1 x i1> %m, i32 %evl)
669 ret <vscale x 1 x i16> %v
672 define <vscale x 1 x i16> @vssubu_vx_nxv1i16_unmasked(<vscale x 1 x i16> %va, i16 %b, i32 zeroext %evl) {
673 ; CHECK-LABEL: vssubu_vx_nxv1i16_unmasked:
675 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
676 ; CHECK-NEXT: vssubu.vx v8, v8, a0
678 %elt.head = insertelement <vscale x 1 x i16> poison, i16 %b, i32 0
679 %vb = shufflevector <vscale x 1 x i16> %elt.head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
680 %v = call <vscale x 1 x i16> @llvm.vp.usub.sat.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb, <vscale x 1 x i1> splat (i1 true), i32 %evl)
681 ret <vscale x 1 x i16> %v
684 define <vscale x 1 x i16> @vssubu_vi_nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
685 ; CHECK-LABEL: vssubu_vi_nxv1i16:
687 ; CHECK-NEXT: li a1, -1
688 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
689 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
691 %v = call <vscale x 1 x i16> @llvm.vp.usub.sat.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> splat (i16 -1), <vscale x 1 x i1> %m, i32 %evl)
692 ret <vscale x 1 x i16> %v
695 define <vscale x 1 x i16> @vssubu_vi_nxv1i16_unmasked(<vscale x 1 x i16> %va, i32 zeroext %evl) {
696 ; CHECK-LABEL: vssubu_vi_nxv1i16_unmasked:
698 ; CHECK-NEXT: li a1, -1
699 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
700 ; CHECK-NEXT: vssubu.vx v8, v8, a1
702 %v = call <vscale x 1 x i16> @llvm.vp.usub.sat.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> splat (i16 -1), <vscale x 1 x i1> splat (i1 true), i32 %evl)
703 ret <vscale x 1 x i16> %v
706 declare <vscale x 2 x i16> @llvm.vp.usub.sat.nxv2i16(<vscale x 2 x i16>, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
708 define <vscale x 2 x i16> @vssubu_vv_nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
709 ; CHECK-LABEL: vssubu_vv_nxv2i16:
711 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
712 ; CHECK-NEXT: vssubu.vv v8, v8, v9, v0.t
714 %v = call <vscale x 2 x i16> @llvm.vp.usub.sat.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, <vscale x 2 x i1> %m, i32 %evl)
715 ret <vscale x 2 x i16> %v
718 define <vscale x 2 x i16> @vssubu_vv_nxv2i16_unmasked(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, i32 zeroext %evl) {
719 ; CHECK-LABEL: vssubu_vv_nxv2i16_unmasked:
721 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
722 ; CHECK-NEXT: vssubu.vv v8, v8, v9
724 %v = call <vscale x 2 x i16> @llvm.vp.usub.sat.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, <vscale x 2 x i1> splat (i1 true), i32 %evl)
725 ret <vscale x 2 x i16> %v
728 define <vscale x 2 x i16> @vssubu_vx_nxv2i16(<vscale x 2 x i16> %va, i16 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
729 ; CHECK-LABEL: vssubu_vx_nxv2i16:
731 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
732 ; CHECK-NEXT: vssubu.vx v8, v8, a0, v0.t
734 %elt.head = insertelement <vscale x 2 x i16> poison, i16 %b, i32 0
735 %vb = shufflevector <vscale x 2 x i16> %elt.head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
736 %v = call <vscale x 2 x i16> @llvm.vp.usub.sat.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb, <vscale x 2 x i1> %m, i32 %evl)
737 ret <vscale x 2 x i16> %v
740 define <vscale x 2 x i16> @vssubu_vx_nxv2i16_unmasked(<vscale x 2 x i16> %va, i16 %b, i32 zeroext %evl) {
741 ; CHECK-LABEL: vssubu_vx_nxv2i16_unmasked:
743 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
744 ; CHECK-NEXT: vssubu.vx v8, v8, a0
746 %elt.head = insertelement <vscale x 2 x i16> poison, i16 %b, i32 0
747 %vb = shufflevector <vscale x 2 x i16> %elt.head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
748 %v = call <vscale x 2 x i16> @llvm.vp.usub.sat.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb, <vscale x 2 x i1> splat (i1 true), i32 %evl)
749 ret <vscale x 2 x i16> %v
752 define <vscale x 2 x i16> @vssubu_vi_nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
753 ; CHECK-LABEL: vssubu_vi_nxv2i16:
755 ; CHECK-NEXT: li a1, -1
756 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
757 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
759 %v = call <vscale x 2 x i16> @llvm.vp.usub.sat.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> splat (i16 -1), <vscale x 2 x i1> %m, i32 %evl)
760 ret <vscale x 2 x i16> %v
763 define <vscale x 2 x i16> @vssubu_vi_nxv2i16_unmasked(<vscale x 2 x i16> %va, i32 zeroext %evl) {
764 ; CHECK-LABEL: vssubu_vi_nxv2i16_unmasked:
766 ; CHECK-NEXT: li a1, -1
767 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
768 ; CHECK-NEXT: vssubu.vx v8, v8, a1
770 %v = call <vscale x 2 x i16> @llvm.vp.usub.sat.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> splat (i16 -1), <vscale x 2 x i1> splat (i1 true), i32 %evl)
771 ret <vscale x 2 x i16> %v
774 declare <vscale x 4 x i16> @llvm.vp.usub.sat.nxv4i16(<vscale x 4 x i16>, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
776 define <vscale x 4 x i16> @vssubu_vv_nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
777 ; CHECK-LABEL: vssubu_vv_nxv4i16:
779 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
780 ; CHECK-NEXT: vssubu.vv v8, v8, v9, v0.t
782 %v = call <vscale x 4 x i16> @llvm.vp.usub.sat.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, <vscale x 4 x i1> %m, i32 %evl)
783 ret <vscale x 4 x i16> %v
786 define <vscale x 4 x i16> @vssubu_vv_nxv4i16_unmasked(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, i32 zeroext %evl) {
787 ; CHECK-LABEL: vssubu_vv_nxv4i16_unmasked:
789 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
790 ; CHECK-NEXT: vssubu.vv v8, v8, v9
792 %v = call <vscale x 4 x i16> @llvm.vp.usub.sat.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, <vscale x 4 x i1> splat (i1 true), i32 %evl)
793 ret <vscale x 4 x i16> %v
796 define <vscale x 4 x i16> @vssubu_vx_nxv4i16(<vscale x 4 x i16> %va, i16 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
797 ; CHECK-LABEL: vssubu_vx_nxv4i16:
799 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
800 ; CHECK-NEXT: vssubu.vx v8, v8, a0, v0.t
802 %elt.head = insertelement <vscale x 4 x i16> poison, i16 %b, i32 0
803 %vb = shufflevector <vscale x 4 x i16> %elt.head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
804 %v = call <vscale x 4 x i16> @llvm.vp.usub.sat.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb, <vscale x 4 x i1> %m, i32 %evl)
805 ret <vscale x 4 x i16> %v
808 define <vscale x 4 x i16> @vssubu_vx_nxv4i16_unmasked(<vscale x 4 x i16> %va, i16 %b, i32 zeroext %evl) {
809 ; CHECK-LABEL: vssubu_vx_nxv4i16_unmasked:
811 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
812 ; CHECK-NEXT: vssubu.vx v8, v8, a0
814 %elt.head = insertelement <vscale x 4 x i16> poison, i16 %b, i32 0
815 %vb = shufflevector <vscale x 4 x i16> %elt.head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
816 %v = call <vscale x 4 x i16> @llvm.vp.usub.sat.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb, <vscale x 4 x i1> splat (i1 true), i32 %evl)
817 ret <vscale x 4 x i16> %v
820 define <vscale x 4 x i16> @vssubu_vi_nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
821 ; CHECK-LABEL: vssubu_vi_nxv4i16:
823 ; CHECK-NEXT: li a1, -1
824 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
825 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
827 %v = call <vscale x 4 x i16> @llvm.vp.usub.sat.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> splat (i16 -1), <vscale x 4 x i1> %m, i32 %evl)
828 ret <vscale x 4 x i16> %v
831 define <vscale x 4 x i16> @vssubu_vi_nxv4i16_unmasked(<vscale x 4 x i16> %va, i32 zeroext %evl) {
832 ; CHECK-LABEL: vssubu_vi_nxv4i16_unmasked:
834 ; CHECK-NEXT: li a1, -1
835 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
836 ; CHECK-NEXT: vssubu.vx v8, v8, a1
838 %v = call <vscale x 4 x i16> @llvm.vp.usub.sat.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> splat (i16 -1), <vscale x 4 x i1> splat (i1 true), i32 %evl)
839 ret <vscale x 4 x i16> %v
842 declare <vscale x 8 x i16> @llvm.vp.usub.sat.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i1>, i32)
844 define <vscale x 8 x i16> @vssubu_vv_nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
845 ; CHECK-LABEL: vssubu_vv_nxv8i16:
847 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
848 ; CHECK-NEXT: vssubu.vv v8, v8, v10, v0.t
850 %v = call <vscale x 8 x i16> @llvm.vp.usub.sat.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, <vscale x 8 x i1> %m, i32 %evl)
851 ret <vscale x 8 x i16> %v
854 define <vscale x 8 x i16> @vssubu_vv_nxv8i16_unmasked(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, i32 zeroext %evl) {
855 ; CHECK-LABEL: vssubu_vv_nxv8i16_unmasked:
857 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
858 ; CHECK-NEXT: vssubu.vv v8, v8, v10
860 %v = call <vscale x 8 x i16> @llvm.vp.usub.sat.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, <vscale x 8 x i1> splat (i1 true), i32 %evl)
861 ret <vscale x 8 x i16> %v
864 define <vscale x 8 x i16> @vssubu_vx_nxv8i16(<vscale x 8 x i16> %va, i16 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
865 ; CHECK-LABEL: vssubu_vx_nxv8i16:
867 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
868 ; CHECK-NEXT: vssubu.vx v8, v8, a0, v0.t
870 %elt.head = insertelement <vscale x 8 x i16> poison, i16 %b, i32 0
871 %vb = shufflevector <vscale x 8 x i16> %elt.head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
872 %v = call <vscale x 8 x i16> @llvm.vp.usub.sat.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb, <vscale x 8 x i1> %m, i32 %evl)
873 ret <vscale x 8 x i16> %v
876 define <vscale x 8 x i16> @vssubu_vx_nxv8i16_unmasked(<vscale x 8 x i16> %va, i16 %b, i32 zeroext %evl) {
877 ; CHECK-LABEL: vssubu_vx_nxv8i16_unmasked:
879 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
880 ; CHECK-NEXT: vssubu.vx v8, v8, a0
882 %elt.head = insertelement <vscale x 8 x i16> poison, i16 %b, i32 0
883 %vb = shufflevector <vscale x 8 x i16> %elt.head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
884 %v = call <vscale x 8 x i16> @llvm.vp.usub.sat.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb, <vscale x 8 x i1> splat (i1 true), i32 %evl)
885 ret <vscale x 8 x i16> %v
888 define <vscale x 8 x i16> @vssubu_vi_nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
889 ; CHECK-LABEL: vssubu_vi_nxv8i16:
891 ; CHECK-NEXT: li a1, -1
892 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
893 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
895 %v = call <vscale x 8 x i16> @llvm.vp.usub.sat.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> splat (i16 -1), <vscale x 8 x i1> %m, i32 %evl)
896 ret <vscale x 8 x i16> %v
899 define <vscale x 8 x i16> @vssubu_vi_nxv8i16_unmasked(<vscale x 8 x i16> %va, i32 zeroext %evl) {
900 ; CHECK-LABEL: vssubu_vi_nxv8i16_unmasked:
902 ; CHECK-NEXT: li a1, -1
903 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
904 ; CHECK-NEXT: vssubu.vx v8, v8, a1
906 %v = call <vscale x 8 x i16> @llvm.vp.usub.sat.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> splat (i16 -1), <vscale x 8 x i1> splat (i1 true), i32 %evl)
907 ret <vscale x 8 x i16> %v
910 declare <vscale x 16 x i16> @llvm.vp.usub.sat.nxv16i16(<vscale x 16 x i16>, <vscale x 16 x i16>, <vscale x 16 x i1>, i32)
912 define <vscale x 16 x i16> @vssubu_vv_nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
913 ; CHECK-LABEL: vssubu_vv_nxv16i16:
915 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
916 ; CHECK-NEXT: vssubu.vv v8, v8, v12, v0.t
918 %v = call <vscale x 16 x i16> @llvm.vp.usub.sat.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, <vscale x 16 x i1> %m, i32 %evl)
919 ret <vscale x 16 x i16> %v
922 define <vscale x 16 x i16> @vssubu_vv_nxv16i16_unmasked(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, i32 zeroext %evl) {
923 ; CHECK-LABEL: vssubu_vv_nxv16i16_unmasked:
925 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
926 ; CHECK-NEXT: vssubu.vv v8, v8, v12
928 %v = call <vscale x 16 x i16> @llvm.vp.usub.sat.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, <vscale x 16 x i1> splat (i1 true), i32 %evl)
929 ret <vscale x 16 x i16> %v
932 define <vscale x 16 x i16> @vssubu_vx_nxv16i16(<vscale x 16 x i16> %va, i16 %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
933 ; CHECK-LABEL: vssubu_vx_nxv16i16:
935 ; CHECK-NEXT: vsetvli zero, a1, e16, m4, ta, ma
936 ; CHECK-NEXT: vssubu.vx v8, v8, a0, v0.t
938 %elt.head = insertelement <vscale x 16 x i16> poison, i16 %b, i32 0
939 %vb = shufflevector <vscale x 16 x i16> %elt.head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
940 %v = call <vscale x 16 x i16> @llvm.vp.usub.sat.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb, <vscale x 16 x i1> %m, i32 %evl)
941 ret <vscale x 16 x i16> %v
944 define <vscale x 16 x i16> @vssubu_vx_nxv16i16_unmasked(<vscale x 16 x i16> %va, i16 %b, i32 zeroext %evl) {
945 ; CHECK-LABEL: vssubu_vx_nxv16i16_unmasked:
947 ; CHECK-NEXT: vsetvli zero, a1, e16, m4, ta, ma
948 ; CHECK-NEXT: vssubu.vx v8, v8, a0
950 %elt.head = insertelement <vscale x 16 x i16> poison, i16 %b, i32 0
951 %vb = shufflevector <vscale x 16 x i16> %elt.head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
952 %v = call <vscale x 16 x i16> @llvm.vp.usub.sat.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb, <vscale x 16 x i1> splat (i1 true), i32 %evl)
953 ret <vscale x 16 x i16> %v
956 define <vscale x 16 x i16> @vssubu_vi_nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
957 ; CHECK-LABEL: vssubu_vi_nxv16i16:
959 ; CHECK-NEXT: li a1, -1
960 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
961 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
963 %v = call <vscale x 16 x i16> @llvm.vp.usub.sat.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> splat (i16 -1), <vscale x 16 x i1> %m, i32 %evl)
964 ret <vscale x 16 x i16> %v
967 define <vscale x 16 x i16> @vssubu_vi_nxv16i16_unmasked(<vscale x 16 x i16> %va, i32 zeroext %evl) {
968 ; CHECK-LABEL: vssubu_vi_nxv16i16_unmasked:
970 ; CHECK-NEXT: li a1, -1
971 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
972 ; CHECK-NEXT: vssubu.vx v8, v8, a1
974 %v = call <vscale x 16 x i16> @llvm.vp.usub.sat.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> splat (i16 -1), <vscale x 16 x i1> splat (i1 true), i32 %evl)
975 ret <vscale x 16 x i16> %v
978 declare <vscale x 32 x i16> @llvm.vp.usub.sat.nxv32i16(<vscale x 32 x i16>, <vscale x 32 x i16>, <vscale x 32 x i1>, i32)
980 define <vscale x 32 x i16> @vssubu_vv_nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
981 ; CHECK-LABEL: vssubu_vv_nxv32i16:
983 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
984 ; CHECK-NEXT: vssubu.vv v8, v8, v16, v0.t
986 %v = call <vscale x 32 x i16> @llvm.vp.usub.sat.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, <vscale x 32 x i1> %m, i32 %evl)
987 ret <vscale x 32 x i16> %v
990 define <vscale x 32 x i16> @vssubu_vv_nxv32i16_unmasked(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, i32 zeroext %evl) {
991 ; CHECK-LABEL: vssubu_vv_nxv32i16_unmasked:
993 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
994 ; CHECK-NEXT: vssubu.vv v8, v8, v16
996 %v = call <vscale x 32 x i16> @llvm.vp.usub.sat.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, <vscale x 32 x i1> splat (i1 true), i32 %evl)
997 ret <vscale x 32 x i16> %v
1000 define <vscale x 32 x i16> @vssubu_vx_nxv32i16(<vscale x 32 x i16> %va, i16 %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
1001 ; CHECK-LABEL: vssubu_vx_nxv32i16:
1003 ; CHECK-NEXT: vsetvli zero, a1, e16, m8, ta, ma
1004 ; CHECK-NEXT: vssubu.vx v8, v8, a0, v0.t
1006 %elt.head = insertelement <vscale x 32 x i16> poison, i16 %b, i32 0
1007 %vb = shufflevector <vscale x 32 x i16> %elt.head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
1008 %v = call <vscale x 32 x i16> @llvm.vp.usub.sat.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb, <vscale x 32 x i1> %m, i32 %evl)
1009 ret <vscale x 32 x i16> %v
1012 define <vscale x 32 x i16> @vssubu_vx_nxv32i16_unmasked(<vscale x 32 x i16> %va, i16 %b, i32 zeroext %evl) {
1013 ; CHECK-LABEL: vssubu_vx_nxv32i16_unmasked:
1015 ; CHECK-NEXT: vsetvli zero, a1, e16, m8, ta, ma
1016 ; CHECK-NEXT: vssubu.vx v8, v8, a0
1018 %elt.head = insertelement <vscale x 32 x i16> poison, i16 %b, i32 0
1019 %vb = shufflevector <vscale x 32 x i16> %elt.head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
1020 %v = call <vscale x 32 x i16> @llvm.vp.usub.sat.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb, <vscale x 32 x i1> splat (i1 true), i32 %evl)
1021 ret <vscale x 32 x i16> %v
1024 define <vscale x 32 x i16> @vssubu_vi_nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i1> %m, i32 zeroext %evl) {
1025 ; CHECK-LABEL: vssubu_vi_nxv32i16:
1027 ; CHECK-NEXT: li a1, -1
1028 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
1029 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
1031 %v = call <vscale x 32 x i16> @llvm.vp.usub.sat.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> splat (i16 -1), <vscale x 32 x i1> %m, i32 %evl)
1032 ret <vscale x 32 x i16> %v
1035 define <vscale x 32 x i16> @vssubu_vi_nxv32i16_unmasked(<vscale x 32 x i16> %va, i32 zeroext %evl) {
1036 ; CHECK-LABEL: vssubu_vi_nxv32i16_unmasked:
1038 ; CHECK-NEXT: li a1, -1
1039 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
1040 ; CHECK-NEXT: vssubu.vx v8, v8, a1
1042 %v = call <vscale x 32 x i16> @llvm.vp.usub.sat.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> splat (i16 -1), <vscale x 32 x i1> splat (i1 true), i32 %evl)
1043 ret <vscale x 32 x i16> %v
1046 declare <vscale x 1 x i32> @llvm.vp.usub.sat.nxv1i32(<vscale x 1 x i32>, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
1048 define <vscale x 1 x i32> @vssubu_vv_nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1049 ; CHECK-LABEL: vssubu_vv_nxv1i32:
1051 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
1052 ; CHECK-NEXT: vssubu.vv v8, v8, v9, v0.t
1054 %v = call <vscale x 1 x i32> @llvm.vp.usub.sat.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, <vscale x 1 x i1> %m, i32 %evl)
1055 ret <vscale x 1 x i32> %v
1058 define <vscale x 1 x i32> @vssubu_vv_nxv1i32_unmasked(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, i32 zeroext %evl) {
1059 ; CHECK-LABEL: vssubu_vv_nxv1i32_unmasked:
1061 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
1062 ; CHECK-NEXT: vssubu.vv v8, v8, v9
1064 %v = call <vscale x 1 x i32> @llvm.vp.usub.sat.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, <vscale x 1 x i1> splat (i1 true), i32 %evl)
1065 ret <vscale x 1 x i32> %v
1068 define <vscale x 1 x i32> @vssubu_vx_nxv1i32(<vscale x 1 x i32> %va, i32 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1069 ; CHECK-LABEL: vssubu_vx_nxv1i32:
1071 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
1072 ; CHECK-NEXT: vssubu.vx v8, v8, a0, v0.t
1074 %elt.head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
1075 %vb = shufflevector <vscale x 1 x i32> %elt.head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
1076 %v = call <vscale x 1 x i32> @llvm.vp.usub.sat.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb, <vscale x 1 x i1> %m, i32 %evl)
1077 ret <vscale x 1 x i32> %v
1080 define <vscale x 1 x i32> @vssubu_vx_nxv1i32_unmasked(<vscale x 1 x i32> %va, i32 %b, i32 zeroext %evl) {
1081 ; CHECK-LABEL: vssubu_vx_nxv1i32_unmasked:
1083 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
1084 ; CHECK-NEXT: vssubu.vx v8, v8, a0
1086 %elt.head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
1087 %vb = shufflevector <vscale x 1 x i32> %elt.head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
1088 %v = call <vscale x 1 x i32> @llvm.vp.usub.sat.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb, <vscale x 1 x i1> splat (i1 true), i32 %evl)
1089 ret <vscale x 1 x i32> %v
1092 define <vscale x 1 x i32> @vssubu_vi_nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1093 ; CHECK-LABEL: vssubu_vi_nxv1i32:
1095 ; CHECK-NEXT: li a1, -1
1096 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
1097 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
1099 %v = call <vscale x 1 x i32> @llvm.vp.usub.sat.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> splat (i32 -1), <vscale x 1 x i1> %m, i32 %evl)
1100 ret <vscale x 1 x i32> %v
1103 define <vscale x 1 x i32> @vssubu_vi_nxv1i32_unmasked(<vscale x 1 x i32> %va, i32 zeroext %evl) {
1104 ; CHECK-LABEL: vssubu_vi_nxv1i32_unmasked:
1106 ; CHECK-NEXT: li a1, -1
1107 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
1108 ; CHECK-NEXT: vssubu.vx v8, v8, a1
1110 %v = call <vscale x 1 x i32> @llvm.vp.usub.sat.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> splat (i32 -1), <vscale x 1 x i1> splat (i1 true), i32 %evl)
1111 ret <vscale x 1 x i32> %v
1114 declare <vscale x 2 x i32> @llvm.vp.usub.sat.nxv2i32(<vscale x 2 x i32>, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
1116 define <vscale x 2 x i32> @vssubu_vv_nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1117 ; CHECK-LABEL: vssubu_vv_nxv2i32:
1119 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
1120 ; CHECK-NEXT: vssubu.vv v8, v8, v9, v0.t
1122 %v = call <vscale x 2 x i32> @llvm.vp.usub.sat.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, <vscale x 2 x i1> %m, i32 %evl)
1123 ret <vscale x 2 x i32> %v
1126 define <vscale x 2 x i32> @vssubu_vv_nxv2i32_unmasked(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, i32 zeroext %evl) {
1127 ; CHECK-LABEL: vssubu_vv_nxv2i32_unmasked:
1129 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
1130 ; CHECK-NEXT: vssubu.vv v8, v8, v9
1132 %v = call <vscale x 2 x i32> @llvm.vp.usub.sat.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, <vscale x 2 x i1> splat (i1 true), i32 %evl)
1133 ret <vscale x 2 x i32> %v
1136 define <vscale x 2 x i32> @vssubu_vx_nxv2i32(<vscale x 2 x i32> %va, i32 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1137 ; CHECK-LABEL: vssubu_vx_nxv2i32:
1139 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
1140 ; CHECK-NEXT: vssubu.vx v8, v8, a0, v0.t
1142 %elt.head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
1143 %vb = shufflevector <vscale x 2 x i32> %elt.head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
1144 %v = call <vscale x 2 x i32> @llvm.vp.usub.sat.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb, <vscale x 2 x i1> %m, i32 %evl)
1145 ret <vscale x 2 x i32> %v
1148 define <vscale x 2 x i32> @vssubu_vx_nxv2i32_unmasked(<vscale x 2 x i32> %va, i32 %b, i32 zeroext %evl) {
1149 ; CHECK-LABEL: vssubu_vx_nxv2i32_unmasked:
1151 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
1152 ; CHECK-NEXT: vssubu.vx v8, v8, a0
1154 %elt.head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
1155 %vb = shufflevector <vscale x 2 x i32> %elt.head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
1156 %v = call <vscale x 2 x i32> @llvm.vp.usub.sat.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb, <vscale x 2 x i1> splat (i1 true), i32 %evl)
1157 ret <vscale x 2 x i32> %v
1160 define <vscale x 2 x i32> @vssubu_vi_nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1161 ; CHECK-LABEL: vssubu_vi_nxv2i32:
1163 ; CHECK-NEXT: li a1, -1
1164 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
1165 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
1167 %v = call <vscale x 2 x i32> @llvm.vp.usub.sat.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> splat (i32 -1), <vscale x 2 x i1> %m, i32 %evl)
1168 ret <vscale x 2 x i32> %v
1171 define <vscale x 2 x i32> @vssubu_vi_nxv2i32_unmasked(<vscale x 2 x i32> %va, i32 zeroext %evl) {
1172 ; CHECK-LABEL: vssubu_vi_nxv2i32_unmasked:
1174 ; CHECK-NEXT: li a1, -1
1175 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
1176 ; CHECK-NEXT: vssubu.vx v8, v8, a1
1178 %v = call <vscale x 2 x i32> @llvm.vp.usub.sat.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> splat (i32 -1), <vscale x 2 x i1> splat (i1 true), i32 %evl)
1179 ret <vscale x 2 x i32> %v
1182 declare <vscale x 4 x i32> @llvm.vp.usub.sat.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1184 define <vscale x 4 x i32> @vssubu_vv_nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1185 ; CHECK-LABEL: vssubu_vv_nxv4i32:
1187 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1188 ; CHECK-NEXT: vssubu.vv v8, v8, v10, v0.t
1190 %v = call <vscale x 4 x i32> @llvm.vp.usub.sat.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, <vscale x 4 x i1> %m, i32 %evl)
1191 ret <vscale x 4 x i32> %v
1194 define <vscale x 4 x i32> @vssubu_vv_nxv4i32_unmasked(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, i32 zeroext %evl) {
1195 ; CHECK-LABEL: vssubu_vv_nxv4i32_unmasked:
1197 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1198 ; CHECK-NEXT: vssubu.vv v8, v8, v10
1200 %v = call <vscale x 4 x i32> @llvm.vp.usub.sat.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, <vscale x 4 x i1> splat (i1 true), i32 %evl)
1201 ret <vscale x 4 x i32> %v
1204 define <vscale x 4 x i32> @vssubu_vx_nxv4i32(<vscale x 4 x i32> %va, i32 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1205 ; CHECK-LABEL: vssubu_vx_nxv4i32:
1207 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1208 ; CHECK-NEXT: vssubu.vx v8, v8, a0, v0.t
1210 %elt.head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
1211 %vb = shufflevector <vscale x 4 x i32> %elt.head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
1212 %v = call <vscale x 4 x i32> @llvm.vp.usub.sat.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb, <vscale x 4 x i1> %m, i32 %evl)
1213 ret <vscale x 4 x i32> %v
1216 define <vscale x 4 x i32> @vssubu_vx_nxv4i32_unmasked(<vscale x 4 x i32> %va, i32 %b, i32 zeroext %evl) {
1217 ; CHECK-LABEL: vssubu_vx_nxv4i32_unmasked:
1219 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1220 ; CHECK-NEXT: vssubu.vx v8, v8, a0
1222 %elt.head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
1223 %vb = shufflevector <vscale x 4 x i32> %elt.head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
1224 %v = call <vscale x 4 x i32> @llvm.vp.usub.sat.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb, <vscale x 4 x i1> splat (i1 true), i32 %evl)
1225 ret <vscale x 4 x i32> %v
1228 define <vscale x 4 x i32> @vssubu_vi_nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1229 ; CHECK-LABEL: vssubu_vi_nxv4i32:
1231 ; CHECK-NEXT: li a1, -1
1232 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1233 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
1235 %v = call <vscale x 4 x i32> @llvm.vp.usub.sat.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> splat (i32 -1), <vscale x 4 x i1> %m, i32 %evl)
1236 ret <vscale x 4 x i32> %v
1239 define <vscale x 4 x i32> @vssubu_vi_nxv4i32_unmasked(<vscale x 4 x i32> %va, i32 zeroext %evl) {
1240 ; CHECK-LABEL: vssubu_vi_nxv4i32_unmasked:
1242 ; CHECK-NEXT: li a1, -1
1243 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1244 ; CHECK-NEXT: vssubu.vx v8, v8, a1
1246 %v = call <vscale x 4 x i32> @llvm.vp.usub.sat.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> splat (i32 -1), <vscale x 4 x i1> splat (i1 true), i32 %evl)
1247 ret <vscale x 4 x i32> %v
1250 declare <vscale x 8 x i32> @llvm.vp.usub.sat.nxv8i32(<vscale x 8 x i32>, <vscale x 8 x i32>, <vscale x 8 x i1>, i32)
1252 define <vscale x 8 x i32> @vssubu_vv_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1253 ; CHECK-LABEL: vssubu_vv_nxv8i32:
1255 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1256 ; CHECK-NEXT: vssubu.vv v8, v8, v12, v0.t
1258 %v = call <vscale x 8 x i32> @llvm.vp.usub.sat.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, <vscale x 8 x i1> %m, i32 %evl)
1259 ret <vscale x 8 x i32> %v
1262 define <vscale x 8 x i32> @vssubu_vv_nxv8i32_unmasked(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, i32 zeroext %evl) {
1263 ; CHECK-LABEL: vssubu_vv_nxv8i32_unmasked:
1265 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1266 ; CHECK-NEXT: vssubu.vv v8, v8, v12
1268 %v = call <vscale x 8 x i32> @llvm.vp.usub.sat.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, <vscale x 8 x i1> splat (i1 true), i32 %evl)
1269 ret <vscale x 8 x i32> %v
1272 define <vscale x 8 x i32> @vssubu_vx_nxv8i32(<vscale x 8 x i32> %va, i32 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1273 ; CHECK-LABEL: vssubu_vx_nxv8i32:
1275 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1276 ; CHECK-NEXT: vssubu.vx v8, v8, a0, v0.t
1278 %elt.head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
1279 %vb = shufflevector <vscale x 8 x i32> %elt.head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
1280 %v = call <vscale x 8 x i32> @llvm.vp.usub.sat.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, <vscale x 8 x i1> %m, i32 %evl)
1281 ret <vscale x 8 x i32> %v
1284 define <vscale x 8 x i32> @vssubu_vx_nxv8i32_unmasked(<vscale x 8 x i32> %va, i32 %b, i32 zeroext %evl) {
1285 ; CHECK-LABEL: vssubu_vx_nxv8i32_unmasked:
1287 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1288 ; CHECK-NEXT: vssubu.vx v8, v8, a0
1290 %elt.head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
1291 %vb = shufflevector <vscale x 8 x i32> %elt.head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
1292 %v = call <vscale x 8 x i32> @llvm.vp.usub.sat.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, <vscale x 8 x i1> splat (i1 true), i32 %evl)
1293 ret <vscale x 8 x i32> %v
1296 define <vscale x 8 x i32> @vssubu_vi_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1297 ; CHECK-LABEL: vssubu_vi_nxv8i32:
1299 ; CHECK-NEXT: li a1, -1
1300 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1301 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
1303 %v = call <vscale x 8 x i32> @llvm.vp.usub.sat.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> splat (i32 -1), <vscale x 8 x i1> %m, i32 %evl)
1304 ret <vscale x 8 x i32> %v
1307 define <vscale x 8 x i32> @vssubu_vi_nxv8i32_unmasked(<vscale x 8 x i32> %va, i32 zeroext %evl) {
1308 ; CHECK-LABEL: vssubu_vi_nxv8i32_unmasked:
1310 ; CHECK-NEXT: li a1, -1
1311 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1312 ; CHECK-NEXT: vssubu.vx v8, v8, a1
1314 %v = call <vscale x 8 x i32> @llvm.vp.usub.sat.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> splat (i32 -1), <vscale x 8 x i1> splat (i1 true), i32 %evl)
1315 ret <vscale x 8 x i32> %v
1318 declare <vscale x 16 x i32> @llvm.vp.usub.sat.nxv16i32(<vscale x 16 x i32>, <vscale x 16 x i32>, <vscale x 16 x i1>, i32)
1320 define <vscale x 16 x i32> @vssubu_vv_nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1321 ; CHECK-LABEL: vssubu_vv_nxv16i32:
1323 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1324 ; CHECK-NEXT: vssubu.vv v8, v8, v16, v0.t
1326 %v = call <vscale x 16 x i32> @llvm.vp.usub.sat.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, <vscale x 16 x i1> %m, i32 %evl)
1327 ret <vscale x 16 x i32> %v
1330 define <vscale x 16 x i32> @vssubu_vv_nxv16i32_unmasked(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, i32 zeroext %evl) {
1331 ; CHECK-LABEL: vssubu_vv_nxv16i32_unmasked:
1333 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1334 ; CHECK-NEXT: vssubu.vv v8, v8, v16
1336 %v = call <vscale x 16 x i32> @llvm.vp.usub.sat.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, <vscale x 16 x i1> splat (i1 true), i32 %evl)
1337 ret <vscale x 16 x i32> %v
1340 define <vscale x 16 x i32> @vssubu_vx_nxv16i32(<vscale x 16 x i32> %va, i32 %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1341 ; CHECK-LABEL: vssubu_vx_nxv16i32:
1343 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1344 ; CHECK-NEXT: vssubu.vx v8, v8, a0, v0.t
1346 %elt.head = insertelement <vscale x 16 x i32> poison, i32 %b, i32 0
1347 %vb = shufflevector <vscale x 16 x i32> %elt.head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
1348 %v = call <vscale x 16 x i32> @llvm.vp.usub.sat.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb, <vscale x 16 x i1> %m, i32 %evl)
1349 ret <vscale x 16 x i32> %v
1352 define <vscale x 16 x i32> @vssubu_vx_nxv16i32_unmasked(<vscale x 16 x i32> %va, i32 %b, i32 zeroext %evl) {
1353 ; CHECK-LABEL: vssubu_vx_nxv16i32_unmasked:
1355 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1356 ; CHECK-NEXT: vssubu.vx v8, v8, a0
1358 %elt.head = insertelement <vscale x 16 x i32> poison, i32 %b, i32 0
1359 %vb = shufflevector <vscale x 16 x i32> %elt.head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
1360 %v = call <vscale x 16 x i32> @llvm.vp.usub.sat.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb, <vscale x 16 x i1> splat (i1 true), i32 %evl)
1361 ret <vscale x 16 x i32> %v
1364 define <vscale x 16 x i32> @vssubu_vi_nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1365 ; CHECK-LABEL: vssubu_vi_nxv16i32:
1367 ; CHECK-NEXT: li a1, -1
1368 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1369 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
1371 %v = call <vscale x 16 x i32> @llvm.vp.usub.sat.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> splat (i32 -1), <vscale x 16 x i1> %m, i32 %evl)
1372 ret <vscale x 16 x i32> %v
1375 define <vscale x 16 x i32> @vssubu_vi_nxv16i32_unmasked(<vscale x 16 x i32> %va, i32 zeroext %evl) {
1376 ; CHECK-LABEL: vssubu_vi_nxv16i32_unmasked:
1378 ; CHECK-NEXT: li a1, -1
1379 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1380 ; CHECK-NEXT: vssubu.vx v8, v8, a1
1382 %v = call <vscale x 16 x i32> @llvm.vp.usub.sat.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> splat (i32 -1), <vscale x 16 x i1> splat (i1 true), i32 %evl)
1383 ret <vscale x 16 x i32> %v
1386 ; Test that split-legalization works then the mask needs manual splitting.
1388 declare <vscale x 32 x i32> @llvm.vp.usub.sat.nxv32i32(<vscale x 32 x i32>, <vscale x 32 x i32>, <vscale x 32 x i1>, i32)
1390 define <vscale x 32 x i32> @vssubu_vi_nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i1> %m, i32 zeroext %evl) {
1391 ; CHECK-LABEL: vssubu_vi_nxv32i32:
1393 ; CHECK-NEXT: vmv1r.v v24, v0
1394 ; CHECK-NEXT: csrr a1, vlenb
1395 ; CHECK-NEXT: srli a2, a1, 2
1396 ; CHECK-NEXT: vsetvli a3, zero, e8, mf2, ta, ma
1397 ; CHECK-NEXT: vslidedown.vx v0, v0, a2
1398 ; CHECK-NEXT: slli a1, a1, 1
1399 ; CHECK-NEXT: sub a2, a0, a1
1400 ; CHECK-NEXT: sltu a3, a0, a2
1401 ; CHECK-NEXT: addi a3, a3, -1
1402 ; CHECK-NEXT: and a3, a3, a2
1403 ; CHECK-NEXT: li a2, -1
1404 ; CHECK-NEXT: vsetvli zero, a3, e32, m8, ta, ma
1405 ; CHECK-NEXT: vssubu.vx v16, v16, a2, v0.t
1406 ; CHECK-NEXT: bltu a0, a1, .LBB118_2
1407 ; CHECK-NEXT: # %bb.1:
1408 ; CHECK-NEXT: mv a0, a1
1409 ; CHECK-NEXT: .LBB118_2:
1410 ; CHECK-NEXT: vmv1r.v v0, v24
1411 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1412 ; CHECK-NEXT: vssubu.vx v8, v8, a2, v0.t
1414 %v = call <vscale x 32 x i32> @llvm.vp.usub.sat.nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i32> splat (i32 -1), <vscale x 32 x i1> %m, i32 %evl)
1415 ret <vscale x 32 x i32> %v
1418 define <vscale x 32 x i32> @vssubu_vi_nxv32i32_unmasked(<vscale x 32 x i32> %va, i32 zeroext %evl) {
1419 ; CHECK-LABEL: vssubu_vi_nxv32i32_unmasked:
1421 ; CHECK-NEXT: csrr a1, vlenb
1422 ; CHECK-NEXT: slli a1, a1, 1
1423 ; CHECK-NEXT: sub a2, a0, a1
1424 ; CHECK-NEXT: sltu a3, a0, a2
1425 ; CHECK-NEXT: addi a3, a3, -1
1426 ; CHECK-NEXT: and a3, a3, a2
1427 ; CHECK-NEXT: li a2, -1
1428 ; CHECK-NEXT: vsetvli zero, a3, e32, m8, ta, ma
1429 ; CHECK-NEXT: vssubu.vx v16, v16, a2
1430 ; CHECK-NEXT: bltu a0, a1, .LBB119_2
1431 ; CHECK-NEXT: # %bb.1:
1432 ; CHECK-NEXT: mv a0, a1
1433 ; CHECK-NEXT: .LBB119_2:
1434 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1435 ; CHECK-NEXT: vssubu.vx v8, v8, a2
1437 %v = call <vscale x 32 x i32> @llvm.vp.usub.sat.nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i32> splat (i32 -1), <vscale x 32 x i1> splat (i1 true), i32 %evl)
1438 ret <vscale x 32 x i32> %v
1441 declare <vscale x 1 x i64> @llvm.vp.usub.sat.nxv1i64(<vscale x 1 x i64>, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1443 define <vscale x 1 x i64> @vssubu_vv_nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1444 ; CHECK-LABEL: vssubu_vv_nxv1i64:
1446 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1447 ; CHECK-NEXT: vssubu.vv v8, v8, v9, v0.t
1449 %v = call <vscale x 1 x i64> @llvm.vp.usub.sat.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, <vscale x 1 x i1> %m, i32 %evl)
1450 ret <vscale x 1 x i64> %v
1453 define <vscale x 1 x i64> @vssubu_vv_nxv1i64_unmasked(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, i32 zeroext %evl) {
1454 ; CHECK-LABEL: vssubu_vv_nxv1i64_unmasked:
1456 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1457 ; CHECK-NEXT: vssubu.vv v8, v8, v9
1459 %v = call <vscale x 1 x i64> @llvm.vp.usub.sat.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, <vscale x 1 x i1> splat (i1 true), i32 %evl)
1460 ret <vscale x 1 x i64> %v
1463 define <vscale x 1 x i64> @vssubu_vx_nxv1i64(<vscale x 1 x i64> %va, i64 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1464 ; RV32-LABEL: vssubu_vx_nxv1i64:
1466 ; RV32-NEXT: addi sp, sp, -16
1467 ; RV32-NEXT: .cfi_def_cfa_offset 16
1468 ; RV32-NEXT: sw a1, 12(sp)
1469 ; RV32-NEXT: sw a0, 8(sp)
1470 ; RV32-NEXT: addi a0, sp, 8
1471 ; RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1472 ; RV32-NEXT: vlse64.v v9, (a0), zero
1473 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1474 ; RV32-NEXT: vssubu.vv v8, v8, v9, v0.t
1475 ; RV32-NEXT: addi sp, sp, 16
1478 ; RV64-LABEL: vssubu_vx_nxv1i64:
1480 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1481 ; RV64-NEXT: vssubu.vx v8, v8, a0, v0.t
1483 %elt.head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
1484 %vb = shufflevector <vscale x 1 x i64> %elt.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
1485 %v = call <vscale x 1 x i64> @llvm.vp.usub.sat.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb, <vscale x 1 x i1> %m, i32 %evl)
1486 ret <vscale x 1 x i64> %v
1489 define <vscale x 1 x i64> @vssubu_vx_nxv1i64_unmasked(<vscale x 1 x i64> %va, i64 %b, i32 zeroext %evl) {
1490 ; RV32-LABEL: vssubu_vx_nxv1i64_unmasked:
1492 ; RV32-NEXT: addi sp, sp, -16
1493 ; RV32-NEXT: .cfi_def_cfa_offset 16
1494 ; RV32-NEXT: sw a1, 12(sp)
1495 ; RV32-NEXT: sw a0, 8(sp)
1496 ; RV32-NEXT: addi a0, sp, 8
1497 ; RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1498 ; RV32-NEXT: vlse64.v v9, (a0), zero
1499 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1500 ; RV32-NEXT: vssubu.vv v8, v8, v9
1501 ; RV32-NEXT: addi sp, sp, 16
1504 ; RV64-LABEL: vssubu_vx_nxv1i64_unmasked:
1506 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1507 ; RV64-NEXT: vssubu.vx v8, v8, a0
1509 %elt.head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
1510 %vb = shufflevector <vscale x 1 x i64> %elt.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
1511 %v = call <vscale x 1 x i64> @llvm.vp.usub.sat.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb, <vscale x 1 x i1> splat (i1 true), i32 %evl)
1512 ret <vscale x 1 x i64> %v
1515 define <vscale x 1 x i64> @vssubu_vi_nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1516 ; CHECK-LABEL: vssubu_vi_nxv1i64:
1518 ; CHECK-NEXT: li a1, -1
1519 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1520 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
1522 %v = call <vscale x 1 x i64> @llvm.vp.usub.sat.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> splat (i64 -1), <vscale x 1 x i1> %m, i32 %evl)
1523 ret <vscale x 1 x i64> %v
1526 define <vscale x 1 x i64> @vssubu_vi_nxv1i64_unmasked(<vscale x 1 x i64> %va, i32 zeroext %evl) {
1527 ; CHECK-LABEL: vssubu_vi_nxv1i64_unmasked:
1529 ; CHECK-NEXT: li a1, -1
1530 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1531 ; CHECK-NEXT: vssubu.vx v8, v8, a1
1533 %v = call <vscale x 1 x i64> @llvm.vp.usub.sat.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> splat (i64 -1), <vscale x 1 x i1> splat (i1 true), i32 %evl)
1534 ret <vscale x 1 x i64> %v
1537 declare <vscale x 2 x i64> @llvm.vp.usub.sat.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1539 define <vscale x 2 x i64> @vssubu_vv_nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1540 ; CHECK-LABEL: vssubu_vv_nxv2i64:
1542 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1543 ; CHECK-NEXT: vssubu.vv v8, v8, v10, v0.t
1545 %v = call <vscale x 2 x i64> @llvm.vp.usub.sat.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, <vscale x 2 x i1> %m, i32 %evl)
1546 ret <vscale x 2 x i64> %v
1549 define <vscale x 2 x i64> @vssubu_vv_nxv2i64_unmasked(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, i32 zeroext %evl) {
1550 ; CHECK-LABEL: vssubu_vv_nxv2i64_unmasked:
1552 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1553 ; CHECK-NEXT: vssubu.vv v8, v8, v10
1555 %v = call <vscale x 2 x i64> @llvm.vp.usub.sat.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, <vscale x 2 x i1> splat (i1 true), i32 %evl)
1556 ret <vscale x 2 x i64> %v
1559 define <vscale x 2 x i64> @vssubu_vx_nxv2i64(<vscale x 2 x i64> %va, i64 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1560 ; RV32-LABEL: vssubu_vx_nxv2i64:
1562 ; RV32-NEXT: addi sp, sp, -16
1563 ; RV32-NEXT: .cfi_def_cfa_offset 16
1564 ; RV32-NEXT: sw a1, 12(sp)
1565 ; RV32-NEXT: sw a0, 8(sp)
1566 ; RV32-NEXT: addi a0, sp, 8
1567 ; RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1568 ; RV32-NEXT: vlse64.v v10, (a0), zero
1569 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1570 ; RV32-NEXT: vssubu.vv v8, v8, v10, v0.t
1571 ; RV32-NEXT: addi sp, sp, 16
1574 ; RV64-LABEL: vssubu_vx_nxv2i64:
1576 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1577 ; RV64-NEXT: vssubu.vx v8, v8, a0, v0.t
1579 %elt.head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
1580 %vb = shufflevector <vscale x 2 x i64> %elt.head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
1581 %v = call <vscale x 2 x i64> @llvm.vp.usub.sat.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb, <vscale x 2 x i1> %m, i32 %evl)
1582 ret <vscale x 2 x i64> %v
1585 define <vscale x 2 x i64> @vssubu_vx_nxv2i64_unmasked(<vscale x 2 x i64> %va, i64 %b, i32 zeroext %evl) {
1586 ; RV32-LABEL: vssubu_vx_nxv2i64_unmasked:
1588 ; RV32-NEXT: addi sp, sp, -16
1589 ; RV32-NEXT: .cfi_def_cfa_offset 16
1590 ; RV32-NEXT: sw a1, 12(sp)
1591 ; RV32-NEXT: sw a0, 8(sp)
1592 ; RV32-NEXT: addi a0, sp, 8
1593 ; RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1594 ; RV32-NEXT: vlse64.v v10, (a0), zero
1595 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1596 ; RV32-NEXT: vssubu.vv v8, v8, v10
1597 ; RV32-NEXT: addi sp, sp, 16
1600 ; RV64-LABEL: vssubu_vx_nxv2i64_unmasked:
1602 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1603 ; RV64-NEXT: vssubu.vx v8, v8, a0
1605 %elt.head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
1606 %vb = shufflevector <vscale x 2 x i64> %elt.head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
1607 %v = call <vscale x 2 x i64> @llvm.vp.usub.sat.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb, <vscale x 2 x i1> splat (i1 true), i32 %evl)
1608 ret <vscale x 2 x i64> %v
1611 define <vscale x 2 x i64> @vssubu_vi_nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1612 ; CHECK-LABEL: vssubu_vi_nxv2i64:
1614 ; CHECK-NEXT: li a1, -1
1615 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1616 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
1618 %v = call <vscale x 2 x i64> @llvm.vp.usub.sat.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> splat (i64 -1), <vscale x 2 x i1> %m, i32 %evl)
1619 ret <vscale x 2 x i64> %v
1622 define <vscale x 2 x i64> @vssubu_vi_nxv2i64_unmasked(<vscale x 2 x i64> %va, i32 zeroext %evl) {
1623 ; CHECK-LABEL: vssubu_vi_nxv2i64_unmasked:
1625 ; CHECK-NEXT: li a1, -1
1626 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1627 ; CHECK-NEXT: vssubu.vx v8, v8, a1
1629 %v = call <vscale x 2 x i64> @llvm.vp.usub.sat.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> splat (i64 -1), <vscale x 2 x i1> splat (i1 true), i32 %evl)
1630 ret <vscale x 2 x i64> %v
1633 declare <vscale x 4 x i64> @llvm.vp.usub.sat.nxv4i64(<vscale x 4 x i64>, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
1635 define <vscale x 4 x i64> @vssubu_vv_nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1636 ; CHECK-LABEL: vssubu_vv_nxv4i64:
1638 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1639 ; CHECK-NEXT: vssubu.vv v8, v8, v12, v0.t
1641 %v = call <vscale x 4 x i64> @llvm.vp.usub.sat.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, <vscale x 4 x i1> %m, i32 %evl)
1642 ret <vscale x 4 x i64> %v
1645 define <vscale x 4 x i64> @vssubu_vv_nxv4i64_unmasked(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, i32 zeroext %evl) {
1646 ; CHECK-LABEL: vssubu_vv_nxv4i64_unmasked:
1648 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1649 ; CHECK-NEXT: vssubu.vv v8, v8, v12
1651 %v = call <vscale x 4 x i64> @llvm.vp.usub.sat.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, <vscale x 4 x i1> splat (i1 true), i32 %evl)
1652 ret <vscale x 4 x i64> %v
1655 define <vscale x 4 x i64> @vssubu_vx_nxv4i64(<vscale x 4 x i64> %va, i64 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1656 ; RV32-LABEL: vssubu_vx_nxv4i64:
1658 ; RV32-NEXT: addi sp, sp, -16
1659 ; RV32-NEXT: .cfi_def_cfa_offset 16
1660 ; RV32-NEXT: sw a1, 12(sp)
1661 ; RV32-NEXT: sw a0, 8(sp)
1662 ; RV32-NEXT: addi a0, sp, 8
1663 ; RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1664 ; RV32-NEXT: vlse64.v v12, (a0), zero
1665 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
1666 ; RV32-NEXT: vssubu.vv v8, v8, v12, v0.t
1667 ; RV32-NEXT: addi sp, sp, 16
1670 ; RV64-LABEL: vssubu_vx_nxv4i64:
1672 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
1673 ; RV64-NEXT: vssubu.vx v8, v8, a0, v0.t
1675 %elt.head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
1676 %vb = shufflevector <vscale x 4 x i64> %elt.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
1677 %v = call <vscale x 4 x i64> @llvm.vp.usub.sat.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb, <vscale x 4 x i1> %m, i32 %evl)
1678 ret <vscale x 4 x i64> %v
1681 define <vscale x 4 x i64> @vssubu_vx_nxv4i64_unmasked(<vscale x 4 x i64> %va, i64 %b, i32 zeroext %evl) {
1682 ; RV32-LABEL: vssubu_vx_nxv4i64_unmasked:
1684 ; RV32-NEXT: addi sp, sp, -16
1685 ; RV32-NEXT: .cfi_def_cfa_offset 16
1686 ; RV32-NEXT: sw a1, 12(sp)
1687 ; RV32-NEXT: sw a0, 8(sp)
1688 ; RV32-NEXT: addi a0, sp, 8
1689 ; RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1690 ; RV32-NEXT: vlse64.v v12, (a0), zero
1691 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
1692 ; RV32-NEXT: vssubu.vv v8, v8, v12
1693 ; RV32-NEXT: addi sp, sp, 16
1696 ; RV64-LABEL: vssubu_vx_nxv4i64_unmasked:
1698 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
1699 ; RV64-NEXT: vssubu.vx v8, v8, a0
1701 %elt.head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
1702 %vb = shufflevector <vscale x 4 x i64> %elt.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
1703 %v = call <vscale x 4 x i64> @llvm.vp.usub.sat.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb, <vscale x 4 x i1> splat (i1 true), i32 %evl)
1704 ret <vscale x 4 x i64> %v
1707 define <vscale x 4 x i64> @vssubu_vi_nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1708 ; CHECK-LABEL: vssubu_vi_nxv4i64:
1710 ; CHECK-NEXT: li a1, -1
1711 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1712 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
1714 %v = call <vscale x 4 x i64> @llvm.vp.usub.sat.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> splat (i64 -1), <vscale x 4 x i1> %m, i32 %evl)
1715 ret <vscale x 4 x i64> %v
1718 define <vscale x 4 x i64> @vssubu_vi_nxv4i64_unmasked(<vscale x 4 x i64> %va, i32 zeroext %evl) {
1719 ; CHECK-LABEL: vssubu_vi_nxv4i64_unmasked:
1721 ; CHECK-NEXT: li a1, -1
1722 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1723 ; CHECK-NEXT: vssubu.vx v8, v8, a1
1725 %v = call <vscale x 4 x i64> @llvm.vp.usub.sat.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> splat (i64 -1), <vscale x 4 x i1> splat (i1 true), i32 %evl)
1726 ret <vscale x 4 x i64> %v
1729 declare <vscale x 8 x i64> @llvm.vp.usub.sat.nxv8i64(<vscale x 8 x i64>, <vscale x 8 x i64>, <vscale x 8 x i1>, i32)
1731 define <vscale x 8 x i64> @vssubu_vv_nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1732 ; CHECK-LABEL: vssubu_vv_nxv8i64:
1734 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1735 ; CHECK-NEXT: vssubu.vv v8, v8, v16, v0.t
1737 %v = call <vscale x 8 x i64> @llvm.vp.usub.sat.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, <vscale x 8 x i1> %m, i32 %evl)
1738 ret <vscale x 8 x i64> %v
1741 define <vscale x 8 x i64> @vssubu_vv_nxv8i64_unmasked(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, i32 zeroext %evl) {
1742 ; CHECK-LABEL: vssubu_vv_nxv8i64_unmasked:
1744 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1745 ; CHECK-NEXT: vssubu.vv v8, v8, v16
1747 %v = call <vscale x 8 x i64> @llvm.vp.usub.sat.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, <vscale x 8 x i1> splat (i1 true), i32 %evl)
1748 ret <vscale x 8 x i64> %v
1751 define <vscale x 8 x i64> @vssubu_vx_nxv8i64(<vscale x 8 x i64> %va, i64 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1752 ; RV32-LABEL: vssubu_vx_nxv8i64:
1754 ; RV32-NEXT: addi sp, sp, -16
1755 ; RV32-NEXT: .cfi_def_cfa_offset 16
1756 ; RV32-NEXT: sw a1, 12(sp)
1757 ; RV32-NEXT: sw a0, 8(sp)
1758 ; RV32-NEXT: addi a0, sp, 8
1759 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1760 ; RV32-NEXT: vlse64.v v16, (a0), zero
1761 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1762 ; RV32-NEXT: vssubu.vv v8, v8, v16, v0.t
1763 ; RV32-NEXT: addi sp, sp, 16
1766 ; RV64-LABEL: vssubu_vx_nxv8i64:
1768 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1769 ; RV64-NEXT: vssubu.vx v8, v8, a0, v0.t
1771 %elt.head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
1772 %vb = shufflevector <vscale x 8 x i64> %elt.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
1773 %v = call <vscale x 8 x i64> @llvm.vp.usub.sat.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb, <vscale x 8 x i1> %m, i32 %evl)
1774 ret <vscale x 8 x i64> %v
1777 define <vscale x 8 x i64> @vssubu_vx_nxv8i64_unmasked(<vscale x 8 x i64> %va, i64 %b, i32 zeroext %evl) {
1778 ; RV32-LABEL: vssubu_vx_nxv8i64_unmasked:
1780 ; RV32-NEXT: addi sp, sp, -16
1781 ; RV32-NEXT: .cfi_def_cfa_offset 16
1782 ; RV32-NEXT: sw a1, 12(sp)
1783 ; RV32-NEXT: sw a0, 8(sp)
1784 ; RV32-NEXT: addi a0, sp, 8
1785 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1786 ; RV32-NEXT: vlse64.v v16, (a0), zero
1787 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1788 ; RV32-NEXT: vssubu.vv v8, v8, v16
1789 ; RV32-NEXT: addi sp, sp, 16
1792 ; RV64-LABEL: vssubu_vx_nxv8i64_unmasked:
1794 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1795 ; RV64-NEXT: vssubu.vx v8, v8, a0
1797 %elt.head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
1798 %vb = shufflevector <vscale x 8 x i64> %elt.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
1799 %v = call <vscale x 8 x i64> @llvm.vp.usub.sat.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb, <vscale x 8 x i1> splat (i1 true), i32 %evl)
1800 ret <vscale x 8 x i64> %v
1803 define <vscale x 8 x i64> @vssubu_vi_nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1804 ; CHECK-LABEL: vssubu_vi_nxv8i64:
1806 ; CHECK-NEXT: li a1, -1
1807 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1808 ; CHECK-NEXT: vssubu.vx v8, v8, a1, v0.t
1810 %v = call <vscale x 8 x i64> @llvm.vp.usub.sat.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> splat (i64 -1), <vscale x 8 x i1> %m, i32 %evl)
1811 ret <vscale x 8 x i64> %v
1814 define <vscale x 8 x i64> @vssubu_vi_nxv8i64_unmasked(<vscale x 8 x i64> %va, i32 zeroext %evl) {
1815 ; CHECK-LABEL: vssubu_vi_nxv8i64_unmasked:
1817 ; CHECK-NEXT: li a1, -1
1818 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1819 ; CHECK-NEXT: vssubu.vx v8, v8, a1
1821 %v = call <vscale x 8 x i64> @llvm.vp.usub.sat.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> splat (i64 -1), <vscale x 8 x i1> splat (i1 true), i32 %evl)
1822 ret <vscale x 8 x i64> %v