1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV32
3 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV64
5 define <vscale x 1 x i8> @vsub_vv_nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb) {
6 ; CHECK-LABEL: vsub_vv_nxv1i8:
8 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
9 ; CHECK-NEXT: vsub.vv v8, v8, v9
11 %vc = sub <vscale x 1 x i8> %va, %vb
12 ret <vscale x 1 x i8> %vc
15 define <vscale x 1 x i8> @vsub_vx_nxv1i8(<vscale x 1 x i8> %va, i8 signext %b) {
16 ; CHECK-LABEL: vsub_vx_nxv1i8:
18 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
19 ; CHECK-NEXT: vsub.vx v8, v8, a0
21 %head = insertelement <vscale x 1 x i8> poison, i8 %b, i32 0
22 %splat = shufflevector <vscale x 1 x i8> %head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
23 %vc = sub <vscale x 1 x i8> %va, %splat
24 ret <vscale x 1 x i8> %vc
27 define <vscale x 1 x i8> @vsub_vx_nxv1i8_0(<vscale x 1 x i8> %va) {
28 ; CHECK-LABEL: vsub_vx_nxv1i8_0:
30 ; CHECK-NEXT: li a0, 1
31 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
32 ; CHECK-NEXT: vsub.vx v8, v8, a0
34 %head = insertelement <vscale x 1 x i8> poison, i8 1, i32 0
35 %splat = shufflevector <vscale x 1 x i8> %head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
36 %vc = sub <vscale x 1 x i8> %va, %splat
37 ret <vscale x 1 x i8> %vc
40 ; Test constant subs to see if we can optimize them away for scalable vectors.
41 define <vscale x 1 x i8> @vsub_ii_nxv1i8_1() {
42 ; CHECK-LABEL: vsub_ii_nxv1i8_1:
44 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
45 ; CHECK-NEXT: vmv.v.i v8, -1
47 %heada = insertelement <vscale x 1 x i8> poison, i8 2, i32 0
48 %splata = shufflevector <vscale x 1 x i8> %heada, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
49 %headb = insertelement <vscale x 1 x i8> poison, i8 3, i32 0
50 %splatb = shufflevector <vscale x 1 x i8> %headb, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
51 %vc = sub <vscale x 1 x i8> %splata, %splatb
52 ret <vscale x 1 x i8> %vc
55 define <vscale x 2 x i8> @vsub_vv_nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb) {
56 ; CHECK-LABEL: vsub_vv_nxv2i8:
58 ; CHECK-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
59 ; CHECK-NEXT: vsub.vv v8, v8, v9
61 %vc = sub <vscale x 2 x i8> %va, %vb
62 ret <vscale x 2 x i8> %vc
65 define <vscale x 2 x i8> @vsub_vx_nxv2i8(<vscale x 2 x i8> %va, i8 signext %b) {
66 ; CHECK-LABEL: vsub_vx_nxv2i8:
68 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
69 ; CHECK-NEXT: vsub.vx v8, v8, a0
71 %head = insertelement <vscale x 2 x i8> poison, i8 %b, i32 0
72 %splat = shufflevector <vscale x 2 x i8> %head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
73 %vc = sub <vscale x 2 x i8> %va, %splat
74 ret <vscale x 2 x i8> %vc
77 define <vscale x 2 x i8> @vsub_vx_nxv2i8_0(<vscale x 2 x i8> %va) {
78 ; CHECK-LABEL: vsub_vx_nxv2i8_0:
80 ; CHECK-NEXT: li a0, 1
81 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
82 ; CHECK-NEXT: vsub.vx v8, v8, a0
84 %head = insertelement <vscale x 2 x i8> poison, i8 1, i32 0
85 %splat = shufflevector <vscale x 2 x i8> %head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
86 %vc = sub <vscale x 2 x i8> %va, %splat
87 ret <vscale x 2 x i8> %vc
90 define <vscale x 4 x i8> @vsub_vv_nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb) {
91 ; CHECK-LABEL: vsub_vv_nxv4i8:
93 ; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
94 ; CHECK-NEXT: vsub.vv v8, v8, v9
96 %vc = sub <vscale x 4 x i8> %va, %vb
97 ret <vscale x 4 x i8> %vc
100 define <vscale x 4 x i8> @vsub_vx_nxv4i8(<vscale x 4 x i8> %va, i8 signext %b) {
101 ; CHECK-LABEL: vsub_vx_nxv4i8:
103 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
104 ; CHECK-NEXT: vsub.vx v8, v8, a0
106 %head = insertelement <vscale x 4 x i8> poison, i8 %b, i32 0
107 %splat = shufflevector <vscale x 4 x i8> %head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
108 %vc = sub <vscale x 4 x i8> %va, %splat
109 ret <vscale x 4 x i8> %vc
112 define <vscale x 4 x i8> @vsub_vx_nxv4i8_0(<vscale x 4 x i8> %va) {
113 ; CHECK-LABEL: vsub_vx_nxv4i8_0:
115 ; CHECK-NEXT: li a0, 1
116 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
117 ; CHECK-NEXT: vsub.vx v8, v8, a0
119 %head = insertelement <vscale x 4 x i8> poison, i8 1, i32 0
120 %splat = shufflevector <vscale x 4 x i8> %head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
121 %vc = sub <vscale x 4 x i8> %va, %splat
122 ret <vscale x 4 x i8> %vc
125 define <vscale x 8 x i8> @vsub_vv_nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb) {
126 ; CHECK-LABEL: vsub_vv_nxv8i8:
128 ; CHECK-NEXT: vsetvli a0, zero, e8, m1, ta, ma
129 ; CHECK-NEXT: vsub.vv v8, v8, v9
131 %vc = sub <vscale x 8 x i8> %va, %vb
132 ret <vscale x 8 x i8> %vc
135 define <vscale x 8 x i8> @vsub_vx_nxv8i8(<vscale x 8 x i8> %va, i8 signext %b) {
136 ; CHECK-LABEL: vsub_vx_nxv8i8:
138 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
139 ; CHECK-NEXT: vsub.vx v8, v8, a0
141 %head = insertelement <vscale x 8 x i8> poison, i8 %b, i32 0
142 %splat = shufflevector <vscale x 8 x i8> %head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
143 %vc = sub <vscale x 8 x i8> %va, %splat
144 ret <vscale x 8 x i8> %vc
147 define <vscale x 8 x i8> @vsub_vx_nxv8i8_0(<vscale x 8 x i8> %va) {
148 ; CHECK-LABEL: vsub_vx_nxv8i8_0:
150 ; CHECK-NEXT: li a0, 1
151 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
152 ; CHECK-NEXT: vsub.vx v8, v8, a0
154 %head = insertelement <vscale x 8 x i8> poison, i8 1, i32 0
155 %splat = shufflevector <vscale x 8 x i8> %head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
156 %vc = sub <vscale x 8 x i8> %va, %splat
157 ret <vscale x 8 x i8> %vc
160 define <vscale x 16 x i8> @vsub_vv_nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb) {
161 ; CHECK-LABEL: vsub_vv_nxv16i8:
163 ; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma
164 ; CHECK-NEXT: vsub.vv v8, v8, v10
166 %vc = sub <vscale x 16 x i8> %va, %vb
167 ret <vscale x 16 x i8> %vc
170 define <vscale x 16 x i8> @vsub_vx_nxv16i8(<vscale x 16 x i8> %va, i8 signext %b) {
171 ; CHECK-LABEL: vsub_vx_nxv16i8:
173 ; CHECK-NEXT: vsetvli a1, zero, e8, m2, ta, ma
174 ; CHECK-NEXT: vsub.vx v8, v8, a0
176 %head = insertelement <vscale x 16 x i8> poison, i8 %b, i32 0
177 %splat = shufflevector <vscale x 16 x i8> %head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
178 %vc = sub <vscale x 16 x i8> %va, %splat
179 ret <vscale x 16 x i8> %vc
182 define <vscale x 16 x i8> @vsub_vx_nxv16i8_0(<vscale x 16 x i8> %va) {
183 ; CHECK-LABEL: vsub_vx_nxv16i8_0:
185 ; CHECK-NEXT: li a0, 1
186 ; CHECK-NEXT: vsetvli a1, zero, e8, m2, ta, ma
187 ; CHECK-NEXT: vsub.vx v8, v8, a0
189 %head = insertelement <vscale x 16 x i8> poison, i8 1, i32 0
190 %splat = shufflevector <vscale x 16 x i8> %head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
191 %vc = sub <vscale x 16 x i8> %va, %splat
192 ret <vscale x 16 x i8> %vc
195 define <vscale x 32 x i8> @vsub_vv_nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb) {
196 ; CHECK-LABEL: vsub_vv_nxv32i8:
198 ; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma
199 ; CHECK-NEXT: vsub.vv v8, v8, v12
201 %vc = sub <vscale x 32 x i8> %va, %vb
202 ret <vscale x 32 x i8> %vc
205 define <vscale x 32 x i8> @vsub_vx_nxv32i8(<vscale x 32 x i8> %va, i8 signext %b) {
206 ; CHECK-LABEL: vsub_vx_nxv32i8:
208 ; CHECK-NEXT: vsetvli a1, zero, e8, m4, ta, ma
209 ; CHECK-NEXT: vsub.vx v8, v8, a0
211 %head = insertelement <vscale x 32 x i8> poison, i8 %b, i32 0
212 %splat = shufflevector <vscale x 32 x i8> %head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
213 %vc = sub <vscale x 32 x i8> %va, %splat
214 ret <vscale x 32 x i8> %vc
217 define <vscale x 32 x i8> @vsub_vx_nxv32i8_0(<vscale x 32 x i8> %va) {
218 ; CHECK-LABEL: vsub_vx_nxv32i8_0:
220 ; CHECK-NEXT: li a0, 1
221 ; CHECK-NEXT: vsetvli a1, zero, e8, m4, ta, ma
222 ; CHECK-NEXT: vsub.vx v8, v8, a0
224 %head = insertelement <vscale x 32 x i8> poison, i8 1, i32 0
225 %splat = shufflevector <vscale x 32 x i8> %head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
226 %vc = sub <vscale x 32 x i8> %va, %splat
227 ret <vscale x 32 x i8> %vc
230 define <vscale x 64 x i8> @vsub_vv_nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb) {
231 ; CHECK-LABEL: vsub_vv_nxv64i8:
233 ; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma
234 ; CHECK-NEXT: vsub.vv v8, v8, v16
236 %vc = sub <vscale x 64 x i8> %va, %vb
237 ret <vscale x 64 x i8> %vc
240 define <vscale x 64 x i8> @vsub_vx_nxv64i8(<vscale x 64 x i8> %va, i8 signext %b) {
241 ; CHECK-LABEL: vsub_vx_nxv64i8:
243 ; CHECK-NEXT: vsetvli a1, zero, e8, m8, ta, ma
244 ; CHECK-NEXT: vsub.vx v8, v8, a0
246 %head = insertelement <vscale x 64 x i8> poison, i8 %b, i32 0
247 %splat = shufflevector <vscale x 64 x i8> %head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
248 %vc = sub <vscale x 64 x i8> %va, %splat
249 ret <vscale x 64 x i8> %vc
252 define <vscale x 64 x i8> @vsub_vx_nxv64i8_0(<vscale x 64 x i8> %va) {
253 ; CHECK-LABEL: vsub_vx_nxv64i8_0:
255 ; CHECK-NEXT: li a0, 1
256 ; CHECK-NEXT: vsetvli a1, zero, e8, m8, ta, ma
257 ; CHECK-NEXT: vsub.vx v8, v8, a0
259 %head = insertelement <vscale x 64 x i8> poison, i8 1, i32 0
260 %splat = shufflevector <vscale x 64 x i8> %head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
261 %vc = sub <vscale x 64 x i8> %va, %splat
262 ret <vscale x 64 x i8> %vc
265 define <vscale x 1 x i16> @vsub_vv_nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb) {
266 ; CHECK-LABEL: vsub_vv_nxv1i16:
268 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
269 ; CHECK-NEXT: vsub.vv v8, v8, v9
271 %vc = sub <vscale x 1 x i16> %va, %vb
272 ret <vscale x 1 x i16> %vc
275 define <vscale x 1 x i16> @vsub_vx_nxv1i16(<vscale x 1 x i16> %va, i16 signext %b) {
276 ; CHECK-LABEL: vsub_vx_nxv1i16:
278 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
279 ; CHECK-NEXT: vsub.vx v8, v8, a0
281 %head = insertelement <vscale x 1 x i16> poison, i16 %b, i32 0
282 %splat = shufflevector <vscale x 1 x i16> %head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
283 %vc = sub <vscale x 1 x i16> %va, %splat
284 ret <vscale x 1 x i16> %vc
287 define <vscale x 1 x i16> @vsub_vx_nxv1i16_0(<vscale x 1 x i16> %va) {
288 ; CHECK-LABEL: vsub_vx_nxv1i16_0:
290 ; CHECK-NEXT: li a0, 1
291 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
292 ; CHECK-NEXT: vsub.vx v8, v8, a0
294 %head = insertelement <vscale x 1 x i16> poison, i16 1, i32 0
295 %splat = shufflevector <vscale x 1 x i16> %head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
296 %vc = sub <vscale x 1 x i16> %va, %splat
297 ret <vscale x 1 x i16> %vc
300 define <vscale x 2 x i16> @vsub_vv_nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb) {
301 ; CHECK-LABEL: vsub_vv_nxv2i16:
303 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
304 ; CHECK-NEXT: vsub.vv v8, v8, v9
306 %vc = sub <vscale x 2 x i16> %va, %vb
307 ret <vscale x 2 x i16> %vc
310 define <vscale x 2 x i16> @vsub_vx_nxv2i16(<vscale x 2 x i16> %va, i16 signext %b) {
311 ; CHECK-LABEL: vsub_vx_nxv2i16:
313 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
314 ; CHECK-NEXT: vsub.vx v8, v8, a0
316 %head = insertelement <vscale x 2 x i16> poison, i16 %b, i32 0
317 %splat = shufflevector <vscale x 2 x i16> %head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
318 %vc = sub <vscale x 2 x i16> %va, %splat
319 ret <vscale x 2 x i16> %vc
322 define <vscale x 2 x i16> @vsub_vx_nxv2i16_0(<vscale x 2 x i16> %va) {
323 ; CHECK-LABEL: vsub_vx_nxv2i16_0:
325 ; CHECK-NEXT: li a0, 1
326 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
327 ; CHECK-NEXT: vsub.vx v8, v8, a0
329 %head = insertelement <vscale x 2 x i16> poison, i16 1, i32 0
330 %splat = shufflevector <vscale x 2 x i16> %head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
331 %vc = sub <vscale x 2 x i16> %va, %splat
332 ret <vscale x 2 x i16> %vc
335 define <vscale x 4 x i16> @vsub_vv_nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb) {
336 ; CHECK-LABEL: vsub_vv_nxv4i16:
338 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
339 ; CHECK-NEXT: vsub.vv v8, v8, v9
341 %vc = sub <vscale x 4 x i16> %va, %vb
342 ret <vscale x 4 x i16> %vc
345 define <vscale x 4 x i16> @vsub_vx_nxv4i16(<vscale x 4 x i16> %va, i16 signext %b) {
346 ; CHECK-LABEL: vsub_vx_nxv4i16:
348 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
349 ; CHECK-NEXT: vsub.vx v8, v8, a0
351 %head = insertelement <vscale x 4 x i16> poison, i16 %b, i32 0
352 %splat = shufflevector <vscale x 4 x i16> %head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
353 %vc = sub <vscale x 4 x i16> %va, %splat
354 ret <vscale x 4 x i16> %vc
357 define <vscale x 4 x i16> @vsub_vx_nxv4i16_0(<vscale x 4 x i16> %va) {
358 ; CHECK-LABEL: vsub_vx_nxv4i16_0:
360 ; CHECK-NEXT: li a0, 1
361 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
362 ; CHECK-NEXT: vsub.vx v8, v8, a0
364 %head = insertelement <vscale x 4 x i16> poison, i16 1, i32 0
365 %splat = shufflevector <vscale x 4 x i16> %head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
366 %vc = sub <vscale x 4 x i16> %va, %splat
367 ret <vscale x 4 x i16> %vc
370 define <vscale x 8 x i16> @vsub_vv_nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb) {
371 ; CHECK-LABEL: vsub_vv_nxv8i16:
373 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
374 ; CHECK-NEXT: vsub.vv v8, v8, v10
376 %vc = sub <vscale x 8 x i16> %va, %vb
377 ret <vscale x 8 x i16> %vc
380 define <vscale x 8 x i16> @vsub_vx_nxv8i16(<vscale x 8 x i16> %va, i16 signext %b) {
381 ; CHECK-LABEL: vsub_vx_nxv8i16:
383 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
384 ; CHECK-NEXT: vsub.vx v8, v8, a0
386 %head = insertelement <vscale x 8 x i16> poison, i16 %b, i32 0
387 %splat = shufflevector <vscale x 8 x i16> %head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
388 %vc = sub <vscale x 8 x i16> %va, %splat
389 ret <vscale x 8 x i16> %vc
392 define <vscale x 8 x i16> @vsub_vx_nxv8i16_0(<vscale x 8 x i16> %va) {
393 ; CHECK-LABEL: vsub_vx_nxv8i16_0:
395 ; CHECK-NEXT: li a0, 1
396 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
397 ; CHECK-NEXT: vsub.vx v8, v8, a0
399 %head = insertelement <vscale x 8 x i16> poison, i16 1, i32 0
400 %splat = shufflevector <vscale x 8 x i16> %head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
401 %vc = sub <vscale x 8 x i16> %va, %splat
402 ret <vscale x 8 x i16> %vc
405 define <vscale x 16 x i16> @vsub_vv_nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb) {
406 ; CHECK-LABEL: vsub_vv_nxv16i16:
408 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
409 ; CHECK-NEXT: vsub.vv v8, v8, v12
411 %vc = sub <vscale x 16 x i16> %va, %vb
412 ret <vscale x 16 x i16> %vc
415 define <vscale x 16 x i16> @vsub_vx_nxv16i16(<vscale x 16 x i16> %va, i16 signext %b) {
416 ; CHECK-LABEL: vsub_vx_nxv16i16:
418 ; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, ma
419 ; CHECK-NEXT: vsub.vx v8, v8, a0
421 %head = insertelement <vscale x 16 x i16> poison, i16 %b, i32 0
422 %splat = shufflevector <vscale x 16 x i16> %head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
423 %vc = sub <vscale x 16 x i16> %va, %splat
424 ret <vscale x 16 x i16> %vc
427 define <vscale x 16 x i16> @vsub_vx_nxv16i16_0(<vscale x 16 x i16> %va) {
428 ; CHECK-LABEL: vsub_vx_nxv16i16_0:
430 ; CHECK-NEXT: li a0, 1
431 ; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, ma
432 ; CHECK-NEXT: vsub.vx v8, v8, a0
434 %head = insertelement <vscale x 16 x i16> poison, i16 1, i32 0
435 %splat = shufflevector <vscale x 16 x i16> %head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
436 %vc = sub <vscale x 16 x i16> %va, %splat
437 ret <vscale x 16 x i16> %vc
440 define <vscale x 32 x i16> @vsub_vv_nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb) {
441 ; CHECK-LABEL: vsub_vv_nxv32i16:
443 ; CHECK-NEXT: vsetvli a0, zero, e16, m8, ta, ma
444 ; CHECK-NEXT: vsub.vv v8, v8, v16
446 %vc = sub <vscale x 32 x i16> %va, %vb
447 ret <vscale x 32 x i16> %vc
450 define <vscale x 32 x i16> @vsub_vx_nxv32i16(<vscale x 32 x i16> %va, i16 signext %b) {
451 ; CHECK-LABEL: vsub_vx_nxv32i16:
453 ; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, ma
454 ; CHECK-NEXT: vsub.vx v8, v8, a0
456 %head = insertelement <vscale x 32 x i16> poison, i16 %b, i32 0
457 %splat = shufflevector <vscale x 32 x i16> %head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
458 %vc = sub <vscale x 32 x i16> %va, %splat
459 ret <vscale x 32 x i16> %vc
462 define <vscale x 32 x i16> @vsub_vx_nxv32i16_0(<vscale x 32 x i16> %va) {
463 ; CHECK-LABEL: vsub_vx_nxv32i16_0:
465 ; CHECK-NEXT: li a0, 1
466 ; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, ma
467 ; CHECK-NEXT: vsub.vx v8, v8, a0
469 %head = insertelement <vscale x 32 x i16> poison, i16 1, i32 0
470 %splat = shufflevector <vscale x 32 x i16> %head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
471 %vc = sub <vscale x 32 x i16> %va, %splat
472 ret <vscale x 32 x i16> %vc
475 define <vscale x 1 x i32> @vsub_vv_nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb) {
476 ; CHECK-LABEL: vsub_vv_nxv1i32:
478 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
479 ; CHECK-NEXT: vsub.vv v8, v8, v9
481 %vc = sub <vscale x 1 x i32> %va, %vb
482 ret <vscale x 1 x i32> %vc
485 define <vscale x 1 x i32> @vsub_vx_nxv1i32(<vscale x 1 x i32> %va, i32 signext %b) {
486 ; CHECK-LABEL: vsub_vx_nxv1i32:
488 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
489 ; CHECK-NEXT: vsub.vx v8, v8, a0
491 %head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
492 %splat = shufflevector <vscale x 1 x i32> %head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
493 %vc = sub <vscale x 1 x i32> %va, %splat
494 ret <vscale x 1 x i32> %vc
497 define <vscale x 1 x i32> @vsub_vx_nxv1i32_0(<vscale x 1 x i32> %va) {
498 ; CHECK-LABEL: vsub_vx_nxv1i32_0:
500 ; CHECK-NEXT: li a0, 1
501 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
502 ; CHECK-NEXT: vsub.vx v8, v8, a0
504 %head = insertelement <vscale x 1 x i32> poison, i32 1, i32 0
505 %splat = shufflevector <vscale x 1 x i32> %head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
506 %vc = sub <vscale x 1 x i32> %va, %splat
507 ret <vscale x 1 x i32> %vc
510 define <vscale x 2 x i32> @vsub_vv_nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb) {
511 ; CHECK-LABEL: vsub_vv_nxv2i32:
513 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
514 ; CHECK-NEXT: vsub.vv v8, v8, v9
516 %vc = sub <vscale x 2 x i32> %va, %vb
517 ret <vscale x 2 x i32> %vc
520 define <vscale x 2 x i32> @vsub_vx_nxv2i32(<vscale x 2 x i32> %va, i32 signext %b) {
521 ; CHECK-LABEL: vsub_vx_nxv2i32:
523 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
524 ; CHECK-NEXT: vsub.vx v8, v8, a0
526 %head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
527 %splat = shufflevector <vscale x 2 x i32> %head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
528 %vc = sub <vscale x 2 x i32> %va, %splat
529 ret <vscale x 2 x i32> %vc
532 define <vscale x 2 x i32> @vsub_vx_nxv2i32_0(<vscale x 2 x i32> %va) {
533 ; CHECK-LABEL: vsub_vx_nxv2i32_0:
535 ; CHECK-NEXT: li a0, 1
536 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
537 ; CHECK-NEXT: vsub.vx v8, v8, a0
539 %head = insertelement <vscale x 2 x i32> poison, i32 1, i32 0
540 %splat = shufflevector <vscale x 2 x i32> %head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
541 %vc = sub <vscale x 2 x i32> %va, %splat
542 ret <vscale x 2 x i32> %vc
545 define <vscale x 4 x i32> @vsub_vv_nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb) {
546 ; CHECK-LABEL: vsub_vv_nxv4i32:
548 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
549 ; CHECK-NEXT: vsub.vv v8, v8, v10
551 %vc = sub <vscale x 4 x i32> %va, %vb
552 ret <vscale x 4 x i32> %vc
555 define <vscale x 4 x i32> @vsub_vx_nxv4i32(<vscale x 4 x i32> %va, i32 signext %b) {
556 ; CHECK-LABEL: vsub_vx_nxv4i32:
558 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
559 ; CHECK-NEXT: vsub.vx v8, v8, a0
561 %head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
562 %splat = shufflevector <vscale x 4 x i32> %head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
563 %vc = sub <vscale x 4 x i32> %va, %splat
564 ret <vscale x 4 x i32> %vc
567 define <vscale x 4 x i32> @vsub_vx_nxv4i32_0(<vscale x 4 x i32> %va) {
568 ; CHECK-LABEL: vsub_vx_nxv4i32_0:
570 ; CHECK-NEXT: li a0, 1
571 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
572 ; CHECK-NEXT: vsub.vx v8, v8, a0
574 %head = insertelement <vscale x 4 x i32> poison, i32 1, i32 0
575 %splat = shufflevector <vscale x 4 x i32> %head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
576 %vc = sub <vscale x 4 x i32> %va, %splat
577 ret <vscale x 4 x i32> %vc
580 define <vscale x 8 x i32> @vsub_vv_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb) {
581 ; CHECK-LABEL: vsub_vv_nxv8i32:
583 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
584 ; CHECK-NEXT: vsub.vv v8, v8, v12
586 %vc = sub <vscale x 8 x i32> %va, %vb
587 ret <vscale x 8 x i32> %vc
590 define <vscale x 8 x i32> @vsub_vx_nxv8i32(<vscale x 8 x i32> %va, i32 signext %b) {
591 ; CHECK-LABEL: vsub_vx_nxv8i32:
593 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
594 ; CHECK-NEXT: vsub.vx v8, v8, a0
596 %head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
597 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
598 %vc = sub <vscale x 8 x i32> %va, %splat
599 ret <vscale x 8 x i32> %vc
602 define <vscale x 8 x i32> @vsub_vx_nxv8i32_0(<vscale x 8 x i32> %va) {
603 ; CHECK-LABEL: vsub_vx_nxv8i32_0:
605 ; CHECK-NEXT: li a0, 1
606 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
607 ; CHECK-NEXT: vsub.vx v8, v8, a0
609 %head = insertelement <vscale x 8 x i32> poison, i32 1, i32 0
610 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
611 %vc = sub <vscale x 8 x i32> %va, %splat
612 ret <vscale x 8 x i32> %vc
615 define <vscale x 16 x i32> @vsub_vv_nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb) {
616 ; CHECK-LABEL: vsub_vv_nxv16i32:
618 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
619 ; CHECK-NEXT: vsub.vv v8, v8, v16
621 %vc = sub <vscale x 16 x i32> %va, %vb
622 ret <vscale x 16 x i32> %vc
625 define <vscale x 16 x i32> @vsub_vx_nxv16i32(<vscale x 16 x i32> %va, i32 signext %b) {
626 ; CHECK-LABEL: vsub_vx_nxv16i32:
628 ; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, ma
629 ; CHECK-NEXT: vsub.vx v8, v8, a0
631 %head = insertelement <vscale x 16 x i32> poison, i32 %b, i32 0
632 %splat = shufflevector <vscale x 16 x i32> %head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
633 %vc = sub <vscale x 16 x i32> %va, %splat
634 ret <vscale x 16 x i32> %vc
637 define <vscale x 16 x i32> @vsub_vx_nxv16i32_0(<vscale x 16 x i32> %va) {
638 ; CHECK-LABEL: vsub_vx_nxv16i32_0:
640 ; CHECK-NEXT: li a0, 1
641 ; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, ma
642 ; CHECK-NEXT: vsub.vx v8, v8, a0
644 %head = insertelement <vscale x 16 x i32> poison, i32 1, i32 0
645 %splat = shufflevector <vscale x 16 x i32> %head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
646 %vc = sub <vscale x 16 x i32> %va, %splat
647 ret <vscale x 16 x i32> %vc
650 define <vscale x 1 x i64> @vsub_vv_nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb) {
651 ; CHECK-LABEL: vsub_vv_nxv1i64:
653 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
654 ; CHECK-NEXT: vsub.vv v8, v8, v9
656 %vc = sub <vscale x 1 x i64> %va, %vb
657 ret <vscale x 1 x i64> %vc
660 define <vscale x 1 x i64> @vsub_vx_nxv1i64(<vscale x 1 x i64> %va, i64 %b) {
661 ; RV32-LABEL: vsub_vx_nxv1i64:
663 ; RV32-NEXT: addi sp, sp, -16
664 ; RV32-NEXT: .cfi_def_cfa_offset 16
665 ; RV32-NEXT: sw a1, 12(sp)
666 ; RV32-NEXT: sw a0, 8(sp)
667 ; RV32-NEXT: addi a0, sp, 8
668 ; RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
669 ; RV32-NEXT: vlse64.v v9, (a0), zero
670 ; RV32-NEXT: vsub.vv v8, v8, v9
671 ; RV32-NEXT: addi sp, sp, 16
674 ; RV64-LABEL: vsub_vx_nxv1i64:
676 ; RV64-NEXT: vsetvli a1, zero, e64, m1, ta, ma
677 ; RV64-NEXT: vsub.vx v8, v8, a0
679 %head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
680 %splat = shufflevector <vscale x 1 x i64> %head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
681 %vc = sub <vscale x 1 x i64> %va, %splat
682 ret <vscale x 1 x i64> %vc
685 define <vscale x 1 x i64> @vsub_vx_nxv1i64_0(<vscale x 1 x i64> %va) {
686 ; CHECK-LABEL: vsub_vx_nxv1i64_0:
688 ; CHECK-NEXT: li a0, 1
689 ; CHECK-NEXT: vsetvli a1, zero, e64, m1, ta, ma
690 ; CHECK-NEXT: vsub.vx v8, v8, a0
692 %head = insertelement <vscale x 1 x i64> poison, i64 1, i32 0
693 %splat = shufflevector <vscale x 1 x i64> %head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
694 %vc = sub <vscale x 1 x i64> %va, %splat
695 ret <vscale x 1 x i64> %vc
698 define <vscale x 2 x i64> @vsub_vv_nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb) {
699 ; CHECK-LABEL: vsub_vv_nxv2i64:
701 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
702 ; CHECK-NEXT: vsub.vv v8, v8, v10
704 %vc = sub <vscale x 2 x i64> %va, %vb
705 ret <vscale x 2 x i64> %vc
708 define <vscale x 2 x i64> @vsub_vx_nxv2i64(<vscale x 2 x i64> %va, i64 %b) {
709 ; RV32-LABEL: vsub_vx_nxv2i64:
711 ; RV32-NEXT: addi sp, sp, -16
712 ; RV32-NEXT: .cfi_def_cfa_offset 16
713 ; RV32-NEXT: sw a1, 12(sp)
714 ; RV32-NEXT: sw a0, 8(sp)
715 ; RV32-NEXT: addi a0, sp, 8
716 ; RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
717 ; RV32-NEXT: vlse64.v v10, (a0), zero
718 ; RV32-NEXT: vsub.vv v8, v8, v10
719 ; RV32-NEXT: addi sp, sp, 16
722 ; RV64-LABEL: vsub_vx_nxv2i64:
724 ; RV64-NEXT: vsetvli a1, zero, e64, m2, ta, ma
725 ; RV64-NEXT: vsub.vx v8, v8, a0
727 %head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
728 %splat = shufflevector <vscale x 2 x i64> %head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
729 %vc = sub <vscale x 2 x i64> %va, %splat
730 ret <vscale x 2 x i64> %vc
733 define <vscale x 2 x i64> @vsub_vx_nxv2i64_0(<vscale x 2 x i64> %va) {
734 ; CHECK-LABEL: vsub_vx_nxv2i64_0:
736 ; CHECK-NEXT: li a0, 1
737 ; CHECK-NEXT: vsetvli a1, zero, e64, m2, ta, ma
738 ; CHECK-NEXT: vsub.vx v8, v8, a0
740 %head = insertelement <vscale x 2 x i64> poison, i64 1, i32 0
741 %splat = shufflevector <vscale x 2 x i64> %head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
742 %vc = sub <vscale x 2 x i64> %va, %splat
743 ret <vscale x 2 x i64> %vc
746 define <vscale x 4 x i64> @vsub_vv_nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb) {
747 ; CHECK-LABEL: vsub_vv_nxv4i64:
749 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
750 ; CHECK-NEXT: vsub.vv v8, v8, v12
752 %vc = sub <vscale x 4 x i64> %va, %vb
753 ret <vscale x 4 x i64> %vc
756 define <vscale x 4 x i64> @vsub_vx_nxv4i64(<vscale x 4 x i64> %va, i64 %b) {
757 ; RV32-LABEL: vsub_vx_nxv4i64:
759 ; RV32-NEXT: addi sp, sp, -16
760 ; RV32-NEXT: .cfi_def_cfa_offset 16
761 ; RV32-NEXT: sw a1, 12(sp)
762 ; RV32-NEXT: sw a0, 8(sp)
763 ; RV32-NEXT: addi a0, sp, 8
764 ; RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
765 ; RV32-NEXT: vlse64.v v12, (a0), zero
766 ; RV32-NEXT: vsub.vv v8, v8, v12
767 ; RV32-NEXT: addi sp, sp, 16
770 ; RV64-LABEL: vsub_vx_nxv4i64:
772 ; RV64-NEXT: vsetvli a1, zero, e64, m4, ta, ma
773 ; RV64-NEXT: vsub.vx v8, v8, a0
775 %head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
776 %splat = shufflevector <vscale x 4 x i64> %head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
777 %vc = sub <vscale x 4 x i64> %va, %splat
778 ret <vscale x 4 x i64> %vc
781 define <vscale x 4 x i64> @vsub_vx_nxv4i64_0(<vscale x 4 x i64> %va) {
782 ; CHECK-LABEL: vsub_vx_nxv4i64_0:
784 ; CHECK-NEXT: li a0, 1
785 ; CHECK-NEXT: vsetvli a1, zero, e64, m4, ta, ma
786 ; CHECK-NEXT: vsub.vx v8, v8, a0
788 %head = insertelement <vscale x 4 x i64> poison, i64 1, i32 0
789 %splat = shufflevector <vscale x 4 x i64> %head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
790 %vc = sub <vscale x 4 x i64> %va, %splat
791 ret <vscale x 4 x i64> %vc
794 define <vscale x 8 x i64> @vsub_vv_nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb) {
795 ; CHECK-LABEL: vsub_vv_nxv8i64:
797 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
798 ; CHECK-NEXT: vsub.vv v8, v8, v16
800 %vc = sub <vscale x 8 x i64> %va, %vb
801 ret <vscale x 8 x i64> %vc
804 define <vscale x 8 x i64> @vsub_vx_nxv8i64(<vscale x 8 x i64> %va, i64 %b) {
805 ; RV32-LABEL: vsub_vx_nxv8i64:
807 ; RV32-NEXT: addi sp, sp, -16
808 ; RV32-NEXT: .cfi_def_cfa_offset 16
809 ; RV32-NEXT: sw a1, 12(sp)
810 ; RV32-NEXT: sw a0, 8(sp)
811 ; RV32-NEXT: addi a0, sp, 8
812 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
813 ; RV32-NEXT: vlse64.v v16, (a0), zero
814 ; RV32-NEXT: vsub.vv v8, v8, v16
815 ; RV32-NEXT: addi sp, sp, 16
818 ; RV64-LABEL: vsub_vx_nxv8i64:
820 ; RV64-NEXT: vsetvli a1, zero, e64, m8, ta, ma
821 ; RV64-NEXT: vsub.vx v8, v8, a0
823 %head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
824 %splat = shufflevector <vscale x 8 x i64> %head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
825 %vc = sub <vscale x 8 x i64> %va, %splat
826 ret <vscale x 8 x i64> %vc
829 define <vscale x 8 x i64> @vsub_vx_nxv8i64_0(<vscale x 8 x i64> %va) {
830 ; CHECK-LABEL: vsub_vx_nxv8i64_0:
832 ; CHECK-NEXT: li a0, 1
833 ; CHECK-NEXT: vsetvli a1, zero, e64, m8, ta, ma
834 ; CHECK-NEXT: vsub.vx v8, v8, a0
836 %head = insertelement <vscale x 8 x i64> poison, i64 1, i32 0
837 %splat = shufflevector <vscale x 8 x i64> %head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
838 %vc = sub <vscale x 8 x i64> %va, %splat
839 ret <vscale x 8 x i64> %vc
842 define <vscale x 8 x i64> @vsub_xx_nxv8i64(i64 %a, i64 %b) nounwind {
843 ; RV32-LABEL: vsub_xx_nxv8i64:
845 ; RV32-NEXT: addi sp, sp, -16
846 ; RV32-NEXT: sw a1, 12(sp)
847 ; RV32-NEXT: sw a0, 8(sp)
848 ; RV32-NEXT: addi a0, sp, 8
849 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
850 ; RV32-NEXT: vlse64.v v8, (a0), zero
851 ; RV32-NEXT: sw a3, 4(sp)
852 ; RV32-NEXT: sw a2, 0(sp)
853 ; RV32-NEXT: mv a0, sp
854 ; RV32-NEXT: vlse64.v v16, (a0), zero
855 ; RV32-NEXT: vsub.vv v8, v8, v16
856 ; RV32-NEXT: addi sp, sp, 16
859 ; RV64-LABEL: vsub_xx_nxv8i64:
861 ; RV64-NEXT: sub a0, a0, a1
862 ; RV64-NEXT: vsetvli a1, zero, e64, m8, ta, ma
863 ; RV64-NEXT: vmv.v.x v8, a0
865 %head1 = insertelement <vscale x 8 x i64> poison, i64 %a, i32 0
866 %splat1 = shufflevector <vscale x 8 x i64> %head1, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
867 %head2 = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
868 %splat2 = shufflevector <vscale x 8 x i64> %head2, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
869 %v = sub <vscale x 8 x i64> %splat1, %splat2
870 ret <vscale x 8 x i64> %v
873 define <vscale x 8 x i32> @vsub_vv_mask_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, <vscale x 8 x i1> %mask) {
874 ; CHECK-LABEL: vsub_vv_mask_nxv8i32:
876 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, mu
877 ; CHECK-NEXT: vsub.vv v8, v8, v12, v0.t
880 %vs = select <vscale x 8 x i1> %mask, <vscale x 8 x i32> %vb, <vscale x 8 x i32> zeroinitializer
881 %vc = sub <vscale x 8 x i32> %va, %vs
882 ret <vscale x 8 x i32> %vc
885 define <vscale x 8 x i32> @vsub_vx_mask_nxv8i32(<vscale x 8 x i32> %va, i32 signext %b, <vscale x 8 x i1> %mask) {
886 ; CHECK-LABEL: vsub_vx_mask_nxv8i32:
888 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu
889 ; CHECK-NEXT: vsub.vx v8, v8, a0, v0.t
891 %head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
892 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
893 %vs = select <vscale x 8 x i1> %mask, <vscale x 8 x i32> %splat, <vscale x 8 x i32> zeroinitializer
894 %vc = sub <vscale x 8 x i32> %va, %vs
895 ret <vscale x 8 x i32> %vc
898 define <vscale x 8 x i32> @vsub_vi_mask_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i1> %mask) {
899 ; CHECK-LABEL: vsub_vi_mask_nxv8i32:
901 ; CHECK-NEXT: li a0, 7
902 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu
903 ; CHECK-NEXT: vsub.vx v8, v8, a0, v0.t
905 %head = insertelement <vscale x 8 x i32> poison, i32 7, i32 0
906 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
907 %vs = select <vscale x 8 x i1> %mask, <vscale x 8 x i32> %splat, <vscale x 8 x i32> zeroinitializer
908 %vc = sub <vscale x 8 x i32> %va, %vs
909 ret <vscale x 8 x i32> %vc