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 <2 x i8> @llvm.vp.sub.v2i8(<2 x i8>, <2 x i8>, <2 x i1>, i32)
9 define <2 x i8> @vrsub_vx_v2i8(<2 x i8> %va, i8 %b, <2 x i1> %m, i32 zeroext %evl) {
10 ; CHECK-LABEL: vrsub_vx_v2i8:
12 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
13 ; CHECK-NEXT: vrsub.vx v8, v8, a0, v0.t
15 %elt.head = insertelement <2 x i8> poison, i8 %b, i32 0
16 %vb = shufflevector <2 x i8> %elt.head, <2 x i8> poison, <2 x i32> zeroinitializer
17 %v = call <2 x i8> @llvm.vp.sub.v2i8(<2 x i8> %vb, <2 x i8> %va, <2 x i1> %m, i32 %evl)
21 define <2 x i8> @vrsub_vx_v2i8_unmasked(<2 x i8> %va, i8 %b, i32 zeroext %evl) {
22 ; CHECK-LABEL: vrsub_vx_v2i8_unmasked:
24 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
25 ; CHECK-NEXT: vrsub.vx v8, v8, a0
27 %elt.head = insertelement <2 x i8> poison, i8 %b, i32 0
28 %vb = shufflevector <2 x i8> %elt.head, <2 x i8> poison, <2 x i32> zeroinitializer
29 %head = insertelement <2 x i1> poison, i1 true, i32 0
30 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
31 %v = call <2 x i8> @llvm.vp.sub.v2i8(<2 x i8> %vb, <2 x i8> %va, <2 x i1> %m, i32 %evl)
35 define <2 x i8> @vrsub_vi_v2i8(<2 x i8> %va, <2 x i1> %m, i32 zeroext %evl) {
36 ; CHECK-LABEL: vrsub_vi_v2i8:
38 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
39 ; CHECK-NEXT: vrsub.vi v8, v8, 2, v0.t
41 %elt.head = insertelement <2 x i8> poison, i8 2, i32 0
42 %vb = shufflevector <2 x i8> %elt.head, <2 x i8> poison, <2 x i32> zeroinitializer
43 %v = call <2 x i8> @llvm.vp.sub.v2i8(<2 x i8> %vb, <2 x i8> %va, <2 x i1> %m, i32 %evl)
47 define <2 x i8> @vrsub_vi_v2i8_unmasked(<2 x i8> %va, i32 zeroext %evl) {
48 ; CHECK-LABEL: vrsub_vi_v2i8_unmasked:
50 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
51 ; CHECK-NEXT: vrsub.vi v8, v8, 2
53 %elt.head = insertelement <2 x i8> poison, i8 2, i32 0
54 %vb = shufflevector <2 x i8> %elt.head, <2 x i8> poison, <2 x i32> zeroinitializer
55 %head = insertelement <2 x i1> poison, i1 true, i32 0
56 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
57 %v = call <2 x i8> @llvm.vp.sub.v2i8(<2 x i8> %vb, <2 x i8> %va, <2 x i1> %m, i32 %evl)
61 declare <4 x i8> @llvm.vp.sub.v4i8(<4 x i8>, <4 x i8>, <4 x i1>, i32)
63 define <4 x i8> @vrsub_vx_v4i8(<4 x i8> %va, i8 %b, <4 x i1> %m, i32 zeroext %evl) {
64 ; CHECK-LABEL: vrsub_vx_v4i8:
66 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
67 ; CHECK-NEXT: vrsub.vx v8, v8, a0, v0.t
69 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
70 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
71 %v = call <4 x i8> @llvm.vp.sub.v4i8(<4 x i8> %vb, <4 x i8> %va, <4 x i1> %m, i32 %evl)
75 define <4 x i8> @vrsub_vx_v4i8_unmasked(<4 x i8> %va, i8 %b, i32 zeroext %evl) {
76 ; CHECK-LABEL: vrsub_vx_v4i8_unmasked:
78 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
79 ; CHECK-NEXT: vrsub.vx v8, v8, a0
81 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
82 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
83 %head = insertelement <4 x i1> poison, i1 true, i32 0
84 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
85 %v = call <4 x i8> @llvm.vp.sub.v4i8(<4 x i8> %vb, <4 x i8> %va, <4 x i1> %m, i32 %evl)
89 define <4 x i8> @vrsub_vi_v4i8(<4 x i8> %va, <4 x i1> %m, i32 zeroext %evl) {
90 ; CHECK-LABEL: vrsub_vi_v4i8:
92 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
93 ; CHECK-NEXT: vrsub.vi v8, v8, 2, v0.t
95 %elt.head = insertelement <4 x i8> poison, i8 2, i32 0
96 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
97 %v = call <4 x i8> @llvm.vp.sub.v4i8(<4 x i8> %vb, <4 x i8> %va, <4 x i1> %m, i32 %evl)
101 define <4 x i8> @vrsub_vi_v4i8_unmasked(<4 x i8> %va, i32 zeroext %evl) {
102 ; CHECK-LABEL: vrsub_vi_v4i8_unmasked:
104 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
105 ; CHECK-NEXT: vrsub.vi v8, v8, 2
107 %elt.head = insertelement <4 x i8> poison, i8 2, i32 0
108 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
109 %head = insertelement <4 x i1> poison, i1 true, i32 0
110 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
111 %v = call <4 x i8> @llvm.vp.sub.v4i8(<4 x i8> %vb, <4 x i8> %va, <4 x i1> %m, i32 %evl)
115 declare <8 x i8> @llvm.vp.sub.v8i8(<8 x i8>, <8 x i8>, <8 x i1>, i32)
117 define <8 x i8> @vrsub_vx_v8i8(<8 x i8> %va, i8 %b, <8 x i1> %m, i32 zeroext %evl) {
118 ; CHECK-LABEL: vrsub_vx_v8i8:
120 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
121 ; CHECK-NEXT: vrsub.vx v8, v8, a0, v0.t
123 %elt.head = insertelement <8 x i8> poison, i8 %b, i32 0
124 %vb = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
125 %v = call <8 x i8> @llvm.vp.sub.v8i8(<8 x i8> %vb, <8 x i8> %va, <8 x i1> %m, i32 %evl)
129 define <8 x i8> @vrsub_vx_v8i8_unmasked(<8 x i8> %va, i8 %b, i32 zeroext %evl) {
130 ; CHECK-LABEL: vrsub_vx_v8i8_unmasked:
132 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
133 ; CHECK-NEXT: vrsub.vx v8, v8, a0
135 %elt.head = insertelement <8 x i8> poison, i8 %b, i32 0
136 %vb = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
137 %head = insertelement <8 x i1> poison, i1 true, i32 0
138 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
139 %v = call <8 x i8> @llvm.vp.sub.v8i8(<8 x i8> %vb, <8 x i8> %va, <8 x i1> %m, i32 %evl)
143 define <8 x i8> @vrsub_vi_v8i8(<8 x i8> %va, <8 x i1> %m, i32 zeroext %evl) {
144 ; CHECK-LABEL: vrsub_vi_v8i8:
146 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
147 ; CHECK-NEXT: vrsub.vi v8, v8, 2, v0.t
149 %elt.head = insertelement <8 x i8> poison, i8 2, i32 0
150 %vb = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
151 %v = call <8 x i8> @llvm.vp.sub.v8i8(<8 x i8> %vb, <8 x i8> %va, <8 x i1> %m, i32 %evl)
155 define <8 x i8> @vrsub_vi_v8i8_unmasked(<8 x i8> %va, i32 zeroext %evl) {
156 ; CHECK-LABEL: vrsub_vi_v8i8_unmasked:
158 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
159 ; CHECK-NEXT: vrsub.vi v8, v8, 2
161 %elt.head = insertelement <8 x i8> poison, i8 2, i32 0
162 %vb = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
163 %head = insertelement <8 x i1> poison, i1 true, i32 0
164 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
165 %v = call <8 x i8> @llvm.vp.sub.v8i8(<8 x i8> %vb, <8 x i8> %va, <8 x i1> %m, i32 %evl)
169 declare <16 x i8> @llvm.vp.sub.v16i8(<16 x i8>, <16 x i8>, <16 x i1>, i32)
171 define <16 x i8> @vrsub_vx_v16i8(<16 x i8> %va, i8 %b, <16 x i1> %m, i32 zeroext %evl) {
172 ; CHECK-LABEL: vrsub_vx_v16i8:
174 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
175 ; CHECK-NEXT: vrsub.vx v8, v8, a0, v0.t
177 %elt.head = insertelement <16 x i8> poison, i8 %b, i32 0
178 %vb = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
179 %v = call <16 x i8> @llvm.vp.sub.v16i8(<16 x i8> %vb, <16 x i8> %va, <16 x i1> %m, i32 %evl)
183 define <16 x i8> @vrsub_vx_v16i8_unmasked(<16 x i8> %va, i8 %b, i32 zeroext %evl) {
184 ; CHECK-LABEL: vrsub_vx_v16i8_unmasked:
186 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
187 ; CHECK-NEXT: vrsub.vx v8, v8, a0
189 %elt.head = insertelement <16 x i8> poison, i8 %b, i32 0
190 %vb = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
191 %head = insertelement <16 x i1> poison, i1 true, i32 0
192 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
193 %v = call <16 x i8> @llvm.vp.sub.v16i8(<16 x i8> %vb, <16 x i8> %va, <16 x i1> %m, i32 %evl)
197 define <16 x i8> @vrsub_vi_v16i8(<16 x i8> %va, <16 x i1> %m, i32 zeroext %evl) {
198 ; CHECK-LABEL: vrsub_vi_v16i8:
200 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
201 ; CHECK-NEXT: vrsub.vi v8, v8, 2, v0.t
203 %elt.head = insertelement <16 x i8> poison, i8 2, i32 0
204 %vb = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
205 %v = call <16 x i8> @llvm.vp.sub.v16i8(<16 x i8> %vb, <16 x i8> %va, <16 x i1> %m, i32 %evl)
209 define <16 x i8> @vrsub_vi_v16i8_unmasked(<16 x i8> %va, i32 zeroext %evl) {
210 ; CHECK-LABEL: vrsub_vi_v16i8_unmasked:
212 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
213 ; CHECK-NEXT: vrsub.vi v8, v8, 2
215 %elt.head = insertelement <16 x i8> poison, i8 2, i32 0
216 %vb = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
217 %head = insertelement <16 x i1> poison, i1 true, i32 0
218 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
219 %v = call <16 x i8> @llvm.vp.sub.v16i8(<16 x i8> %vb, <16 x i8> %va, <16 x i1> %m, i32 %evl)
223 declare <2 x i16> @llvm.vp.sub.v2i16(<2 x i16>, <2 x i16>, <2 x i1>, i32)
225 define <2 x i16> @vrsub_vx_v2i16(<2 x i16> %va, i16 %b, <2 x i1> %m, i32 zeroext %evl) {
226 ; CHECK-LABEL: vrsub_vx_v2i16:
228 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
229 ; CHECK-NEXT: vrsub.vx v8, v8, a0, v0.t
231 %elt.head = insertelement <2 x i16> poison, i16 %b, i32 0
232 %vb = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
233 %v = call <2 x i16> @llvm.vp.sub.v2i16(<2 x i16> %vb, <2 x i16> %va, <2 x i1> %m, i32 %evl)
237 define <2 x i16> @vrsub_vx_v2i16_unmasked(<2 x i16> %va, i16 %b, i32 zeroext %evl) {
238 ; CHECK-LABEL: vrsub_vx_v2i16_unmasked:
240 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
241 ; CHECK-NEXT: vrsub.vx v8, v8, a0
243 %elt.head = insertelement <2 x i16> poison, i16 %b, i32 0
244 %vb = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
245 %head = insertelement <2 x i1> poison, i1 true, i32 0
246 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
247 %v = call <2 x i16> @llvm.vp.sub.v2i16(<2 x i16> %vb, <2 x i16> %va, <2 x i1> %m, i32 %evl)
251 define <2 x i16> @vrsub_vi_v2i16(<2 x i16> %va, <2 x i1> %m, i32 zeroext %evl) {
252 ; CHECK-LABEL: vrsub_vi_v2i16:
254 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
255 ; CHECK-NEXT: vrsub.vi v8, v8, 2, v0.t
257 %elt.head = insertelement <2 x i16> poison, i16 2, i32 0
258 %vb = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
259 %v = call <2 x i16> @llvm.vp.sub.v2i16(<2 x i16> %vb, <2 x i16> %va, <2 x i1> %m, i32 %evl)
263 define <2 x i16> @vrsub_vi_v2i16_unmasked(<2 x i16> %va, i32 zeroext %evl) {
264 ; CHECK-LABEL: vrsub_vi_v2i16_unmasked:
266 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
267 ; CHECK-NEXT: vrsub.vi v8, v8, 2
269 %elt.head = insertelement <2 x i16> poison, i16 2, i32 0
270 %vb = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
271 %head = insertelement <2 x i1> poison, i1 true, i32 0
272 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
273 %v = call <2 x i16> @llvm.vp.sub.v2i16(<2 x i16> %vb, <2 x i16> %va, <2 x i1> %m, i32 %evl)
277 declare <4 x i16> @llvm.vp.sub.v4i16(<4 x i16>, <4 x i16>, <4 x i1>, i32)
279 define <4 x i16> @vrsub_vx_v4i16(<4 x i16> %va, i16 %b, <4 x i1> %m, i32 zeroext %evl) {
280 ; CHECK-LABEL: vrsub_vx_v4i16:
282 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
283 ; CHECK-NEXT: vrsub.vx v8, v8, a0, v0.t
285 %elt.head = insertelement <4 x i16> poison, i16 %b, i32 0
286 %vb = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
287 %v = call <4 x i16> @llvm.vp.sub.v4i16(<4 x i16> %vb, <4 x i16> %va, <4 x i1> %m, i32 %evl)
291 define <4 x i16> @vrsub_vx_v4i16_unmasked(<4 x i16> %va, i16 %b, i32 zeroext %evl) {
292 ; CHECK-LABEL: vrsub_vx_v4i16_unmasked:
294 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
295 ; CHECK-NEXT: vrsub.vx v8, v8, a0
297 %elt.head = insertelement <4 x i16> poison, i16 %b, i32 0
298 %vb = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
299 %head = insertelement <4 x i1> poison, i1 true, i32 0
300 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
301 %v = call <4 x i16> @llvm.vp.sub.v4i16(<4 x i16> %vb, <4 x i16> %va, <4 x i1> %m, i32 %evl)
305 define <4 x i16> @vrsub_vi_v4i16(<4 x i16> %va, <4 x i1> %m, i32 zeroext %evl) {
306 ; CHECK-LABEL: vrsub_vi_v4i16:
308 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
309 ; CHECK-NEXT: vrsub.vi v8, v8, 2, v0.t
311 %elt.head = insertelement <4 x i16> poison, i16 2, i32 0
312 %vb = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
313 %v = call <4 x i16> @llvm.vp.sub.v4i16(<4 x i16> %vb, <4 x i16> %va, <4 x i1> %m, i32 %evl)
317 define <4 x i16> @vrsub_vi_v4i16_unmasked(<4 x i16> %va, i32 zeroext %evl) {
318 ; CHECK-LABEL: vrsub_vi_v4i16_unmasked:
320 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
321 ; CHECK-NEXT: vrsub.vi v8, v8, 2
323 %elt.head = insertelement <4 x i16> poison, i16 2, i32 0
324 %vb = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
325 %head = insertelement <4 x i1> poison, i1 true, i32 0
326 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
327 %v = call <4 x i16> @llvm.vp.sub.v4i16(<4 x i16> %vb, <4 x i16> %va, <4 x i1> %m, i32 %evl)
331 declare <8 x i16> @llvm.vp.sub.v8i16(<8 x i16>, <8 x i16>, <8 x i1>, i32)
333 define <8 x i16> @vrsub_vx_v8i16(<8 x i16> %va, i16 %b, <8 x i1> %m, i32 zeroext %evl) {
334 ; CHECK-LABEL: vrsub_vx_v8i16:
336 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
337 ; CHECK-NEXT: vrsub.vx v8, v8, a0, v0.t
339 %elt.head = insertelement <8 x i16> poison, i16 %b, i32 0
340 %vb = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
341 %v = call <8 x i16> @llvm.vp.sub.v8i16(<8 x i16> %vb, <8 x i16> %va, <8 x i1> %m, i32 %evl)
345 define <8 x i16> @vrsub_vx_v8i16_unmasked(<8 x i16> %va, i16 %b, i32 zeroext %evl) {
346 ; CHECK-LABEL: vrsub_vx_v8i16_unmasked:
348 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
349 ; CHECK-NEXT: vrsub.vx v8, v8, a0
351 %elt.head = insertelement <8 x i16> poison, i16 %b, i32 0
352 %vb = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
353 %head = insertelement <8 x i1> poison, i1 true, i32 0
354 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
355 %v = call <8 x i16> @llvm.vp.sub.v8i16(<8 x i16> %vb, <8 x i16> %va, <8 x i1> %m, i32 %evl)
359 define <8 x i16> @vrsub_vi_v8i16(<8 x i16> %va, <8 x i1> %m, i32 zeroext %evl) {
360 ; CHECK-LABEL: vrsub_vi_v8i16:
362 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
363 ; CHECK-NEXT: vrsub.vi v8, v8, 2, v0.t
365 %elt.head = insertelement <8 x i16> poison, i16 2, i32 0
366 %vb = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
367 %v = call <8 x i16> @llvm.vp.sub.v8i16(<8 x i16> %vb, <8 x i16> %va, <8 x i1> %m, i32 %evl)
371 define <8 x i16> @vrsub_vi_v8i16_unmasked(<8 x i16> %va, i32 zeroext %evl) {
372 ; CHECK-LABEL: vrsub_vi_v8i16_unmasked:
374 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
375 ; CHECK-NEXT: vrsub.vi v8, v8, 2
377 %elt.head = insertelement <8 x i16> poison, i16 2, i32 0
378 %vb = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
379 %head = insertelement <8 x i1> poison, i1 true, i32 0
380 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
381 %v = call <8 x i16> @llvm.vp.sub.v8i16(<8 x i16> %vb, <8 x i16> %va, <8 x i1> %m, i32 %evl)
385 declare <16 x i16> @llvm.vp.sub.v16i16(<16 x i16>, <16 x i16>, <16 x i1>, i32)
387 define <16 x i16> @vrsub_vx_v16i16(<16 x i16> %va, i16 %b, <16 x i1> %m, i32 zeroext %evl) {
388 ; CHECK-LABEL: vrsub_vx_v16i16:
390 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
391 ; CHECK-NEXT: vrsub.vx v8, v8, a0, v0.t
393 %elt.head = insertelement <16 x i16> poison, i16 %b, i32 0
394 %vb = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
395 %v = call <16 x i16> @llvm.vp.sub.v16i16(<16 x i16> %vb, <16 x i16> %va, <16 x i1> %m, i32 %evl)
399 define <16 x i16> @vrsub_vx_v16i16_unmasked(<16 x i16> %va, i16 %b, i32 zeroext %evl) {
400 ; CHECK-LABEL: vrsub_vx_v16i16_unmasked:
402 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
403 ; CHECK-NEXT: vrsub.vx v8, v8, a0
405 %elt.head = insertelement <16 x i16> poison, i16 %b, i32 0
406 %vb = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
407 %head = insertelement <16 x i1> poison, i1 true, i32 0
408 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
409 %v = call <16 x i16> @llvm.vp.sub.v16i16(<16 x i16> %vb, <16 x i16> %va, <16 x i1> %m, i32 %evl)
413 define <16 x i16> @vrsub_vi_v16i16(<16 x i16> %va, <16 x i1> %m, i32 zeroext %evl) {
414 ; CHECK-LABEL: vrsub_vi_v16i16:
416 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
417 ; CHECK-NEXT: vrsub.vi v8, v8, 2, v0.t
419 %elt.head = insertelement <16 x i16> poison, i16 2, i32 0
420 %vb = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
421 %v = call <16 x i16> @llvm.vp.sub.v16i16(<16 x i16> %vb, <16 x i16> %va, <16 x i1> %m, i32 %evl)
425 define <16 x i16> @vrsub_vi_v16i16_unmasked(<16 x i16> %va, i32 zeroext %evl) {
426 ; CHECK-LABEL: vrsub_vi_v16i16_unmasked:
428 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
429 ; CHECK-NEXT: vrsub.vi v8, v8, 2
431 %elt.head = insertelement <16 x i16> poison, i16 2, i32 0
432 %vb = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
433 %head = insertelement <16 x i1> poison, i1 true, i32 0
434 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
435 %v = call <16 x i16> @llvm.vp.sub.v16i16(<16 x i16> %vb, <16 x i16> %va, <16 x i1> %m, i32 %evl)
439 declare <2 x i32> @llvm.vp.sub.v2i32(<2 x i32>, <2 x i32>, <2 x i1>, i32)
441 define <2 x i32> @vrsub_vx_v2i32(<2 x i32> %va, i32 %b, <2 x i1> %m, i32 zeroext %evl) {
442 ; CHECK-LABEL: vrsub_vx_v2i32:
444 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
445 ; CHECK-NEXT: vrsub.vx v8, v8, a0, v0.t
447 %elt.head = insertelement <2 x i32> poison, i32 %b, i32 0
448 %vb = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
449 %v = call <2 x i32> @llvm.vp.sub.v2i32(<2 x i32> %vb, <2 x i32> %va, <2 x i1> %m, i32 %evl)
453 define <2 x i32> @vrsub_vx_v2i32_unmasked(<2 x i32> %va, i32 %b, i32 zeroext %evl) {
454 ; CHECK-LABEL: vrsub_vx_v2i32_unmasked:
456 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
457 ; CHECK-NEXT: vrsub.vx v8, v8, a0
459 %elt.head = insertelement <2 x i32> poison, i32 %b, i32 0
460 %vb = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
461 %head = insertelement <2 x i1> poison, i1 true, i32 0
462 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
463 %v = call <2 x i32> @llvm.vp.sub.v2i32(<2 x i32> %vb, <2 x i32> %va, <2 x i1> %m, i32 %evl)
467 define <2 x i32> @vrsub_vi_v2i32(<2 x i32> %va, <2 x i1> %m, i32 zeroext %evl) {
468 ; CHECK-LABEL: vrsub_vi_v2i32:
470 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
471 ; CHECK-NEXT: vrsub.vi v8, v8, 2, v0.t
473 %elt.head = insertelement <2 x i32> poison, i32 2, 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> %vb, <2 x i32> %va, <2 x i1> %m, i32 %evl)
479 define <2 x i32> @vrsub_vi_v2i32_unmasked(<2 x i32> %va, i32 zeroext %evl) {
480 ; CHECK-LABEL: vrsub_vi_v2i32_unmasked:
482 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
483 ; CHECK-NEXT: vrsub.vi v8, v8, 2
485 %elt.head = insertelement <2 x i32> poison, i32 2, i32 0
486 %vb = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
487 %head = insertelement <2 x i1> poison, i1 true, i32 0
488 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
489 %v = call <2 x i32> @llvm.vp.sub.v2i32(<2 x i32> %vb, <2 x i32> %va, <2 x i1> %m, i32 %evl)
493 declare <4 x i32> @llvm.vp.sub.v4i32(<4 x i32>, <4 x i32>, <4 x i1>, i32)
495 define <4 x i32> @vrsub_vx_v4i32(<4 x i32> %va, i32 %b, <4 x i1> %m, i32 zeroext %evl) {
496 ; CHECK-LABEL: vrsub_vx_v4i32:
498 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
499 ; CHECK-NEXT: vrsub.vx v8, v8, a0, v0.t
501 %elt.head = insertelement <4 x i32> poison, i32 %b, i32 0
502 %vb = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
503 %v = call <4 x i32> @llvm.vp.sub.v4i32(<4 x i32> %vb, <4 x i32> %va, <4 x i1> %m, i32 %evl)
507 define <4 x i32> @vrsub_vx_v4i32_unmasked(<4 x i32> %va, i32 %b, i32 zeroext %evl) {
508 ; CHECK-LABEL: vrsub_vx_v4i32_unmasked:
510 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
511 ; CHECK-NEXT: vrsub.vx v8, v8, a0
513 %elt.head = insertelement <4 x i32> poison, i32 %b, i32 0
514 %vb = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
515 %head = insertelement <4 x i1> poison, i1 true, i32 0
516 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
517 %v = call <4 x i32> @llvm.vp.sub.v4i32(<4 x i32> %vb, <4 x i32> %va, <4 x i1> %m, i32 %evl)
521 define <4 x i32> @vrsub_vi_v4i32(<4 x i32> %va, <4 x i1> %m, i32 zeroext %evl) {
522 ; CHECK-LABEL: vrsub_vi_v4i32:
524 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
525 ; CHECK-NEXT: vrsub.vi v8, v8, 2, v0.t
527 %elt.head = insertelement <4 x i32> poison, i32 2, i32 0
528 %vb = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
529 %v = call <4 x i32> @llvm.vp.sub.v4i32(<4 x i32> %vb, <4 x i32> %va, <4 x i1> %m, i32 %evl)
533 define <4 x i32> @vrsub_vi_v4i32_unmasked(<4 x i32> %va, i32 zeroext %evl) {
534 ; CHECK-LABEL: vrsub_vi_v4i32_unmasked:
536 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
537 ; CHECK-NEXT: vrsub.vi v8, v8, 2
539 %elt.head = insertelement <4 x i32> poison, i32 2, i32 0
540 %vb = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
541 %head = insertelement <4 x i1> poison, i1 true, i32 0
542 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
543 %v = call <4 x i32> @llvm.vp.sub.v4i32(<4 x i32> %vb, <4 x i32> %va, <4 x i1> %m, i32 %evl)
547 declare <8 x i32> @llvm.vp.sub.v8i32(<8 x i32>, <8 x i32>, <8 x i1>, i32)
549 define <8 x i32> @vrsub_vx_v8i32(<8 x i32> %va, i32 %b, <8 x i1> %m, i32 zeroext %evl) {
550 ; CHECK-LABEL: vrsub_vx_v8i32:
552 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
553 ; CHECK-NEXT: vrsub.vx v8, v8, a0, v0.t
555 %elt.head = insertelement <8 x i32> poison, i32 %b, i32 0
556 %vb = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
557 %v = call <8 x i32> @llvm.vp.sub.v8i32(<8 x i32> %vb, <8 x i32> %va, <8 x i1> %m, i32 %evl)
561 define <8 x i32> @vrsub_vx_v8i32_unmasked(<8 x i32> %va, i32 %b, i32 zeroext %evl) {
562 ; CHECK-LABEL: vrsub_vx_v8i32_unmasked:
564 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
565 ; CHECK-NEXT: vrsub.vx v8, v8, a0
567 %elt.head = insertelement <8 x i32> poison, i32 %b, i32 0
568 %vb = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
569 %head = insertelement <8 x i1> poison, i1 true, i32 0
570 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
571 %v = call <8 x i32> @llvm.vp.sub.v8i32(<8 x i32> %vb, <8 x i32> %va, <8 x i1> %m, i32 %evl)
575 define <8 x i32> @vrsub_vi_v8i32(<8 x i32> %va, <8 x i1> %m, i32 zeroext %evl) {
576 ; CHECK-LABEL: vrsub_vi_v8i32:
578 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
579 ; CHECK-NEXT: vrsub.vi v8, v8, 2, v0.t
581 %elt.head = insertelement <8 x i32> poison, i32 2, i32 0
582 %vb = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
583 %v = call <8 x i32> @llvm.vp.sub.v8i32(<8 x i32> %vb, <8 x i32> %va, <8 x i1> %m, i32 %evl)
587 define <8 x i32> @vrsub_vi_v8i32_unmasked(<8 x i32> %va, i32 zeroext %evl) {
588 ; CHECK-LABEL: vrsub_vi_v8i32_unmasked:
590 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
591 ; CHECK-NEXT: vrsub.vi v8, v8, 2
593 %elt.head = insertelement <8 x i32> poison, i32 2, i32 0
594 %vb = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
595 %head = insertelement <8 x i1> poison, i1 true, i32 0
596 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
597 %v = call <8 x i32> @llvm.vp.sub.v8i32(<8 x i32> %vb, <8 x i32> %va, <8 x i1> %m, i32 %evl)
601 declare <16 x i32> @llvm.vp.sub.v16i32(<16 x i32>, <16 x i32>, <16 x i1>, i32)
603 define <16 x i32> @vrsub_vx_v16i32(<16 x i32> %va, i32 %b, <16 x i1> %m, i32 zeroext %evl) {
604 ; CHECK-LABEL: vrsub_vx_v16i32:
606 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
607 ; CHECK-NEXT: vrsub.vx v8, v8, a0, v0.t
609 %elt.head = insertelement <16 x i32> poison, i32 %b, i32 0
610 %vb = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
611 %v = call <16 x i32> @llvm.vp.sub.v16i32(<16 x i32> %vb, <16 x i32> %va, <16 x i1> %m, i32 %evl)
615 define <16 x i32> @vrsub_vx_v16i32_unmasked(<16 x i32> %va, i32 %b, i32 zeroext %evl) {
616 ; CHECK-LABEL: vrsub_vx_v16i32_unmasked:
618 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
619 ; CHECK-NEXT: vrsub.vx v8, v8, a0
621 %elt.head = insertelement <16 x i32> poison, i32 %b, i32 0
622 %vb = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
623 %head = insertelement <16 x i1> poison, i1 true, i32 0
624 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
625 %v = call <16 x i32> @llvm.vp.sub.v16i32(<16 x i32> %vb, <16 x i32> %va, <16 x i1> %m, i32 %evl)
629 define <16 x i32> @vrsub_vi_v16i32(<16 x i32> %va, <16 x i1> %m, i32 zeroext %evl) {
630 ; CHECK-LABEL: vrsub_vi_v16i32:
632 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
633 ; CHECK-NEXT: vrsub.vi v8, v8, 2, v0.t
635 %elt.head = insertelement <16 x i32> poison, i32 2, i32 0
636 %vb = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
637 %v = call <16 x i32> @llvm.vp.sub.v16i32(<16 x i32> %vb, <16 x i32> %va, <16 x i1> %m, i32 %evl)
641 define <16 x i32> @vrsub_vi_v16i32_unmasked(<16 x i32> %va, i32 zeroext %evl) {
642 ; CHECK-LABEL: vrsub_vi_v16i32_unmasked:
644 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
645 ; CHECK-NEXT: vrsub.vi v8, v8, 2
647 %elt.head = insertelement <16 x i32> poison, i32 2, i32 0
648 %vb = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
649 %head = insertelement <16 x i1> poison, i1 true, i32 0
650 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
651 %v = call <16 x i32> @llvm.vp.sub.v16i32(<16 x i32> %vb, <16 x i32> %va, <16 x i1> %m, i32 %evl)
655 declare <2 x i64> @llvm.vp.sub.v2i64(<2 x i64>, <2 x i64>, <2 x i1>, i32)
657 define <2 x i64> @vrsub_vx_v2i64(<2 x i64> %va, i64 %b, <2 x i1> %m, i32 zeroext %evl) {
658 ; RV32-LABEL: vrsub_vx_v2i64:
660 ; RV32-NEXT: addi sp, sp, -16
661 ; RV32-NEXT: .cfi_def_cfa_offset 16
662 ; RV32-NEXT: sw a1, 12(sp)
663 ; RV32-NEXT: sw a0, 8(sp)
664 ; RV32-NEXT: addi a0, sp, 8
665 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
666 ; RV32-NEXT: vlse64.v v9, (a0), zero
667 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
668 ; RV32-NEXT: vsub.vv v8, v9, v8, v0.t
669 ; RV32-NEXT: addi sp, sp, 16
672 ; RV64-LABEL: vrsub_vx_v2i64:
674 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
675 ; RV64-NEXT: vrsub.vx v8, v8, a0, v0.t
677 %elt.head = insertelement <2 x i64> poison, i64 %b, i32 0
678 %vb = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
679 %v = call <2 x i64> @llvm.vp.sub.v2i64(<2 x i64> %vb, <2 x i64> %va, <2 x i1> %m, i32 %evl)
683 define <2 x i64> @vrsub_vx_v2i64_unmasked(<2 x i64> %va, i64 %b, i32 zeroext %evl) {
684 ; RV32-LABEL: vrsub_vx_v2i64_unmasked:
686 ; RV32-NEXT: addi sp, sp, -16
687 ; RV32-NEXT: .cfi_def_cfa_offset 16
688 ; RV32-NEXT: sw a1, 12(sp)
689 ; RV32-NEXT: sw a0, 8(sp)
690 ; RV32-NEXT: addi a0, sp, 8
691 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
692 ; RV32-NEXT: vlse64.v v9, (a0), zero
693 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
694 ; RV32-NEXT: vsub.vv v8, v9, v8
695 ; RV32-NEXT: addi sp, sp, 16
698 ; RV64-LABEL: vrsub_vx_v2i64_unmasked:
700 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
701 ; RV64-NEXT: vrsub.vx v8, v8, a0
703 %elt.head = insertelement <2 x i64> poison, i64 %b, i32 0
704 %vb = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
705 %head = insertelement <2 x i1> poison, i1 true, i32 0
706 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
707 %v = call <2 x i64> @llvm.vp.sub.v2i64(<2 x i64> %vb, <2 x i64> %va, <2 x i1> %m, i32 %evl)
711 define <2 x i64> @vrsub_vi_v2i64(<2 x i64> %va, <2 x i1> %m, i32 zeroext %evl) {
712 ; CHECK-LABEL: vrsub_vi_v2i64:
714 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
715 ; CHECK-NEXT: vrsub.vi v8, v8, 2, v0.t
717 %elt.head = insertelement <2 x i64> poison, i64 2, i32 0
718 %vb = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
719 %v = call <2 x i64> @llvm.vp.sub.v2i64(<2 x i64> %vb, <2 x i64> %va, <2 x i1> %m, i32 %evl)
723 define <2 x i64> @vrsub_vi_v2i64_unmasked(<2 x i64> %va, i32 zeroext %evl) {
724 ; CHECK-LABEL: vrsub_vi_v2i64_unmasked:
726 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
727 ; CHECK-NEXT: vrsub.vi v8, v8, 2
729 %elt.head = insertelement <2 x i64> poison, i64 2, i32 0
730 %vb = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
731 %head = insertelement <2 x i1> poison, i1 true, i32 0
732 %m = shufflevector <2 x i1> %head, <2 x i1> poison, <2 x i32> zeroinitializer
733 %v = call <2 x i64> @llvm.vp.sub.v2i64(<2 x i64> %vb, <2 x i64> %va, <2 x i1> %m, i32 %evl)
737 declare <4 x i64> @llvm.vp.sub.v4i64(<4 x i64>, <4 x i64>, <4 x i1>, i32)
739 define <4 x i64> @vrsub_vx_v4i64(<4 x i64> %va, i64 %b, <4 x i1> %m, i32 zeroext %evl) {
740 ; RV32-LABEL: vrsub_vx_v4i64:
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, v10, v8, v0.t
751 ; RV32-NEXT: addi sp, sp, 16
754 ; RV64-LABEL: vrsub_vx_v4i64:
756 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
757 ; RV64-NEXT: vrsub.vx v8, v8, a0, v0.t
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> %vb, <4 x i64> %va, <4 x i1> %m, i32 %evl)
765 define <4 x i64> @vrsub_vx_v4i64_unmasked(<4 x i64> %va, i64 %b, i32 zeroext %evl) {
766 ; RV32-LABEL: vrsub_vx_v4i64_unmasked:
768 ; RV32-NEXT: addi sp, sp, -16
769 ; RV32-NEXT: .cfi_def_cfa_offset 16
770 ; RV32-NEXT: sw a1, 12(sp)
771 ; RV32-NEXT: sw a0, 8(sp)
772 ; RV32-NEXT: addi a0, sp, 8
773 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
774 ; RV32-NEXT: vlse64.v v10, (a0), zero
775 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
776 ; RV32-NEXT: vsub.vv v8, v10, v8
777 ; RV32-NEXT: addi sp, sp, 16
780 ; RV64-LABEL: vrsub_vx_v4i64_unmasked:
782 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
783 ; RV64-NEXT: vrsub.vx v8, v8, a0
785 %elt.head = insertelement <4 x i64> poison, i64 %b, i32 0
786 %vb = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
787 %head = insertelement <4 x i1> poison, i1 true, i32 0
788 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
789 %v = call <4 x i64> @llvm.vp.sub.v4i64(<4 x i64> %vb, <4 x i64> %va, <4 x i1> %m, i32 %evl)
793 define <4 x i64> @vrsub_vi_v4i64(<4 x i64> %va, <4 x i1> %m, i32 zeroext %evl) {
794 ; CHECK-LABEL: vrsub_vi_v4i64:
796 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
797 ; CHECK-NEXT: vrsub.vi v8, v8, 2, v0.t
799 %elt.head = insertelement <4 x i64> poison, i64 2, i32 0
800 %vb = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
801 %v = call <4 x i64> @llvm.vp.sub.v4i64(<4 x i64> %vb, <4 x i64> %va, <4 x i1> %m, i32 %evl)
805 define <4 x i64> @vrsub_vi_v4i64_unmasked(<4 x i64> %va, i32 zeroext %evl) {
806 ; CHECK-LABEL: vrsub_vi_v4i64_unmasked:
808 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
809 ; CHECK-NEXT: vrsub.vi v8, v8, 2
811 %elt.head = insertelement <4 x i64> poison, i64 2, i32 0
812 %vb = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
813 %head = insertelement <4 x i1> poison, i1 true, i32 0
814 %m = shufflevector <4 x i1> %head, <4 x i1> poison, <4 x i32> zeroinitializer
815 %v = call <4 x i64> @llvm.vp.sub.v4i64(<4 x i64> %vb, <4 x i64> %va, <4 x i1> %m, i32 %evl)
819 declare <8 x i64> @llvm.vp.sub.v8i64(<8 x i64>, <8 x i64>, <8 x i1>, i32)
821 define <8 x i64> @vrsub_vx_v8i64(<8 x i64> %va, i64 %b, <8 x i1> %m, i32 zeroext %evl) {
822 ; RV32-LABEL: vrsub_vx_v8i64:
824 ; RV32-NEXT: addi sp, sp, -16
825 ; RV32-NEXT: .cfi_def_cfa_offset 16
826 ; RV32-NEXT: sw a1, 12(sp)
827 ; RV32-NEXT: sw a0, 8(sp)
828 ; RV32-NEXT: addi a0, sp, 8
829 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
830 ; RV32-NEXT: vlse64.v v12, (a0), zero
831 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
832 ; RV32-NEXT: vsub.vv v8, v12, v8, v0.t
833 ; RV32-NEXT: addi sp, sp, 16
836 ; RV64-LABEL: vrsub_vx_v8i64:
838 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
839 ; RV64-NEXT: vrsub.vx v8, v8, a0, v0.t
841 %elt.head = insertelement <8 x i64> poison, i64 %b, i32 0
842 %vb = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
843 %v = call <8 x i64> @llvm.vp.sub.v8i64(<8 x i64> %vb, <8 x i64> %va, <8 x i1> %m, i32 %evl)
847 define <8 x i64> @vrsub_vx_v8i64_unmasked(<8 x i64> %va, i64 %b, i32 zeroext %evl) {
848 ; RV32-LABEL: vrsub_vx_v8i64_unmasked:
850 ; RV32-NEXT: addi sp, sp, -16
851 ; RV32-NEXT: .cfi_def_cfa_offset 16
852 ; RV32-NEXT: sw a1, 12(sp)
853 ; RV32-NEXT: sw a0, 8(sp)
854 ; RV32-NEXT: addi a0, sp, 8
855 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
856 ; RV32-NEXT: vlse64.v v12, (a0), zero
857 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
858 ; RV32-NEXT: vsub.vv v8, v12, v8
859 ; RV32-NEXT: addi sp, sp, 16
862 ; RV64-LABEL: vrsub_vx_v8i64_unmasked:
864 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
865 ; RV64-NEXT: vrsub.vx v8, v8, a0
867 %elt.head = insertelement <8 x i64> poison, i64 %b, i32 0
868 %vb = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
869 %head = insertelement <8 x i1> poison, i1 true, i32 0
870 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
871 %v = call <8 x i64> @llvm.vp.sub.v8i64(<8 x i64> %vb, <8 x i64> %va, <8 x i1> %m, i32 %evl)
875 define <8 x i64> @vrsub_vi_v8i64(<8 x i64> %va, <8 x i1> %m, i32 zeroext %evl) {
876 ; CHECK-LABEL: vrsub_vi_v8i64:
878 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
879 ; CHECK-NEXT: vrsub.vi v8, v8, 2, v0.t
881 %elt.head = insertelement <8 x i64> poison, i64 2, i32 0
882 %vb = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
883 %v = call <8 x i64> @llvm.vp.sub.v8i64(<8 x i64> %vb, <8 x i64> %va, <8 x i1> %m, i32 %evl)
887 define <8 x i64> @vrsub_vi_v8i64_unmasked(<8 x i64> %va, i32 zeroext %evl) {
888 ; CHECK-LABEL: vrsub_vi_v8i64_unmasked:
890 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
891 ; CHECK-NEXT: vrsub.vi v8, v8, 2
893 %elt.head = insertelement <8 x i64> poison, i64 2, i32 0
894 %vb = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
895 %head = insertelement <8 x i1> poison, i1 true, i32 0
896 %m = shufflevector <8 x i1> %head, <8 x i1> poison, <8 x i32> zeroinitializer
897 %v = call <8 x i64> @llvm.vp.sub.v8i64(<8 x i64> %vb, <8 x i64> %va, <8 x i1> %m, i32 %evl)
901 declare <16 x i64> @llvm.vp.sub.v16i64(<16 x i64>, <16 x i64>, <16 x i1>, i32)
903 define <16 x i64> @vrsub_vx_v16i64(<16 x i64> %va, i64 %b, <16 x i1> %m, i32 zeroext %evl) {
904 ; RV32-LABEL: vrsub_vx_v16i64:
906 ; RV32-NEXT: addi sp, sp, -16
907 ; RV32-NEXT: .cfi_def_cfa_offset 16
908 ; RV32-NEXT: sw a1, 12(sp)
909 ; RV32-NEXT: sw a0, 8(sp)
910 ; RV32-NEXT: addi a0, sp, 8
911 ; RV32-NEXT: vsetivli zero, 16, e64, m8, ta, ma
912 ; RV32-NEXT: vlse64.v v16, (a0), zero
913 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
914 ; RV32-NEXT: vsub.vv v8, v16, v8, v0.t
915 ; RV32-NEXT: addi sp, sp, 16
918 ; RV64-LABEL: vrsub_vx_v16i64:
920 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
921 ; RV64-NEXT: vrsub.vx v8, v8, a0, v0.t
923 %elt.head = insertelement <16 x i64> poison, i64 %b, i32 0
924 %vb = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
925 %v = call <16 x i64> @llvm.vp.sub.v16i64(<16 x i64> %vb, <16 x i64> %va, <16 x i1> %m, i32 %evl)
929 define <16 x i64> @vrsub_vx_v16i64_unmasked(<16 x i64> %va, i64 %b, i32 zeroext %evl) {
930 ; RV32-LABEL: vrsub_vx_v16i64_unmasked:
932 ; RV32-NEXT: addi sp, sp, -16
933 ; RV32-NEXT: .cfi_def_cfa_offset 16
934 ; RV32-NEXT: sw a1, 12(sp)
935 ; RV32-NEXT: sw a0, 8(sp)
936 ; RV32-NEXT: addi a0, sp, 8
937 ; RV32-NEXT: vsetivli zero, 16, e64, m8, ta, ma
938 ; RV32-NEXT: vlse64.v v16, (a0), zero
939 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
940 ; RV32-NEXT: vsub.vv v8, v16, v8
941 ; RV32-NEXT: addi sp, sp, 16
944 ; RV64-LABEL: vrsub_vx_v16i64_unmasked:
946 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
947 ; RV64-NEXT: vrsub.vx v8, v8, a0
949 %elt.head = insertelement <16 x i64> poison, i64 %b, i32 0
950 %vb = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
951 %head = insertelement <16 x i1> poison, i1 true, i32 0
952 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
953 %v = call <16 x i64> @llvm.vp.sub.v16i64(<16 x i64> %vb, <16 x i64> %va, <16 x i1> %m, i32 %evl)
957 define <16 x i64> @vrsub_vi_v16i64(<16 x i64> %va, <16 x i1> %m, i32 zeroext %evl) {
958 ; CHECK-LABEL: vrsub_vi_v16i64:
960 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
961 ; CHECK-NEXT: vrsub.vi v8, v8, 2, v0.t
963 %elt.head = insertelement <16 x i64> poison, i64 2, i32 0
964 %vb = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
965 %v = call <16 x i64> @llvm.vp.sub.v16i64(<16 x i64> %vb, <16 x i64> %va, <16 x i1> %m, i32 %evl)
969 define <16 x i64> @vrsub_vi_v16i64_unmasked(<16 x i64> %va, i32 zeroext %evl) {
970 ; CHECK-LABEL: vrsub_vi_v16i64_unmasked:
972 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
973 ; CHECK-NEXT: vrsub.vi v8, v8, 2
975 %elt.head = insertelement <16 x i64> poison, i64 2, i32 0
976 %vb = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
977 %head = insertelement <16 x i1> poison, i1 true, i32 0
978 %m = shufflevector <16 x i1> %head, <16 x i1> poison, <16 x i32> zeroinitializer
979 %v = call <16 x i64> @llvm.vp.sub.v16i64(<16 x i64> %vb, <16 x i64> %va, <16 x i1> %m, i32 %evl)