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.add.v8i7(<8 x i7>, <8 x i7>, <8 x i1>, i32)
9 define <8 x i7> @vadd_vv_v8i7(<8 x i7> %va, <8 x i7> %b, <8 x i1> %m, i32 zeroext %evl) {
10 ; CHECK-LABEL: vadd_vv_v8i7:
12 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
13 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
15 %v = call <8 x i7> @llvm.vp.add.v8i7(<8 x i7> %va, <8 x i7> %b, <8 x i1> %m, i32 %evl)
19 declare <2 x i8> @llvm.vp.add.v2i8(<2 x i8>, <2 x i8>, <2 x i1>, i32)
21 define <2 x i8> @vadd_vv_v2i8(<2 x i8> %va, <2 x i8> %b, <2 x i1> %m, i32 zeroext %evl) {
22 ; CHECK-LABEL: vadd_vv_v2i8:
24 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
25 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
27 %v = call <2 x i8> @llvm.vp.add.v2i8(<2 x i8> %va, <2 x i8> %b, <2 x i1> %m, i32 %evl)
31 define <2 x i8> @vadd_vv_v2i8_unmasked(<2 x i8> %va, <2 x i8> %b, i32 zeroext %evl) {
32 ; CHECK-LABEL: vadd_vv_v2i8_unmasked:
34 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
35 ; CHECK-NEXT: vadd.vv v8, v8, v9
37 %v = call <2 x i8> @llvm.vp.add.v2i8(<2 x i8> %va, <2 x i8> %b, <2 x i1> splat (i1 true), i32 %evl)
41 define <2 x i8> @vadd_vx_v2i8(<2 x i8> %va, i8 %b, <2 x i1> %m, i32 zeroext %evl) {
42 ; CHECK-LABEL: vadd_vx_v2i8:
44 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
45 ; CHECK-NEXT: vadd.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.add.v2i8(<2 x i8> %va, <2 x i8> %vb, <2 x i1> %m, i32 %evl)
53 define <2 x i8> @vadd_vx_v2i8_unmasked(<2 x i8> %va, i8 %b, i32 zeroext %evl) {
54 ; CHECK-LABEL: vadd_vx_v2i8_unmasked:
56 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
57 ; CHECK-NEXT: vadd.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.add.v2i8(<2 x i8> %va, <2 x i8> %vb, <2 x i1> splat (i1 true), i32 %evl)
65 define <2 x i8> @vadd_vi_v2i8(<2 x i8> %va, <2 x i1> %m, i32 zeroext %evl) {
66 ; CHECK-LABEL: vadd_vi_v2i8:
68 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
69 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
71 %v = call <2 x i8> @llvm.vp.add.v2i8(<2 x i8> %va, <2 x i8> splat (i8 -1), <2 x i1> %m, i32 %evl)
75 define <2 x i8> @vadd_vi_v2i8_unmasked(<2 x i8> %va, i32 zeroext %evl) {
76 ; CHECK-LABEL: vadd_vi_v2i8_unmasked:
78 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
79 ; CHECK-NEXT: vadd.vi v8, v8, -1
81 %v = call <2 x i8> @llvm.vp.add.v2i8(<2 x i8> %va, <2 x i8> splat (i8 -1), <2 x i1> splat (i1 true), i32 %evl)
85 declare <4 x i8> @llvm.vp.add.v4i8(<4 x i8>, <4 x i8>, <4 x i1>, i32)
87 define <4 x i8> @vadd_vv_v4i8(<4 x i8> %va, <4 x i8> %b, <4 x i1> %m, i32 zeroext %evl) {
88 ; CHECK-LABEL: vadd_vv_v4i8:
90 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
91 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
93 %v = call <4 x i8> @llvm.vp.add.v4i8(<4 x i8> %va, <4 x i8> %b, <4 x i1> %m, i32 %evl)
97 define <4 x i8> @vadd_vv_v4i8_unmasked(<4 x i8> %va, <4 x i8> %b, i32 zeroext %evl) {
98 ; CHECK-LABEL: vadd_vv_v4i8_unmasked:
100 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
101 ; CHECK-NEXT: vadd.vv v8, v8, v9
103 %v = call <4 x i8> @llvm.vp.add.v4i8(<4 x i8> %va, <4 x i8> %b, <4 x i1> splat (i1 true), i32 %evl)
107 define <4 x i8> @vadd_vx_v4i8(<4 x i8> %va, i8 %b, <4 x i1> %m, i32 zeroext %evl) {
108 ; CHECK-LABEL: vadd_vx_v4i8:
110 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
111 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
113 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
114 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
115 %v = call <4 x i8> @llvm.vp.add.v4i8(<4 x i8> %va, <4 x i8> %vb, <4 x i1> %m, i32 %evl)
119 define <4 x i8> @vadd_vx_v4i8_commute(<4 x i8> %va, i8 %b, <4 x i1> %m, i32 zeroext %evl) {
120 ; CHECK-LABEL: vadd_vx_v4i8_commute:
122 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
123 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
125 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
126 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
127 %v = call <4 x i8> @llvm.vp.add.v4i8(<4 x i8> %vb, <4 x i8> %va, <4 x i1> %m, i32 %evl)
131 define <4 x i8> @vadd_vx_v4i8_unmasked(<4 x i8> %va, i8 %b, i32 zeroext %evl) {
132 ; CHECK-LABEL: vadd_vx_v4i8_unmasked:
134 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
135 ; CHECK-NEXT: vadd.vx v8, v8, a0
137 %elt.head = insertelement <4 x i8> poison, i8 %b, i32 0
138 %vb = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
139 %v = call <4 x i8> @llvm.vp.add.v4i8(<4 x i8> %va, <4 x i8> %vb, <4 x i1> splat (i1 true), i32 %evl)
143 define <4 x i8> @vadd_vi_v4i8(<4 x i8> %va, <4 x i1> %m, i32 zeroext %evl) {
144 ; CHECK-LABEL: vadd_vi_v4i8:
146 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
147 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
149 %v = call <4 x i8> @llvm.vp.add.v4i8(<4 x i8> %va, <4 x i8> splat (i8 -1), <4 x i1> %m, i32 %evl)
153 define <4 x i8> @vadd_vi_v4i8_unmasked(<4 x i8> %va, i32 zeroext %evl) {
154 ; CHECK-LABEL: vadd_vi_v4i8_unmasked:
156 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
157 ; CHECK-NEXT: vadd.vi v8, v8, -1
159 %v = call <4 x i8> @llvm.vp.add.v4i8(<4 x i8> %va, <4 x i8> splat (i8 -1), <4 x i1> splat (i1 true), i32 %evl)
163 declare <5 x i8> @llvm.vp.add.v5i8(<5 x i8>, <5 x i8>, <5 x i1>, i32)
165 define <5 x i8> @vadd_vv_v5i8(<5 x i8> %va, <5 x i8> %b, <5 x i1> %m, i32 zeroext %evl) {
166 ; CHECK-LABEL: vadd_vv_v5i8:
168 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
169 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
171 %v = call <5 x i8> @llvm.vp.add.v5i8(<5 x i8> %va, <5 x i8> %b, <5 x i1> %m, i32 %evl)
175 define <5 x i8> @vadd_vv_v5i8_unmasked(<5 x i8> %va, <5 x i8> %b, i32 zeroext %evl) {
176 ; CHECK-LABEL: vadd_vv_v5i8_unmasked:
178 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
179 ; CHECK-NEXT: vadd.vv v8, v8, v9
181 %v = call <5 x i8> @llvm.vp.add.v5i8(<5 x i8> %va, <5 x i8> %b, <5 x i1> splat (i1 true), i32 %evl)
185 define <5 x i8> @vadd_vx_v5i8(<5 x i8> %va, i8 %b, <5 x i1> %m, i32 zeroext %evl) {
186 ; CHECK-LABEL: vadd_vx_v5i8:
188 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
189 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
191 %elt.head = insertelement <5 x i8> poison, i8 %b, i32 0
192 %vb = shufflevector <5 x i8> %elt.head, <5 x i8> poison, <5 x i32> zeroinitializer
193 %v = call <5 x i8> @llvm.vp.add.v5i8(<5 x i8> %va, <5 x i8> %vb, <5 x i1> %m, i32 %evl)
197 define <5 x i8> @vadd_vx_v5i8_unmasked(<5 x i8> %va, i8 %b, i32 zeroext %evl) {
198 ; CHECK-LABEL: vadd_vx_v5i8_unmasked:
200 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
201 ; CHECK-NEXT: vadd.vx v8, v8, a0
203 %elt.head = insertelement <5 x i8> poison, i8 %b, i32 0
204 %vb = shufflevector <5 x i8> %elt.head, <5 x i8> poison, <5 x i32> zeroinitializer
205 %v = call <5 x i8> @llvm.vp.add.v5i8(<5 x i8> %va, <5 x i8> %vb, <5 x i1> splat (i1 true), i32 %evl)
209 define <5 x i8> @vadd_vi_v5i8(<5 x i8> %va, <5 x i1> %m, i32 zeroext %evl) {
210 ; CHECK-LABEL: vadd_vi_v5i8:
212 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
213 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
215 %v = call <5 x i8> @llvm.vp.add.v5i8(<5 x i8> %va, <5 x i8> splat (i8 -1), <5 x i1> %m, i32 %evl)
219 define <5 x i8> @vadd_vi_v5i8_unmasked(<5 x i8> %va, i32 zeroext %evl) {
220 ; CHECK-LABEL: vadd_vi_v5i8_unmasked:
222 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
223 ; CHECK-NEXT: vadd.vi v8, v8, -1
225 %v = call <5 x i8> @llvm.vp.add.v5i8(<5 x i8> %va, <5 x i8> splat (i8 -1), <5 x i1> splat (i1 true), i32 %evl)
229 declare <8 x i8> @llvm.vp.add.v8i8(<8 x i8>, <8 x i8>, <8 x i1>, i32)
231 define <8 x i8> @vadd_vv_v8i8(<8 x i8> %va, <8 x i8> %b, <8 x i1> %m, i32 zeroext %evl) {
232 ; CHECK-LABEL: vadd_vv_v8i8:
234 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
235 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
237 %v = call <8 x i8> @llvm.vp.add.v8i8(<8 x i8> %va, <8 x i8> %b, <8 x i1> %m, i32 %evl)
241 define <8 x i8> @vadd_vv_v8i8_unmasked(<8 x i8> %va, <8 x i8> %b, i32 zeroext %evl) {
242 ; CHECK-LABEL: vadd_vv_v8i8_unmasked:
244 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
245 ; CHECK-NEXT: vadd.vv v8, v8, v9
247 %v = call <8 x i8> @llvm.vp.add.v8i8(<8 x i8> %va, <8 x i8> %b, <8 x i1> splat (i1 true), i32 %evl)
251 define <8 x i8> @vadd_vx_v8i8(<8 x i8> %va, i8 %b, <8 x i1> %m, i32 zeroext %evl) {
252 ; CHECK-LABEL: vadd_vx_v8i8:
254 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
255 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
257 %elt.head = insertelement <8 x i8> poison, i8 %b, i32 0
258 %vb = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
259 %v = call <8 x i8> @llvm.vp.add.v8i8(<8 x i8> %va, <8 x i8> %vb, <8 x i1> %m, i32 %evl)
263 define <8 x i8> @vadd_vx_v8i8_unmasked(<8 x i8> %va, i8 %b, i32 zeroext %evl) {
264 ; CHECK-LABEL: vadd_vx_v8i8_unmasked:
266 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
267 ; CHECK-NEXT: vadd.vx v8, v8, a0
269 %elt.head = insertelement <8 x i8> poison, i8 %b, i32 0
270 %vb = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
271 %v = call <8 x i8> @llvm.vp.add.v8i8(<8 x i8> %va, <8 x i8> %vb, <8 x i1> splat (i1 true), i32 %evl)
275 define <8 x i8> @vadd_vi_v8i8(<8 x i8> %va, <8 x i1> %m, i32 zeroext %evl) {
276 ; CHECK-LABEL: vadd_vi_v8i8:
278 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
279 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
281 %v = call <8 x i8> @llvm.vp.add.v8i8(<8 x i8> %va, <8 x i8> splat (i8 -1), <8 x i1> %m, i32 %evl)
285 define <8 x i8> @vadd_vi_v8i8_unmasked(<8 x i8> %va, i32 zeroext %evl) {
286 ; CHECK-LABEL: vadd_vi_v8i8_unmasked:
288 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
289 ; CHECK-NEXT: vadd.vi v8, v8, -1
291 %v = call <8 x i8> @llvm.vp.add.v8i8(<8 x i8> %va, <8 x i8> splat (i8 -1), <8 x i1> splat (i1 true), i32 %evl)
295 declare <16 x i8> @llvm.vp.add.v16i8(<16 x i8>, <16 x i8>, <16 x i1>, i32)
297 define <16 x i8> @vadd_vv_v16i8(<16 x i8> %va, <16 x i8> %b, <16 x i1> %m, i32 zeroext %evl) {
298 ; CHECK-LABEL: vadd_vv_v16i8:
300 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
301 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
303 %v = call <16 x i8> @llvm.vp.add.v16i8(<16 x i8> %va, <16 x i8> %b, <16 x i1> %m, i32 %evl)
307 define <16 x i8> @vadd_vv_v16i8_unmasked(<16 x i8> %va, <16 x i8> %b, i32 zeroext %evl) {
308 ; CHECK-LABEL: vadd_vv_v16i8_unmasked:
310 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
311 ; CHECK-NEXT: vadd.vv v8, v8, v9
313 %v = call <16 x i8> @llvm.vp.add.v16i8(<16 x i8> %va, <16 x i8> %b, <16 x i1> splat (i1 true), i32 %evl)
317 define <16 x i8> @vadd_vx_v16i8(<16 x i8> %va, i8 %b, <16 x i1> %m, i32 zeroext %evl) {
318 ; CHECK-LABEL: vadd_vx_v16i8:
320 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
321 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
323 %elt.head = insertelement <16 x i8> poison, i8 %b, i32 0
324 %vb = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
325 %v = call <16 x i8> @llvm.vp.add.v16i8(<16 x i8> %va, <16 x i8> %vb, <16 x i1> %m, i32 %evl)
329 define <16 x i8> @vadd_vx_v16i8_unmasked(<16 x i8> %va, i8 %b, i32 zeroext %evl) {
330 ; CHECK-LABEL: vadd_vx_v16i8_unmasked:
332 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
333 ; CHECK-NEXT: vadd.vx v8, v8, a0
335 %elt.head = insertelement <16 x i8> poison, i8 %b, i32 0
336 %vb = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
337 %v = call <16 x i8> @llvm.vp.add.v16i8(<16 x i8> %va, <16 x i8> %vb, <16 x i1> splat (i1 true), i32 %evl)
341 define <16 x i8> @vadd_vi_v16i8(<16 x i8> %va, <16 x i1> %m, i32 zeroext %evl) {
342 ; CHECK-LABEL: vadd_vi_v16i8:
344 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
345 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
347 %v = call <16 x i8> @llvm.vp.add.v16i8(<16 x i8> %va, <16 x i8> splat (i8 -1), <16 x i1> %m, i32 %evl)
351 define <16 x i8> @vadd_vi_v16i8_unmasked(<16 x i8> %va, i32 zeroext %evl) {
352 ; CHECK-LABEL: vadd_vi_v16i8_unmasked:
354 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
355 ; CHECK-NEXT: vadd.vi v8, v8, -1
357 %v = call <16 x i8> @llvm.vp.add.v16i8(<16 x i8> %va, <16 x i8> splat (i8 -1), <16 x i1> splat (i1 true), i32 %evl)
361 declare <256 x i8> @llvm.vp.add.v258i8(<256 x i8>, <256 x i8>, <256 x i1>, i32)
363 define <256 x i8> @vadd_vi_v258i8(<256 x i8> %va, <256 x i1> %m, i32 zeroext %evl) {
364 ; CHECK-LABEL: vadd_vi_v258i8:
366 ; CHECK-NEXT: vmv1r.v v24, v0
367 ; CHECK-NEXT: li a2, 128
368 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
369 ; CHECK-NEXT: vlm.v v0, (a0)
370 ; CHECK-NEXT: addi a0, a1, -128
371 ; CHECK-NEXT: sltu a3, a1, a0
372 ; CHECK-NEXT: addi a3, a3, -1
373 ; CHECK-NEXT: and a0, a3, a0
374 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
375 ; CHECK-NEXT: vadd.vi v16, v16, -1, v0.t
376 ; CHECK-NEXT: bltu a1, a2, .LBB32_2
377 ; CHECK-NEXT: # %bb.1:
378 ; CHECK-NEXT: li a1, 128
379 ; CHECK-NEXT: .LBB32_2:
380 ; CHECK-NEXT: vmv1r.v v0, v24
381 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
382 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
384 %v = call <256 x i8> @llvm.vp.add.v258i8(<256 x i8> %va, <256 x i8> splat (i8 -1), <256 x i1> %m, i32 %evl)
388 define <256 x i8> @vadd_vi_v258i8_unmasked(<256 x i8> %va, i32 zeroext %evl) {
389 ; CHECK-LABEL: vadd_vi_v258i8_unmasked:
391 ; CHECK-NEXT: li a2, 128
392 ; CHECK-NEXT: mv a1, a0
393 ; CHECK-NEXT: bltu a0, a2, .LBB33_2
394 ; CHECK-NEXT: # %bb.1:
395 ; CHECK-NEXT: li a1, 128
396 ; CHECK-NEXT: .LBB33_2:
397 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
398 ; CHECK-NEXT: vadd.vi v8, v8, -1
399 ; CHECK-NEXT: addi a1, a0, -128
400 ; CHECK-NEXT: sltu a0, a0, a1
401 ; CHECK-NEXT: addi a0, a0, -1
402 ; CHECK-NEXT: and a0, a0, a1
403 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
404 ; CHECK-NEXT: vadd.vi v16, v16, -1
406 %v = call <256 x i8> @llvm.vp.add.v258i8(<256 x i8> %va, <256 x i8> splat (i8 -1), <256 x i1> splat (i1 true), i32 %evl)
410 ; Test splitting when the %evl is a known constant.
412 define <256 x i8> @vadd_vi_v258i8_evl129(<256 x i8> %va, <256 x i1> %m) {
413 ; CHECK-LABEL: vadd_vi_v258i8_evl129:
415 ; CHECK-NEXT: li a1, 128
416 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
417 ; CHECK-NEXT: vlm.v v24, (a0)
418 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
419 ; CHECK-NEXT: vmv1r.v v0, v24
420 ; CHECK-NEXT: vsetivli zero, 1, e8, m8, ta, ma
421 ; CHECK-NEXT: vadd.vi v16, v16, -1, v0.t
423 %v = call <256 x i8> @llvm.vp.add.v258i8(<256 x i8> %va, <256 x i8> splat (i8 -1), <256 x i1> %m, i32 129)
427 ; FIXME: The upper half is doing nothing.
429 define <256 x i8> @vadd_vi_v258i8_evl128(<256 x i8> %va, <256 x i1> %m) {
430 ; CHECK-LABEL: vadd_vi_v258i8_evl128:
432 ; CHECK-NEXT: li a0, 128
433 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
434 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
436 %v = call <256 x i8> @llvm.vp.add.v258i8(<256 x i8> %va, <256 x i8> splat (i8 -1), <256 x i1> %m, i32 128)
440 declare <2 x i16> @llvm.vp.add.v2i16(<2 x i16>, <2 x i16>, <2 x i1>, i32)
442 define <2 x i16> @vadd_vv_v2i16(<2 x i16> %va, <2 x i16> %b, <2 x i1> %m, i32 zeroext %evl) {
443 ; CHECK-LABEL: vadd_vv_v2i16:
445 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
446 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
448 %v = call <2 x i16> @llvm.vp.add.v2i16(<2 x i16> %va, <2 x i16> %b, <2 x i1> %m, i32 %evl)
452 define <2 x i16> @vadd_vv_v2i16_unmasked(<2 x i16> %va, <2 x i16> %b, i32 zeroext %evl) {
453 ; CHECK-LABEL: vadd_vv_v2i16_unmasked:
455 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
456 ; CHECK-NEXT: vadd.vv v8, v8, v9
458 %v = call <2 x i16> @llvm.vp.add.v2i16(<2 x i16> %va, <2 x i16> %b, <2 x i1> splat (i1 true), i32 %evl)
462 define <2 x i16> @vadd_vx_v2i16(<2 x i16> %va, i16 %b, <2 x i1> %m, i32 zeroext %evl) {
463 ; CHECK-LABEL: vadd_vx_v2i16:
465 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
466 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
468 %elt.head = insertelement <2 x i16> poison, i16 %b, i32 0
469 %vb = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
470 %v = call <2 x i16> @llvm.vp.add.v2i16(<2 x i16> %va, <2 x i16> %vb, <2 x i1> %m, i32 %evl)
474 define <2 x i16> @vadd_vx_v2i16_unmasked(<2 x i16> %va, i16 %b, i32 zeroext %evl) {
475 ; CHECK-LABEL: vadd_vx_v2i16_unmasked:
477 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
478 ; CHECK-NEXT: vadd.vx v8, v8, a0
480 %elt.head = insertelement <2 x i16> poison, i16 %b, i32 0
481 %vb = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
482 %v = call <2 x i16> @llvm.vp.add.v2i16(<2 x i16> %va, <2 x i16> %vb, <2 x i1> splat (i1 true), i32 %evl)
486 define <2 x i16> @vadd_vi_v2i16(<2 x i16> %va, <2 x i1> %m, i32 zeroext %evl) {
487 ; CHECK-LABEL: vadd_vi_v2i16:
489 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
490 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
492 %v = call <2 x i16> @llvm.vp.add.v2i16(<2 x i16> %va, <2 x i16> splat (i16 -1), <2 x i1> %m, i32 %evl)
496 define <2 x i16> @vadd_vi_v2i16_unmasked(<2 x i16> %va, i32 zeroext %evl) {
497 ; CHECK-LABEL: vadd_vi_v2i16_unmasked:
499 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
500 ; CHECK-NEXT: vadd.vi v8, v8, -1
502 %v = call <2 x i16> @llvm.vp.add.v2i16(<2 x i16> %va, <2 x i16> splat (i16 -1), <2 x i1> splat (i1 true), i32 %evl)
506 declare <4 x i16> @llvm.vp.add.v4i16(<4 x i16>, <4 x i16>, <4 x i1>, i32)
508 define <4 x i16> @vadd_vv_v4i16(<4 x i16> %va, <4 x i16> %b, <4 x i1> %m, i32 zeroext %evl) {
509 ; CHECK-LABEL: vadd_vv_v4i16:
511 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
512 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
514 %v = call <4 x i16> @llvm.vp.add.v4i16(<4 x i16> %va, <4 x i16> %b, <4 x i1> %m, i32 %evl)
518 define <4 x i16> @vadd_vv_v4i16_unmasked(<4 x i16> %va, <4 x i16> %b, i32 zeroext %evl) {
519 ; CHECK-LABEL: vadd_vv_v4i16_unmasked:
521 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
522 ; CHECK-NEXT: vadd.vv v8, v8, v9
524 %v = call <4 x i16> @llvm.vp.add.v4i16(<4 x i16> %va, <4 x i16> %b, <4 x i1> splat (i1 true), i32 %evl)
528 define <4 x i16> @vadd_vx_v4i16(<4 x i16> %va, i16 %b, <4 x i1> %m, i32 zeroext %evl) {
529 ; CHECK-LABEL: vadd_vx_v4i16:
531 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
532 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
534 %elt.head = insertelement <4 x i16> poison, i16 %b, i32 0
535 %vb = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
536 %v = call <4 x i16> @llvm.vp.add.v4i16(<4 x i16> %va, <4 x i16> %vb, <4 x i1> %m, i32 %evl)
540 define <4 x i16> @vadd_vx_v4i16_unmasked(<4 x i16> %va, i16 %b, i32 zeroext %evl) {
541 ; CHECK-LABEL: vadd_vx_v4i16_unmasked:
543 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
544 ; CHECK-NEXT: vadd.vx v8, v8, a0
546 %elt.head = insertelement <4 x i16> poison, i16 %b, i32 0
547 %vb = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
548 %v = call <4 x i16> @llvm.vp.add.v4i16(<4 x i16> %va, <4 x i16> %vb, <4 x i1> splat (i1 true), i32 %evl)
552 define <4 x i16> @vadd_vi_v4i16(<4 x i16> %va, <4 x i1> %m, i32 zeroext %evl) {
553 ; CHECK-LABEL: vadd_vi_v4i16:
555 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
556 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
558 %v = call <4 x i16> @llvm.vp.add.v4i16(<4 x i16> %va, <4 x i16> splat (i16 -1), <4 x i1> %m, i32 %evl)
562 define <4 x i16> @vadd_vi_v4i16_unmasked(<4 x i16> %va, i32 zeroext %evl) {
563 ; CHECK-LABEL: vadd_vi_v4i16_unmasked:
565 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
566 ; CHECK-NEXT: vadd.vi v8, v8, -1
568 %v = call <4 x i16> @llvm.vp.add.v4i16(<4 x i16> %va, <4 x i16> splat (i16 -1), <4 x i1> splat (i1 true), i32 %evl)
572 declare <8 x i16> @llvm.vp.add.v8i16(<8 x i16>, <8 x i16>, <8 x i1>, i32)
574 define <8 x i16> @vadd_vv_v8i16(<8 x i16> %va, <8 x i16> %b, <8 x i1> %m, i32 zeroext %evl) {
575 ; CHECK-LABEL: vadd_vv_v8i16:
577 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
578 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
580 %v = call <8 x i16> @llvm.vp.add.v8i16(<8 x i16> %va, <8 x i16> %b, <8 x i1> %m, i32 %evl)
584 define <8 x i16> @vadd_vv_v8i16_unmasked(<8 x i16> %va, <8 x i16> %b, i32 zeroext %evl) {
585 ; CHECK-LABEL: vadd_vv_v8i16_unmasked:
587 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
588 ; CHECK-NEXT: vadd.vv v8, v8, v9
590 %v = call <8 x i16> @llvm.vp.add.v8i16(<8 x i16> %va, <8 x i16> %b, <8 x i1> splat (i1 true), i32 %evl)
594 define <8 x i16> @vadd_vx_v8i16(<8 x i16> %va, i16 %b, <8 x i1> %m, i32 zeroext %evl) {
595 ; CHECK-LABEL: vadd_vx_v8i16:
597 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
598 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
600 %elt.head = insertelement <8 x i16> poison, i16 %b, i32 0
601 %vb = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
602 %v = call <8 x i16> @llvm.vp.add.v8i16(<8 x i16> %va, <8 x i16> %vb, <8 x i1> %m, i32 %evl)
606 define <8 x i16> @vadd_vx_v8i16_unmasked(<8 x i16> %va, i16 %b, i32 zeroext %evl) {
607 ; CHECK-LABEL: vadd_vx_v8i16_unmasked:
609 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
610 ; CHECK-NEXT: vadd.vx v8, v8, a0
612 %elt.head = insertelement <8 x i16> poison, i16 %b, i32 0
613 %vb = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
614 %v = call <8 x i16> @llvm.vp.add.v8i16(<8 x i16> %va, <8 x i16> %vb, <8 x i1> splat (i1 true), i32 %evl)
618 define <8 x i16> @vadd_vi_v8i16(<8 x i16> %va, <8 x i1> %m, i32 zeroext %evl) {
619 ; CHECK-LABEL: vadd_vi_v8i16:
621 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
622 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
624 %v = call <8 x i16> @llvm.vp.add.v8i16(<8 x i16> %va, <8 x i16> splat (i16 -1), <8 x i1> %m, i32 %evl)
628 define <8 x i16> @vadd_vi_v8i16_unmasked(<8 x i16> %va, i32 zeroext %evl) {
629 ; CHECK-LABEL: vadd_vi_v8i16_unmasked:
631 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
632 ; CHECK-NEXT: vadd.vi v8, v8, -1
634 %v = call <8 x i16> @llvm.vp.add.v8i16(<8 x i16> %va, <8 x i16> splat (i16 -1), <8 x i1> splat (i1 true), i32 %evl)
638 declare <16 x i16> @llvm.vp.add.v16i16(<16 x i16>, <16 x i16>, <16 x i1>, i32)
640 define <16 x i16> @vadd_vv_v16i16(<16 x i16> %va, <16 x i16> %b, <16 x i1> %m, i32 zeroext %evl) {
641 ; CHECK-LABEL: vadd_vv_v16i16:
643 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
644 ; CHECK-NEXT: vadd.vv v8, v8, v10, v0.t
646 %v = call <16 x i16> @llvm.vp.add.v16i16(<16 x i16> %va, <16 x i16> %b, <16 x i1> %m, i32 %evl)
650 define <16 x i16> @vadd_vv_v16i16_unmasked(<16 x i16> %va, <16 x i16> %b, i32 zeroext %evl) {
651 ; CHECK-LABEL: vadd_vv_v16i16_unmasked:
653 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
654 ; CHECK-NEXT: vadd.vv v8, v8, v10
656 %v = call <16 x i16> @llvm.vp.add.v16i16(<16 x i16> %va, <16 x i16> %b, <16 x i1> splat (i1 true), i32 %evl)
660 define <16 x i16> @vadd_vx_v16i16(<16 x i16> %va, i16 %b, <16 x i1> %m, i32 zeroext %evl) {
661 ; CHECK-LABEL: vadd_vx_v16i16:
663 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
664 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
666 %elt.head = insertelement <16 x i16> poison, i16 %b, i32 0
667 %vb = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
668 %v = call <16 x i16> @llvm.vp.add.v16i16(<16 x i16> %va, <16 x i16> %vb, <16 x i1> %m, i32 %evl)
672 define <16 x i16> @vadd_vx_v16i16_unmasked(<16 x i16> %va, i16 %b, i32 zeroext %evl) {
673 ; CHECK-LABEL: vadd_vx_v16i16_unmasked:
675 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
676 ; CHECK-NEXT: vadd.vx v8, v8, a0
678 %elt.head = insertelement <16 x i16> poison, i16 %b, i32 0
679 %vb = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
680 %v = call <16 x i16> @llvm.vp.add.v16i16(<16 x i16> %va, <16 x i16> %vb, <16 x i1> splat (i1 true), i32 %evl)
684 define <16 x i16> @vadd_vi_v16i16(<16 x i16> %va, <16 x i1> %m, i32 zeroext %evl) {
685 ; CHECK-LABEL: vadd_vi_v16i16:
687 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
688 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
690 %v = call <16 x i16> @llvm.vp.add.v16i16(<16 x i16> %va, <16 x i16> splat (i16 -1), <16 x i1> %m, i32 %evl)
694 define <16 x i16> @vadd_vi_v16i16_unmasked(<16 x i16> %va, i32 zeroext %evl) {
695 ; CHECK-LABEL: vadd_vi_v16i16_unmasked:
697 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
698 ; CHECK-NEXT: vadd.vi v8, v8, -1
700 %v = call <16 x i16> @llvm.vp.add.v16i16(<16 x i16> %va, <16 x i16> splat (i16 -1), <16 x i1> splat (i1 true), i32 %evl)
704 declare <2 x i32> @llvm.vp.add.v2i32(<2 x i32>, <2 x i32>, <2 x i1>, i32)
706 define <2 x i32> @vadd_vv_v2i32(<2 x i32> %va, <2 x i32> %b, <2 x i1> %m, i32 zeroext %evl) {
707 ; CHECK-LABEL: vadd_vv_v2i32:
709 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
710 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
712 %v = call <2 x i32> @llvm.vp.add.v2i32(<2 x i32> %va, <2 x i32> %b, <2 x i1> %m, i32 %evl)
716 define <2 x i32> @vadd_vv_v2i32_unmasked(<2 x i32> %va, <2 x i32> %b, i32 zeroext %evl) {
717 ; CHECK-LABEL: vadd_vv_v2i32_unmasked:
719 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
720 ; CHECK-NEXT: vadd.vv v8, v8, v9
722 %v = call <2 x i32> @llvm.vp.add.v2i32(<2 x i32> %va, <2 x i32> %b, <2 x i1> splat (i1 true), i32 %evl)
726 define <2 x i32> @vadd_vx_v2i32(<2 x i32> %va, i32 %b, <2 x i1> %m, i32 zeroext %evl) {
727 ; CHECK-LABEL: vadd_vx_v2i32:
729 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
730 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
732 %elt.head = insertelement <2 x i32> poison, i32 %b, i32 0
733 %vb = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
734 %v = call <2 x i32> @llvm.vp.add.v2i32(<2 x i32> %va, <2 x i32> %vb, <2 x i1> %m, i32 %evl)
738 define <2 x i32> @vadd_vx_v2i32_unmasked(<2 x i32> %va, i32 %b, i32 zeroext %evl) {
739 ; CHECK-LABEL: vadd_vx_v2i32_unmasked:
741 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
742 ; CHECK-NEXT: vadd.vx v8, v8, a0
744 %elt.head = insertelement <2 x i32> poison, i32 %b, i32 0
745 %vb = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
746 %v = call <2 x i32> @llvm.vp.add.v2i32(<2 x i32> %va, <2 x i32> %vb, <2 x i1> splat (i1 true), i32 %evl)
750 define <2 x i32> @vadd_vi_v2i32(<2 x i32> %va, <2 x i1> %m, i32 zeroext %evl) {
751 ; CHECK-LABEL: vadd_vi_v2i32:
753 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
754 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
756 %v = call <2 x i32> @llvm.vp.add.v2i32(<2 x i32> %va, <2 x i32> splat (i32 -1), <2 x i1> %m, i32 %evl)
760 define <2 x i32> @vadd_vi_v2i32_unmasked(<2 x i32> %va, i32 zeroext %evl) {
761 ; CHECK-LABEL: vadd_vi_v2i32_unmasked:
763 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
764 ; CHECK-NEXT: vadd.vi v8, v8, -1
766 %v = call <2 x i32> @llvm.vp.add.v2i32(<2 x i32> %va, <2 x i32> splat (i32 -1), <2 x i1> splat (i1 true), i32 %evl)
770 declare <4 x i32> @llvm.vp.add.v4i32(<4 x i32>, <4 x i32>, <4 x i1>, i32)
772 define <4 x i32> @vadd_vv_v4i32(<4 x i32> %va, <4 x i32> %b, <4 x i1> %m, i32 zeroext %evl) {
773 ; CHECK-LABEL: vadd_vv_v4i32:
775 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
776 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
778 %v = call <4 x i32> @llvm.vp.add.v4i32(<4 x i32> %va, <4 x i32> %b, <4 x i1> %m, i32 %evl)
782 define <4 x i32> @vadd_vv_v4i32_unmasked(<4 x i32> %va, <4 x i32> %b, i32 zeroext %evl) {
783 ; CHECK-LABEL: vadd_vv_v4i32_unmasked:
785 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
786 ; CHECK-NEXT: vadd.vv v8, v8, v9
788 %v = call <4 x i32> @llvm.vp.add.v4i32(<4 x i32> %va, <4 x i32> %b, <4 x i1> splat (i1 true), i32 %evl)
792 define <4 x i32> @vadd_vx_v4i32(<4 x i32> %va, i32 %b, <4 x i1> %m, i32 zeroext %evl) {
793 ; CHECK-LABEL: vadd_vx_v4i32:
795 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
796 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
798 %elt.head = insertelement <4 x i32> poison, i32 %b, i32 0
799 %vb = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
800 %v = call <4 x i32> @llvm.vp.add.v4i32(<4 x i32> %va, <4 x i32> %vb, <4 x i1> %m, i32 %evl)
804 define <4 x i32> @vadd_vx_v4i32_unmasked(<4 x i32> %va, i32 %b, i32 zeroext %evl) {
805 ; CHECK-LABEL: vadd_vx_v4i32_unmasked:
807 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
808 ; CHECK-NEXT: vadd.vx v8, v8, a0
810 %elt.head = insertelement <4 x i32> poison, i32 %b, i32 0
811 %vb = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
812 %v = call <4 x i32> @llvm.vp.add.v4i32(<4 x i32> %va, <4 x i32> %vb, <4 x i1> splat (i1 true), i32 %evl)
816 define <4 x i32> @vadd_vi_v4i32(<4 x i32> %va, <4 x i1> %m, i32 zeroext %evl) {
817 ; CHECK-LABEL: vadd_vi_v4i32:
819 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
820 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
822 %v = call <4 x i32> @llvm.vp.add.v4i32(<4 x i32> %va, <4 x i32> splat (i32 -1), <4 x i1> %m, i32 %evl)
826 define <4 x i32> @vadd_vi_v4i32_unmasked(<4 x i32> %va, i32 zeroext %evl) {
827 ; CHECK-LABEL: vadd_vi_v4i32_unmasked:
829 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
830 ; CHECK-NEXT: vadd.vi v8, v8, -1
832 %v = call <4 x i32> @llvm.vp.add.v4i32(<4 x i32> %va, <4 x i32> splat (i32 -1), <4 x i1> splat (i1 true), i32 %evl)
836 declare <8 x i32> @llvm.vp.add.v8i32(<8 x i32>, <8 x i32>, <8 x i1>, i32)
838 define <8 x i32> @vadd_vv_v8i32(<8 x i32> %va, <8 x i32> %b, <8 x i1> %m, i32 zeroext %evl) {
839 ; CHECK-LABEL: vadd_vv_v8i32:
841 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
842 ; CHECK-NEXT: vadd.vv v8, v8, v10, v0.t
844 %v = call <8 x i32> @llvm.vp.add.v8i32(<8 x i32> %va, <8 x i32> %b, <8 x i1> %m, i32 %evl)
848 define <8 x i32> @vadd_vv_v8i32_unmasked(<8 x i32> %va, <8 x i32> %b, i32 zeroext %evl) {
849 ; CHECK-LABEL: vadd_vv_v8i32_unmasked:
851 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
852 ; CHECK-NEXT: vadd.vv v8, v8, v10
854 %v = call <8 x i32> @llvm.vp.add.v8i32(<8 x i32> %va, <8 x i32> %b, <8 x i1> splat (i1 true), i32 %evl)
858 define <8 x i32> @vadd_vx_v8i32(<8 x i32> %va, i32 %b, <8 x i1> %m, i32 zeroext %evl) {
859 ; CHECK-LABEL: vadd_vx_v8i32:
861 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
862 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
864 %elt.head = insertelement <8 x i32> poison, i32 %b, i32 0
865 %vb = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
866 %v = call <8 x i32> @llvm.vp.add.v8i32(<8 x i32> %va, <8 x i32> %vb, <8 x i1> %m, i32 %evl)
870 define <8 x i32> @vadd_vx_v8i32_unmasked(<8 x i32> %va, i32 %b, i32 zeroext %evl) {
871 ; CHECK-LABEL: vadd_vx_v8i32_unmasked:
873 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
874 ; CHECK-NEXT: vadd.vx v8, v8, a0
876 %elt.head = insertelement <8 x i32> poison, i32 %b, i32 0
877 %vb = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
878 %v = call <8 x i32> @llvm.vp.add.v8i32(<8 x i32> %va, <8 x i32> %vb, <8 x i1> splat (i1 true), i32 %evl)
882 define <8 x i32> @vadd_vi_v8i32(<8 x i32> %va, <8 x i1> %m, i32 zeroext %evl) {
883 ; CHECK-LABEL: vadd_vi_v8i32:
885 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
886 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
888 %v = call <8 x i32> @llvm.vp.add.v8i32(<8 x i32> %va, <8 x i32> splat (i32 -1), <8 x i1> %m, i32 %evl)
892 define <8 x i32> @vadd_vi_v8i32_unmasked(<8 x i32> %va, i32 zeroext %evl) {
893 ; CHECK-LABEL: vadd_vi_v8i32_unmasked:
895 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
896 ; CHECK-NEXT: vadd.vi v8, v8, -1
898 %v = call <8 x i32> @llvm.vp.add.v8i32(<8 x i32> %va, <8 x i32> splat (i32 -1), <8 x i1> splat (i1 true), i32 %evl)
902 declare <16 x i32> @llvm.vp.add.v16i32(<16 x i32>, <16 x i32>, <16 x i1>, i32)
904 define <16 x i32> @vadd_vv_v16i32(<16 x i32> %va, <16 x i32> %b, <16 x i1> %m, i32 zeroext %evl) {
905 ; CHECK-LABEL: vadd_vv_v16i32:
907 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
908 ; CHECK-NEXT: vadd.vv v8, v8, v12, v0.t
910 %v = call <16 x i32> @llvm.vp.add.v16i32(<16 x i32> %va, <16 x i32> %b, <16 x i1> %m, i32 %evl)
914 define <16 x i32> @vadd_vv_v16i32_unmasked(<16 x i32> %va, <16 x i32> %b, i32 zeroext %evl) {
915 ; CHECK-LABEL: vadd_vv_v16i32_unmasked:
917 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
918 ; CHECK-NEXT: vadd.vv v8, v8, v12
920 %v = call <16 x i32> @llvm.vp.add.v16i32(<16 x i32> %va, <16 x i32> %b, <16 x i1> splat (i1 true), i32 %evl)
924 define <16 x i32> @vadd_vx_v16i32(<16 x i32> %va, i32 %b, <16 x i1> %m, i32 zeroext %evl) {
925 ; CHECK-LABEL: vadd_vx_v16i32:
927 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
928 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
930 %elt.head = insertelement <16 x i32> poison, i32 %b, i32 0
931 %vb = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
932 %v = call <16 x i32> @llvm.vp.add.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i1> %m, i32 %evl)
936 define <16 x i32> @vadd_vx_v16i32_unmasked(<16 x i32> %va, i32 %b, i32 zeroext %evl) {
937 ; CHECK-LABEL: vadd_vx_v16i32_unmasked:
939 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
940 ; CHECK-NEXT: vadd.vx v8, v8, a0
942 %elt.head = insertelement <16 x i32> poison, i32 %b, i32 0
943 %vb = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
944 %v = call <16 x i32> @llvm.vp.add.v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i1> splat (i1 true), i32 %evl)
948 define <16 x i32> @vadd_vi_v16i32(<16 x i32> %va, <16 x i1> %m, i32 zeroext %evl) {
949 ; CHECK-LABEL: vadd_vi_v16i32:
951 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
952 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
954 %v = call <16 x i32> @llvm.vp.add.v16i32(<16 x i32> %va, <16 x i32> splat (i32 -1), <16 x i1> %m, i32 %evl)
958 define <16 x i32> @vadd_vi_v16i32_unmasked(<16 x i32> %va, i32 zeroext %evl) {
959 ; CHECK-LABEL: vadd_vi_v16i32_unmasked:
961 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
962 ; CHECK-NEXT: vadd.vi v8, v8, -1
964 %v = call <16 x i32> @llvm.vp.add.v16i32(<16 x i32> %va, <16 x i32> splat (i32 -1), <16 x i1> splat (i1 true), i32 %evl)
968 declare <2 x i64> @llvm.vp.add.v2i64(<2 x i64>, <2 x i64>, <2 x i1>, i32)
970 define <2 x i64> @vadd_vv_v2i64(<2 x i64> %va, <2 x i64> %b, <2 x i1> %m, i32 zeroext %evl) {
971 ; CHECK-LABEL: vadd_vv_v2i64:
973 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
974 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
976 %v = call <2 x i64> @llvm.vp.add.v2i64(<2 x i64> %va, <2 x i64> %b, <2 x i1> %m, i32 %evl)
980 define <2 x i64> @vadd_vv_v2i64_unmasked(<2 x i64> %va, <2 x i64> %b, i32 zeroext %evl) {
981 ; CHECK-LABEL: vadd_vv_v2i64_unmasked:
983 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
984 ; CHECK-NEXT: vadd.vv v8, v8, v9
986 %v = call <2 x i64> @llvm.vp.add.v2i64(<2 x i64> %va, <2 x i64> %b, <2 x i1> splat (i1 true), i32 %evl)
990 define <2 x i64> @vadd_vx_v2i64(<2 x i64> %va, i64 %b, <2 x i1> %m, i32 zeroext %evl) {
991 ; RV32-LABEL: vadd_vx_v2i64:
993 ; RV32-NEXT: addi sp, sp, -16
994 ; RV32-NEXT: .cfi_def_cfa_offset 16
995 ; RV32-NEXT: sw a1, 12(sp)
996 ; RV32-NEXT: sw a0, 8(sp)
997 ; RV32-NEXT: addi a0, sp, 8
998 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
999 ; RV32-NEXT: vlse64.v v9, (a0), zero
1000 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1001 ; RV32-NEXT: vadd.vv v8, v8, v9, v0.t
1002 ; RV32-NEXT: addi sp, sp, 16
1005 ; RV64-LABEL: vadd_vx_v2i64:
1007 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1008 ; RV64-NEXT: vadd.vx v8, v8, a0, v0.t
1010 %elt.head = insertelement <2 x i64> poison, i64 %b, i32 0
1011 %vb = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
1012 %v = call <2 x i64> @llvm.vp.add.v2i64(<2 x i64> %va, <2 x i64> %vb, <2 x i1> %m, i32 %evl)
1016 define <2 x i64> @vadd_vx_v2i64_unmasked(<2 x i64> %va, i64 %b, i32 zeroext %evl) {
1017 ; RV32-LABEL: vadd_vx_v2i64_unmasked:
1019 ; RV32-NEXT: addi sp, sp, -16
1020 ; RV32-NEXT: .cfi_def_cfa_offset 16
1021 ; RV32-NEXT: sw a1, 12(sp)
1022 ; RV32-NEXT: sw a0, 8(sp)
1023 ; RV32-NEXT: addi a0, sp, 8
1024 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
1025 ; RV32-NEXT: vlse64.v v9, (a0), zero
1026 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1027 ; RV32-NEXT: vadd.vv v8, v8, v9
1028 ; RV32-NEXT: addi sp, sp, 16
1031 ; RV64-LABEL: vadd_vx_v2i64_unmasked:
1033 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1034 ; RV64-NEXT: vadd.vx v8, v8, a0
1036 %elt.head = insertelement <2 x i64> poison, i64 %b, i32 0
1037 %vb = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
1038 %v = call <2 x i64> @llvm.vp.add.v2i64(<2 x i64> %va, <2 x i64> %vb, <2 x i1> splat (i1 true), i32 %evl)
1042 define <2 x i64> @vadd_vi_v2i64(<2 x i64> %va, <2 x i1> %m, i32 zeroext %evl) {
1043 ; CHECK-LABEL: vadd_vi_v2i64:
1045 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1046 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1048 %v = call <2 x i64> @llvm.vp.add.v2i64(<2 x i64> %va, <2 x i64> splat (i64 -1), <2 x i1> %m, i32 %evl)
1052 define <2 x i64> @vadd_vi_v2i64_unmasked(<2 x i64> %va, i32 zeroext %evl) {
1053 ; CHECK-LABEL: vadd_vi_v2i64_unmasked:
1055 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1056 ; CHECK-NEXT: vadd.vi v8, v8, -1
1058 %v = call <2 x i64> @llvm.vp.add.v2i64(<2 x i64> %va, <2 x i64> splat (i64 -1), <2 x i1> splat (i1 true), i32 %evl)
1062 declare <4 x i64> @llvm.vp.add.v4i64(<4 x i64>, <4 x i64>, <4 x i1>, i32)
1064 define <4 x i64> @vadd_vv_v4i64(<4 x i64> %va, <4 x i64> %b, <4 x i1> %m, i32 zeroext %evl) {
1065 ; CHECK-LABEL: vadd_vv_v4i64:
1067 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1068 ; CHECK-NEXT: vadd.vv v8, v8, v10, v0.t
1070 %v = call <4 x i64> @llvm.vp.add.v4i64(<4 x i64> %va, <4 x i64> %b, <4 x i1> %m, i32 %evl)
1074 define <4 x i64> @vadd_vv_v4i64_unmasked(<4 x i64> %va, <4 x i64> %b, i32 zeroext %evl) {
1075 ; CHECK-LABEL: vadd_vv_v4i64_unmasked:
1077 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1078 ; CHECK-NEXT: vadd.vv v8, v8, v10
1080 %v = call <4 x i64> @llvm.vp.add.v4i64(<4 x i64> %va, <4 x i64> %b, <4 x i1> splat (i1 true), i32 %evl)
1084 define <4 x i64> @vadd_vx_v4i64(<4 x i64> %va, i64 %b, <4 x i1> %m, i32 zeroext %evl) {
1085 ; RV32-LABEL: vadd_vx_v4i64:
1087 ; RV32-NEXT: addi sp, sp, -16
1088 ; RV32-NEXT: .cfi_def_cfa_offset 16
1089 ; RV32-NEXT: sw a1, 12(sp)
1090 ; RV32-NEXT: sw a0, 8(sp)
1091 ; RV32-NEXT: addi a0, sp, 8
1092 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
1093 ; RV32-NEXT: vlse64.v v10, (a0), zero
1094 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1095 ; RV32-NEXT: vadd.vv v8, v8, v10, v0.t
1096 ; RV32-NEXT: addi sp, sp, 16
1099 ; RV64-LABEL: vadd_vx_v4i64:
1101 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1102 ; RV64-NEXT: vadd.vx v8, v8, a0, v0.t
1104 %elt.head = insertelement <4 x i64> poison, i64 %b, i32 0
1105 %vb = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
1106 %v = call <4 x i64> @llvm.vp.add.v4i64(<4 x i64> %va, <4 x i64> %vb, <4 x i1> %m, i32 %evl)
1110 define <4 x i64> @vadd_vx_v4i64_unmasked(<4 x i64> %va, i64 %b, i32 zeroext %evl) {
1111 ; RV32-LABEL: vadd_vx_v4i64_unmasked:
1113 ; RV32-NEXT: addi sp, sp, -16
1114 ; RV32-NEXT: .cfi_def_cfa_offset 16
1115 ; RV32-NEXT: sw a1, 12(sp)
1116 ; RV32-NEXT: sw a0, 8(sp)
1117 ; RV32-NEXT: addi a0, sp, 8
1118 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
1119 ; RV32-NEXT: vlse64.v v10, (a0), zero
1120 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1121 ; RV32-NEXT: vadd.vv v8, v8, v10
1122 ; RV32-NEXT: addi sp, sp, 16
1125 ; RV64-LABEL: vadd_vx_v4i64_unmasked:
1127 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1128 ; RV64-NEXT: vadd.vx v8, v8, a0
1130 %elt.head = insertelement <4 x i64> poison, i64 %b, i32 0
1131 %vb = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
1132 %v = call <4 x i64> @llvm.vp.add.v4i64(<4 x i64> %va, <4 x i64> %vb, <4 x i1> splat (i1 true), i32 %evl)
1136 define <4 x i64> @vadd_vi_v4i64(<4 x i64> %va, <4 x i1> %m, i32 zeroext %evl) {
1137 ; CHECK-LABEL: vadd_vi_v4i64:
1139 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1140 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1142 %v = call <4 x i64> @llvm.vp.add.v4i64(<4 x i64> %va, <4 x i64> splat (i64 -1), <4 x i1> %m, i32 %evl)
1146 define <4 x i64> @vadd_vi_v4i64_unmasked(<4 x i64> %va, i32 zeroext %evl) {
1147 ; CHECK-LABEL: vadd_vi_v4i64_unmasked:
1149 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1150 ; CHECK-NEXT: vadd.vi v8, v8, -1
1152 %v = call <4 x i64> @llvm.vp.add.v4i64(<4 x i64> %va, <4 x i64> splat (i64 -1), <4 x i1> splat (i1 true), i32 %evl)
1156 declare <8 x i64> @llvm.vp.add.v8i64(<8 x i64>, <8 x i64>, <8 x i1>, i32)
1158 define <8 x i64> @vadd_vv_v8i64(<8 x i64> %va, <8 x i64> %b, <8 x i1> %m, i32 zeroext %evl) {
1159 ; CHECK-LABEL: vadd_vv_v8i64:
1161 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1162 ; CHECK-NEXT: vadd.vv v8, v8, v12, v0.t
1164 %v = call <8 x i64> @llvm.vp.add.v8i64(<8 x i64> %va, <8 x i64> %b, <8 x i1> %m, i32 %evl)
1168 define <8 x i64> @vadd_vv_v8i64_unmasked(<8 x i64> %va, <8 x i64> %b, i32 zeroext %evl) {
1169 ; CHECK-LABEL: vadd_vv_v8i64_unmasked:
1171 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1172 ; CHECK-NEXT: vadd.vv v8, v8, v12
1174 %v = call <8 x i64> @llvm.vp.add.v8i64(<8 x i64> %va, <8 x i64> %b, <8 x i1> splat (i1 true), i32 %evl)
1178 define <8 x i64> @vadd_vx_v8i64(<8 x i64> %va, i64 %b, <8 x i1> %m, i32 zeroext %evl) {
1179 ; RV32-LABEL: vadd_vx_v8i64:
1181 ; RV32-NEXT: addi sp, sp, -16
1182 ; RV32-NEXT: .cfi_def_cfa_offset 16
1183 ; RV32-NEXT: sw a1, 12(sp)
1184 ; RV32-NEXT: sw a0, 8(sp)
1185 ; RV32-NEXT: addi a0, sp, 8
1186 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
1187 ; RV32-NEXT: vlse64.v v12, (a0), zero
1188 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
1189 ; RV32-NEXT: vadd.vv v8, v8, v12, v0.t
1190 ; RV32-NEXT: addi sp, sp, 16
1193 ; RV64-LABEL: vadd_vx_v8i64:
1195 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
1196 ; RV64-NEXT: vadd.vx v8, v8, a0, v0.t
1198 %elt.head = insertelement <8 x i64> poison, i64 %b, i32 0
1199 %vb = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
1200 %v = call <8 x i64> @llvm.vp.add.v8i64(<8 x i64> %va, <8 x i64> %vb, <8 x i1> %m, i32 %evl)
1204 define <8 x i64> @vadd_vx_v8i64_unmasked(<8 x i64> %va, i64 %b, i32 zeroext %evl) {
1205 ; RV32-LABEL: vadd_vx_v8i64_unmasked:
1207 ; RV32-NEXT: addi sp, sp, -16
1208 ; RV32-NEXT: .cfi_def_cfa_offset 16
1209 ; RV32-NEXT: sw a1, 12(sp)
1210 ; RV32-NEXT: sw a0, 8(sp)
1211 ; RV32-NEXT: addi a0, sp, 8
1212 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
1213 ; RV32-NEXT: vlse64.v v12, (a0), zero
1214 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
1215 ; RV32-NEXT: vadd.vv v8, v8, v12
1216 ; RV32-NEXT: addi sp, sp, 16
1219 ; RV64-LABEL: vadd_vx_v8i64_unmasked:
1221 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
1222 ; RV64-NEXT: vadd.vx v8, v8, a0
1224 %elt.head = insertelement <8 x i64> poison, i64 %b, i32 0
1225 %vb = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
1226 %v = call <8 x i64> @llvm.vp.add.v8i64(<8 x i64> %va, <8 x i64> %vb, <8 x i1> splat (i1 true), i32 %evl)
1230 define <8 x i64> @vadd_vi_v8i64(<8 x i64> %va, <8 x i1> %m, i32 zeroext %evl) {
1231 ; CHECK-LABEL: vadd_vi_v8i64:
1233 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1234 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1236 %v = call <8 x i64> @llvm.vp.add.v8i64(<8 x i64> %va, <8 x i64> splat (i64 -1), <8 x i1> %m, i32 %evl)
1240 define <8 x i64> @vadd_vi_v8i64_unmasked(<8 x i64> %va, i32 zeroext %evl) {
1241 ; CHECK-LABEL: vadd_vi_v8i64_unmasked:
1243 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1244 ; CHECK-NEXT: vadd.vi v8, v8, -1
1246 %v = call <8 x i64> @llvm.vp.add.v8i64(<8 x i64> %va, <8 x i64> splat (i64 -1), <8 x i1> splat (i1 true), i32 %evl)
1250 declare <16 x i64> @llvm.vp.add.v16i64(<16 x i64>, <16 x i64>, <16 x i1>, i32)
1252 define <16 x i64> @vadd_vv_v16i64(<16 x i64> %va, <16 x i64> %b, <16 x i1> %m, i32 zeroext %evl) {
1253 ; CHECK-LABEL: vadd_vv_v16i64:
1255 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1256 ; CHECK-NEXT: vadd.vv v8, v8, v16, v0.t
1258 %v = call <16 x i64> @llvm.vp.add.v16i64(<16 x i64> %va, <16 x i64> %b, <16 x i1> %m, i32 %evl)
1262 define <16 x i64> @vadd_vv_v16i64_unmasked(<16 x i64> %va, <16 x i64> %b, i32 zeroext %evl) {
1263 ; CHECK-LABEL: vadd_vv_v16i64_unmasked:
1265 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1266 ; CHECK-NEXT: vadd.vv v8, v8, v16
1268 %v = call <16 x i64> @llvm.vp.add.v16i64(<16 x i64> %va, <16 x i64> %b, <16 x i1> splat (i1 true), i32 %evl)
1272 define <16 x i64> @vadd_vx_v16i64(<16 x i64> %va, i64 %b, <16 x i1> %m, i32 zeroext %evl) {
1273 ; RV32-LABEL: vadd_vx_v16i64:
1275 ; RV32-NEXT: addi sp, sp, -16
1276 ; RV32-NEXT: .cfi_def_cfa_offset 16
1277 ; RV32-NEXT: sw a1, 12(sp)
1278 ; RV32-NEXT: sw a0, 8(sp)
1279 ; RV32-NEXT: addi a0, sp, 8
1280 ; RV32-NEXT: vsetivli zero, 16, e64, m8, ta, ma
1281 ; RV32-NEXT: vlse64.v v16, (a0), zero
1282 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1283 ; RV32-NEXT: vadd.vv v8, v8, v16, v0.t
1284 ; RV32-NEXT: addi sp, sp, 16
1287 ; RV64-LABEL: vadd_vx_v16i64:
1289 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1290 ; RV64-NEXT: vadd.vx v8, v8, a0, v0.t
1292 %elt.head = insertelement <16 x i64> poison, i64 %b, i32 0
1293 %vb = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
1294 %v = call <16 x i64> @llvm.vp.add.v16i64(<16 x i64> %va, <16 x i64> %vb, <16 x i1> %m, i32 %evl)
1298 define <16 x i64> @vadd_vx_v16i64_unmasked(<16 x i64> %va, i64 %b, i32 zeroext %evl) {
1299 ; RV32-LABEL: vadd_vx_v16i64_unmasked:
1301 ; RV32-NEXT: addi sp, sp, -16
1302 ; RV32-NEXT: .cfi_def_cfa_offset 16
1303 ; RV32-NEXT: sw a1, 12(sp)
1304 ; RV32-NEXT: sw a0, 8(sp)
1305 ; RV32-NEXT: addi a0, sp, 8
1306 ; RV32-NEXT: vsetivli zero, 16, e64, m8, ta, ma
1307 ; RV32-NEXT: vlse64.v v16, (a0), zero
1308 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1309 ; RV32-NEXT: vadd.vv v8, v8, v16
1310 ; RV32-NEXT: addi sp, sp, 16
1313 ; RV64-LABEL: vadd_vx_v16i64_unmasked:
1315 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1316 ; RV64-NEXT: vadd.vx v8, v8, a0
1318 %elt.head = insertelement <16 x i64> poison, i64 %b, i32 0
1319 %vb = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
1320 %v = call <16 x i64> @llvm.vp.add.v16i64(<16 x i64> %va, <16 x i64> %vb, <16 x i1> splat (i1 true), i32 %evl)
1324 define <16 x i64> @vadd_vi_v16i64(<16 x i64> %va, <16 x i1> %m, i32 zeroext %evl) {
1325 ; CHECK-LABEL: vadd_vi_v16i64:
1327 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1328 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1330 %v = call <16 x i64> @llvm.vp.add.v16i64(<16 x i64> %va, <16 x i64> splat (i64 -1), <16 x i1> %m, i32 %evl)
1334 define <16 x i64> @vadd_vi_v16i64_unmasked(<16 x i64> %va, i32 zeroext %evl) {
1335 ; CHECK-LABEL: vadd_vi_v16i64_unmasked:
1337 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1338 ; CHECK-NEXT: vadd.vi v8, v8, -1
1340 %v = call <16 x i64> @llvm.vp.add.v16i64(<16 x i64> %va, <16 x i64> splat (i64 -1), <16 x i1> splat (i1 true), i32 %evl)
1344 ; Test that split-legalization works as expected.
1346 declare <32 x i64> @llvm.vp.add.v32i64(<32 x i64>, <32 x i64>, <32 x i1>, i32)
1348 define <32 x i64> @vadd_vx_v32i64(<32 x i64> %va, <32 x i1> %m, i32 zeroext %evl) {
1349 ; RV32-LABEL: vadd_vx_v32i64:
1351 ; RV32-NEXT: li a2, 16
1352 ; RV32-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
1353 ; RV32-NEXT: vslidedown.vi v7, v0, 2
1354 ; RV32-NEXT: mv a1, a0
1355 ; RV32-NEXT: bltu a0, a2, .LBB108_2
1356 ; RV32-NEXT: # %bb.1:
1357 ; RV32-NEXT: li a1, 16
1358 ; RV32-NEXT: .LBB108_2:
1359 ; RV32-NEXT: li a2, 32
1360 ; RV32-NEXT: vsetvli zero, a2, e32, m8, ta, ma
1361 ; RV32-NEXT: vmv.v.i v24, -1
1362 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1363 ; RV32-NEXT: vadd.vv v8, v8, v24, v0.t
1364 ; RV32-NEXT: addi a1, a0, -16
1365 ; RV32-NEXT: sltu a0, a0, a1
1366 ; RV32-NEXT: addi a0, a0, -1
1367 ; RV32-NEXT: and a0, a0, a1
1368 ; RV32-NEXT: vmv1r.v v0, v7
1369 ; RV32-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1370 ; RV32-NEXT: vadd.vv v16, v16, v24, v0.t
1373 ; RV64-LABEL: vadd_vx_v32i64:
1375 ; RV64-NEXT: li a2, 16
1376 ; RV64-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
1377 ; RV64-NEXT: vslidedown.vi v24, v0, 2
1378 ; RV64-NEXT: mv a1, a0
1379 ; RV64-NEXT: bltu a0, a2, .LBB108_2
1380 ; RV64-NEXT: # %bb.1:
1381 ; RV64-NEXT: li a1, 16
1382 ; RV64-NEXT: .LBB108_2:
1383 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1384 ; RV64-NEXT: vadd.vi v8, v8, -1, v0.t
1385 ; RV64-NEXT: addi a1, a0, -16
1386 ; RV64-NEXT: sltu a0, a0, a1
1387 ; RV64-NEXT: addi a0, a0, -1
1388 ; RV64-NEXT: and a0, a0, a1
1389 ; RV64-NEXT: vmv1r.v v0, v24
1390 ; RV64-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1391 ; RV64-NEXT: vadd.vi v16, v16, -1, v0.t
1393 %v = call <32 x i64> @llvm.vp.add.v32i64(<32 x i64> %va, <32 x i64> splat (i64 -1), <32 x i1> %m, i32 %evl)
1397 define <32 x i64> @vadd_vi_v32i64_unmasked(<32 x i64> %va, i32 zeroext %evl) {
1398 ; RV32-LABEL: vadd_vi_v32i64_unmasked:
1400 ; RV32-NEXT: li a2, 16
1401 ; RV32-NEXT: mv a1, a0
1402 ; RV32-NEXT: bltu a0, a2, .LBB109_2
1403 ; RV32-NEXT: # %bb.1:
1404 ; RV32-NEXT: li a1, 16
1405 ; RV32-NEXT: .LBB109_2:
1406 ; RV32-NEXT: li a2, 32
1407 ; RV32-NEXT: vsetvli zero, a2, e32, m8, ta, ma
1408 ; RV32-NEXT: vmv.v.i v24, -1
1409 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1410 ; RV32-NEXT: vadd.vv v8, v8, v24
1411 ; RV32-NEXT: addi a1, a0, -16
1412 ; RV32-NEXT: sltu a0, a0, a1
1413 ; RV32-NEXT: addi a0, a0, -1
1414 ; RV32-NEXT: and a0, a0, a1
1415 ; RV32-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1416 ; RV32-NEXT: vadd.vv v16, v16, v24
1419 ; RV64-LABEL: vadd_vi_v32i64_unmasked:
1421 ; RV64-NEXT: li a2, 16
1422 ; RV64-NEXT: mv a1, a0
1423 ; RV64-NEXT: bltu a0, a2, .LBB109_2
1424 ; RV64-NEXT: # %bb.1:
1425 ; RV64-NEXT: li a1, 16
1426 ; RV64-NEXT: .LBB109_2:
1427 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1428 ; RV64-NEXT: vadd.vi v8, v8, -1
1429 ; RV64-NEXT: addi a1, a0, -16
1430 ; RV64-NEXT: sltu a0, a0, a1
1431 ; RV64-NEXT: addi a0, a0, -1
1432 ; RV64-NEXT: and a0, a0, a1
1433 ; RV64-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1434 ; RV64-NEXT: vadd.vi v16, v16, -1
1436 %v = call <32 x i64> @llvm.vp.add.v32i64(<32 x i64> %va, <32 x i64> splat (i64 -1), <32 x i1> splat (i1 true), i32 %evl)
1440 ; FIXME: We don't match vadd.vi on RV32.
1442 define <32 x i64> @vadd_vx_v32i64_evl12(<32 x i64> %va, <32 x i1> %m) {
1443 ; RV32-LABEL: vadd_vx_v32i64_evl12:
1445 ; RV32-NEXT: li a0, 32
1446 ; RV32-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1447 ; RV32-NEXT: vmv.v.i v16, -1
1448 ; RV32-NEXT: vsetivli zero, 12, e64, m8, ta, ma
1449 ; RV32-NEXT: vadd.vv v8, v8, v16, v0.t
1452 ; RV64-LABEL: vadd_vx_v32i64_evl12:
1454 ; RV64-NEXT: vsetivli zero, 12, e64, m8, ta, ma
1455 ; RV64-NEXT: vadd.vi v8, v8, -1, v0.t
1457 %v = call <32 x i64> @llvm.vp.add.v32i64(<32 x i64> %va, <32 x i64> splat (i64 -1), <32 x i1> %m, i32 12)
1461 define <32 x i64> @vadd_vx_v32i64_evl27(<32 x i64> %va, <32 x i1> %m) {
1462 ; RV32-LABEL: vadd_vx_v32i64_evl27:
1464 ; RV32-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
1465 ; RV32-NEXT: vslidedown.vi v7, v0, 2
1466 ; RV32-NEXT: li a0, 32
1467 ; RV32-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1468 ; RV32-NEXT: vmv.v.i v24, -1
1469 ; RV32-NEXT: vsetivli zero, 16, e64, m8, ta, ma
1470 ; RV32-NEXT: vadd.vv v8, v8, v24, v0.t
1471 ; RV32-NEXT: vmv1r.v v0, v7
1472 ; RV32-NEXT: vsetivli zero, 11, e64, m8, ta, ma
1473 ; RV32-NEXT: vadd.vv v16, v16, v24, v0.t
1476 ; RV64-LABEL: vadd_vx_v32i64_evl27:
1478 ; RV64-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
1479 ; RV64-NEXT: vslidedown.vi v24, v0, 2
1480 ; RV64-NEXT: vsetivli zero, 16, e64, m8, ta, ma
1481 ; RV64-NEXT: vadd.vi v8, v8, -1, v0.t
1482 ; RV64-NEXT: vmv1r.v v0, v24
1483 ; RV64-NEXT: vsetivli zero, 11, e64, m8, ta, ma
1484 ; RV64-NEXT: vadd.vi v16, v16, -1, v0.t
1486 %v = call <32 x i64> @llvm.vp.add.v32i64(<32 x i64> %va, <32 x i64> splat (i64 -1), <32 x i1> %m, i32 27)