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 <8 x i7> @llvm.vp.sub.v8i7(<8 x i7>, <8 x i7>, <8 x i1>, i32)
9 define <8 x i7> @vsub_vv_v8i7(<8 x i7> %va, <8 x i7> %b, <8 x i1> %m, i32 zeroext %evl) {
10 ; CHECK-LABEL: vsub_vv_v8i7:
12 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
13 ; CHECK-NEXT: vsub.vv v8, v8, v9, v0.t
15 %v = call <8 x i7> @llvm.vp.sub.v8i7(<8 x i7> %va, <8 x i7> %b, <8 x i1> %m, i32 %evl)
19 declare <2 x i8> @llvm.vp.sub.v2i8(<2 x i8>, <2 x i8>, <2 x i1>, i32)
21 define <2 x i8> @vsub_vv_v2i8(<2 x i8> %va, <2 x i8> %b, <2 x i1> %m, i32 zeroext %evl) {
22 ; CHECK-LABEL: vsub_vv_v2i8:
24 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
25 ; CHECK-NEXT: vsub.vv v8, v8, v9, v0.t
27 %v = call <2 x i8> @llvm.vp.sub.v2i8(<2 x i8> %va, <2 x i8> %b, <2 x i1> %m, i32 %evl)
31 define <2 x i8> @vsub_vv_v2i8_unmasked(<2 x i8> %va, <2 x i8> %b, i32 zeroext %evl) {
32 ; CHECK-LABEL: vsub_vv_v2i8_unmasked:
34 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
35 ; CHECK-NEXT: vsub.vv v8, v8, v9
37 %v = call <2 x i8> @llvm.vp.sub.v2i8(<2 x i8> %va, <2 x i8> %b, <2 x i1> splat (i1 true), i32 %evl)
41 define <2 x i8> @vsub_vx_v2i8(<2 x i8> %va, i8 %b, <2 x i1> %m, i32 zeroext %evl) {
42 ; CHECK-LABEL: vsub_vx_v2i8:
44 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
45 ; CHECK-NEXT: vsub.vx v8, v8, a0, v0.t
47 %elt.head = insertelement <2 x i8> poison, i8 %b, i32 0
48 %vb = shufflevector <2 x i8> %elt.head, <2 x i8> poison, <2 x i32> zeroinitializer
49 %v = call <2 x i8> @llvm.vp.sub.v2i8(<2 x i8> %va, <2 x i8> %vb, <2 x i1> %m, i32 %evl)
53 define <2 x i8> @vsub_vx_v2i8_unmasked(<2 x i8> %va, i8 %b, i32 zeroext %evl) {
54 ; CHECK-LABEL: vsub_vx_v2i8_unmasked:
56 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
57 ; CHECK-NEXT: vsub.vx v8, v8, a0
59 %elt.head = insertelement <2 x i8> poison, i8 %b, i32 0
60 %vb = shufflevector <2 x i8> %elt.head, <2 x i8> poison, <2 x i32> zeroinitializer
61 %v = call <2 x i8> @llvm.vp.sub.v2i8(<2 x i8> %va, <2 x i8> %vb, <2 x i1> splat (i1 true), i32 %evl)
65 declare <3 x i8> @llvm.vp.sub.v3i8(<3 x i8>, <3 x i8>, <3 x i1>, i32)
67 define <3 x i8> @vsub_vv_v3i8(<3 x i8> %va, <3 x i8> %b, <3 x i1> %m, i32 zeroext %evl) {
68 ; CHECK-LABEL: vsub_vv_v3i8:
70 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
71 ; CHECK-NEXT: vsub.vv v8, v8, v9, v0.t
73 %v = call <3 x i8> @llvm.vp.sub.v3i8(<3 x i8> %va, <3 x i8> %b, <3 x i1> %m, i32 %evl)
77 define <3 x i8> @vsub_vv_v3i8_unmasked(<3 x i8> %va, <3 x i8> %b, i32 zeroext %evl) {
78 ; CHECK-LABEL: vsub_vv_v3i8_unmasked:
80 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
81 ; CHECK-NEXT: vsub.vv v8, v8, v9
83 %v = call <3 x i8> @llvm.vp.sub.v3i8(<3 x i8> %va, <3 x i8> %b, <3 x i1> splat (i1 true), i32 %evl)
87 define <3 x i8> @vsub_vx_v3i8(<3 x i8> %va, i8 %b, <3 x i1> %m, i32 zeroext %evl) {
88 ; CHECK-LABEL: vsub_vx_v3i8:
90 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
91 ; CHECK-NEXT: vsub.vx v8, v8, a0, v0.t
93 %elt.head = insertelement <3 x i8> poison, i8 %b, i32 0
94 %vb = shufflevector <3 x i8> %elt.head, <3 x i8> poison, <3 x i32> zeroinitializer
95 %v = call <3 x i8> @llvm.vp.sub.v3i8(<3 x i8> %va, <3 x i8> %vb, <3 x i1> %m, i32 %evl)
99 define <3 x i8> @vsub_vx_v3i8_unmasked(<3 x i8> %va, i8 %b, i32 zeroext %evl) {
100 ; CHECK-LABEL: vsub_vx_v3i8_unmasked:
102 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
103 ; CHECK-NEXT: vsub.vx v8, v8, a0
105 %elt.head = insertelement <3 x i8> poison, i8 %b, i32 0
106 %vb = shufflevector <3 x i8> %elt.head, <3 x i8> poison, <3 x i32> zeroinitializer
107 %v = call <3 x i8> @llvm.vp.sub.v3i8(<3 x i8> %va, <3 x i8> %vb, <3 x i1> splat (i1 true), i32 %evl)
111 declare <4 x i8> @llvm.vp.sub.v4i8(<4 x i8>, <4 x i8>, <4 x i1>, i32)
113 define <4 x i8> @vsub_vv_v4i8(<4 x i8> %va, <4 x i8> %b, <4 x i1> %m, i32 zeroext %evl) {
114 ; CHECK-LABEL: vsub_vv_v4i8:
116 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
117 ; CHECK-NEXT: vsub.vv v8, v8, v9, v0.t
119 %v = call <4 x i8> @llvm.vp.sub.v4i8(<4 x i8> %va, <4 x i8> %b, <4 x i1> %m, i32 %evl)
123 define <4 x i8> @vsub_vv_v4i8_unmasked(<4 x i8> %va, <4 x i8> %b, i32 zeroext %evl) {
124 ; CHECK-LABEL: vsub_vv_v4i8_unmasked:
126 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
127 ; CHECK-NEXT: vsub.vv v8, v8, v9
129 %v = call <4 x i8> @llvm.vp.sub.v4i8(<4 x i8> %va, <4 x i8> %b, <4 x i1> splat (i1 true), i32 %evl)
133 define <4 x i8> @vsub_vx_v4i8(<4 x i8> %va, i8 %b, <4 x i1> %m, i32 zeroext %evl) {
134 ; CHECK-LABEL: vsub_vx_v4i8:
136 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
137 ; CHECK-NEXT: vsub.vx v8, v8, a0, v0.t
139 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
140 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
141 %v = call <4 x i8> @llvm.vp.sub.v4i8(<4 x i8> %va, <4 x i8> %vb, <4 x i1> %m, i32 %evl)
145 define <4 x i8> @vsub_vx_v4i8_unmasked(<4 x i8> %va, i8 %b, i32 zeroext %evl) {
146 ; CHECK-LABEL: vsub_vx_v4i8_unmasked:
148 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
149 ; CHECK-NEXT: vsub.vx v8, v8, a0
151 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
152 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
153 %v = call <4 x i8> @llvm.vp.sub.v4i8(<4 x i8> %va, <4 x i8> %vb, <4 x i1> splat (i1 true), i32 %evl)
157 declare <8 x i8> @llvm.vp.sub.v8i8(<8 x i8>, <8 x i8>, <8 x i1>, i32)
159 define <8 x i8> @vsub_vv_v8i8(<8 x i8> %va, <8 x i8> %b, <8 x i1> %m, i32 zeroext %evl) {
160 ; CHECK-LABEL: vsub_vv_v8i8:
162 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
163 ; CHECK-NEXT: vsub.vv v8, v8, v9, v0.t
165 %v = call <8 x i8> @llvm.vp.sub.v8i8(<8 x i8> %va, <8 x i8> %b, <8 x i1> %m, i32 %evl)
169 define <8 x i8> @vsub_vv_v8i8_unmasked(<8 x i8> %va, <8 x i8> %b, i32 zeroext %evl) {
170 ; CHECK-LABEL: vsub_vv_v8i8_unmasked:
172 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
173 ; CHECK-NEXT: vsub.vv v8, v8, v9
175 %v = call <8 x i8> @llvm.vp.sub.v8i8(<8 x i8> %va, <8 x i8> %b, <8 x i1> splat (i1 true), i32 %evl)
179 define <8 x i8> @vsub_vx_v8i8(<8 x i8> %va, i8 %b, <8 x i1> %m, i32 zeroext %evl) {
180 ; CHECK-LABEL: vsub_vx_v8i8:
182 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
183 ; CHECK-NEXT: vsub.vx v8, v8, a0, v0.t
185 %elt.head = insertelement <8 x i8> poison, i8 %b, i32 0
186 %vb = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
187 %v = call <8 x i8> @llvm.vp.sub.v8i8(<8 x i8> %va, <8 x i8> %vb, <8 x i1> %m, i32 %evl)
191 define <8 x i8> @vsub_vx_v8i8_unmasked(<8 x i8> %va, i8 %b, i32 zeroext %evl) {
192 ; CHECK-LABEL: vsub_vx_v8i8_unmasked:
194 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
195 ; CHECK-NEXT: vsub.vx v8, v8, a0
197 %elt.head = insertelement <8 x i8> poison, i8 %b, i32 0
198 %vb = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
199 %v = call <8 x i8> @llvm.vp.sub.v8i8(<8 x i8> %va, <8 x i8> %vb, <8 x i1> splat (i1 true), i32 %evl)
203 declare <16 x i8> @llvm.vp.sub.v16i8(<16 x i8>, <16 x i8>, <16 x i1>, i32)
205 define <16 x i8> @vsub_vv_v16i8(<16 x i8> %va, <16 x i8> %b, <16 x i1> %m, i32 zeroext %evl) {
206 ; CHECK-LABEL: vsub_vv_v16i8:
208 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
209 ; CHECK-NEXT: vsub.vv v8, v8, v9, v0.t
211 %v = call <16 x i8> @llvm.vp.sub.v16i8(<16 x i8> %va, <16 x i8> %b, <16 x i1> %m, i32 %evl)
215 define <16 x i8> @vsub_vv_v16i8_unmasked(<16 x i8> %va, <16 x i8> %b, i32 zeroext %evl) {
216 ; CHECK-LABEL: vsub_vv_v16i8_unmasked:
218 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
219 ; CHECK-NEXT: vsub.vv v8, v8, v9
221 %v = call <16 x i8> @llvm.vp.sub.v16i8(<16 x i8> %va, <16 x i8> %b, <16 x i1> splat (i1 true), i32 %evl)
225 define <16 x i8> @vsub_vx_v16i8(<16 x i8> %va, i8 %b, <16 x i1> %m, i32 zeroext %evl) {
226 ; CHECK-LABEL: vsub_vx_v16i8:
228 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
229 ; CHECK-NEXT: vsub.vx v8, v8, a0, v0.t
231 %elt.head = insertelement <16 x i8> poison, i8 %b, i32 0
232 %vb = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
233 %v = call <16 x i8> @llvm.vp.sub.v16i8(<16 x i8> %va, <16 x i8> %vb, <16 x i1> %m, i32 %evl)
237 define <16 x i8> @vsub_vx_v16i8_unmasked(<16 x i8> %va, i8 %b, i32 zeroext %evl) {
238 ; CHECK-LABEL: vsub_vx_v16i8_unmasked:
240 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
241 ; CHECK-NEXT: vsub.vx v8, v8, a0
243 %elt.head = insertelement <16 x i8> poison, i8 %b, i32 0
244 %vb = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
245 %v = call <16 x i8> @llvm.vp.sub.v16i8(<16 x i8> %va, <16 x i8> %vb, <16 x i1> splat (i1 true), i32 %evl)
249 declare <2 x i16> @llvm.vp.sub.v2i16(<2 x i16>, <2 x i16>, <2 x i1>, i32)
251 define <2 x i16> @vsub_vv_v2i16(<2 x i16> %va, <2 x i16> %b, <2 x i1> %m, i32 zeroext %evl) {
252 ; CHECK-LABEL: vsub_vv_v2i16:
254 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
255 ; CHECK-NEXT: vsub.vv v8, v8, v9, v0.t
257 %v = call <2 x i16> @llvm.vp.sub.v2i16(<2 x i16> %va, <2 x i16> %b, <2 x i1> %m, i32 %evl)
261 define <2 x i16> @vsub_vv_v2i16_unmasked(<2 x i16> %va, <2 x i16> %b, i32 zeroext %evl) {
262 ; CHECK-LABEL: vsub_vv_v2i16_unmasked:
264 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
265 ; CHECK-NEXT: vsub.vv v8, v8, v9
267 %v = call <2 x i16> @llvm.vp.sub.v2i16(<2 x i16> %va, <2 x i16> %b, <2 x i1> splat (i1 true), i32 %evl)
271 define <2 x i16> @vsub_vx_v2i16(<2 x i16> %va, i16 %b, <2 x i1> %m, i32 zeroext %evl) {
272 ; CHECK-LABEL: vsub_vx_v2i16:
274 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
275 ; CHECK-NEXT: vsub.vx v8, v8, a0, v0.t
277 %elt.head = insertelement <2 x i16> poison, i16 %b, i32 0
278 %vb = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
279 %v = call <2 x i16> @llvm.vp.sub.v2i16(<2 x i16> %va, <2 x i16> %vb, <2 x i1> %m, i32 %evl)
283 define <2 x i16> @vsub_vx_v2i16_unmasked(<2 x i16> %va, i16 %b, i32 zeroext %evl) {
284 ; CHECK-LABEL: vsub_vx_v2i16_unmasked:
286 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
287 ; CHECK-NEXT: vsub.vx v8, v8, a0
289 %elt.head = insertelement <2 x i16> poison, i16 %b, i32 0
290 %vb = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
291 %v = call <2 x i16> @llvm.vp.sub.v2i16(<2 x i16> %va, <2 x i16> %vb, <2 x i1> splat (i1 true), i32 %evl)
295 declare <4 x i16> @llvm.vp.sub.v4i16(<4 x i16>, <4 x i16>, <4 x i1>, i32)
297 define <4 x i16> @vsub_vv_v4i16(<4 x i16> %va, <4 x i16> %b, <4 x i1> %m, i32 zeroext %evl) {
298 ; CHECK-LABEL: vsub_vv_v4i16:
300 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
301 ; CHECK-NEXT: vsub.vv v8, v8, v9, v0.t
303 %v = call <4 x i16> @llvm.vp.sub.v4i16(<4 x i16> %va, <4 x i16> %b, <4 x i1> %m, i32 %evl)
307 define <4 x i16> @vsub_vv_v4i16_unmasked(<4 x i16> %va, <4 x i16> %b, i32 zeroext %evl) {
308 ; CHECK-LABEL: vsub_vv_v4i16_unmasked:
310 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
311 ; CHECK-NEXT: vsub.vv v8, v8, v9
313 %v = call <4 x i16> @llvm.vp.sub.v4i16(<4 x i16> %va, <4 x i16> %b, <4 x i1> splat (i1 true), i32 %evl)
317 define <4 x i16> @vsub_vx_v4i16(<4 x i16> %va, i16 %b, <4 x i1> %m, i32 zeroext %evl) {
318 ; CHECK-LABEL: vsub_vx_v4i16:
320 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
321 ; CHECK-NEXT: vsub.vx v8, v8, a0, v0.t
323 %elt.head = insertelement <4 x i16> poison, i16 %b, i32 0
324 %vb = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
325 %v = call <4 x i16> @llvm.vp.sub.v4i16(<4 x i16> %va, <4 x i16> %vb, <4 x i1> %m, i32 %evl)
329 define <4 x i16> @vsub_vx_v4i16_unmasked(<4 x i16> %va, i16 %b, i32 zeroext %evl) {
330 ; CHECK-LABEL: vsub_vx_v4i16_unmasked:
332 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
333 ; CHECK-NEXT: vsub.vx v8, v8, a0
335 %elt.head = insertelement <4 x i16> poison, i16 %b, i32 0
336 %vb = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
337 %v = call <4 x i16> @llvm.vp.sub.v4i16(<4 x i16> %va, <4 x i16> %vb, <4 x i1> splat (i1 true), i32 %evl)
341 declare <8 x i16> @llvm.vp.sub.v8i16(<8 x i16>, <8 x i16>, <8 x i1>, i32)
343 define <8 x i16> @vsub_vv_v8i16(<8 x i16> %va, <8 x i16> %b, <8 x i1> %m, i32 zeroext %evl) {
344 ; CHECK-LABEL: vsub_vv_v8i16:
346 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
347 ; CHECK-NEXT: vsub.vv v8, v8, v9, v0.t
349 %v = call <8 x i16> @llvm.vp.sub.v8i16(<8 x i16> %va, <8 x i16> %b, <8 x i1> %m, i32 %evl)
353 define <8 x i16> @vsub_vv_v8i16_unmasked(<8 x i16> %va, <8 x i16> %b, i32 zeroext %evl) {
354 ; CHECK-LABEL: vsub_vv_v8i16_unmasked:
356 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
357 ; CHECK-NEXT: vsub.vv v8, v8, v9
359 %v = call <8 x i16> @llvm.vp.sub.v8i16(<8 x i16> %va, <8 x i16> %b, <8 x i1> splat (i1 true), i32 %evl)
363 define <8 x i16> @vsub_vx_v8i16(<8 x i16> %va, i16 %b, <8 x i1> %m, i32 zeroext %evl) {
364 ; CHECK-LABEL: vsub_vx_v8i16:
366 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
367 ; CHECK-NEXT: vsub.vx v8, v8, a0, v0.t
369 %elt.head = insertelement <8 x i16> poison, i16 %b, i32 0
370 %vb = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
371 %v = call <8 x i16> @llvm.vp.sub.v8i16(<8 x i16> %va, <8 x i16> %vb, <8 x i1> %m, i32 %evl)
375 define <8 x i16> @vsub_vx_v8i16_unmasked(<8 x i16> %va, i16 %b, i32 zeroext %evl) {
376 ; CHECK-LABEL: vsub_vx_v8i16_unmasked:
378 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
379 ; CHECK-NEXT: vsub.vx v8, v8, a0
381 %elt.head = insertelement <8 x i16> poison, i16 %b, i32 0
382 %vb = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
383 %v = call <8 x i16> @llvm.vp.sub.v8i16(<8 x i16> %va, <8 x i16> %vb, <8 x i1> splat (i1 true), i32 %evl)
387 declare <16 x i16> @llvm.vp.sub.v16i16(<16 x i16>, <16 x i16>, <16 x i1>, i32)
389 define <16 x i16> @vsub_vv_v16i16(<16 x i16> %va, <16 x i16> %b, <16 x i1> %m, i32 zeroext %evl) {
390 ; CHECK-LABEL: vsub_vv_v16i16:
392 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
393 ; CHECK-NEXT: vsub.vv v8, v8, v10, v0.t
395 %v = call <16 x i16> @llvm.vp.sub.v16i16(<16 x i16> %va, <16 x i16> %b, <16 x i1> %m, i32 %evl)
399 define <16 x i16> @vsub_vv_v16i16_unmasked(<16 x i16> %va, <16 x i16> %b, i32 zeroext %evl) {
400 ; CHECK-LABEL: vsub_vv_v16i16_unmasked:
402 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
403 ; CHECK-NEXT: vsub.vv v8, v8, v10
405 %v = call <16 x i16> @llvm.vp.sub.v16i16(<16 x i16> %va, <16 x i16> %b, <16 x i1> splat (i1 true), i32 %evl)
409 define <16 x i16> @vsub_vx_v16i16(<16 x i16> %va, i16 %b, <16 x i1> %m, i32 zeroext %evl) {
410 ; CHECK-LABEL: vsub_vx_v16i16:
412 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
413 ; CHECK-NEXT: vsub.vx v8, v8, a0, v0.t
415 %elt.head = insertelement <16 x i16> poison, i16 %b, i32 0
416 %vb = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
417 %v = call <16 x i16> @llvm.vp.sub.v16i16(<16 x i16> %va, <16 x i16> %vb, <16 x i1> %m, i32 %evl)
421 define <16 x i16> @vsub_vx_v16i16_unmasked(<16 x i16> %va, i16 %b, i32 zeroext %evl) {
422 ; CHECK-LABEL: vsub_vx_v16i16_unmasked:
424 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
425 ; CHECK-NEXT: vsub.vx v8, v8, a0
427 %elt.head = insertelement <16 x i16> poison, i16 %b, i32 0
428 %vb = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
429 %v = call <16 x i16> @llvm.vp.sub.v16i16(<16 x i16> %va, <16 x i16> %vb, <16 x i1> splat (i1 true), i32 %evl)
433 declare <2 x i32> @llvm.vp.sub.v2i32(<2 x i32>, <2 x i32>, <2 x i1>, i32)
435 define <2 x i32> @vsub_vv_v2i32(<2 x i32> %va, <2 x i32> %b, <2 x i1> %m, i32 zeroext %evl) {
436 ; CHECK-LABEL: vsub_vv_v2i32:
438 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
439 ; CHECK-NEXT: vsub.vv v8, v8, v9, v0.t
441 %v = call <2 x i32> @llvm.vp.sub.v2i32(<2 x i32> %va, <2 x i32> %b, <2 x i1> %m, i32 %evl)
445 define <2 x i32> @vsub_vv_v2i32_unmasked(<2 x i32> %va, <2 x i32> %b, i32 zeroext %evl) {
446 ; CHECK-LABEL: vsub_vv_v2i32_unmasked:
448 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
449 ; CHECK-NEXT: vsub.vv v8, v8, v9
451 %v = call <2 x i32> @llvm.vp.sub.v2i32(<2 x i32> %va, <2 x i32> %b, <2 x i1> splat (i1 true), i32 %evl)
455 define <2 x i32> @vsub_vx_v2i32(<2 x i32> %va, i32 %b, <2 x i1> %m, i32 zeroext %evl) {
456 ; CHECK-LABEL: vsub_vx_v2i32:
458 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
459 ; CHECK-NEXT: vsub.vx v8, v8, a0, v0.t
461 %elt.head = insertelement <2 x i32> poison, i32 %b, i32 0
462 %vb = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
463 %v = call <2 x i32> @llvm.vp.sub.v2i32(<2 x i32> %va, <2 x i32> %vb, <2 x i1> %m, i32 %evl)
467 define <2 x i32> @vsub_vx_v2i32_unmasked(<2 x i32> %va, i32 %b, i32 zeroext %evl) {
468 ; CHECK-LABEL: vsub_vx_v2i32_unmasked:
470 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
471 ; CHECK-NEXT: vsub.vx v8, v8, a0
473 %elt.head = insertelement <2 x i32> poison, i32 %b, i32 0
474 %vb = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
475 %v = call <2 x i32> @llvm.vp.sub.v2i32(<2 x i32> %va, <2 x i32> %vb, <2 x i1> splat (i1 true), i32 %evl)
479 declare <4 x i32> @llvm.vp.sub.v4i32(<4 x i32>, <4 x i32>, <4 x i1>, i32)
481 define <4 x i32> @vsub_vv_v4i32(<4 x i32> %va, <4 x i32> %b, <4 x i1> %m, i32 zeroext %evl) {
482 ; CHECK-LABEL: vsub_vv_v4i32:
484 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
485 ; CHECK-NEXT: vsub.vv v8, v8, v9, v0.t
487 %v = call <4 x i32> @llvm.vp.sub.v4i32(<4 x i32> %va, <4 x i32> %b, <4 x i1> %m, i32 %evl)
491 define <4 x i32> @vsub_vv_v4i32_unmasked(<4 x i32> %va, <4 x i32> %b, i32 zeroext %evl) {
492 ; CHECK-LABEL: vsub_vv_v4i32_unmasked:
494 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
495 ; CHECK-NEXT: vsub.vv v8, v8, v9
497 %v = call <4 x i32> @llvm.vp.sub.v4i32(<4 x i32> %va, <4 x i32> %b, <4 x i1> splat (i1 true), i32 %evl)
501 define <4 x i32> @vsub_vx_v4i32(<4 x i32> %va, i32 %b, <4 x i1> %m, i32 zeroext %evl) {
502 ; CHECK-LABEL: vsub_vx_v4i32:
504 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
505 ; CHECK-NEXT: vsub.vx v8, v8, a0, v0.t
507 %elt.head = insertelement <4 x i32> poison, i32 %b, i32 0
508 %vb = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
509 %v = call <4 x i32> @llvm.vp.sub.v4i32(<4 x i32> %va, <4 x i32> %vb, <4 x i1> %m, i32 %evl)
513 define <4 x i32> @vsub_vx_v4i32_unmasked(<4 x i32> %va, i32 %b, i32 zeroext %evl) {
514 ; CHECK-LABEL: vsub_vx_v4i32_unmasked:
516 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
517 ; CHECK-NEXT: vsub.vx v8, v8, a0
519 %elt.head = insertelement <4 x i32> poison, i32 %b, i32 0
520 %vb = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
521 %v = call <4 x i32> @llvm.vp.sub.v4i32(<4 x i32> %va, <4 x i32> %vb, <4 x i1> splat (i1 true), i32 %evl)
525 declare <8 x i32> @llvm.vp.sub.v8i32(<8 x i32>, <8 x i32>, <8 x i1>, i32)
527 define <8 x i32> @vsub_vv_v8i32(<8 x i32> %va, <8 x i32> %b, <8 x i1> %m, i32 zeroext %evl) {
528 ; CHECK-LABEL: vsub_vv_v8i32:
530 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
531 ; CHECK-NEXT: vsub.vv v8, v8, v10, v0.t
533 %v = call <8 x i32> @llvm.vp.sub.v8i32(<8 x i32> %va, <8 x i32> %b, <8 x i1> %m, i32 %evl)
537 define <8 x i32> @vsub_vv_v8i32_unmasked(<8 x i32> %va, <8 x i32> %b, i32 zeroext %evl) {
538 ; CHECK-LABEL: vsub_vv_v8i32_unmasked:
540 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
541 ; CHECK-NEXT: vsub.vv v8, v8, v10
543 %v = call <8 x i32> @llvm.vp.sub.v8i32(<8 x i32> %va, <8 x i32> %b, <8 x i1> splat (i1 true), i32 %evl)
547 define <8 x i32> @vsub_vx_v8i32(<8 x i32> %va, i32 %b, <8 x i1> %m, i32 zeroext %evl) {
548 ; CHECK-LABEL: vsub_vx_v8i32:
550 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
551 ; CHECK-NEXT: vsub.vx v8, v8, a0, v0.t
553 %elt.head = insertelement <8 x i32> poison, i32 %b, i32 0
554 %vb = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
555 %v = call <8 x i32> @llvm.vp.sub.v8i32(<8 x i32> %va, <8 x i32> %vb, <8 x i1> %m, i32 %evl)
559 define <8 x i32> @vsub_vx_v8i32_unmasked(<8 x i32> %va, i32 %b, i32 zeroext %evl) {
560 ; CHECK-LABEL: vsub_vx_v8i32_unmasked:
562 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
563 ; CHECK-NEXT: vsub.vx v8, v8, a0
565 %elt.head = insertelement <8 x i32> poison, i32 %b, i32 0
566 %vb = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
567 %v = call <8 x i32> @llvm.vp.sub.v8i32(<8 x i32> %va, <8 x i32> %vb, <8 x i1> splat (i1 true), i32 %evl)
571 declare <16 x i32> @llvm.vp.sub.v16i32(<16 x i32>, <16 x i32>, <16 x i1>, i32)
573 define <16 x i32> @vsub_vv_v16i32(<16 x i32> %va, <16 x i32> %b, <16 x i1> %m, i32 zeroext %evl) {
574 ; CHECK-LABEL: vsub_vv_v16i32:
576 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
577 ; CHECK-NEXT: vsub.vv v8, v8, v12, v0.t
579 %v = call <16 x i32> @llvm.vp.sub.v16i32(<16 x i32> %va, <16 x i32> %b, <16 x i1> %m, i32 %evl)
583 define <16 x i32> @vsub_vv_v16i32_unmasked(<16 x i32> %va, <16 x i32> %b, i32 zeroext %evl) {
584 ; CHECK-LABEL: vsub_vv_v16i32_unmasked:
586 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
587 ; CHECK-NEXT: vsub.vv v8, v8, v12
589 %v = call <16 x i32> @llvm.vp.sub.v16i32(<16 x i32> %va, <16 x i32> %b, <16 x i1> splat (i1 true), i32 %evl)
593 define <16 x i32> @vsub_vx_v16i32(<16 x i32> %va, i32 %b, <16 x i1> %m, i32 zeroext %evl) {
594 ; CHECK-LABEL: vsub_vx_v16i32:
596 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
597 ; CHECK-NEXT: vsub.vx v8, v8, a0, v0.t
599 %elt.head = insertelement <16 x i32> poison, i32 %b, i32 0
600 %vb = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
601 %v = call <16 x i32> @llvm.vp.sub.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i1> %m, i32 %evl)
605 define <16 x i32> @vsub_vx_v16i32_unmasked(<16 x i32> %va, i32 %b, i32 zeroext %evl) {
606 ; CHECK-LABEL: vsub_vx_v16i32_unmasked:
608 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
609 ; CHECK-NEXT: vsub.vx v8, v8, a0
611 %elt.head = insertelement <16 x i32> poison, i32 %b, i32 0
612 %vb = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
613 %v = call <16 x i32> @llvm.vp.sub.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i1> splat (i1 true), i32 %evl)
617 declare <2 x i64> @llvm.vp.sub.v2i64(<2 x i64>, <2 x i64>, <2 x i1>, i32)
619 define <2 x i64> @vsub_vv_v2i64(<2 x i64> %va, <2 x i64> %b, <2 x i1> %m, i32 zeroext %evl) {
620 ; CHECK-LABEL: vsub_vv_v2i64:
622 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
623 ; CHECK-NEXT: vsub.vv v8, v8, v9, v0.t
625 %v = call <2 x i64> @llvm.vp.sub.v2i64(<2 x i64> %va, <2 x i64> %b, <2 x i1> %m, i32 %evl)
629 define <2 x i64> @vsub_vv_v2i64_unmasked(<2 x i64> %va, <2 x i64> %b, i32 zeroext %evl) {
630 ; CHECK-LABEL: vsub_vv_v2i64_unmasked:
632 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
633 ; CHECK-NEXT: vsub.vv v8, v8, v9
635 %v = call <2 x i64> @llvm.vp.sub.v2i64(<2 x i64> %va, <2 x i64> %b, <2 x i1> splat (i1 true), i32 %evl)
639 define <2 x i64> @vsub_vx_v2i64(<2 x i64> %va, i64 %b, <2 x i1> %m, i32 zeroext %evl) {
640 ; RV32-LABEL: vsub_vx_v2i64:
642 ; RV32-NEXT: addi sp, sp, -16
643 ; RV32-NEXT: .cfi_def_cfa_offset 16
644 ; RV32-NEXT: sw a1, 12(sp)
645 ; RV32-NEXT: sw a0, 8(sp)
646 ; RV32-NEXT: addi a0, sp, 8
647 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
648 ; RV32-NEXT: vlse64.v v9, (a0), zero
649 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
650 ; RV32-NEXT: vsub.vv v8, v8, v9, v0.t
651 ; RV32-NEXT: addi sp, sp, 16
654 ; RV64-LABEL: vsub_vx_v2i64:
656 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
657 ; RV64-NEXT: vsub.vx v8, v8, a0, v0.t
659 %elt.head = insertelement <2 x i64> poison, i64 %b, i32 0
660 %vb = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
661 %v = call <2 x i64> @llvm.vp.sub.v2i64(<2 x i64> %va, <2 x i64> %vb, <2 x i1> %m, i32 %evl)
665 define <2 x i64> @vsub_vx_v2i64_unmasked(<2 x i64> %va, i64 %b, i32 zeroext %evl) {
666 ; RV32-LABEL: vsub_vx_v2i64_unmasked:
668 ; RV32-NEXT: addi sp, sp, -16
669 ; RV32-NEXT: .cfi_def_cfa_offset 16
670 ; RV32-NEXT: sw a1, 12(sp)
671 ; RV32-NEXT: sw a0, 8(sp)
672 ; RV32-NEXT: addi a0, sp, 8
673 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
674 ; RV32-NEXT: vlse64.v v9, (a0), zero
675 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
676 ; RV32-NEXT: vsub.vv v8, v8, v9
677 ; RV32-NEXT: addi sp, sp, 16
680 ; RV64-LABEL: vsub_vx_v2i64_unmasked:
682 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
683 ; RV64-NEXT: vsub.vx v8, v8, a0
685 %elt.head = insertelement <2 x i64> poison, i64 %b, i32 0
686 %vb = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
687 %v = call <2 x i64> @llvm.vp.sub.v2i64(<2 x i64> %va, <2 x i64> %vb, <2 x i1> splat (i1 true), i32 %evl)
691 declare <4 x i64> @llvm.vp.sub.v4i64(<4 x i64>, <4 x i64>, <4 x i1>, i32)
693 define <4 x i64> @vsub_vv_v4i64(<4 x i64> %va, <4 x i64> %b, <4 x i1> %m, i32 zeroext %evl) {
694 ; CHECK-LABEL: vsub_vv_v4i64:
696 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
697 ; CHECK-NEXT: vsub.vv v8, v8, v10, v0.t
699 %v = call <4 x i64> @llvm.vp.sub.v4i64(<4 x i64> %va, <4 x i64> %b, <4 x i1> %m, i32 %evl)
703 define <4 x i64> @vsub_vv_v4i64_unmasked(<4 x i64> %va, <4 x i64> %b, i32 zeroext %evl) {
704 ; CHECK-LABEL: vsub_vv_v4i64_unmasked:
706 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
707 ; CHECK-NEXT: vsub.vv v8, v8, v10
709 %v = call <4 x i64> @llvm.vp.sub.v4i64(<4 x i64> %va, <4 x i64> %b, <4 x i1> splat (i1 true), i32 %evl)
713 define <4 x i64> @vsub_vx_v4i64(<4 x i64> %va, i64 %b, <4 x i1> %m, i32 zeroext %evl) {
714 ; RV32-LABEL: vsub_vx_v4i64:
716 ; RV32-NEXT: addi sp, sp, -16
717 ; RV32-NEXT: .cfi_def_cfa_offset 16
718 ; RV32-NEXT: sw a1, 12(sp)
719 ; RV32-NEXT: sw a0, 8(sp)
720 ; RV32-NEXT: addi a0, sp, 8
721 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
722 ; RV32-NEXT: vlse64.v v10, (a0), zero
723 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
724 ; RV32-NEXT: vsub.vv v8, v8, v10, v0.t
725 ; RV32-NEXT: addi sp, sp, 16
728 ; RV64-LABEL: vsub_vx_v4i64:
730 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
731 ; RV64-NEXT: vsub.vx v8, v8, a0, v0.t
733 %elt.head = insertelement <4 x i64> poison, i64 %b, i32 0
734 %vb = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
735 %v = call <4 x i64> @llvm.vp.sub.v4i64(<4 x i64> %va, <4 x i64> %vb, <4 x i1> %m, i32 %evl)
739 define <4 x i64> @vsub_vx_v4i64_unmasked(<4 x i64> %va, i64 %b, i32 zeroext %evl) {
740 ; RV32-LABEL: vsub_vx_v4i64_unmasked:
742 ; RV32-NEXT: addi sp, sp, -16
743 ; RV32-NEXT: .cfi_def_cfa_offset 16
744 ; RV32-NEXT: sw a1, 12(sp)
745 ; RV32-NEXT: sw a0, 8(sp)
746 ; RV32-NEXT: addi a0, sp, 8
747 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
748 ; RV32-NEXT: vlse64.v v10, (a0), zero
749 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
750 ; RV32-NEXT: vsub.vv v8, v8, v10
751 ; RV32-NEXT: addi sp, sp, 16
754 ; RV64-LABEL: vsub_vx_v4i64_unmasked:
756 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
757 ; RV64-NEXT: vsub.vx v8, v8, a0
759 %elt.head = insertelement <4 x i64> poison, i64 %b, i32 0
760 %vb = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
761 %v = call <4 x i64> @llvm.vp.sub.v4i64(<4 x i64> %va, <4 x i64> %vb, <4 x i1> splat (i1 true), i32 %evl)
765 declare <8 x i64> @llvm.vp.sub.v8i64(<8 x i64>, <8 x i64>, <8 x i1>, i32)
767 define <8 x i64> @vsub_vv_v8i64(<8 x i64> %va, <8 x i64> %b, <8 x i1> %m, i32 zeroext %evl) {
768 ; CHECK-LABEL: vsub_vv_v8i64:
770 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
771 ; CHECK-NEXT: vsub.vv v8, v8, v12, v0.t
773 %v = call <8 x i64> @llvm.vp.sub.v8i64(<8 x i64> %va, <8 x i64> %b, <8 x i1> %m, i32 %evl)
777 define <8 x i64> @vsub_vv_v8i64_unmasked(<8 x i64> %va, <8 x i64> %b, i32 zeroext %evl) {
778 ; CHECK-LABEL: vsub_vv_v8i64_unmasked:
780 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
781 ; CHECK-NEXT: vsub.vv v8, v8, v12
783 %v = call <8 x i64> @llvm.vp.sub.v8i64(<8 x i64> %va, <8 x i64> %b, <8 x i1> splat (i1 true), i32 %evl)
787 define <8 x i64> @vsub_vx_v8i64(<8 x i64> %va, i64 %b, <8 x i1> %m, i32 zeroext %evl) {
788 ; RV32-LABEL: vsub_vx_v8i64:
790 ; RV32-NEXT: addi sp, sp, -16
791 ; RV32-NEXT: .cfi_def_cfa_offset 16
792 ; RV32-NEXT: sw a1, 12(sp)
793 ; RV32-NEXT: sw a0, 8(sp)
794 ; RV32-NEXT: addi a0, sp, 8
795 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
796 ; RV32-NEXT: vlse64.v v12, (a0), zero
797 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
798 ; RV32-NEXT: vsub.vv v8, v8, v12, v0.t
799 ; RV32-NEXT: addi sp, sp, 16
802 ; RV64-LABEL: vsub_vx_v8i64:
804 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
805 ; RV64-NEXT: vsub.vx v8, v8, a0, v0.t
807 %elt.head = insertelement <8 x i64> poison, i64 %b, i32 0
808 %vb = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
809 %v = call <8 x i64> @llvm.vp.sub.v8i64(<8 x i64> %va, <8 x i64> %vb, <8 x i1> %m, i32 %evl)
813 define <8 x i64> @vsub_vx_v8i64_unmasked(<8 x i64> %va, i64 %b, i32 zeroext %evl) {
814 ; RV32-LABEL: vsub_vx_v8i64_unmasked:
816 ; RV32-NEXT: addi sp, sp, -16
817 ; RV32-NEXT: .cfi_def_cfa_offset 16
818 ; RV32-NEXT: sw a1, 12(sp)
819 ; RV32-NEXT: sw a0, 8(sp)
820 ; RV32-NEXT: addi a0, sp, 8
821 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
822 ; RV32-NEXT: vlse64.v v12, (a0), zero
823 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
824 ; RV32-NEXT: vsub.vv v8, v8, v12
825 ; RV32-NEXT: addi sp, sp, 16
828 ; RV64-LABEL: vsub_vx_v8i64_unmasked:
830 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
831 ; RV64-NEXT: vsub.vx v8, v8, a0
833 %elt.head = insertelement <8 x i64> poison, i64 %b, i32 0
834 %vb = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
835 %v = call <8 x i64> @llvm.vp.sub.v8i64(<8 x i64> %va, <8 x i64> %vb, <8 x i1> splat (i1 true), i32 %evl)
839 declare <16 x i64> @llvm.vp.sub.v16i64(<16 x i64>, <16 x i64>, <16 x i1>, i32)
841 define <16 x i64> @vsub_vv_v16i64(<16 x i64> %va, <16 x i64> %b, <16 x i1> %m, i32 zeroext %evl) {
842 ; CHECK-LABEL: vsub_vv_v16i64:
844 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
845 ; CHECK-NEXT: vsub.vv v8, v8, v16, v0.t
847 %v = call <16 x i64> @llvm.vp.sub.v16i64(<16 x i64> %va, <16 x i64> %b, <16 x i1> %m, i32 %evl)
851 define <16 x i64> @vsub_vv_v16i64_unmasked(<16 x i64> %va, <16 x i64> %b, i32 zeroext %evl) {
852 ; CHECK-LABEL: vsub_vv_v16i64_unmasked:
854 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
855 ; CHECK-NEXT: vsub.vv v8, v8, v16
857 %v = call <16 x i64> @llvm.vp.sub.v16i64(<16 x i64> %va, <16 x i64> %b, <16 x i1> splat (i1 true), i32 %evl)
861 define <16 x i64> @vsub_vx_v16i64(<16 x i64> %va, i64 %b, <16 x i1> %m, i32 zeroext %evl) {
862 ; RV32-LABEL: vsub_vx_v16i64:
864 ; RV32-NEXT: addi sp, sp, -16
865 ; RV32-NEXT: .cfi_def_cfa_offset 16
866 ; RV32-NEXT: sw a1, 12(sp)
867 ; RV32-NEXT: sw a0, 8(sp)
868 ; RV32-NEXT: addi a0, sp, 8
869 ; RV32-NEXT: vsetivli zero, 16, e64, m8, ta, ma
870 ; RV32-NEXT: vlse64.v v16, (a0), zero
871 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
872 ; RV32-NEXT: vsub.vv v8, v8, v16, v0.t
873 ; RV32-NEXT: addi sp, sp, 16
876 ; RV64-LABEL: vsub_vx_v16i64:
878 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
879 ; RV64-NEXT: vsub.vx v8, v8, a0, v0.t
881 %elt.head = insertelement <16 x i64> poison, i64 %b, i32 0
882 %vb = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
883 %v = call <16 x i64> @llvm.vp.sub.v16i64(<16 x i64> %va, <16 x i64> %vb, <16 x i1> %m, i32 %evl)
887 define <16 x i64> @vsub_vx_v16i64_unmasked(<16 x i64> %va, i64 %b, i32 zeroext %evl) {
888 ; RV32-LABEL: vsub_vx_v16i64_unmasked:
890 ; RV32-NEXT: addi sp, sp, -16
891 ; RV32-NEXT: .cfi_def_cfa_offset 16
892 ; RV32-NEXT: sw a1, 12(sp)
893 ; RV32-NEXT: sw a0, 8(sp)
894 ; RV32-NEXT: addi a0, sp, 8
895 ; RV32-NEXT: vsetivli zero, 16, e64, m8, ta, ma
896 ; RV32-NEXT: vlse64.v v16, (a0), zero
897 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
898 ; RV32-NEXT: vsub.vv v8, v8, v16
899 ; RV32-NEXT: addi sp, sp, 16
902 ; RV64-LABEL: vsub_vx_v16i64_unmasked:
904 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
905 ; RV64-NEXT: vsub.vx v8, v8, a0
907 %elt.head = insertelement <16 x i64> poison, i64 %b, i32 0
908 %vb = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
909 %v = call <16 x i64> @llvm.vp.sub.v16i64(<16 x i64> %va, <16 x i64> %vb, <16 x i1> splat (i1 true), i32 %evl)