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 1 x i8> @llvm.usub.sat.nxv1i8(<vscale x 1 x i8>, <vscale x 1 x i8>)
9 define <vscale x 1 x i8> @usub_nxv1i8_vv(<vscale x 1 x i8> %va, <vscale x 1 x i8> %b) {
10 ; CHECK-LABEL: usub_nxv1i8_vv:
12 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
13 ; CHECK-NEXT: vssubu.vv v8, v8, v9
15 %v = call <vscale x 1 x i8> @llvm.usub.sat.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %b)
16 ret <vscale x 1 x i8> %v
19 define <vscale x 1 x i8> @usub_nxv1i8_vx(<vscale x 1 x i8> %va, i8 %b) {
20 ; CHECK-LABEL: usub_nxv1i8_vx:
22 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
23 ; CHECK-NEXT: vssubu.vx v8, v8, a0
25 %elt.head = insertelement <vscale x 1 x i8> poison, i8 %b, i32 0
26 %vb = shufflevector <vscale x 1 x i8> %elt.head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
27 %v = call <vscale x 1 x i8> @llvm.usub.sat.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb)
28 ret <vscale x 1 x i8> %v
31 define <vscale x 1 x i8> @usub_nxv1i8_vi(<vscale x 1 x i8> %va) {
32 ; CHECK-LABEL: usub_nxv1i8_vi:
34 ; CHECK-NEXT: li a0, 2
35 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
36 ; CHECK-NEXT: vssubu.vx v8, v8, a0
38 %elt.head = insertelement <vscale x 1 x i8> poison, i8 2, i32 0
39 %vb = shufflevector <vscale x 1 x i8> %elt.head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
40 %v = call <vscale x 1 x i8> @llvm.usub.sat.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb)
41 ret <vscale x 1 x i8> %v
44 declare <vscale x 2 x i8> @llvm.usub.sat.nxv2i8(<vscale x 2 x i8>, <vscale x 2 x i8>)
46 define <vscale x 2 x i8> @usub_nxv2i8_vv(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b) {
47 ; CHECK-LABEL: usub_nxv2i8_vv:
49 ; CHECK-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
50 ; CHECK-NEXT: vssubu.vv v8, v8, v9
52 %v = call <vscale x 2 x i8> @llvm.usub.sat.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b)
53 ret <vscale x 2 x i8> %v
56 define <vscale x 2 x i8> @usub_nxv2i8_vx(<vscale x 2 x i8> %va, i8 %b) {
57 ; CHECK-LABEL: usub_nxv2i8_vx:
59 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
60 ; CHECK-NEXT: vssubu.vx v8, v8, a0
62 %elt.head = insertelement <vscale x 2 x i8> poison, i8 %b, i32 0
63 %vb = shufflevector <vscale x 2 x i8> %elt.head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
64 %v = call <vscale x 2 x i8> @llvm.usub.sat.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb)
65 ret <vscale x 2 x i8> %v
68 define <vscale x 2 x i8> @usub_nxv2i8_vi(<vscale x 2 x i8> %va) {
69 ; CHECK-LABEL: usub_nxv2i8_vi:
71 ; CHECK-NEXT: li a0, 2
72 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
73 ; CHECK-NEXT: vssubu.vx v8, v8, a0
75 %elt.head = insertelement <vscale x 2 x i8> poison, i8 2, i32 0
76 %vb = shufflevector <vscale x 2 x i8> %elt.head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
77 %v = call <vscale x 2 x i8> @llvm.usub.sat.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb)
78 ret <vscale x 2 x i8> %v
81 declare <vscale x 4 x i8> @llvm.usub.sat.nxv4i8(<vscale x 4 x i8>, <vscale x 4 x i8>)
83 define <vscale x 4 x i8> @usub_nxv4i8_vv(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b) {
84 ; CHECK-LABEL: usub_nxv4i8_vv:
86 ; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
87 ; CHECK-NEXT: vssubu.vv v8, v8, v9
89 %v = call <vscale x 4 x i8> @llvm.usub.sat.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b)
90 ret <vscale x 4 x i8> %v
93 define <vscale x 4 x i8> @usub_nxv4i8_vx(<vscale x 4 x i8> %va, i8 %b) {
94 ; CHECK-LABEL: usub_nxv4i8_vx:
96 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
97 ; CHECK-NEXT: vssubu.vx v8, v8, a0
99 %elt.head = insertelement <vscale x 4 x i8> poison, i8 %b, i32 0
100 %vb = shufflevector <vscale x 4 x i8> %elt.head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
101 %v = call <vscale x 4 x i8> @llvm.usub.sat.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb)
102 ret <vscale x 4 x i8> %v
105 define <vscale x 4 x i8> @usub_nxv4i8_vi(<vscale x 4 x i8> %va) {
106 ; CHECK-LABEL: usub_nxv4i8_vi:
108 ; CHECK-NEXT: li a0, 2
109 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
110 ; CHECK-NEXT: vssubu.vx v8, v8, a0
112 %elt.head = insertelement <vscale x 4 x i8> poison, i8 2, i32 0
113 %vb = shufflevector <vscale x 4 x i8> %elt.head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
114 %v = call <vscale x 4 x i8> @llvm.usub.sat.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb)
115 ret <vscale x 4 x i8> %v
118 declare <vscale x 8 x i8> @llvm.usub.sat.nxv8i8(<vscale x 8 x i8>, <vscale x 8 x i8>)
120 define <vscale x 8 x i8> @usub_nxv8i8_vv(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b) {
121 ; CHECK-LABEL: usub_nxv8i8_vv:
123 ; CHECK-NEXT: vsetvli a0, zero, e8, m1, ta, ma
124 ; CHECK-NEXT: vssubu.vv v8, v8, v9
126 %v = call <vscale x 8 x i8> @llvm.usub.sat.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b)
127 ret <vscale x 8 x i8> %v
130 define <vscale x 8 x i8> @usub_nxv8i8_vx(<vscale x 8 x i8> %va, i8 %b) {
131 ; CHECK-LABEL: usub_nxv8i8_vx:
133 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
134 ; CHECK-NEXT: vssubu.vx v8, v8, a0
136 %elt.head = insertelement <vscale x 8 x i8> poison, i8 %b, i32 0
137 %vb = shufflevector <vscale x 8 x i8> %elt.head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
138 %v = call <vscale x 8 x i8> @llvm.usub.sat.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb)
139 ret <vscale x 8 x i8> %v
142 define <vscale x 8 x i8> @usub_nxv8i8_vi(<vscale x 8 x i8> %va) {
143 ; CHECK-LABEL: usub_nxv8i8_vi:
145 ; CHECK-NEXT: li a0, 2
146 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
147 ; CHECK-NEXT: vssubu.vx v8, v8, a0
149 %elt.head = insertelement <vscale x 8 x i8> poison, i8 2, i32 0
150 %vb = shufflevector <vscale x 8 x i8> %elt.head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
151 %v = call <vscale x 8 x i8> @llvm.usub.sat.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb)
152 ret <vscale x 8 x i8> %v
155 declare <vscale x 16 x i8> @llvm.usub.sat.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>)
157 define <vscale x 16 x i8> @usub_nxv16i8_vv(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b) {
158 ; CHECK-LABEL: usub_nxv16i8_vv:
160 ; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma
161 ; CHECK-NEXT: vssubu.vv v8, v8, v10
163 %v = call <vscale x 16 x i8> @llvm.usub.sat.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b)
164 ret <vscale x 16 x i8> %v
167 define <vscale x 16 x i8> @usub_nxv16i8_vx(<vscale x 16 x i8> %va, i8 %b) {
168 ; CHECK-LABEL: usub_nxv16i8_vx:
170 ; CHECK-NEXT: vsetvli a1, zero, e8, m2, ta, ma
171 ; CHECK-NEXT: vssubu.vx v8, v8, a0
173 %elt.head = insertelement <vscale x 16 x i8> poison, i8 %b, i32 0
174 %vb = shufflevector <vscale x 16 x i8> %elt.head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
175 %v = call <vscale x 16 x i8> @llvm.usub.sat.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb)
176 ret <vscale x 16 x i8> %v
179 define <vscale x 16 x i8> @usub_nxv16i8_vi(<vscale x 16 x i8> %va) {
180 ; CHECK-LABEL: usub_nxv16i8_vi:
182 ; CHECK-NEXT: li a0, 2
183 ; CHECK-NEXT: vsetvli a1, zero, e8, m2, ta, ma
184 ; CHECK-NEXT: vssubu.vx v8, v8, a0
186 %elt.head = insertelement <vscale x 16 x i8> poison, i8 2, i32 0
187 %vb = shufflevector <vscale x 16 x i8> %elt.head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
188 %v = call <vscale x 16 x i8> @llvm.usub.sat.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb)
189 ret <vscale x 16 x i8> %v
192 declare <vscale x 32 x i8> @llvm.usub.sat.nxv32i8(<vscale x 32 x i8>, <vscale x 32 x i8>)
194 define <vscale x 32 x i8> @usub_nxv32i8_vv(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b) {
195 ; CHECK-LABEL: usub_nxv32i8_vv:
197 ; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma
198 ; CHECK-NEXT: vssubu.vv v8, v8, v12
200 %v = call <vscale x 32 x i8> @llvm.usub.sat.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b)
201 ret <vscale x 32 x i8> %v
204 define <vscale x 32 x i8> @usub_nxv32i8_vx(<vscale x 32 x i8> %va, i8 %b) {
205 ; CHECK-LABEL: usub_nxv32i8_vx:
207 ; CHECK-NEXT: vsetvli a1, zero, e8, m4, ta, ma
208 ; CHECK-NEXT: vssubu.vx v8, v8, a0
210 %elt.head = insertelement <vscale x 32 x i8> poison, i8 %b, i32 0
211 %vb = shufflevector <vscale x 32 x i8> %elt.head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
212 %v = call <vscale x 32 x i8> @llvm.usub.sat.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb)
213 ret <vscale x 32 x i8> %v
216 define <vscale x 32 x i8> @usub_nxv32i8_vi(<vscale x 32 x i8> %va) {
217 ; CHECK-LABEL: usub_nxv32i8_vi:
219 ; CHECK-NEXT: li a0, 2
220 ; CHECK-NEXT: vsetvli a1, zero, e8, m4, ta, ma
221 ; CHECK-NEXT: vssubu.vx v8, v8, a0
223 %elt.head = insertelement <vscale x 32 x i8> poison, i8 2, i32 0
224 %vb = shufflevector <vscale x 32 x i8> %elt.head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
225 %v = call <vscale x 32 x i8> @llvm.usub.sat.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb)
226 ret <vscale x 32 x i8> %v
229 declare <vscale x 64 x i8> @llvm.usub.sat.nxv64i8(<vscale x 64 x i8>, <vscale x 64 x i8>)
231 define <vscale x 64 x i8> @usub_nxv64i8_vv(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b) {
232 ; CHECK-LABEL: usub_nxv64i8_vv:
234 ; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma
235 ; CHECK-NEXT: vssubu.vv v8, v8, v16
237 %v = call <vscale x 64 x i8> @llvm.usub.sat.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b)
238 ret <vscale x 64 x i8> %v
241 define <vscale x 64 x i8> @usub_nxv64i8_vx(<vscale x 64 x i8> %va, i8 %b) {
242 ; CHECK-LABEL: usub_nxv64i8_vx:
244 ; CHECK-NEXT: vsetvli a1, zero, e8, m8, ta, ma
245 ; CHECK-NEXT: vssubu.vx v8, v8, a0
247 %elt.head = insertelement <vscale x 64 x i8> poison, i8 %b, i32 0
248 %vb = shufflevector <vscale x 64 x i8> %elt.head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
249 %v = call <vscale x 64 x i8> @llvm.usub.sat.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb)
250 ret <vscale x 64 x i8> %v
253 define <vscale x 64 x i8> @usub_nxv64i8_vi(<vscale x 64 x i8> %va) {
254 ; CHECK-LABEL: usub_nxv64i8_vi:
256 ; CHECK-NEXT: li a0, 2
257 ; CHECK-NEXT: vsetvli a1, zero, e8, m8, ta, ma
258 ; CHECK-NEXT: vssubu.vx v8, v8, a0
260 %elt.head = insertelement <vscale x 64 x i8> poison, i8 2, i32 0
261 %vb = shufflevector <vscale x 64 x i8> %elt.head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
262 %v = call <vscale x 64 x i8> @llvm.usub.sat.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb)
263 ret <vscale x 64 x i8> %v
266 declare <vscale x 1 x i16> @llvm.usub.sat.nxv1i16(<vscale x 1 x i16>, <vscale x 1 x i16>)
268 define <vscale x 1 x i16> @usub_nxv1i16_vv(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b) {
269 ; CHECK-LABEL: usub_nxv1i16_vv:
271 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
272 ; CHECK-NEXT: vssubu.vv v8, v8, v9
274 %v = call <vscale x 1 x i16> @llvm.usub.sat.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b)
275 ret <vscale x 1 x i16> %v
278 define <vscale x 1 x i16> @usub_nxv1i16_vx(<vscale x 1 x i16> %va, i16 %b) {
279 ; CHECK-LABEL: usub_nxv1i16_vx:
281 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
282 ; CHECK-NEXT: vssubu.vx v8, v8, a0
284 %elt.head = insertelement <vscale x 1 x i16> poison, i16 %b, i32 0
285 %vb = shufflevector <vscale x 1 x i16> %elt.head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
286 %v = call <vscale x 1 x i16> @llvm.usub.sat.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb)
287 ret <vscale x 1 x i16> %v
290 define <vscale x 1 x i16> @usub_nxv1i16_vi(<vscale x 1 x i16> %va) {
291 ; CHECK-LABEL: usub_nxv1i16_vi:
293 ; CHECK-NEXT: li a0, 2
294 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
295 ; CHECK-NEXT: vssubu.vx v8, v8, a0
297 %elt.head = insertelement <vscale x 1 x i16> poison, i16 2, i32 0
298 %vb = shufflevector <vscale x 1 x i16> %elt.head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
299 %v = call <vscale x 1 x i16> @llvm.usub.sat.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb)
300 ret <vscale x 1 x i16> %v
303 declare <vscale x 2 x i16> @llvm.usub.sat.nxv2i16(<vscale x 2 x i16>, <vscale x 2 x i16>)
305 define <vscale x 2 x i16> @usub_nxv2i16_vv(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b) {
306 ; CHECK-LABEL: usub_nxv2i16_vv:
308 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
309 ; CHECK-NEXT: vssubu.vv v8, v8, v9
311 %v = call <vscale x 2 x i16> @llvm.usub.sat.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b)
312 ret <vscale x 2 x i16> %v
315 define <vscale x 2 x i16> @usub_nxv2i16_vx(<vscale x 2 x i16> %va, i16 %b) {
316 ; CHECK-LABEL: usub_nxv2i16_vx:
318 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
319 ; CHECK-NEXT: vssubu.vx v8, v8, a0
321 %elt.head = insertelement <vscale x 2 x i16> poison, i16 %b, i32 0
322 %vb = shufflevector <vscale x 2 x i16> %elt.head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
323 %v = call <vscale x 2 x i16> @llvm.usub.sat.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb)
324 ret <vscale x 2 x i16> %v
327 define <vscale x 2 x i16> @usub_nxv2i16_vi(<vscale x 2 x i16> %va) {
328 ; CHECK-LABEL: usub_nxv2i16_vi:
330 ; CHECK-NEXT: li a0, 2
331 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
332 ; CHECK-NEXT: vssubu.vx v8, v8, a0
334 %elt.head = insertelement <vscale x 2 x i16> poison, i16 2, i32 0
335 %vb = shufflevector <vscale x 2 x i16> %elt.head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
336 %v = call <vscale x 2 x i16> @llvm.usub.sat.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb)
337 ret <vscale x 2 x i16> %v
340 declare <vscale x 4 x i16> @llvm.usub.sat.nxv4i16(<vscale x 4 x i16>, <vscale x 4 x i16>)
342 define <vscale x 4 x i16> @usub_nxv4i16_vv(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b) {
343 ; CHECK-LABEL: usub_nxv4i16_vv:
345 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
346 ; CHECK-NEXT: vssubu.vv v8, v8, v9
348 %v = call <vscale x 4 x i16> @llvm.usub.sat.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b)
349 ret <vscale x 4 x i16> %v
352 define <vscale x 4 x i16> @usub_nxv4i16_vx(<vscale x 4 x i16> %va, i16 %b) {
353 ; CHECK-LABEL: usub_nxv4i16_vx:
355 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
356 ; CHECK-NEXT: vssubu.vx v8, v8, a0
358 %elt.head = insertelement <vscale x 4 x i16> poison, i16 %b, i32 0
359 %vb = shufflevector <vscale x 4 x i16> %elt.head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
360 %v = call <vscale x 4 x i16> @llvm.usub.sat.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb)
361 ret <vscale x 4 x i16> %v
364 define <vscale x 4 x i16> @usub_nxv4i16_vi(<vscale x 4 x i16> %va) {
365 ; CHECK-LABEL: usub_nxv4i16_vi:
367 ; CHECK-NEXT: li a0, 2
368 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
369 ; CHECK-NEXT: vssubu.vx v8, v8, a0
371 %elt.head = insertelement <vscale x 4 x i16> poison, i16 2, i32 0
372 %vb = shufflevector <vscale x 4 x i16> %elt.head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
373 %v = call <vscale x 4 x i16> @llvm.usub.sat.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb)
374 ret <vscale x 4 x i16> %v
377 declare <vscale x 8 x i16> @llvm.usub.sat.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>)
379 define <vscale x 8 x i16> @usub_nxv8i16_vv(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b) {
380 ; CHECK-LABEL: usub_nxv8i16_vv:
382 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
383 ; CHECK-NEXT: vssubu.vv v8, v8, v10
385 %v = call <vscale x 8 x i16> @llvm.usub.sat.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b)
386 ret <vscale x 8 x i16> %v
389 define <vscale x 8 x i16> @usub_nxv8i16_vx(<vscale x 8 x i16> %va, i16 %b) {
390 ; CHECK-LABEL: usub_nxv8i16_vx:
392 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
393 ; CHECK-NEXT: vssubu.vx v8, v8, a0
395 %elt.head = insertelement <vscale x 8 x i16> poison, i16 %b, i32 0
396 %vb = shufflevector <vscale x 8 x i16> %elt.head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
397 %v = call <vscale x 8 x i16> @llvm.usub.sat.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb)
398 ret <vscale x 8 x i16> %v
401 define <vscale x 8 x i16> @usub_nxv8i16_vi(<vscale x 8 x i16> %va) {
402 ; CHECK-LABEL: usub_nxv8i16_vi:
404 ; CHECK-NEXT: li a0, 2
405 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
406 ; CHECK-NEXT: vssubu.vx v8, v8, a0
408 %elt.head = insertelement <vscale x 8 x i16> poison, i16 2, i32 0
409 %vb = shufflevector <vscale x 8 x i16> %elt.head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
410 %v = call <vscale x 8 x i16> @llvm.usub.sat.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb)
411 ret <vscale x 8 x i16> %v
414 declare <vscale x 16 x i16> @llvm.usub.sat.nxv16i16(<vscale x 16 x i16>, <vscale x 16 x i16>)
416 define <vscale x 16 x i16> @usub_nxv16i16_vv(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b) {
417 ; CHECK-LABEL: usub_nxv16i16_vv:
419 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
420 ; CHECK-NEXT: vssubu.vv v8, v8, v12
422 %v = call <vscale x 16 x i16> @llvm.usub.sat.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b)
423 ret <vscale x 16 x i16> %v
426 define <vscale x 16 x i16> @usub_nxv16i16_vx(<vscale x 16 x i16> %va, i16 %b) {
427 ; CHECK-LABEL: usub_nxv16i16_vx:
429 ; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, ma
430 ; CHECK-NEXT: vssubu.vx v8, v8, a0
432 %elt.head = insertelement <vscale x 16 x i16> poison, i16 %b, i32 0
433 %vb = shufflevector <vscale x 16 x i16> %elt.head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
434 %v = call <vscale x 16 x i16> @llvm.usub.sat.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb)
435 ret <vscale x 16 x i16> %v
438 define <vscale x 16 x i16> @usub_nxv16i16_vi(<vscale x 16 x i16> %va) {
439 ; CHECK-LABEL: usub_nxv16i16_vi:
441 ; CHECK-NEXT: li a0, 2
442 ; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, ma
443 ; CHECK-NEXT: vssubu.vx v8, v8, a0
445 %elt.head = insertelement <vscale x 16 x i16> poison, i16 2, i32 0
446 %vb = shufflevector <vscale x 16 x i16> %elt.head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
447 %v = call <vscale x 16 x i16> @llvm.usub.sat.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb)
448 ret <vscale x 16 x i16> %v
451 declare <vscale x 32 x i16> @llvm.usub.sat.nxv32i16(<vscale x 32 x i16>, <vscale x 32 x i16>)
453 define <vscale x 32 x i16> @usub_nxv32i16_vv(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b) {
454 ; CHECK-LABEL: usub_nxv32i16_vv:
456 ; CHECK-NEXT: vsetvli a0, zero, e16, m8, ta, ma
457 ; CHECK-NEXT: vssubu.vv v8, v8, v16
459 %v = call <vscale x 32 x i16> @llvm.usub.sat.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b)
460 ret <vscale x 32 x i16> %v
463 define <vscale x 32 x i16> @usub_nxv32i16_vx(<vscale x 32 x i16> %va, i16 %b) {
464 ; CHECK-LABEL: usub_nxv32i16_vx:
466 ; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, ma
467 ; CHECK-NEXT: vssubu.vx v8, v8, a0
469 %elt.head = insertelement <vscale x 32 x i16> poison, i16 %b, i32 0
470 %vb = shufflevector <vscale x 32 x i16> %elt.head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
471 %v = call <vscale x 32 x i16> @llvm.usub.sat.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb)
472 ret <vscale x 32 x i16> %v
475 define <vscale x 32 x i16> @usub_nxv32i16_vi(<vscale x 32 x i16> %va) {
476 ; CHECK-LABEL: usub_nxv32i16_vi:
478 ; CHECK-NEXT: li a0, 2
479 ; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, ma
480 ; CHECK-NEXT: vssubu.vx v8, v8, a0
482 %elt.head = insertelement <vscale x 32 x i16> poison, i16 2, i32 0
483 %vb = shufflevector <vscale x 32 x i16> %elt.head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
484 %v = call <vscale x 32 x i16> @llvm.usub.sat.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb)
485 ret <vscale x 32 x i16> %v
488 declare <vscale x 1 x i32> @llvm.usub.sat.nxv1i32(<vscale x 1 x i32>, <vscale x 1 x i32>)
490 define <vscale x 1 x i32> @usub_nxv1i32_vv(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b) {
491 ; CHECK-LABEL: usub_nxv1i32_vv:
493 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
494 ; CHECK-NEXT: vssubu.vv v8, v8, v9
496 %v = call <vscale x 1 x i32> @llvm.usub.sat.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b)
497 ret <vscale x 1 x i32> %v
500 define <vscale x 1 x i32> @usub_nxv1i32_vx(<vscale x 1 x i32> %va, i32 %b) {
501 ; CHECK-LABEL: usub_nxv1i32_vx:
503 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
504 ; CHECK-NEXT: vssubu.vx v8, v8, a0
506 %elt.head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
507 %vb = shufflevector <vscale x 1 x i32> %elt.head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
508 %v = call <vscale x 1 x i32> @llvm.usub.sat.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb)
509 ret <vscale x 1 x i32> %v
512 define <vscale x 1 x i32> @usub_nxv1i32_vi(<vscale x 1 x i32> %va) {
513 ; CHECK-LABEL: usub_nxv1i32_vi:
515 ; CHECK-NEXT: li a0, 2
516 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
517 ; CHECK-NEXT: vssubu.vx v8, v8, a0
519 %elt.head = insertelement <vscale x 1 x i32> poison, i32 2, i32 0
520 %vb = shufflevector <vscale x 1 x i32> %elt.head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
521 %v = call <vscale x 1 x i32> @llvm.usub.sat.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb)
522 ret <vscale x 1 x i32> %v
525 declare <vscale x 2 x i32> @llvm.usub.sat.nxv2i32(<vscale x 2 x i32>, <vscale x 2 x i32>)
527 define <vscale x 2 x i32> @usub_nxv2i32_vv(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b) {
528 ; CHECK-LABEL: usub_nxv2i32_vv:
530 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
531 ; CHECK-NEXT: vssubu.vv v8, v8, v9
533 %v = call <vscale x 2 x i32> @llvm.usub.sat.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b)
534 ret <vscale x 2 x i32> %v
537 define <vscale x 2 x i32> @usub_nxv2i32_vx(<vscale x 2 x i32> %va, i32 %b) {
538 ; CHECK-LABEL: usub_nxv2i32_vx:
540 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
541 ; CHECK-NEXT: vssubu.vx v8, v8, a0
543 %elt.head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
544 %vb = shufflevector <vscale x 2 x i32> %elt.head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
545 %v = call <vscale x 2 x i32> @llvm.usub.sat.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb)
546 ret <vscale x 2 x i32> %v
549 define <vscale x 2 x i32> @usub_nxv2i32_vi(<vscale x 2 x i32> %va) {
550 ; CHECK-LABEL: usub_nxv2i32_vi:
552 ; CHECK-NEXT: li a0, 2
553 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
554 ; CHECK-NEXT: vssubu.vx v8, v8, a0
556 %elt.head = insertelement <vscale x 2 x i32> poison, i32 2, i32 0
557 %vb = shufflevector <vscale x 2 x i32> %elt.head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
558 %v = call <vscale x 2 x i32> @llvm.usub.sat.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb)
559 ret <vscale x 2 x i32> %v
562 declare <vscale x 4 x i32> @llvm.usub.sat.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>)
564 define <vscale x 4 x i32> @usub_nxv4i32_vv(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b) {
565 ; CHECK-LABEL: usub_nxv4i32_vv:
567 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
568 ; CHECK-NEXT: vssubu.vv v8, v8, v10
570 %v = call <vscale x 4 x i32> @llvm.usub.sat.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b)
571 ret <vscale x 4 x i32> %v
574 define <vscale x 4 x i32> @usub_nxv4i32_vx(<vscale x 4 x i32> %va, i32 %b) {
575 ; CHECK-LABEL: usub_nxv4i32_vx:
577 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
578 ; CHECK-NEXT: vssubu.vx v8, v8, a0
580 %elt.head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
581 %vb = shufflevector <vscale x 4 x i32> %elt.head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
582 %v = call <vscale x 4 x i32> @llvm.usub.sat.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb)
583 ret <vscale x 4 x i32> %v
586 define <vscale x 4 x i32> @usub_nxv4i32_vi(<vscale x 4 x i32> %va) {
587 ; CHECK-LABEL: usub_nxv4i32_vi:
589 ; CHECK-NEXT: li a0, 2
590 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
591 ; CHECK-NEXT: vssubu.vx v8, v8, a0
593 %elt.head = insertelement <vscale x 4 x i32> poison, i32 2, i32 0
594 %vb = shufflevector <vscale x 4 x i32> %elt.head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
595 %v = call <vscale x 4 x i32> @llvm.usub.sat.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb)
596 ret <vscale x 4 x i32> %v
599 declare <vscale x 8 x i32> @llvm.usub.sat.nxv8i32(<vscale x 8 x i32>, <vscale x 8 x i32>)
601 define <vscale x 8 x i32> @usub_nxv8i32_vv(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b) {
602 ; CHECK-LABEL: usub_nxv8i32_vv:
604 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
605 ; CHECK-NEXT: vssubu.vv v8, v8, v12
607 %v = call <vscale x 8 x i32> @llvm.usub.sat.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b)
608 ret <vscale x 8 x i32> %v
611 define <vscale x 8 x i32> @usub_nxv8i32_vx(<vscale x 8 x i32> %va, i32 %b) {
612 ; CHECK-LABEL: usub_nxv8i32_vx:
614 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
615 ; CHECK-NEXT: vssubu.vx v8, v8, a0
617 %elt.head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
618 %vb = shufflevector <vscale x 8 x i32> %elt.head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
619 %v = call <vscale x 8 x i32> @llvm.usub.sat.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb)
620 ret <vscale x 8 x i32> %v
623 define <vscale x 8 x i32> @usub_nxv8i32_vi(<vscale x 8 x i32> %va) {
624 ; CHECK-LABEL: usub_nxv8i32_vi:
626 ; CHECK-NEXT: li a0, 2
627 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
628 ; CHECK-NEXT: vssubu.vx v8, v8, a0
630 %elt.head = insertelement <vscale x 8 x i32> poison, i32 2, i32 0
631 %vb = shufflevector <vscale x 8 x i32> %elt.head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
632 %v = call <vscale x 8 x i32> @llvm.usub.sat.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb)
633 ret <vscale x 8 x i32> %v
636 declare <vscale x 16 x i32> @llvm.usub.sat.nxv16i32(<vscale x 16 x i32>, <vscale x 16 x i32>)
638 define <vscale x 16 x i32> @usub_nxv16i32_vv(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b) {
639 ; CHECK-LABEL: usub_nxv16i32_vv:
641 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
642 ; CHECK-NEXT: vssubu.vv v8, v8, v16
644 %v = call <vscale x 16 x i32> @llvm.usub.sat.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b)
645 ret <vscale x 16 x i32> %v
648 define <vscale x 16 x i32> @usub_nxv16i32_vx(<vscale x 16 x i32> %va, i32 %b) {
649 ; CHECK-LABEL: usub_nxv16i32_vx:
651 ; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, ma
652 ; CHECK-NEXT: vssubu.vx v8, v8, a0
654 %elt.head = insertelement <vscale x 16 x i32> poison, i32 %b, i32 0
655 %vb = shufflevector <vscale x 16 x i32> %elt.head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
656 %v = call <vscale x 16 x i32> @llvm.usub.sat.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb)
657 ret <vscale x 16 x i32> %v
660 define <vscale x 16 x i32> @usub_nxv16i32_vi(<vscale x 16 x i32> %va) {
661 ; CHECK-LABEL: usub_nxv16i32_vi:
663 ; CHECK-NEXT: li a0, 2
664 ; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, ma
665 ; CHECK-NEXT: vssubu.vx v8, v8, a0
667 %elt.head = insertelement <vscale x 16 x i32> poison, i32 2, i32 0
668 %vb = shufflevector <vscale x 16 x i32> %elt.head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
669 %v = call <vscale x 16 x i32> @llvm.usub.sat.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb)
670 ret <vscale x 16 x i32> %v
673 declare <vscale x 1 x i64> @llvm.usub.sat.nxv1i64(<vscale x 1 x i64>, <vscale x 1 x i64>)
675 define <vscale x 1 x i64> @usub_nxv1i64_vv(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b) {
676 ; CHECK-LABEL: usub_nxv1i64_vv:
678 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
679 ; CHECK-NEXT: vssubu.vv v8, v8, v9
681 %v = call <vscale x 1 x i64> @llvm.usub.sat.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b)
682 ret <vscale x 1 x i64> %v
685 define <vscale x 1 x i64> @usub_nxv1i64_vx(<vscale x 1 x i64> %va, i64 %b) {
686 ; RV32-LABEL: usub_nxv1i64_vx:
688 ; RV32-NEXT: addi sp, sp, -16
689 ; RV32-NEXT: .cfi_def_cfa_offset 16
690 ; RV32-NEXT: sw a1, 12(sp)
691 ; RV32-NEXT: sw a0, 8(sp)
692 ; RV32-NEXT: addi a0, sp, 8
693 ; RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
694 ; RV32-NEXT: vlse64.v v9, (a0), zero
695 ; RV32-NEXT: vssubu.vv v8, v8, v9
696 ; RV32-NEXT: addi sp, sp, 16
699 ; RV64-LABEL: usub_nxv1i64_vx:
701 ; RV64-NEXT: vsetvli a1, zero, e64, m1, ta, ma
702 ; RV64-NEXT: vssubu.vx v8, v8, a0
704 %elt.head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
705 %vb = shufflevector <vscale x 1 x i64> %elt.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
706 %v = call <vscale x 1 x i64> @llvm.usub.sat.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb)
707 ret <vscale x 1 x i64> %v
710 define <vscale x 1 x i64> @usub_nxv1i64_vi(<vscale x 1 x i64> %va) {
711 ; CHECK-LABEL: usub_nxv1i64_vi:
713 ; CHECK-NEXT: li a0, 2
714 ; CHECK-NEXT: vsetvli a1, zero, e64, m1, ta, ma
715 ; CHECK-NEXT: vssubu.vx v8, v8, a0
717 %elt.head = insertelement <vscale x 1 x i64> poison, i64 2, i32 0
718 %vb = shufflevector <vscale x 1 x i64> %elt.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
719 %v = call <vscale x 1 x i64> @llvm.usub.sat.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb)
720 ret <vscale x 1 x i64> %v
723 declare <vscale x 2 x i64> @llvm.usub.sat.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>)
725 define <vscale x 2 x i64> @usub_nxv2i64_vv(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b) {
726 ; CHECK-LABEL: usub_nxv2i64_vv:
728 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
729 ; CHECK-NEXT: vssubu.vv v8, v8, v10
731 %v = call <vscale x 2 x i64> @llvm.usub.sat.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b)
732 ret <vscale x 2 x i64> %v
735 define <vscale x 2 x i64> @usub_nxv2i64_vx(<vscale x 2 x i64> %va, i64 %b) {
736 ; RV32-LABEL: usub_nxv2i64_vx:
738 ; RV32-NEXT: addi sp, sp, -16
739 ; RV32-NEXT: .cfi_def_cfa_offset 16
740 ; RV32-NEXT: sw a1, 12(sp)
741 ; RV32-NEXT: sw a0, 8(sp)
742 ; RV32-NEXT: addi a0, sp, 8
743 ; RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
744 ; RV32-NEXT: vlse64.v v10, (a0), zero
745 ; RV32-NEXT: vssubu.vv v8, v8, v10
746 ; RV32-NEXT: addi sp, sp, 16
749 ; RV64-LABEL: usub_nxv2i64_vx:
751 ; RV64-NEXT: vsetvli a1, zero, e64, m2, ta, ma
752 ; RV64-NEXT: vssubu.vx v8, v8, a0
754 %elt.head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
755 %vb = shufflevector <vscale x 2 x i64> %elt.head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
756 %v = call <vscale x 2 x i64> @llvm.usub.sat.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb)
757 ret <vscale x 2 x i64> %v
760 define <vscale x 2 x i64> @usub_nxv2i64_vi(<vscale x 2 x i64> %va) {
761 ; CHECK-LABEL: usub_nxv2i64_vi:
763 ; CHECK-NEXT: li a0, 2
764 ; CHECK-NEXT: vsetvli a1, zero, e64, m2, ta, ma
765 ; CHECK-NEXT: vssubu.vx v8, v8, a0
767 %elt.head = insertelement <vscale x 2 x i64> poison, i64 2, i32 0
768 %vb = shufflevector <vscale x 2 x i64> %elt.head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
769 %v = call <vscale x 2 x i64> @llvm.usub.sat.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb)
770 ret <vscale x 2 x i64> %v
773 declare <vscale x 4 x i64> @llvm.usub.sat.nxv4i64(<vscale x 4 x i64>, <vscale x 4 x i64>)
775 define <vscale x 4 x i64> @usub_nxv4i64_vv(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b) {
776 ; CHECK-LABEL: usub_nxv4i64_vv:
778 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
779 ; CHECK-NEXT: vssubu.vv v8, v8, v12
781 %v = call <vscale x 4 x i64> @llvm.usub.sat.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b)
782 ret <vscale x 4 x i64> %v
785 define <vscale x 4 x i64> @usub_nxv4i64_vx(<vscale x 4 x i64> %va, i64 %b) {
786 ; RV32-LABEL: usub_nxv4i64_vx:
788 ; RV32-NEXT: addi sp, sp, -16
789 ; RV32-NEXT: .cfi_def_cfa_offset 16
790 ; RV32-NEXT: sw a1, 12(sp)
791 ; RV32-NEXT: sw a0, 8(sp)
792 ; RV32-NEXT: addi a0, sp, 8
793 ; RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
794 ; RV32-NEXT: vlse64.v v12, (a0), zero
795 ; RV32-NEXT: vssubu.vv v8, v8, v12
796 ; RV32-NEXT: addi sp, sp, 16
799 ; RV64-LABEL: usub_nxv4i64_vx:
801 ; RV64-NEXT: vsetvli a1, zero, e64, m4, ta, ma
802 ; RV64-NEXT: vssubu.vx v8, v8, a0
804 %elt.head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
805 %vb = shufflevector <vscale x 4 x i64> %elt.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
806 %v = call <vscale x 4 x i64> @llvm.usub.sat.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb)
807 ret <vscale x 4 x i64> %v
810 define <vscale x 4 x i64> @usub_nxv4i64_vi(<vscale x 4 x i64> %va) {
811 ; CHECK-LABEL: usub_nxv4i64_vi:
813 ; CHECK-NEXT: li a0, 2
814 ; CHECK-NEXT: vsetvli a1, zero, e64, m4, ta, ma
815 ; CHECK-NEXT: vssubu.vx v8, v8, a0
817 %elt.head = insertelement <vscale x 4 x i64> poison, i64 2, i32 0
818 %vb = shufflevector <vscale x 4 x i64> %elt.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
819 %v = call <vscale x 4 x i64> @llvm.usub.sat.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb)
820 ret <vscale x 4 x i64> %v
823 declare <vscale x 8 x i64> @llvm.usub.sat.nxv8i64(<vscale x 8 x i64>, <vscale x 8 x i64>)
825 define <vscale x 8 x i64> @usub_nxv8i64_vv(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b) {
826 ; CHECK-LABEL: usub_nxv8i64_vv:
828 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
829 ; CHECK-NEXT: vssubu.vv v8, v8, v16
831 %v = call <vscale x 8 x i64> @llvm.usub.sat.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b)
832 ret <vscale x 8 x i64> %v
835 define <vscale x 8 x i64> @usub_nxv8i64_vx(<vscale x 8 x i64> %va, i64 %b) {
836 ; RV32-LABEL: usub_nxv8i64_vx:
838 ; RV32-NEXT: addi sp, sp, -16
839 ; RV32-NEXT: .cfi_def_cfa_offset 16
840 ; RV32-NEXT: sw a1, 12(sp)
841 ; RV32-NEXT: sw a0, 8(sp)
842 ; RV32-NEXT: addi a0, sp, 8
843 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
844 ; RV32-NEXT: vlse64.v v16, (a0), zero
845 ; RV32-NEXT: vssubu.vv v8, v8, v16
846 ; RV32-NEXT: addi sp, sp, 16
849 ; RV64-LABEL: usub_nxv8i64_vx:
851 ; RV64-NEXT: vsetvli a1, zero, e64, m8, ta, ma
852 ; RV64-NEXT: vssubu.vx v8, v8, a0
854 %elt.head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
855 %vb = shufflevector <vscale x 8 x i64> %elt.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
856 %v = call <vscale x 8 x i64> @llvm.usub.sat.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb)
857 ret <vscale x 8 x i64> %v
860 define <vscale x 8 x i64> @usub_nxv8i64_vi(<vscale x 8 x i64> %va) {
861 ; CHECK-LABEL: usub_nxv8i64_vi:
863 ; CHECK-NEXT: li a0, 2
864 ; CHECK-NEXT: vsetvli a1, zero, e64, m8, ta, ma
865 ; CHECK-NEXT: vssubu.vx v8, v8, a0
867 %elt.head = insertelement <vscale x 8 x i64> poison, i64 2, i32 0
868 %vb = shufflevector <vscale x 8 x i64> %elt.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
869 %v = call <vscale x 8 x i64> @llvm.usub.sat.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb)
870 ret <vscale x 8 x i64> %v