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.ssub.sat.nxv1i8(<vscale x 1 x i8>, <vscale x 1 x i8>)
9 define <vscale x 1 x i8> @ssub_nxv1i8_vv(<vscale x 1 x i8> %va, <vscale x 1 x i8> %b) {
10 ; CHECK-LABEL: ssub_nxv1i8_vv:
12 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
13 ; CHECK-NEXT: vssub.vv v8, v8, v9
15 %v = call <vscale x 1 x i8> @llvm.ssub.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> @ssub_nxv1i8_vx(<vscale x 1 x i8> %va, i8 %b) {
20 ; CHECK-LABEL: ssub_nxv1i8_vx:
22 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
23 ; CHECK-NEXT: vssub.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.ssub.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> @ssub_nxv1i8_vi(<vscale x 1 x i8> %va) {
32 ; CHECK-LABEL: ssub_nxv1i8_vi:
34 ; CHECK-NEXT: li a0, 1
35 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
36 ; CHECK-NEXT: vssub.vx v8, v8, a0
38 %v = call <vscale x 1 x i8> @llvm.ssub.sat.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> splat (i8 1))
39 ret <vscale x 1 x i8> %v
42 declare <vscale x 2 x i8> @llvm.ssub.sat.nxv2i8(<vscale x 2 x i8>, <vscale x 2 x i8>)
44 define <vscale x 2 x i8> @ssub_nxv2i8_vv(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b) {
45 ; CHECK-LABEL: ssub_nxv2i8_vv:
47 ; CHECK-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
48 ; CHECK-NEXT: vssub.vv v8, v8, v9
50 %v = call <vscale x 2 x i8> @llvm.ssub.sat.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b)
51 ret <vscale x 2 x i8> %v
54 define <vscale x 2 x i8> @ssub_nxv2i8_vx(<vscale x 2 x i8> %va, i8 %b) {
55 ; CHECK-LABEL: ssub_nxv2i8_vx:
57 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
58 ; CHECK-NEXT: vssub.vx v8, v8, a0
60 %elt.head = insertelement <vscale x 2 x i8> poison, i8 %b, i32 0
61 %vb = shufflevector <vscale x 2 x i8> %elt.head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
62 %v = call <vscale x 2 x i8> @llvm.ssub.sat.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb)
63 ret <vscale x 2 x i8> %v
66 define <vscale x 2 x i8> @ssub_nxv2i8_vi(<vscale x 2 x i8> %va) {
67 ; CHECK-LABEL: ssub_nxv2i8_vi:
69 ; CHECK-NEXT: li a0, 1
70 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
71 ; CHECK-NEXT: vssub.vx v8, v8, a0
73 %v = call <vscale x 2 x i8> @llvm.ssub.sat.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> splat (i8 1))
74 ret <vscale x 2 x i8> %v
77 declare <vscale x 4 x i8> @llvm.ssub.sat.nxv4i8(<vscale x 4 x i8>, <vscale x 4 x i8>)
79 define <vscale x 4 x i8> @ssub_nxv4i8_vv(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b) {
80 ; CHECK-LABEL: ssub_nxv4i8_vv:
82 ; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
83 ; CHECK-NEXT: vssub.vv v8, v8, v9
85 %v = call <vscale x 4 x i8> @llvm.ssub.sat.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b)
86 ret <vscale x 4 x i8> %v
89 define <vscale x 4 x i8> @ssub_nxv4i8_vx(<vscale x 4 x i8> %va, i8 %b) {
90 ; CHECK-LABEL: ssub_nxv4i8_vx:
92 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
93 ; CHECK-NEXT: vssub.vx v8, v8, a0
95 %elt.head = insertelement <vscale x 4 x i8> poison, i8 %b, i32 0
96 %vb = shufflevector <vscale x 4 x i8> %elt.head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
97 %v = call <vscale x 4 x i8> @llvm.ssub.sat.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb)
98 ret <vscale x 4 x i8> %v
101 define <vscale x 4 x i8> @ssub_nxv4i8_vi(<vscale x 4 x i8> %va) {
102 ; CHECK-LABEL: ssub_nxv4i8_vi:
104 ; CHECK-NEXT: li a0, 1
105 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
106 ; CHECK-NEXT: vssub.vx v8, v8, a0
108 %v = call <vscale x 4 x i8> @llvm.ssub.sat.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> splat (i8 1))
109 ret <vscale x 4 x i8> %v
112 declare <vscale x 8 x i8> @llvm.ssub.sat.nxv8i8(<vscale x 8 x i8>, <vscale x 8 x i8>)
114 define <vscale x 8 x i8> @ssub_nxv8i8_vv(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b) {
115 ; CHECK-LABEL: ssub_nxv8i8_vv:
117 ; CHECK-NEXT: vsetvli a0, zero, e8, m1, ta, ma
118 ; CHECK-NEXT: vssub.vv v8, v8, v9
120 %v = call <vscale x 8 x i8> @llvm.ssub.sat.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b)
121 ret <vscale x 8 x i8> %v
124 define <vscale x 8 x i8> @ssub_nxv8i8_vx(<vscale x 8 x i8> %va, i8 %b) {
125 ; CHECK-LABEL: ssub_nxv8i8_vx:
127 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
128 ; CHECK-NEXT: vssub.vx v8, v8, a0
130 %elt.head = insertelement <vscale x 8 x i8> poison, i8 %b, i32 0
131 %vb = shufflevector <vscale x 8 x i8> %elt.head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
132 %v = call <vscale x 8 x i8> @llvm.ssub.sat.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb)
133 ret <vscale x 8 x i8> %v
136 define <vscale x 8 x i8> @ssub_nxv8i8_vi(<vscale x 8 x i8> %va) {
137 ; CHECK-LABEL: ssub_nxv8i8_vi:
139 ; CHECK-NEXT: li a0, 1
140 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
141 ; CHECK-NEXT: vssub.vx v8, v8, a0
143 %v = call <vscale x 8 x i8> @llvm.ssub.sat.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> splat (i8 1))
144 ret <vscale x 8 x i8> %v
147 declare <vscale x 16 x i8> @llvm.ssub.sat.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>)
149 define <vscale x 16 x i8> @ssub_nxv16i8_vv(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b) {
150 ; CHECK-LABEL: ssub_nxv16i8_vv:
152 ; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma
153 ; CHECK-NEXT: vssub.vv v8, v8, v10
155 %v = call <vscale x 16 x i8> @llvm.ssub.sat.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b)
156 ret <vscale x 16 x i8> %v
159 define <vscale x 16 x i8> @ssub_nxv16i8_vx(<vscale x 16 x i8> %va, i8 %b) {
160 ; CHECK-LABEL: ssub_nxv16i8_vx:
162 ; CHECK-NEXT: vsetvli a1, zero, e8, m2, ta, ma
163 ; CHECK-NEXT: vssub.vx v8, v8, a0
165 %elt.head = insertelement <vscale x 16 x i8> poison, i8 %b, i32 0
166 %vb = shufflevector <vscale x 16 x i8> %elt.head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
167 %v = call <vscale x 16 x i8> @llvm.ssub.sat.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb)
168 ret <vscale x 16 x i8> %v
171 define <vscale x 16 x i8> @ssub_nxv16i8_vi(<vscale x 16 x i8> %va) {
172 ; CHECK-LABEL: ssub_nxv16i8_vi:
174 ; CHECK-NEXT: li a0, 1
175 ; CHECK-NEXT: vsetvli a1, zero, e8, m2, ta, ma
176 ; CHECK-NEXT: vssub.vx v8, v8, a0
178 %v = call <vscale x 16 x i8> @llvm.ssub.sat.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> splat (i8 1))
179 ret <vscale x 16 x i8> %v
182 declare <vscale x 32 x i8> @llvm.ssub.sat.nxv32i8(<vscale x 32 x i8>, <vscale x 32 x i8>)
184 define <vscale x 32 x i8> @ssub_nxv32i8_vv(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b) {
185 ; CHECK-LABEL: ssub_nxv32i8_vv:
187 ; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma
188 ; CHECK-NEXT: vssub.vv v8, v8, v12
190 %v = call <vscale x 32 x i8> @llvm.ssub.sat.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b)
191 ret <vscale x 32 x i8> %v
194 define <vscale x 32 x i8> @ssub_nxv32i8_vx(<vscale x 32 x i8> %va, i8 %b) {
195 ; CHECK-LABEL: ssub_nxv32i8_vx:
197 ; CHECK-NEXT: vsetvli a1, zero, e8, m4, ta, ma
198 ; CHECK-NEXT: vssub.vx v8, v8, a0
200 %elt.head = insertelement <vscale x 32 x i8> poison, i8 %b, i32 0
201 %vb = shufflevector <vscale x 32 x i8> %elt.head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
202 %v = call <vscale x 32 x i8> @llvm.ssub.sat.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb)
203 ret <vscale x 32 x i8> %v
206 define <vscale x 32 x i8> @ssub_nxv32i8_vi(<vscale x 32 x i8> %va) {
207 ; CHECK-LABEL: ssub_nxv32i8_vi:
209 ; CHECK-NEXT: li a0, 1
210 ; CHECK-NEXT: vsetvli a1, zero, e8, m4, ta, ma
211 ; CHECK-NEXT: vssub.vx v8, v8, a0
213 %v = call <vscale x 32 x i8> @llvm.ssub.sat.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> splat (i8 1))
214 ret <vscale x 32 x i8> %v
217 declare <vscale x 64 x i8> @llvm.ssub.sat.nxv64i8(<vscale x 64 x i8>, <vscale x 64 x i8>)
219 define <vscale x 64 x i8> @ssub_nxv64i8_vv(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b) {
220 ; CHECK-LABEL: ssub_nxv64i8_vv:
222 ; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma
223 ; CHECK-NEXT: vssub.vv v8, v8, v16
225 %v = call <vscale x 64 x i8> @llvm.ssub.sat.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b)
226 ret <vscale x 64 x i8> %v
229 define <vscale x 64 x i8> @ssub_nxv64i8_vx(<vscale x 64 x i8> %va, i8 %b) {
230 ; CHECK-LABEL: ssub_nxv64i8_vx:
232 ; CHECK-NEXT: vsetvli a1, zero, e8, m8, ta, ma
233 ; CHECK-NEXT: vssub.vx v8, v8, a0
235 %elt.head = insertelement <vscale x 64 x i8> poison, i8 %b, i32 0
236 %vb = shufflevector <vscale x 64 x i8> %elt.head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
237 %v = call <vscale x 64 x i8> @llvm.ssub.sat.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb)
238 ret <vscale x 64 x i8> %v
241 define <vscale x 64 x i8> @ssub_nxv64i8_vi(<vscale x 64 x i8> %va) {
242 ; CHECK-LABEL: ssub_nxv64i8_vi:
244 ; CHECK-NEXT: li a0, 1
245 ; CHECK-NEXT: vsetvli a1, zero, e8, m8, ta, ma
246 ; CHECK-NEXT: vssub.vx v8, v8, a0
248 %v = call <vscale x 64 x i8> @llvm.ssub.sat.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> splat (i8 1))
249 ret <vscale x 64 x i8> %v
252 declare <vscale x 1 x i16> @llvm.ssub.sat.nxv1i16(<vscale x 1 x i16>, <vscale x 1 x i16>)
254 define <vscale x 1 x i16> @ssub_nxv1i16_vv(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b) {
255 ; CHECK-LABEL: ssub_nxv1i16_vv:
257 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
258 ; CHECK-NEXT: vssub.vv v8, v8, v9
260 %v = call <vscale x 1 x i16> @llvm.ssub.sat.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b)
261 ret <vscale x 1 x i16> %v
264 define <vscale x 1 x i16> @ssub_nxv1i16_vx(<vscale x 1 x i16> %va, i16 %b) {
265 ; CHECK-LABEL: ssub_nxv1i16_vx:
267 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
268 ; CHECK-NEXT: vssub.vx v8, v8, a0
270 %elt.head = insertelement <vscale x 1 x i16> poison, i16 %b, i32 0
271 %vb = shufflevector <vscale x 1 x i16> %elt.head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
272 %v = call <vscale x 1 x i16> @llvm.ssub.sat.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb)
273 ret <vscale x 1 x i16> %v
276 define <vscale x 1 x i16> @ssub_nxv1i16_vi(<vscale x 1 x i16> %va) {
277 ; CHECK-LABEL: ssub_nxv1i16_vi:
279 ; CHECK-NEXT: li a0, 1
280 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
281 ; CHECK-NEXT: vssub.vx v8, v8, a0
283 %v = call <vscale x 1 x i16> @llvm.ssub.sat.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> splat (i16 1))
284 ret <vscale x 1 x i16> %v
287 declare <vscale x 2 x i16> @llvm.ssub.sat.nxv2i16(<vscale x 2 x i16>, <vscale x 2 x i16>)
289 define <vscale x 2 x i16> @ssub_nxv2i16_vv(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b) {
290 ; CHECK-LABEL: ssub_nxv2i16_vv:
292 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
293 ; CHECK-NEXT: vssub.vv v8, v8, v9
295 %v = call <vscale x 2 x i16> @llvm.ssub.sat.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b)
296 ret <vscale x 2 x i16> %v
299 define <vscale x 2 x i16> @ssub_nxv2i16_vx(<vscale x 2 x i16> %va, i16 %b) {
300 ; CHECK-LABEL: ssub_nxv2i16_vx:
302 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
303 ; CHECK-NEXT: vssub.vx v8, v8, a0
305 %elt.head = insertelement <vscale x 2 x i16> poison, i16 %b, i32 0
306 %vb = shufflevector <vscale x 2 x i16> %elt.head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
307 %v = call <vscale x 2 x i16> @llvm.ssub.sat.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb)
308 ret <vscale x 2 x i16> %v
311 define <vscale x 2 x i16> @ssub_nxv2i16_vi(<vscale x 2 x i16> %va) {
312 ; CHECK-LABEL: ssub_nxv2i16_vi:
314 ; CHECK-NEXT: li a0, 1
315 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
316 ; CHECK-NEXT: vssub.vx v8, v8, a0
318 %v = call <vscale x 2 x i16> @llvm.ssub.sat.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> splat (i16 1))
319 ret <vscale x 2 x i16> %v
322 declare <vscale x 4 x i16> @llvm.ssub.sat.nxv4i16(<vscale x 4 x i16>, <vscale x 4 x i16>)
324 define <vscale x 4 x i16> @ssub_nxv4i16_vv(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b) {
325 ; CHECK-LABEL: ssub_nxv4i16_vv:
327 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
328 ; CHECK-NEXT: vssub.vv v8, v8, v9
330 %v = call <vscale x 4 x i16> @llvm.ssub.sat.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b)
331 ret <vscale x 4 x i16> %v
334 define <vscale x 4 x i16> @ssub_nxv4i16_vx(<vscale x 4 x i16> %va, i16 %b) {
335 ; CHECK-LABEL: ssub_nxv4i16_vx:
337 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
338 ; CHECK-NEXT: vssub.vx v8, v8, a0
340 %elt.head = insertelement <vscale x 4 x i16> poison, i16 %b, i32 0
341 %vb = shufflevector <vscale x 4 x i16> %elt.head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
342 %v = call <vscale x 4 x i16> @llvm.ssub.sat.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb)
343 ret <vscale x 4 x i16> %v
346 define <vscale x 4 x i16> @ssub_nxv4i16_vi(<vscale x 4 x i16> %va) {
347 ; CHECK-LABEL: ssub_nxv4i16_vi:
349 ; CHECK-NEXT: li a0, 1
350 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
351 ; CHECK-NEXT: vssub.vx v8, v8, a0
353 %v = call <vscale x 4 x i16> @llvm.ssub.sat.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> splat (i16 1))
354 ret <vscale x 4 x i16> %v
357 declare <vscale x 8 x i16> @llvm.ssub.sat.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>)
359 define <vscale x 8 x i16> @ssub_nxv8i16_vv(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b) {
360 ; CHECK-LABEL: ssub_nxv8i16_vv:
362 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
363 ; CHECK-NEXT: vssub.vv v8, v8, v10
365 %v = call <vscale x 8 x i16> @llvm.ssub.sat.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b)
366 ret <vscale x 8 x i16> %v
369 define <vscale x 8 x i16> @ssub_nxv8i16_vx(<vscale x 8 x i16> %va, i16 %b) {
370 ; CHECK-LABEL: ssub_nxv8i16_vx:
372 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
373 ; CHECK-NEXT: vssub.vx v8, v8, a0
375 %elt.head = insertelement <vscale x 8 x i16> poison, i16 %b, i32 0
376 %vb = shufflevector <vscale x 8 x i16> %elt.head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
377 %v = call <vscale x 8 x i16> @llvm.ssub.sat.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb)
378 ret <vscale x 8 x i16> %v
381 define <vscale x 8 x i16> @ssub_nxv8i16_vi(<vscale x 8 x i16> %va) {
382 ; CHECK-LABEL: ssub_nxv8i16_vi:
384 ; CHECK-NEXT: li a0, 1
385 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
386 ; CHECK-NEXT: vssub.vx v8, v8, a0
388 %v = call <vscale x 8 x i16> @llvm.ssub.sat.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> splat (i16 1))
389 ret <vscale x 8 x i16> %v
392 declare <vscale x 16 x i16> @llvm.ssub.sat.nxv16i16(<vscale x 16 x i16>, <vscale x 16 x i16>)
394 define <vscale x 16 x i16> @ssub_nxv16i16_vv(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b) {
395 ; CHECK-LABEL: ssub_nxv16i16_vv:
397 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
398 ; CHECK-NEXT: vssub.vv v8, v8, v12
400 %v = call <vscale x 16 x i16> @llvm.ssub.sat.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b)
401 ret <vscale x 16 x i16> %v
404 define <vscale x 16 x i16> @ssub_nxv16i16_vx(<vscale x 16 x i16> %va, i16 %b) {
405 ; CHECK-LABEL: ssub_nxv16i16_vx:
407 ; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, ma
408 ; CHECK-NEXT: vssub.vx v8, v8, a0
410 %elt.head = insertelement <vscale x 16 x i16> poison, i16 %b, i32 0
411 %vb = shufflevector <vscale x 16 x i16> %elt.head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
412 %v = call <vscale x 16 x i16> @llvm.ssub.sat.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb)
413 ret <vscale x 16 x i16> %v
416 define <vscale x 16 x i16> @ssub_nxv16i16_vi(<vscale x 16 x i16> %va) {
417 ; CHECK-LABEL: ssub_nxv16i16_vi:
419 ; CHECK-NEXT: li a0, 1
420 ; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, ma
421 ; CHECK-NEXT: vssub.vx v8, v8, a0
423 %v = call <vscale x 16 x i16> @llvm.ssub.sat.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> splat (i16 1))
424 ret <vscale x 16 x i16> %v
427 declare <vscale x 32 x i16> @llvm.ssub.sat.nxv32i16(<vscale x 32 x i16>, <vscale x 32 x i16>)
429 define <vscale x 32 x i16> @ssub_nxv32i16_vv(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b) {
430 ; CHECK-LABEL: ssub_nxv32i16_vv:
432 ; CHECK-NEXT: vsetvli a0, zero, e16, m8, ta, ma
433 ; CHECK-NEXT: vssub.vv v8, v8, v16
435 %v = call <vscale x 32 x i16> @llvm.ssub.sat.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b)
436 ret <vscale x 32 x i16> %v
439 define <vscale x 32 x i16> @ssub_nxv32i16_vx(<vscale x 32 x i16> %va, i16 %b) {
440 ; CHECK-LABEL: ssub_nxv32i16_vx:
442 ; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, ma
443 ; CHECK-NEXT: vssub.vx v8, v8, a0
445 %elt.head = insertelement <vscale x 32 x i16> poison, i16 %b, i32 0
446 %vb = shufflevector <vscale x 32 x i16> %elt.head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
447 %v = call <vscale x 32 x i16> @llvm.ssub.sat.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb)
448 ret <vscale x 32 x i16> %v
451 define <vscale x 32 x i16> @ssub_nxv32i16_vi(<vscale x 32 x i16> %va) {
452 ; CHECK-LABEL: ssub_nxv32i16_vi:
454 ; CHECK-NEXT: li a0, 1
455 ; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, ma
456 ; CHECK-NEXT: vssub.vx v8, v8, a0
458 %v = call <vscale x 32 x i16> @llvm.ssub.sat.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> splat (i16 1))
459 ret <vscale x 32 x i16> %v
462 declare <vscale x 1 x i32> @llvm.ssub.sat.nxv1i32(<vscale x 1 x i32>, <vscale x 1 x i32>)
464 define <vscale x 1 x i32> @ssub_nxv1i32_vv(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b) {
465 ; CHECK-LABEL: ssub_nxv1i32_vv:
467 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
468 ; CHECK-NEXT: vssub.vv v8, v8, v9
470 %v = call <vscale x 1 x i32> @llvm.ssub.sat.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b)
471 ret <vscale x 1 x i32> %v
474 define <vscale x 1 x i32> @ssub_nxv1i32_vx(<vscale x 1 x i32> %va, i32 %b) {
475 ; CHECK-LABEL: ssub_nxv1i32_vx:
477 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
478 ; CHECK-NEXT: vssub.vx v8, v8, a0
480 %elt.head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
481 %vb = shufflevector <vscale x 1 x i32> %elt.head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
482 %v = call <vscale x 1 x i32> @llvm.ssub.sat.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb)
483 ret <vscale x 1 x i32> %v
486 define <vscale x 1 x i32> @ssub_nxv1i32_vi(<vscale x 1 x i32> %va) {
487 ; CHECK-LABEL: ssub_nxv1i32_vi:
489 ; CHECK-NEXT: li a0, 1
490 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
491 ; CHECK-NEXT: vssub.vx v8, v8, a0
493 %v = call <vscale x 1 x i32> @llvm.ssub.sat.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> splat (i32 1))
494 ret <vscale x 1 x i32> %v
497 declare <vscale x 2 x i32> @llvm.ssub.sat.nxv2i32(<vscale x 2 x i32>, <vscale x 2 x i32>)
499 define <vscale x 2 x i32> @ssub_nxv2i32_vv(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b) {
500 ; CHECK-LABEL: ssub_nxv2i32_vv:
502 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
503 ; CHECK-NEXT: vssub.vv v8, v8, v9
505 %v = call <vscale x 2 x i32> @llvm.ssub.sat.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b)
506 ret <vscale x 2 x i32> %v
509 define <vscale x 2 x i32> @ssub_nxv2i32_vx(<vscale x 2 x i32> %va, i32 %b) {
510 ; CHECK-LABEL: ssub_nxv2i32_vx:
512 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
513 ; CHECK-NEXT: vssub.vx v8, v8, a0
515 %elt.head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
516 %vb = shufflevector <vscale x 2 x i32> %elt.head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
517 %v = call <vscale x 2 x i32> @llvm.ssub.sat.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb)
518 ret <vscale x 2 x i32> %v
521 define <vscale x 2 x i32> @ssub_nxv2i32_vi(<vscale x 2 x i32> %va) {
522 ; CHECK-LABEL: ssub_nxv2i32_vi:
524 ; CHECK-NEXT: li a0, 1
525 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
526 ; CHECK-NEXT: vssub.vx v8, v8, a0
528 %v = call <vscale x 2 x i32> @llvm.ssub.sat.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> splat (i32 1))
529 ret <vscale x 2 x i32> %v
532 declare <vscale x 4 x i32> @llvm.ssub.sat.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>)
534 define <vscale x 4 x i32> @ssub_nxv4i32_vv(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b) {
535 ; CHECK-LABEL: ssub_nxv4i32_vv:
537 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
538 ; CHECK-NEXT: vssub.vv v8, v8, v10
540 %v = call <vscale x 4 x i32> @llvm.ssub.sat.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b)
541 ret <vscale x 4 x i32> %v
544 define <vscale x 4 x i32> @ssub_nxv4i32_vx(<vscale x 4 x i32> %va, i32 %b) {
545 ; CHECK-LABEL: ssub_nxv4i32_vx:
547 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
548 ; CHECK-NEXT: vssub.vx v8, v8, a0
550 %elt.head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
551 %vb = shufflevector <vscale x 4 x i32> %elt.head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
552 %v = call <vscale x 4 x i32> @llvm.ssub.sat.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb)
553 ret <vscale x 4 x i32> %v
556 define <vscale x 4 x i32> @ssub_nxv4i32_vi(<vscale x 4 x i32> %va) {
557 ; CHECK-LABEL: ssub_nxv4i32_vi:
559 ; CHECK-NEXT: li a0, 1
560 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
561 ; CHECK-NEXT: vssub.vx v8, v8, a0
563 %v = call <vscale x 4 x i32> @llvm.ssub.sat.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> splat (i32 1))
564 ret <vscale x 4 x i32> %v
567 declare <vscale x 8 x i32> @llvm.ssub.sat.nxv8i32(<vscale x 8 x i32>, <vscale x 8 x i32>)
569 define <vscale x 8 x i32> @ssub_nxv8i32_vv(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b) {
570 ; CHECK-LABEL: ssub_nxv8i32_vv:
572 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
573 ; CHECK-NEXT: vssub.vv v8, v8, v12
575 %v = call <vscale x 8 x i32> @llvm.ssub.sat.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b)
576 ret <vscale x 8 x i32> %v
579 define <vscale x 8 x i32> @ssub_nxv8i32_vx(<vscale x 8 x i32> %va, i32 %b) {
580 ; CHECK-LABEL: ssub_nxv8i32_vx:
582 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
583 ; CHECK-NEXT: vssub.vx v8, v8, a0
585 %elt.head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
586 %vb = shufflevector <vscale x 8 x i32> %elt.head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
587 %v = call <vscale x 8 x i32> @llvm.ssub.sat.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb)
588 ret <vscale x 8 x i32> %v
591 define <vscale x 8 x i32> @ssub_nxv8i32_vi(<vscale x 8 x i32> %va) {
592 ; CHECK-LABEL: ssub_nxv8i32_vi:
594 ; CHECK-NEXT: li a0, 1
595 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
596 ; CHECK-NEXT: vssub.vx v8, v8, a0
598 %v = call <vscale x 8 x i32> @llvm.ssub.sat.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> splat (i32 1))
599 ret <vscale x 8 x i32> %v
602 declare <vscale x 16 x i32> @llvm.ssub.sat.nxv16i32(<vscale x 16 x i32>, <vscale x 16 x i32>)
604 define <vscale x 16 x i32> @ssub_nxv16i32_vv(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b) {
605 ; CHECK-LABEL: ssub_nxv16i32_vv:
607 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
608 ; CHECK-NEXT: vssub.vv v8, v8, v16
610 %v = call <vscale x 16 x i32> @llvm.ssub.sat.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b)
611 ret <vscale x 16 x i32> %v
614 define <vscale x 16 x i32> @ssub_nxv16i32_vx(<vscale x 16 x i32> %va, i32 %b) {
615 ; CHECK-LABEL: ssub_nxv16i32_vx:
617 ; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, ma
618 ; CHECK-NEXT: vssub.vx v8, v8, a0
620 %elt.head = insertelement <vscale x 16 x i32> poison, i32 %b, i32 0
621 %vb = shufflevector <vscale x 16 x i32> %elt.head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
622 %v = call <vscale x 16 x i32> @llvm.ssub.sat.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb)
623 ret <vscale x 16 x i32> %v
626 define <vscale x 16 x i32> @ssub_nxv16i32_vi(<vscale x 16 x i32> %va) {
627 ; CHECK-LABEL: ssub_nxv16i32_vi:
629 ; CHECK-NEXT: li a0, 1
630 ; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, ma
631 ; CHECK-NEXT: vssub.vx v8, v8, a0
633 %v = call <vscale x 16 x i32> @llvm.ssub.sat.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> splat (i32 1))
634 ret <vscale x 16 x i32> %v
637 declare <vscale x 1 x i64> @llvm.ssub.sat.nxv1i64(<vscale x 1 x i64>, <vscale x 1 x i64>)
639 define <vscale x 1 x i64> @ssub_nxv1i64_vv(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b) {
640 ; CHECK-LABEL: ssub_nxv1i64_vv:
642 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
643 ; CHECK-NEXT: vssub.vv v8, v8, v9
645 %v = call <vscale x 1 x i64> @llvm.ssub.sat.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b)
646 ret <vscale x 1 x i64> %v
649 define <vscale x 1 x i64> @ssub_nxv1i64_vx(<vscale x 1 x i64> %va, i64 %b) {
650 ; RV32-LABEL: ssub_nxv1i64_vx:
652 ; RV32-NEXT: addi sp, sp, -16
653 ; RV32-NEXT: .cfi_def_cfa_offset 16
654 ; RV32-NEXT: sw a1, 12(sp)
655 ; RV32-NEXT: sw a0, 8(sp)
656 ; RV32-NEXT: addi a0, sp, 8
657 ; RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
658 ; RV32-NEXT: vlse64.v v9, (a0), zero
659 ; RV32-NEXT: vssub.vv v8, v8, v9
660 ; RV32-NEXT: addi sp, sp, 16
663 ; RV64-LABEL: ssub_nxv1i64_vx:
665 ; RV64-NEXT: vsetvli a1, zero, e64, m1, ta, ma
666 ; RV64-NEXT: vssub.vx v8, v8, a0
668 %elt.head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
669 %vb = shufflevector <vscale x 1 x i64> %elt.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
670 %v = call <vscale x 1 x i64> @llvm.ssub.sat.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb)
671 ret <vscale x 1 x i64> %v
674 define <vscale x 1 x i64> @ssub_nxv1i64_vi(<vscale x 1 x i64> %va) {
675 ; CHECK-LABEL: ssub_nxv1i64_vi:
677 ; CHECK-NEXT: li a0, 1
678 ; CHECK-NEXT: vsetvli a1, zero, e64, m1, ta, ma
679 ; CHECK-NEXT: vssub.vx v8, v8, a0
681 %v = call <vscale x 1 x i64> @llvm.ssub.sat.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> splat (i64 1))
682 ret <vscale x 1 x i64> %v
685 declare <vscale x 2 x i64> @llvm.ssub.sat.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>)
687 define <vscale x 2 x i64> @ssub_nxv2i64_vv(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b) {
688 ; CHECK-LABEL: ssub_nxv2i64_vv:
690 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
691 ; CHECK-NEXT: vssub.vv v8, v8, v10
693 %v = call <vscale x 2 x i64> @llvm.ssub.sat.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b)
694 ret <vscale x 2 x i64> %v
697 define <vscale x 2 x i64> @ssub_nxv2i64_vx(<vscale x 2 x i64> %va, i64 %b) {
698 ; RV32-LABEL: ssub_nxv2i64_vx:
700 ; RV32-NEXT: addi sp, sp, -16
701 ; RV32-NEXT: .cfi_def_cfa_offset 16
702 ; RV32-NEXT: sw a1, 12(sp)
703 ; RV32-NEXT: sw a0, 8(sp)
704 ; RV32-NEXT: addi a0, sp, 8
705 ; RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
706 ; RV32-NEXT: vlse64.v v10, (a0), zero
707 ; RV32-NEXT: vssub.vv v8, v8, v10
708 ; RV32-NEXT: addi sp, sp, 16
711 ; RV64-LABEL: ssub_nxv2i64_vx:
713 ; RV64-NEXT: vsetvli a1, zero, e64, m2, ta, ma
714 ; RV64-NEXT: vssub.vx v8, v8, a0
716 %elt.head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
717 %vb = shufflevector <vscale x 2 x i64> %elt.head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
718 %v = call <vscale x 2 x i64> @llvm.ssub.sat.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb)
719 ret <vscale x 2 x i64> %v
722 define <vscale x 2 x i64> @ssub_nxv2i64_vi(<vscale x 2 x i64> %va) {
723 ; CHECK-LABEL: ssub_nxv2i64_vi:
725 ; CHECK-NEXT: li a0, 1
726 ; CHECK-NEXT: vsetvli a1, zero, e64, m2, ta, ma
727 ; CHECK-NEXT: vssub.vx v8, v8, a0
729 %v = call <vscale x 2 x i64> @llvm.ssub.sat.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> splat (i64 1))
730 ret <vscale x 2 x i64> %v
733 declare <vscale x 4 x i64> @llvm.ssub.sat.nxv4i64(<vscale x 4 x i64>, <vscale x 4 x i64>)
735 define <vscale x 4 x i64> @ssub_nxv4i64_vv(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b) {
736 ; CHECK-LABEL: ssub_nxv4i64_vv:
738 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
739 ; CHECK-NEXT: vssub.vv v8, v8, v12
741 %v = call <vscale x 4 x i64> @llvm.ssub.sat.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b)
742 ret <vscale x 4 x i64> %v
745 define <vscale x 4 x i64> @ssub_nxv4i64_vx(<vscale x 4 x i64> %va, i64 %b) {
746 ; RV32-LABEL: ssub_nxv4i64_vx:
748 ; RV32-NEXT: addi sp, sp, -16
749 ; RV32-NEXT: .cfi_def_cfa_offset 16
750 ; RV32-NEXT: sw a1, 12(sp)
751 ; RV32-NEXT: sw a0, 8(sp)
752 ; RV32-NEXT: addi a0, sp, 8
753 ; RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
754 ; RV32-NEXT: vlse64.v v12, (a0), zero
755 ; RV32-NEXT: vssub.vv v8, v8, v12
756 ; RV32-NEXT: addi sp, sp, 16
759 ; RV64-LABEL: ssub_nxv4i64_vx:
761 ; RV64-NEXT: vsetvli a1, zero, e64, m4, ta, ma
762 ; RV64-NEXT: vssub.vx v8, v8, a0
764 %elt.head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
765 %vb = shufflevector <vscale x 4 x i64> %elt.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
766 %v = call <vscale x 4 x i64> @llvm.ssub.sat.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb)
767 ret <vscale x 4 x i64> %v
770 define <vscale x 4 x i64> @ssub_nxv4i64_vi(<vscale x 4 x i64> %va) {
771 ; CHECK-LABEL: ssub_nxv4i64_vi:
773 ; CHECK-NEXT: li a0, 1
774 ; CHECK-NEXT: vsetvli a1, zero, e64, m4, ta, ma
775 ; CHECK-NEXT: vssub.vx v8, v8, a0
777 %v = call <vscale x 4 x i64> @llvm.ssub.sat.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> splat (i64 1))
778 ret <vscale x 4 x i64> %v
781 declare <vscale x 8 x i64> @llvm.ssub.sat.nxv8i64(<vscale x 8 x i64>, <vscale x 8 x i64>)
783 define <vscale x 8 x i64> @ssub_nxv8i64_vv(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b) {
784 ; CHECK-LABEL: ssub_nxv8i64_vv:
786 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
787 ; CHECK-NEXT: vssub.vv v8, v8, v16
789 %v = call <vscale x 8 x i64> @llvm.ssub.sat.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b)
790 ret <vscale x 8 x i64> %v
793 define <vscale x 8 x i64> @ssub_nxv8i64_vx(<vscale x 8 x i64> %va, i64 %b) {
794 ; RV32-LABEL: ssub_nxv8i64_vx:
796 ; RV32-NEXT: addi sp, sp, -16
797 ; RV32-NEXT: .cfi_def_cfa_offset 16
798 ; RV32-NEXT: sw a1, 12(sp)
799 ; RV32-NEXT: sw a0, 8(sp)
800 ; RV32-NEXT: addi a0, sp, 8
801 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
802 ; RV32-NEXT: vlse64.v v16, (a0), zero
803 ; RV32-NEXT: vssub.vv v8, v8, v16
804 ; RV32-NEXT: addi sp, sp, 16
807 ; RV64-LABEL: ssub_nxv8i64_vx:
809 ; RV64-NEXT: vsetvli a1, zero, e64, m8, ta, ma
810 ; RV64-NEXT: vssub.vx v8, v8, a0
812 %elt.head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
813 %vb = shufflevector <vscale x 8 x i64> %elt.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
814 %v = call <vscale x 8 x i64> @llvm.ssub.sat.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb)
815 ret <vscale x 8 x i64> %v
818 define <vscale x 8 x i64> @ssub_nxv8i64_vi(<vscale x 8 x i64> %va) {
819 ; CHECK-LABEL: ssub_nxv8i64_vi:
821 ; CHECK-NEXT: li a0, 1
822 ; CHECK-NEXT: vsetvli a1, zero, e64, m8, ta, ma
823 ; CHECK-NEXT: vssub.vx v8, v8, a0
825 %v = call <vscale x 8 x i64> @llvm.ssub.sat.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> splat (i64 1))
826 ret <vscale x 8 x i64> %v