1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < %s \
3 ; RUN: | FileCheck %s --check-prefixes=CHECK,RV32
4 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s \
5 ; RUN: | FileCheck %s --check-prefixes=CHECK,RV64
7 declare <vscale x 8 x i7> @llvm.vp.add.nxv8i7(<vscale x 8 x i7>, <vscale x 8 x i7>, <vscale x 8 x i1>, i32)
9 define <vscale x 8 x i7> @vadd_vx_nxv8i7(<vscale x 8 x i7> %a, i7 signext %b, <vscale x 8 x i1> %mask, i32 zeroext %evl) {
10 ; CHECK-LABEL: vadd_vx_nxv8i7:
12 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
13 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
15 %elt.head = insertelement <vscale x 8 x i7> poison, i7 %b, i32 0
16 %vb = shufflevector <vscale x 8 x i7> %elt.head, <vscale x 8 x i7> poison, <vscale x 8 x i32> zeroinitializer
17 %v = call <vscale x 8 x i7> @llvm.vp.add.nxv8i7(<vscale x 8 x i7> %a, <vscale x 8 x i7> %vb, <vscale x 8 x i1> %mask, i32 %evl)
18 ret <vscale x 8 x i7> %v
21 declare <vscale x 1 x i8> @llvm.vp.add.nxv1i8(<vscale x 1 x i8>, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
23 define <vscale x 1 x i8> @vadd_vv_nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
24 ; CHECK-LABEL: vadd_vv_nxv1i8:
26 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
27 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
29 %v = call <vscale x 1 x i8> @llvm.vp.add.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %b, <vscale x 1 x i1> %m, i32 %evl)
30 ret <vscale x 1 x i8> %v
33 define <vscale x 1 x i8> @vadd_vv_nxv1i8_unmasked(<vscale x 1 x i8> %va, <vscale x 1 x i8> %b, i32 zeroext %evl) {
34 ; CHECK-LABEL: vadd_vv_nxv1i8_unmasked:
36 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
37 ; CHECK-NEXT: vadd.vv v8, v8, v9
39 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
40 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
41 %v = call <vscale x 1 x i8> @llvm.vp.add.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %b, <vscale x 1 x i1> %m, i32 %evl)
42 ret <vscale x 1 x i8> %v
45 define <vscale x 1 x i8> @vadd_vx_nxv1i8(<vscale x 1 x i8> %va, i8 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
46 ; CHECK-LABEL: vadd_vx_nxv1i8:
48 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
49 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
51 %elt.head = insertelement <vscale x 1 x i8> poison, i8 %b, i32 0
52 %vb = shufflevector <vscale x 1 x i8> %elt.head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
53 %v = call <vscale x 1 x i8> @llvm.vp.add.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb, <vscale x 1 x i1> %m, i32 %evl)
54 ret <vscale x 1 x i8> %v
57 define <vscale x 1 x i8> @vadd_vx_nxv1i8_commute(<vscale x 1 x i8> %va, i8 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
58 ; CHECK-LABEL: vadd_vx_nxv1i8_commute:
60 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
61 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
63 %elt.head = insertelement <vscale x 1 x i8> poison, i8 %b, i32 0
64 %vb = shufflevector <vscale x 1 x i8> %elt.head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
65 %v = call <vscale x 1 x i8> @llvm.vp.add.nxv1i8(<vscale x 1 x i8> %vb, <vscale x 1 x i8> %va, <vscale x 1 x i1> %m, i32 %evl)
66 ret <vscale x 1 x i8> %v
69 define <vscale x 1 x i8> @vadd_vx_nxv1i8_unmasked(<vscale x 1 x i8> %va, i8 %b, i32 zeroext %evl) {
70 ; CHECK-LABEL: vadd_vx_nxv1i8_unmasked:
72 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
73 ; CHECK-NEXT: vadd.vx v8, v8, a0
75 %elt.head = insertelement <vscale x 1 x i8> poison, i8 %b, i32 0
76 %vb = shufflevector <vscale x 1 x i8> %elt.head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
77 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
78 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
79 %v = call <vscale x 1 x i8> @llvm.vp.add.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb, <vscale x 1 x i1> %m, i32 %evl)
80 ret <vscale x 1 x i8> %v
83 define <vscale x 1 x i8> @vadd_vi_nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
84 ; CHECK-LABEL: vadd_vi_nxv1i8:
86 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
87 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
89 %elt.head = insertelement <vscale x 1 x i8> poison, i8 -1, i32 0
90 %vb = shufflevector <vscale x 1 x i8> %elt.head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
91 %v = call <vscale x 1 x i8> @llvm.vp.add.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb, <vscale x 1 x i1> %m, i32 %evl)
92 ret <vscale x 1 x i8> %v
95 define <vscale x 1 x i8> @vadd_vi_nxv1i8_unmasked(<vscale x 1 x i8> %va, i32 zeroext %evl) {
96 ; CHECK-LABEL: vadd_vi_nxv1i8_unmasked:
98 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
99 ; CHECK-NEXT: vadd.vi v8, v8, -1
101 %elt.head = insertelement <vscale x 1 x i8> poison, i8 -1, i32 0
102 %vb = shufflevector <vscale x 1 x i8> %elt.head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
103 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
104 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
105 %v = call <vscale x 1 x i8> @llvm.vp.add.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb, <vscale x 1 x i1> %m, i32 %evl)
106 ret <vscale x 1 x i8> %v
109 declare <vscale x 2 x i8> @llvm.vp.add.nxv2i8(<vscale x 2 x i8>, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
111 define <vscale x 2 x i8> @vadd_vv_nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
112 ; CHECK-LABEL: vadd_vv_nxv2i8:
114 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
115 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
117 %v = call <vscale x 2 x i8> @llvm.vp.add.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, <vscale x 2 x i1> %m, i32 %evl)
118 ret <vscale x 2 x i8> %v
121 define <vscale x 2 x i8> @vadd_vv_nxv2i8_unmasked(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, i32 zeroext %evl) {
122 ; CHECK-LABEL: vadd_vv_nxv2i8_unmasked:
124 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
125 ; CHECK-NEXT: vadd.vv v8, v8, v9
127 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
128 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
129 %v = call <vscale x 2 x i8> @llvm.vp.add.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, <vscale x 2 x i1> %m, i32 %evl)
130 ret <vscale x 2 x i8> %v
133 define <vscale x 2 x i8> @vadd_vx_nxv2i8(<vscale x 2 x i8> %va, i8 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
134 ; CHECK-LABEL: vadd_vx_nxv2i8:
136 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
137 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
139 %elt.head = insertelement <vscale x 2 x i8> poison, i8 %b, i32 0
140 %vb = shufflevector <vscale x 2 x i8> %elt.head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
141 %v = call <vscale x 2 x i8> @llvm.vp.add.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb, <vscale x 2 x i1> %m, i32 %evl)
142 ret <vscale x 2 x i8> %v
145 define <vscale x 2 x i8> @vadd_vx_nxv2i8_unmasked(<vscale x 2 x i8> %va, i8 %b, i32 zeroext %evl) {
146 ; CHECK-LABEL: vadd_vx_nxv2i8_unmasked:
148 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
149 ; CHECK-NEXT: vadd.vx v8, v8, a0
151 %elt.head = insertelement <vscale x 2 x i8> poison, i8 %b, i32 0
152 %vb = shufflevector <vscale x 2 x i8> %elt.head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
153 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
154 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
155 %v = call <vscale x 2 x i8> @llvm.vp.add.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb, <vscale x 2 x i1> %m, i32 %evl)
156 ret <vscale x 2 x i8> %v
159 define <vscale x 2 x i8> @vadd_vi_nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
160 ; CHECK-LABEL: vadd_vi_nxv2i8:
162 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
163 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
165 %elt.head = insertelement <vscale x 2 x i8> poison, i8 -1, i32 0
166 %vb = shufflevector <vscale x 2 x i8> %elt.head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
167 %v = call <vscale x 2 x i8> @llvm.vp.add.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb, <vscale x 2 x i1> %m, i32 %evl)
168 ret <vscale x 2 x i8> %v
171 define <vscale x 2 x i8> @vadd_vi_nxv2i8_unmasked(<vscale x 2 x i8> %va, i32 zeroext %evl) {
172 ; CHECK-LABEL: vadd_vi_nxv2i8_unmasked:
174 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
175 ; CHECK-NEXT: vadd.vi v8, v8, -1
177 %elt.head = insertelement <vscale x 2 x i8> poison, i8 -1, i32 0
178 %vb = shufflevector <vscale x 2 x i8> %elt.head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
179 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
180 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
181 %v = call <vscale x 2 x i8> @llvm.vp.add.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb, <vscale x 2 x i1> %m, i32 %evl)
182 ret <vscale x 2 x i8> %v
185 declare <vscale x 3 x i8> @llvm.vp.add.nxv3i8(<vscale x 3 x i8>, <vscale x 3 x i8>, <vscale x 3 x i1>, i32)
187 define <vscale x 3 x i8> @vadd_vv_nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, <vscale x 3 x i1> %m, i32 zeroext %evl) {
188 ; CHECK-LABEL: vadd_vv_nxv3i8:
190 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
191 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
193 %v = call <vscale x 3 x i8> @llvm.vp.add.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, <vscale x 3 x i1> %m, i32 %evl)
194 ret <vscale x 3 x i8> %v
197 define <vscale x 3 x i8> @vadd_vv_nxv3i8_unmasked(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, i32 zeroext %evl) {
198 ; CHECK-LABEL: vadd_vv_nxv3i8_unmasked:
200 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
201 ; CHECK-NEXT: vadd.vv v8, v8, v9
203 %head = insertelement <vscale x 3 x i1> poison, i1 true, i32 0
204 %m = shufflevector <vscale x 3 x i1> %head, <vscale x 3 x i1> poison, <vscale x 3 x i32> zeroinitializer
205 %v = call <vscale x 3 x i8> @llvm.vp.add.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, <vscale x 3 x i1> %m, i32 %evl)
206 ret <vscale x 3 x i8> %v
209 define <vscale x 3 x i8> @vadd_vx_nxv3i8(<vscale x 3 x i8> %va, i8 %b, <vscale x 3 x i1> %m, i32 zeroext %evl) {
210 ; CHECK-LABEL: vadd_vx_nxv3i8:
212 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
213 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
215 %elt.head = insertelement <vscale x 3 x i8> poison, i8 %b, i32 0
216 %vb = shufflevector <vscale x 3 x i8> %elt.head, <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer
217 %v = call <vscale x 3 x i8> @llvm.vp.add.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %vb, <vscale x 3 x i1> %m, i32 %evl)
218 ret <vscale x 3 x i8> %v
221 define <vscale x 3 x i8> @vadd_vx_nxv3i8_unmasked(<vscale x 3 x i8> %va, i8 %b, i32 zeroext %evl) {
222 ; CHECK-LABEL: vadd_vx_nxv3i8_unmasked:
224 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
225 ; CHECK-NEXT: vadd.vx v8, v8, a0
227 %elt.head = insertelement <vscale x 3 x i8> poison, i8 %b, i32 0
228 %vb = shufflevector <vscale x 3 x i8> %elt.head, <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer
229 %head = insertelement <vscale x 3 x i1> poison, i1 true, i32 0
230 %m = shufflevector <vscale x 3 x i1> %head, <vscale x 3 x i1> poison, <vscale x 3 x i32> zeroinitializer
231 %v = call <vscale x 3 x i8> @llvm.vp.add.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %vb, <vscale x 3 x i1> %m, i32 %evl)
232 ret <vscale x 3 x i8> %v
235 define <vscale x 3 x i8> @vadd_vi_nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i1> %m, i32 zeroext %evl) {
236 ; CHECK-LABEL: vadd_vi_nxv3i8:
238 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
239 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
241 %elt.head = insertelement <vscale x 3 x i8> poison, i8 -1, i32 0
242 %vb = shufflevector <vscale x 3 x i8> %elt.head, <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer
243 %v = call <vscale x 3 x i8> @llvm.vp.add.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %vb, <vscale x 3 x i1> %m, i32 %evl)
244 ret <vscale x 3 x i8> %v
247 define <vscale x 3 x i8> @vadd_vi_nxv3i8_unmasked(<vscale x 3 x i8> %va, i32 zeroext %evl) {
248 ; CHECK-LABEL: vadd_vi_nxv3i8_unmasked:
250 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
251 ; CHECK-NEXT: vadd.vi v8, v8, -1
253 %elt.head = insertelement <vscale x 3 x i8> poison, i8 -1, i32 0
254 %vb = shufflevector <vscale x 3 x i8> %elt.head, <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer
255 %head = insertelement <vscale x 3 x i1> poison, i1 true, i32 0
256 %m = shufflevector <vscale x 3 x i1> %head, <vscale x 3 x i1> poison, <vscale x 3 x i32> zeroinitializer
257 %v = call <vscale x 3 x i8> @llvm.vp.add.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %vb, <vscale x 3 x i1> %m, i32 %evl)
258 ret <vscale x 3 x i8> %v
261 declare <vscale x 4 x i8> @llvm.vp.add.nxv4i8(<vscale x 4 x i8>, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
263 define <vscale x 4 x i8> @vadd_vv_nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
264 ; CHECK-LABEL: vadd_vv_nxv4i8:
266 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
267 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
269 %v = call <vscale x 4 x i8> @llvm.vp.add.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, <vscale x 4 x i1> %m, i32 %evl)
270 ret <vscale x 4 x i8> %v
273 define <vscale x 4 x i8> @vadd_vv_nxv4i8_unmasked(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, i32 zeroext %evl) {
274 ; CHECK-LABEL: vadd_vv_nxv4i8_unmasked:
276 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
277 ; CHECK-NEXT: vadd.vv v8, v8, v9
279 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
280 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
281 %v = call <vscale x 4 x i8> @llvm.vp.add.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, <vscale x 4 x i1> %m, i32 %evl)
282 ret <vscale x 4 x i8> %v
285 define <vscale x 4 x i8> @vadd_vx_nxv4i8(<vscale x 4 x i8> %va, i8 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
286 ; CHECK-LABEL: vadd_vx_nxv4i8:
288 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
289 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
291 %elt.head = insertelement <vscale x 4 x i8> poison, i8 %b, i32 0
292 %vb = shufflevector <vscale x 4 x i8> %elt.head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
293 %v = call <vscale x 4 x i8> @llvm.vp.add.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb, <vscale x 4 x i1> %m, i32 %evl)
294 ret <vscale x 4 x i8> %v
297 define <vscale x 4 x i8> @vadd_vx_nxv4i8_unmasked(<vscale x 4 x i8> %va, i8 %b, i32 zeroext %evl) {
298 ; CHECK-LABEL: vadd_vx_nxv4i8_unmasked:
300 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
301 ; CHECK-NEXT: vadd.vx v8, v8, a0
303 %elt.head = insertelement <vscale x 4 x i8> poison, i8 %b, i32 0
304 %vb = shufflevector <vscale x 4 x i8> %elt.head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
305 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
306 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
307 %v = call <vscale x 4 x i8> @llvm.vp.add.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb, <vscale x 4 x i1> %m, i32 %evl)
308 ret <vscale x 4 x i8> %v
311 define <vscale x 4 x i8> @vadd_vi_nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
312 ; CHECK-LABEL: vadd_vi_nxv4i8:
314 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
315 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
317 %elt.head = insertelement <vscale x 4 x i8> poison, i8 -1, i32 0
318 %vb = shufflevector <vscale x 4 x i8> %elt.head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
319 %v = call <vscale x 4 x i8> @llvm.vp.add.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb, <vscale x 4 x i1> %m, i32 %evl)
320 ret <vscale x 4 x i8> %v
323 define <vscale x 4 x i8> @vadd_vi_nxv4i8_unmasked(<vscale x 4 x i8> %va, i32 zeroext %evl) {
324 ; CHECK-LABEL: vadd_vi_nxv4i8_unmasked:
326 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
327 ; CHECK-NEXT: vadd.vi v8, v8, -1
329 %elt.head = insertelement <vscale x 4 x i8> poison, i8 -1, i32 0
330 %vb = shufflevector <vscale x 4 x i8> %elt.head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
331 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
332 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
333 %v = call <vscale x 4 x i8> @llvm.vp.add.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb, <vscale x 4 x i1> %m, i32 %evl)
334 ret <vscale x 4 x i8> %v
337 declare <vscale x 8 x i8> @llvm.vp.add.nxv8i8(<vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i1>, i32)
339 define <vscale x 8 x i8> @vadd_vv_nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
340 ; CHECK-LABEL: vadd_vv_nxv8i8:
342 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
343 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
345 %v = call <vscale x 8 x i8> @llvm.vp.add.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, <vscale x 8 x i1> %m, i32 %evl)
346 ret <vscale x 8 x i8> %v
349 define <vscale x 8 x i8> @vadd_vv_nxv8i8_unmasked(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, i32 zeroext %evl) {
350 ; CHECK-LABEL: vadd_vv_nxv8i8_unmasked:
352 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
353 ; CHECK-NEXT: vadd.vv v8, v8, v9
355 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
356 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
357 %v = call <vscale x 8 x i8> @llvm.vp.add.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, <vscale x 8 x i1> %m, i32 %evl)
358 ret <vscale x 8 x i8> %v
361 define <vscale x 8 x i8> @vadd_vx_nxv8i8(<vscale x 8 x i8> %va, i8 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
362 ; CHECK-LABEL: vadd_vx_nxv8i8:
364 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
365 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
367 %elt.head = insertelement <vscale x 8 x i8> poison, i8 %b, i32 0
368 %vb = shufflevector <vscale x 8 x i8> %elt.head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
369 %v = call <vscale x 8 x i8> @llvm.vp.add.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb, <vscale x 8 x i1> %m, i32 %evl)
370 ret <vscale x 8 x i8> %v
373 define <vscale x 8 x i8> @vadd_vx_nxv8i8_unmasked(<vscale x 8 x i8> %va, i8 %b, i32 zeroext %evl) {
374 ; CHECK-LABEL: vadd_vx_nxv8i8_unmasked:
376 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
377 ; CHECK-NEXT: vadd.vx v8, v8, a0
379 %elt.head = insertelement <vscale x 8 x i8> poison, i8 %b, i32 0
380 %vb = shufflevector <vscale x 8 x i8> %elt.head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
381 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
382 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
383 %v = call <vscale x 8 x i8> @llvm.vp.add.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb, <vscale x 8 x i1> %m, i32 %evl)
384 ret <vscale x 8 x i8> %v
387 define <vscale x 8 x i8> @vadd_vi_nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
388 ; CHECK-LABEL: vadd_vi_nxv8i8:
390 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
391 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
393 %elt.head = insertelement <vscale x 8 x i8> poison, i8 -1, i32 0
394 %vb = shufflevector <vscale x 8 x i8> %elt.head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
395 %v = call <vscale x 8 x i8> @llvm.vp.add.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb, <vscale x 8 x i1> %m, i32 %evl)
396 ret <vscale x 8 x i8> %v
399 define <vscale x 8 x i8> @vadd_vi_nxv8i8_unmasked(<vscale x 8 x i8> %va, i32 zeroext %evl) {
400 ; CHECK-LABEL: vadd_vi_nxv8i8_unmasked:
402 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
403 ; CHECK-NEXT: vadd.vi v8, v8, -1
405 %elt.head = insertelement <vscale x 8 x i8> poison, i8 -1, i32 0
406 %vb = shufflevector <vscale x 8 x i8> %elt.head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
407 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
408 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
409 %v = call <vscale x 8 x i8> @llvm.vp.add.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb, <vscale x 8 x i1> %m, i32 %evl)
410 ret <vscale x 8 x i8> %v
413 declare <vscale x 16 x i8> @llvm.vp.add.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i1>, i32)
415 define <vscale x 16 x i8> @vadd_vv_nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
416 ; CHECK-LABEL: vadd_vv_nxv16i8:
418 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
419 ; CHECK-NEXT: vadd.vv v8, v8, v10, v0.t
421 %v = call <vscale x 16 x i8> @llvm.vp.add.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, <vscale x 16 x i1> %m, i32 %evl)
422 ret <vscale x 16 x i8> %v
425 define <vscale x 16 x i8> @vadd_vv_nxv16i8_unmasked(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, i32 zeroext %evl) {
426 ; CHECK-LABEL: vadd_vv_nxv16i8_unmasked:
428 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
429 ; CHECK-NEXT: vadd.vv v8, v8, v10
431 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
432 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
433 %v = call <vscale x 16 x i8> @llvm.vp.add.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, <vscale x 16 x i1> %m, i32 %evl)
434 ret <vscale x 16 x i8> %v
437 define <vscale x 16 x i8> @vadd_vx_nxv16i8(<vscale x 16 x i8> %va, i8 %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
438 ; CHECK-LABEL: vadd_vx_nxv16i8:
440 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
441 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
443 %elt.head = insertelement <vscale x 16 x i8> poison, i8 %b, i32 0
444 %vb = shufflevector <vscale x 16 x i8> %elt.head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
445 %v = call <vscale x 16 x i8> @llvm.vp.add.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb, <vscale x 16 x i1> %m, i32 %evl)
446 ret <vscale x 16 x i8> %v
449 define <vscale x 16 x i8> @vadd_vx_nxv16i8_unmasked(<vscale x 16 x i8> %va, i8 %b, i32 zeroext %evl) {
450 ; CHECK-LABEL: vadd_vx_nxv16i8_unmasked:
452 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
453 ; CHECK-NEXT: vadd.vx v8, v8, a0
455 %elt.head = insertelement <vscale x 16 x i8> poison, i8 %b, i32 0
456 %vb = shufflevector <vscale x 16 x i8> %elt.head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
457 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
458 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
459 %v = call <vscale x 16 x i8> @llvm.vp.add.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb, <vscale x 16 x i1> %m, i32 %evl)
460 ret <vscale x 16 x i8> %v
463 define <vscale x 16 x i8> @vadd_vi_nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
464 ; CHECK-LABEL: vadd_vi_nxv16i8:
466 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
467 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
469 %elt.head = insertelement <vscale x 16 x i8> poison, i8 -1, i32 0
470 %vb = shufflevector <vscale x 16 x i8> %elt.head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
471 %v = call <vscale x 16 x i8> @llvm.vp.add.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb, <vscale x 16 x i1> %m, i32 %evl)
472 ret <vscale x 16 x i8> %v
475 define <vscale x 16 x i8> @vadd_vi_nxv16i8_unmasked(<vscale x 16 x i8> %va, i32 zeroext %evl) {
476 ; CHECK-LABEL: vadd_vi_nxv16i8_unmasked:
478 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
479 ; CHECK-NEXT: vadd.vi v8, v8, -1
481 %elt.head = insertelement <vscale x 16 x i8> poison, i8 -1, i32 0
482 %vb = shufflevector <vscale x 16 x i8> %elt.head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
483 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
484 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
485 %v = call <vscale x 16 x i8> @llvm.vp.add.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb, <vscale x 16 x i1> %m, i32 %evl)
486 ret <vscale x 16 x i8> %v
489 declare <vscale x 32 x i8> @llvm.vp.add.nxv32i8(<vscale x 32 x i8>, <vscale x 32 x i8>, <vscale x 32 x i1>, i32)
491 define <vscale x 32 x i8> @vadd_vv_nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
492 ; CHECK-LABEL: vadd_vv_nxv32i8:
494 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
495 ; CHECK-NEXT: vadd.vv v8, v8, v12, v0.t
497 %v = call <vscale x 32 x i8> @llvm.vp.add.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, <vscale x 32 x i1> %m, i32 %evl)
498 ret <vscale x 32 x i8> %v
501 define <vscale x 32 x i8> @vadd_vv_nxv32i8_unmasked(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, i32 zeroext %evl) {
502 ; CHECK-LABEL: vadd_vv_nxv32i8_unmasked:
504 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
505 ; CHECK-NEXT: vadd.vv v8, v8, v12
507 %head = insertelement <vscale x 32 x i1> poison, i1 true, i32 0
508 %m = shufflevector <vscale x 32 x i1> %head, <vscale x 32 x i1> poison, <vscale x 32 x i32> zeroinitializer
509 %v = call <vscale x 32 x i8> @llvm.vp.add.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, <vscale x 32 x i1> %m, i32 %evl)
510 ret <vscale x 32 x i8> %v
513 define <vscale x 32 x i8> @vadd_vx_nxv32i8(<vscale x 32 x i8> %va, i8 %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
514 ; CHECK-LABEL: vadd_vx_nxv32i8:
516 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
517 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
519 %elt.head = insertelement <vscale x 32 x i8> poison, i8 %b, i32 0
520 %vb = shufflevector <vscale x 32 x i8> %elt.head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
521 %v = call <vscale x 32 x i8> @llvm.vp.add.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb, <vscale x 32 x i1> %m, i32 %evl)
522 ret <vscale x 32 x i8> %v
525 define <vscale x 32 x i8> @vadd_vx_nxv32i8_unmasked(<vscale x 32 x i8> %va, i8 %b, i32 zeroext %evl) {
526 ; CHECK-LABEL: vadd_vx_nxv32i8_unmasked:
528 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
529 ; CHECK-NEXT: vadd.vx v8, v8, a0
531 %elt.head = insertelement <vscale x 32 x i8> poison, i8 %b, i32 0
532 %vb = shufflevector <vscale x 32 x i8> %elt.head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
533 %head = insertelement <vscale x 32 x i1> poison, i1 true, i32 0
534 %m = shufflevector <vscale x 32 x i1> %head, <vscale x 32 x i1> poison, <vscale x 32 x i32> zeroinitializer
535 %v = call <vscale x 32 x i8> @llvm.vp.add.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb, <vscale x 32 x i1> %m, i32 %evl)
536 ret <vscale x 32 x i8> %v
539 define <vscale x 32 x i8> @vadd_vi_nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i1> %m, i32 zeroext %evl) {
540 ; CHECK-LABEL: vadd_vi_nxv32i8:
542 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
543 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
545 %elt.head = insertelement <vscale x 32 x i8> poison, i8 -1, i32 0
546 %vb = shufflevector <vscale x 32 x i8> %elt.head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
547 %v = call <vscale x 32 x i8> @llvm.vp.add.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb, <vscale x 32 x i1> %m, i32 %evl)
548 ret <vscale x 32 x i8> %v
551 define <vscale x 32 x i8> @vadd_vi_nxv32i8_unmasked(<vscale x 32 x i8> %va, i32 zeroext %evl) {
552 ; CHECK-LABEL: vadd_vi_nxv32i8_unmasked:
554 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
555 ; CHECK-NEXT: vadd.vi v8, v8, -1
557 %elt.head = insertelement <vscale x 32 x i8> poison, i8 -1, i32 0
558 %vb = shufflevector <vscale x 32 x i8> %elt.head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
559 %head = insertelement <vscale x 32 x i1> poison, i1 true, i32 0
560 %m = shufflevector <vscale x 32 x i1> %head, <vscale x 32 x i1> poison, <vscale x 32 x i32> zeroinitializer
561 %v = call <vscale x 32 x i8> @llvm.vp.add.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb, <vscale x 32 x i1> %m, i32 %evl)
562 ret <vscale x 32 x i8> %v
565 declare <vscale x 64 x i8> @llvm.vp.add.nxv64i8(<vscale x 64 x i8>, <vscale x 64 x i8>, <vscale x 64 x i1>, i32)
567 define <vscale x 64 x i8> @vadd_vv_nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, <vscale x 64 x i1> %m, i32 zeroext %evl) {
568 ; CHECK-LABEL: vadd_vv_nxv64i8:
570 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
571 ; CHECK-NEXT: vadd.vv v8, v8, v16, v0.t
573 %v = call <vscale x 64 x i8> @llvm.vp.add.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, <vscale x 64 x i1> %m, i32 %evl)
574 ret <vscale x 64 x i8> %v
577 define <vscale x 64 x i8> @vadd_vv_nxv64i8_unmasked(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, i32 zeroext %evl) {
578 ; CHECK-LABEL: vadd_vv_nxv64i8_unmasked:
580 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
581 ; CHECK-NEXT: vadd.vv v8, v8, v16
583 %head = insertelement <vscale x 64 x i1> poison, i1 true, i32 0
584 %m = shufflevector <vscale x 64 x i1> %head, <vscale x 64 x i1> poison, <vscale x 64 x i32> zeroinitializer
585 %v = call <vscale x 64 x i8> @llvm.vp.add.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, <vscale x 64 x i1> %m, i32 %evl)
586 ret <vscale x 64 x i8> %v
589 define <vscale x 64 x i8> @vadd_vx_nxv64i8(<vscale x 64 x i8> %va, i8 %b, <vscale x 64 x i1> %m, i32 zeroext %evl) {
590 ; CHECK-LABEL: vadd_vx_nxv64i8:
592 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
593 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
595 %elt.head = insertelement <vscale x 64 x i8> poison, i8 %b, i32 0
596 %vb = shufflevector <vscale x 64 x i8> %elt.head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
597 %v = call <vscale x 64 x i8> @llvm.vp.add.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb, <vscale x 64 x i1> %m, i32 %evl)
598 ret <vscale x 64 x i8> %v
601 define <vscale x 64 x i8> @vadd_vx_nxv64i8_unmasked(<vscale x 64 x i8> %va, i8 %b, i32 zeroext %evl) {
602 ; CHECK-LABEL: vadd_vx_nxv64i8_unmasked:
604 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
605 ; CHECK-NEXT: vadd.vx v8, v8, a0
607 %elt.head = insertelement <vscale x 64 x i8> poison, i8 %b, i32 0
608 %vb = shufflevector <vscale x 64 x i8> %elt.head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
609 %head = insertelement <vscale x 64 x i1> poison, i1 true, i32 0
610 %m = shufflevector <vscale x 64 x i1> %head, <vscale x 64 x i1> poison, <vscale x 64 x i32> zeroinitializer
611 %v = call <vscale x 64 x i8> @llvm.vp.add.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb, <vscale x 64 x i1> %m, i32 %evl)
612 ret <vscale x 64 x i8> %v
615 define <vscale x 64 x i8> @vadd_vi_nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i1> %m, i32 zeroext %evl) {
616 ; CHECK-LABEL: vadd_vi_nxv64i8:
618 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
619 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
621 %elt.head = insertelement <vscale x 64 x i8> poison, i8 -1, i32 0
622 %vb = shufflevector <vscale x 64 x i8> %elt.head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
623 %v = call <vscale x 64 x i8> @llvm.vp.add.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb, <vscale x 64 x i1> %m, i32 %evl)
624 ret <vscale x 64 x i8> %v
627 define <vscale x 64 x i8> @vadd_vi_nxv64i8_unmasked(<vscale x 64 x i8> %va, i32 zeroext %evl) {
628 ; CHECK-LABEL: vadd_vi_nxv64i8_unmasked:
630 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
631 ; CHECK-NEXT: vadd.vi v8, v8, -1
633 %elt.head = insertelement <vscale x 64 x i8> poison, i8 -1, i32 0
634 %vb = shufflevector <vscale x 64 x i8> %elt.head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
635 %head = insertelement <vscale x 64 x i1> poison, i1 true, i32 0
636 %m = shufflevector <vscale x 64 x i1> %head, <vscale x 64 x i1> poison, <vscale x 64 x i32> zeroinitializer
637 %v = call <vscale x 64 x i8> @llvm.vp.add.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb, <vscale x 64 x i1> %m, i32 %evl)
638 ret <vscale x 64 x i8> %v
641 ; Test that split-legalization works when the mask itself needs splitting.
643 declare <vscale x 128 x i8> @llvm.vp.add.nxv128i8(<vscale x 128 x i8>, <vscale x 128 x i8>, <vscale x 128 x i1>, i32)
645 define <vscale x 128 x i8> @vadd_vi_nxv128i8(<vscale x 128 x i8> %va, <vscale x 128 x i1> %m, i32 zeroext %evl) {
646 ; CHECK-LABEL: vadd_vi_nxv128i8:
648 ; CHECK-NEXT: vmv1r.v v24, v0
649 ; CHECK-NEXT: vsetvli a2, zero, e8, m8, ta, ma
650 ; CHECK-NEXT: vlm.v v0, (a0)
651 ; CHECK-NEXT: csrr a0, vlenb
652 ; CHECK-NEXT: slli a0, a0, 3
653 ; CHECK-NEXT: sub a2, a1, a0
654 ; CHECK-NEXT: sltu a3, a1, a2
655 ; CHECK-NEXT: addi a3, a3, -1
656 ; CHECK-NEXT: and a2, a3, a2
657 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
658 ; CHECK-NEXT: vadd.vi v16, v16, -1, v0.t
659 ; CHECK-NEXT: bltu a1, a0, .LBB50_2
660 ; CHECK-NEXT: # %bb.1:
661 ; CHECK-NEXT: mv a1, a0
662 ; CHECK-NEXT: .LBB50_2:
663 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
664 ; CHECK-NEXT: vmv1r.v v0, v24
665 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
667 %elt.head = insertelement <vscale x 128 x i8> poison, i8 -1, i32 0
668 %vb = shufflevector <vscale x 128 x i8> %elt.head, <vscale x 128 x i8> poison, <vscale x 128 x i32> zeroinitializer
669 %v = call <vscale x 128 x i8> @llvm.vp.add.nxv128i8(<vscale x 128 x i8> %va, <vscale x 128 x i8> %vb, <vscale x 128 x i1> %m, i32 %evl)
670 ret <vscale x 128 x i8> %v
673 define <vscale x 128 x i8> @vadd_vi_nxv128i8_unmasked(<vscale x 128 x i8> %va, i32 zeroext %evl) {
674 ; CHECK-LABEL: vadd_vi_nxv128i8_unmasked:
676 ; CHECK-NEXT: csrr a1, vlenb
677 ; CHECK-NEXT: slli a1, a1, 3
678 ; CHECK-NEXT: sub a2, a0, a1
679 ; CHECK-NEXT: sltu a3, a0, a2
680 ; CHECK-NEXT: addi a3, a3, -1
681 ; CHECK-NEXT: and a2, a3, a2
682 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
683 ; CHECK-NEXT: vadd.vi v16, v16, -1
684 ; CHECK-NEXT: bltu a0, a1, .LBB51_2
685 ; CHECK-NEXT: # %bb.1:
686 ; CHECK-NEXT: mv a0, a1
687 ; CHECK-NEXT: .LBB51_2:
688 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
689 ; CHECK-NEXT: vadd.vi v8, v8, -1
691 %elt.head = insertelement <vscale x 128 x i8> poison, i8 -1, i32 0
692 %vb = shufflevector <vscale x 128 x i8> %elt.head, <vscale x 128 x i8> poison, <vscale x 128 x i32> zeroinitializer
693 %head = insertelement <vscale x 128 x i1> poison, i1 true, i32 0
694 %m = shufflevector <vscale x 128 x i1> %head, <vscale x 128 x i1> poison, <vscale x 128 x i32> zeroinitializer
695 %v = call <vscale x 128 x i8> @llvm.vp.add.nxv128i8(<vscale x 128 x i8> %va, <vscale x 128 x i8> %vb, <vscale x 128 x i1> %m, i32 %evl)
696 ret <vscale x 128 x i8> %v
699 declare <vscale x 1 x i16> @llvm.vp.add.nxv1i16(<vscale x 1 x i16>, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
701 define <vscale x 1 x i16> @vadd_vv_nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
702 ; CHECK-LABEL: vadd_vv_nxv1i16:
704 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
705 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
707 %v = call <vscale x 1 x i16> @llvm.vp.add.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, <vscale x 1 x i1> %m, i32 %evl)
708 ret <vscale x 1 x i16> %v
711 define <vscale x 1 x i16> @vadd_vv_nxv1i16_unmasked(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, i32 zeroext %evl) {
712 ; CHECK-LABEL: vadd_vv_nxv1i16_unmasked:
714 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
715 ; CHECK-NEXT: vadd.vv v8, v8, v9
717 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
718 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
719 %v = call <vscale x 1 x i16> @llvm.vp.add.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, <vscale x 1 x i1> %m, i32 %evl)
720 ret <vscale x 1 x i16> %v
723 define <vscale x 1 x i16> @vadd_vx_nxv1i16(<vscale x 1 x i16> %va, i16 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
724 ; CHECK-LABEL: vadd_vx_nxv1i16:
726 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
727 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
729 %elt.head = insertelement <vscale x 1 x i16> poison, i16 %b, i32 0
730 %vb = shufflevector <vscale x 1 x i16> %elt.head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
731 %v = call <vscale x 1 x i16> @llvm.vp.add.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb, <vscale x 1 x i1> %m, i32 %evl)
732 ret <vscale x 1 x i16> %v
735 define <vscale x 1 x i16> @vadd_vx_nxv1i16_unmasked(<vscale x 1 x i16> %va, i16 %b, i32 zeroext %evl) {
736 ; CHECK-LABEL: vadd_vx_nxv1i16_unmasked:
738 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
739 ; CHECK-NEXT: vadd.vx v8, v8, a0
741 %elt.head = insertelement <vscale x 1 x i16> poison, i16 %b, i32 0
742 %vb = shufflevector <vscale x 1 x i16> %elt.head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
743 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
744 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
745 %v = call <vscale x 1 x i16> @llvm.vp.add.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb, <vscale x 1 x i1> %m, i32 %evl)
746 ret <vscale x 1 x i16> %v
749 define <vscale x 1 x i16> @vadd_vi_nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
750 ; CHECK-LABEL: vadd_vi_nxv1i16:
752 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
753 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
755 %elt.head = insertelement <vscale x 1 x i16> poison, i16 -1, i32 0
756 %vb = shufflevector <vscale x 1 x i16> %elt.head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
757 %v = call <vscale x 1 x i16> @llvm.vp.add.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb, <vscale x 1 x i1> %m, i32 %evl)
758 ret <vscale x 1 x i16> %v
761 define <vscale x 1 x i16> @vadd_vi_nxv1i16_unmasked(<vscale x 1 x i16> %va, i32 zeroext %evl) {
762 ; CHECK-LABEL: vadd_vi_nxv1i16_unmasked:
764 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
765 ; CHECK-NEXT: vadd.vi v8, v8, -1
767 %elt.head = insertelement <vscale x 1 x i16> poison, i16 -1, i32 0
768 %vb = shufflevector <vscale x 1 x i16> %elt.head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
769 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
770 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
771 %v = call <vscale x 1 x i16> @llvm.vp.add.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb, <vscale x 1 x i1> %m, i32 %evl)
772 ret <vscale x 1 x i16> %v
775 declare <vscale x 2 x i16> @llvm.vp.add.nxv2i16(<vscale x 2 x i16>, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
777 define <vscale x 2 x i16> @vadd_vv_nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
778 ; CHECK-LABEL: vadd_vv_nxv2i16:
780 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
781 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
783 %v = call <vscale x 2 x i16> @llvm.vp.add.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, <vscale x 2 x i1> %m, i32 %evl)
784 ret <vscale x 2 x i16> %v
787 define <vscale x 2 x i16> @vadd_vv_nxv2i16_unmasked(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, i32 zeroext %evl) {
788 ; CHECK-LABEL: vadd_vv_nxv2i16_unmasked:
790 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
791 ; CHECK-NEXT: vadd.vv v8, v8, v9
793 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
794 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
795 %v = call <vscale x 2 x i16> @llvm.vp.add.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, <vscale x 2 x i1> %m, i32 %evl)
796 ret <vscale x 2 x i16> %v
799 define <vscale x 2 x i16> @vadd_vx_nxv2i16(<vscale x 2 x i16> %va, i16 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
800 ; CHECK-LABEL: vadd_vx_nxv2i16:
802 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
803 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
805 %elt.head = insertelement <vscale x 2 x i16> poison, i16 %b, i32 0
806 %vb = shufflevector <vscale x 2 x i16> %elt.head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
807 %v = call <vscale x 2 x i16> @llvm.vp.add.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb, <vscale x 2 x i1> %m, i32 %evl)
808 ret <vscale x 2 x i16> %v
811 define <vscale x 2 x i16> @vadd_vx_nxv2i16_unmasked(<vscale x 2 x i16> %va, i16 %b, i32 zeroext %evl) {
812 ; CHECK-LABEL: vadd_vx_nxv2i16_unmasked:
814 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
815 ; CHECK-NEXT: vadd.vx v8, v8, a0
817 %elt.head = insertelement <vscale x 2 x i16> poison, i16 %b, i32 0
818 %vb = shufflevector <vscale x 2 x i16> %elt.head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
819 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
820 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
821 %v = call <vscale x 2 x i16> @llvm.vp.add.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb, <vscale x 2 x i1> %m, i32 %evl)
822 ret <vscale x 2 x i16> %v
825 define <vscale x 2 x i16> @vadd_vi_nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
826 ; CHECK-LABEL: vadd_vi_nxv2i16:
828 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
829 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
831 %elt.head = insertelement <vscale x 2 x i16> poison, i16 -1, i32 0
832 %vb = shufflevector <vscale x 2 x i16> %elt.head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
833 %v = call <vscale x 2 x i16> @llvm.vp.add.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb, <vscale x 2 x i1> %m, i32 %evl)
834 ret <vscale x 2 x i16> %v
837 define <vscale x 2 x i16> @vadd_vi_nxv2i16_unmasked(<vscale x 2 x i16> %va, i32 zeroext %evl) {
838 ; CHECK-LABEL: vadd_vi_nxv2i16_unmasked:
840 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
841 ; CHECK-NEXT: vadd.vi v8, v8, -1
843 %elt.head = insertelement <vscale x 2 x i16> poison, i16 -1, i32 0
844 %vb = shufflevector <vscale x 2 x i16> %elt.head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
845 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
846 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
847 %v = call <vscale x 2 x i16> @llvm.vp.add.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb, <vscale x 2 x i1> %m, i32 %evl)
848 ret <vscale x 2 x i16> %v
851 declare <vscale x 4 x i16> @llvm.vp.add.nxv4i16(<vscale x 4 x i16>, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
853 define <vscale x 4 x i16> @vadd_vv_nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
854 ; CHECK-LABEL: vadd_vv_nxv4i16:
856 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
857 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
859 %v = call <vscale x 4 x i16> @llvm.vp.add.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, <vscale x 4 x i1> %m, i32 %evl)
860 ret <vscale x 4 x i16> %v
863 define <vscale x 4 x i16> @vadd_vv_nxv4i16_unmasked(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, i32 zeroext %evl) {
864 ; CHECK-LABEL: vadd_vv_nxv4i16_unmasked:
866 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
867 ; CHECK-NEXT: vadd.vv v8, v8, v9
869 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
870 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
871 %v = call <vscale x 4 x i16> @llvm.vp.add.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, <vscale x 4 x i1> %m, i32 %evl)
872 ret <vscale x 4 x i16> %v
875 define <vscale x 4 x i16> @vadd_vx_nxv4i16(<vscale x 4 x i16> %va, i16 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
876 ; CHECK-LABEL: vadd_vx_nxv4i16:
878 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
879 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
881 %elt.head = insertelement <vscale x 4 x i16> poison, i16 %b, i32 0
882 %vb = shufflevector <vscale x 4 x i16> %elt.head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
883 %v = call <vscale x 4 x i16> @llvm.vp.add.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb, <vscale x 4 x i1> %m, i32 %evl)
884 ret <vscale x 4 x i16> %v
887 define <vscale x 4 x i16> @vadd_vx_nxv4i16_unmasked(<vscale x 4 x i16> %va, i16 %b, i32 zeroext %evl) {
888 ; CHECK-LABEL: vadd_vx_nxv4i16_unmasked:
890 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
891 ; CHECK-NEXT: vadd.vx v8, v8, a0
893 %elt.head = insertelement <vscale x 4 x i16> poison, i16 %b, i32 0
894 %vb = shufflevector <vscale x 4 x i16> %elt.head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
895 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
896 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
897 %v = call <vscale x 4 x i16> @llvm.vp.add.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb, <vscale x 4 x i1> %m, i32 %evl)
898 ret <vscale x 4 x i16> %v
901 define <vscale x 4 x i16> @vadd_vi_nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
902 ; CHECK-LABEL: vadd_vi_nxv4i16:
904 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
905 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
907 %elt.head = insertelement <vscale x 4 x i16> poison, i16 -1, i32 0
908 %vb = shufflevector <vscale x 4 x i16> %elt.head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
909 %v = call <vscale x 4 x i16> @llvm.vp.add.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb, <vscale x 4 x i1> %m, i32 %evl)
910 ret <vscale x 4 x i16> %v
913 define <vscale x 4 x i16> @vadd_vi_nxv4i16_unmasked(<vscale x 4 x i16> %va, i32 zeroext %evl) {
914 ; CHECK-LABEL: vadd_vi_nxv4i16_unmasked:
916 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
917 ; CHECK-NEXT: vadd.vi v8, v8, -1
919 %elt.head = insertelement <vscale x 4 x i16> poison, i16 -1, i32 0
920 %vb = shufflevector <vscale x 4 x i16> %elt.head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
921 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
922 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
923 %v = call <vscale x 4 x i16> @llvm.vp.add.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb, <vscale x 4 x i1> %m, i32 %evl)
924 ret <vscale x 4 x i16> %v
927 declare <vscale x 8 x i16> @llvm.vp.add.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i1>, i32)
929 define <vscale x 8 x i16> @vadd_vv_nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
930 ; CHECK-LABEL: vadd_vv_nxv8i16:
932 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
933 ; CHECK-NEXT: vadd.vv v8, v8, v10, v0.t
935 %v = call <vscale x 8 x i16> @llvm.vp.add.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, <vscale x 8 x i1> %m, i32 %evl)
936 ret <vscale x 8 x i16> %v
939 define <vscale x 8 x i16> @vadd_vv_nxv8i16_unmasked(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, i32 zeroext %evl) {
940 ; CHECK-LABEL: vadd_vv_nxv8i16_unmasked:
942 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
943 ; CHECK-NEXT: vadd.vv v8, v8, v10
945 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
946 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
947 %v = call <vscale x 8 x i16> @llvm.vp.add.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, <vscale x 8 x i1> %m, i32 %evl)
948 ret <vscale x 8 x i16> %v
951 define <vscale x 8 x i16> @vadd_vx_nxv8i16(<vscale x 8 x i16> %va, i16 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
952 ; CHECK-LABEL: vadd_vx_nxv8i16:
954 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
955 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
957 %elt.head = insertelement <vscale x 8 x i16> poison, i16 %b, i32 0
958 %vb = shufflevector <vscale x 8 x i16> %elt.head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
959 %v = call <vscale x 8 x i16> @llvm.vp.add.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb, <vscale x 8 x i1> %m, i32 %evl)
960 ret <vscale x 8 x i16> %v
963 define <vscale x 8 x i16> @vadd_vx_nxv8i16_unmasked(<vscale x 8 x i16> %va, i16 %b, i32 zeroext %evl) {
964 ; CHECK-LABEL: vadd_vx_nxv8i16_unmasked:
966 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
967 ; CHECK-NEXT: vadd.vx v8, v8, a0
969 %elt.head = insertelement <vscale x 8 x i16> poison, i16 %b, i32 0
970 %vb = shufflevector <vscale x 8 x i16> %elt.head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
971 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
972 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
973 %v = call <vscale x 8 x i16> @llvm.vp.add.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb, <vscale x 8 x i1> %m, i32 %evl)
974 ret <vscale x 8 x i16> %v
977 define <vscale x 8 x i16> @vadd_vi_nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
978 ; CHECK-LABEL: vadd_vi_nxv8i16:
980 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
981 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
983 %elt.head = insertelement <vscale x 8 x i16> poison, i16 -1, i32 0
984 %vb = shufflevector <vscale x 8 x i16> %elt.head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
985 %v = call <vscale x 8 x i16> @llvm.vp.add.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb, <vscale x 8 x i1> %m, i32 %evl)
986 ret <vscale x 8 x i16> %v
989 define <vscale x 8 x i16> @vadd_vi_nxv8i16_unmasked(<vscale x 8 x i16> %va, i32 zeroext %evl) {
990 ; CHECK-LABEL: vadd_vi_nxv8i16_unmasked:
992 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
993 ; CHECK-NEXT: vadd.vi v8, v8, -1
995 %elt.head = insertelement <vscale x 8 x i16> poison, i16 -1, i32 0
996 %vb = shufflevector <vscale x 8 x i16> %elt.head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
997 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
998 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
999 %v = call <vscale x 8 x i16> @llvm.vp.add.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb, <vscale x 8 x i1> %m, i32 %evl)
1000 ret <vscale x 8 x i16> %v
1003 declare <vscale x 16 x i16> @llvm.vp.add.nxv16i16(<vscale x 16 x i16>, <vscale x 16 x i16>, <vscale x 16 x i1>, i32)
1005 define <vscale x 16 x i16> @vadd_vv_nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1006 ; CHECK-LABEL: vadd_vv_nxv16i16:
1008 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
1009 ; CHECK-NEXT: vadd.vv v8, v8, v12, v0.t
1011 %v = call <vscale x 16 x i16> @llvm.vp.add.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, <vscale x 16 x i1> %m, i32 %evl)
1012 ret <vscale x 16 x i16> %v
1015 define <vscale x 16 x i16> @vadd_vv_nxv16i16_unmasked(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, i32 zeroext %evl) {
1016 ; CHECK-LABEL: vadd_vv_nxv16i16_unmasked:
1018 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
1019 ; CHECK-NEXT: vadd.vv v8, v8, v12
1021 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
1022 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
1023 %v = call <vscale x 16 x i16> @llvm.vp.add.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, <vscale x 16 x i1> %m, i32 %evl)
1024 ret <vscale x 16 x i16> %v
1027 define <vscale x 16 x i16> @vadd_vx_nxv16i16(<vscale x 16 x i16> %va, i16 %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1028 ; CHECK-LABEL: vadd_vx_nxv16i16:
1030 ; CHECK-NEXT: vsetvli zero, a1, e16, m4, ta, ma
1031 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
1033 %elt.head = insertelement <vscale x 16 x i16> poison, i16 %b, i32 0
1034 %vb = shufflevector <vscale x 16 x i16> %elt.head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
1035 %v = call <vscale x 16 x i16> @llvm.vp.add.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb, <vscale x 16 x i1> %m, i32 %evl)
1036 ret <vscale x 16 x i16> %v
1039 define <vscale x 16 x i16> @vadd_vx_nxv16i16_unmasked(<vscale x 16 x i16> %va, i16 %b, i32 zeroext %evl) {
1040 ; CHECK-LABEL: vadd_vx_nxv16i16_unmasked:
1042 ; CHECK-NEXT: vsetvli zero, a1, e16, m4, ta, ma
1043 ; CHECK-NEXT: vadd.vx v8, v8, a0
1045 %elt.head = insertelement <vscale x 16 x i16> poison, i16 %b, i32 0
1046 %vb = shufflevector <vscale x 16 x i16> %elt.head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
1047 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
1048 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
1049 %v = call <vscale x 16 x i16> @llvm.vp.add.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb, <vscale x 16 x i1> %m, i32 %evl)
1050 ret <vscale x 16 x i16> %v
1053 define <vscale x 16 x i16> @vadd_vi_nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1054 ; CHECK-LABEL: vadd_vi_nxv16i16:
1056 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
1057 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1059 %elt.head = insertelement <vscale x 16 x i16> poison, i16 -1, i32 0
1060 %vb = shufflevector <vscale x 16 x i16> %elt.head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
1061 %v = call <vscale x 16 x i16> @llvm.vp.add.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb, <vscale x 16 x i1> %m, i32 %evl)
1062 ret <vscale x 16 x i16> %v
1065 define <vscale x 16 x i16> @vadd_vi_nxv16i16_unmasked(<vscale x 16 x i16> %va, i32 zeroext %evl) {
1066 ; CHECK-LABEL: vadd_vi_nxv16i16_unmasked:
1068 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
1069 ; CHECK-NEXT: vadd.vi v8, v8, -1
1071 %elt.head = insertelement <vscale x 16 x i16> poison, i16 -1, i32 0
1072 %vb = shufflevector <vscale x 16 x i16> %elt.head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
1073 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
1074 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
1075 %v = call <vscale x 16 x i16> @llvm.vp.add.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb, <vscale x 16 x i1> %m, i32 %evl)
1076 ret <vscale x 16 x i16> %v
1079 declare <vscale x 32 x i16> @llvm.vp.add.nxv32i16(<vscale x 32 x i16>, <vscale x 32 x i16>, <vscale x 32 x i1>, i32)
1081 define <vscale x 32 x i16> @vadd_vv_nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
1082 ; CHECK-LABEL: vadd_vv_nxv32i16:
1084 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
1085 ; CHECK-NEXT: vadd.vv v8, v8, v16, v0.t
1087 %v = call <vscale x 32 x i16> @llvm.vp.add.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, <vscale x 32 x i1> %m, i32 %evl)
1088 ret <vscale x 32 x i16> %v
1091 define <vscale x 32 x i16> @vadd_vv_nxv32i16_unmasked(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, i32 zeroext %evl) {
1092 ; CHECK-LABEL: vadd_vv_nxv32i16_unmasked:
1094 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
1095 ; CHECK-NEXT: vadd.vv v8, v8, v16
1097 %head = insertelement <vscale x 32 x i1> poison, i1 true, i32 0
1098 %m = shufflevector <vscale x 32 x i1> %head, <vscale x 32 x i1> poison, <vscale x 32 x i32> zeroinitializer
1099 %v = call <vscale x 32 x i16> @llvm.vp.add.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, <vscale x 32 x i1> %m, i32 %evl)
1100 ret <vscale x 32 x i16> %v
1103 define <vscale x 32 x i16> @vadd_vx_nxv32i16(<vscale x 32 x i16> %va, i16 %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
1104 ; CHECK-LABEL: vadd_vx_nxv32i16:
1106 ; CHECK-NEXT: vsetvli zero, a1, e16, m8, ta, ma
1107 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
1109 %elt.head = insertelement <vscale x 32 x i16> poison, i16 %b, i32 0
1110 %vb = shufflevector <vscale x 32 x i16> %elt.head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
1111 %v = call <vscale x 32 x i16> @llvm.vp.add.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb, <vscale x 32 x i1> %m, i32 %evl)
1112 ret <vscale x 32 x i16> %v
1115 define <vscale x 32 x i16> @vadd_vx_nxv32i16_unmasked(<vscale x 32 x i16> %va, i16 %b, i32 zeroext %evl) {
1116 ; CHECK-LABEL: vadd_vx_nxv32i16_unmasked:
1118 ; CHECK-NEXT: vsetvli zero, a1, e16, m8, ta, ma
1119 ; CHECK-NEXT: vadd.vx v8, v8, a0
1121 %elt.head = insertelement <vscale x 32 x i16> poison, i16 %b, i32 0
1122 %vb = shufflevector <vscale x 32 x i16> %elt.head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
1123 %head = insertelement <vscale x 32 x i1> poison, i1 true, i32 0
1124 %m = shufflevector <vscale x 32 x i1> %head, <vscale x 32 x i1> poison, <vscale x 32 x i32> zeroinitializer
1125 %v = call <vscale x 32 x i16> @llvm.vp.add.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb, <vscale x 32 x i1> %m, i32 %evl)
1126 ret <vscale x 32 x i16> %v
1129 define <vscale x 32 x i16> @vadd_vi_nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i1> %m, i32 zeroext %evl) {
1130 ; CHECK-LABEL: vadd_vi_nxv32i16:
1132 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
1133 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1135 %elt.head = insertelement <vscale x 32 x i16> poison, i16 -1, i32 0
1136 %vb = shufflevector <vscale x 32 x i16> %elt.head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
1137 %v = call <vscale x 32 x i16> @llvm.vp.add.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb, <vscale x 32 x i1> %m, i32 %evl)
1138 ret <vscale x 32 x i16> %v
1141 define <vscale x 32 x i16> @vadd_vi_nxv32i16_unmasked(<vscale x 32 x i16> %va, i32 zeroext %evl) {
1142 ; CHECK-LABEL: vadd_vi_nxv32i16_unmasked:
1144 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
1145 ; CHECK-NEXT: vadd.vi v8, v8, -1
1147 %elt.head = insertelement <vscale x 32 x i16> poison, i16 -1, i32 0
1148 %vb = shufflevector <vscale x 32 x i16> %elt.head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
1149 %head = insertelement <vscale x 32 x i1> poison, i1 true, i32 0
1150 %m = shufflevector <vscale x 32 x i1> %head, <vscale x 32 x i1> poison, <vscale x 32 x i32> zeroinitializer
1151 %v = call <vscale x 32 x i16> @llvm.vp.add.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb, <vscale x 32 x i1> %m, i32 %evl)
1152 ret <vscale x 32 x i16> %v
1155 declare <vscale x 1 x i32> @llvm.vp.add.nxv1i32(<vscale x 1 x i32>, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
1157 define <vscale x 1 x i32> @vadd_vv_nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1158 ; CHECK-LABEL: vadd_vv_nxv1i32:
1160 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
1161 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
1163 %v = call <vscale x 1 x i32> @llvm.vp.add.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, <vscale x 1 x i1> %m, i32 %evl)
1164 ret <vscale x 1 x i32> %v
1167 define <vscale x 1 x i32> @vadd_vv_nxv1i32_unmasked(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, i32 zeroext %evl) {
1168 ; CHECK-LABEL: vadd_vv_nxv1i32_unmasked:
1170 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
1171 ; CHECK-NEXT: vadd.vv v8, v8, v9
1173 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
1174 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
1175 %v = call <vscale x 1 x i32> @llvm.vp.add.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, <vscale x 1 x i1> %m, i32 %evl)
1176 ret <vscale x 1 x i32> %v
1179 define <vscale x 1 x i32> @vadd_vx_nxv1i32(<vscale x 1 x i32> %va, i32 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1180 ; CHECK-LABEL: vadd_vx_nxv1i32:
1182 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
1183 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
1185 %elt.head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
1186 %vb = shufflevector <vscale x 1 x i32> %elt.head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
1187 %v = call <vscale x 1 x i32> @llvm.vp.add.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb, <vscale x 1 x i1> %m, i32 %evl)
1188 ret <vscale x 1 x i32> %v
1191 define <vscale x 1 x i32> @vadd_vx_nxv1i32_unmasked(<vscale x 1 x i32> %va, i32 %b, i32 zeroext %evl) {
1192 ; CHECK-LABEL: vadd_vx_nxv1i32_unmasked:
1194 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
1195 ; CHECK-NEXT: vadd.vx v8, v8, a0
1197 %elt.head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
1198 %vb = shufflevector <vscale x 1 x i32> %elt.head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
1199 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
1200 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
1201 %v = call <vscale x 1 x i32> @llvm.vp.add.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb, <vscale x 1 x i1> %m, i32 %evl)
1202 ret <vscale x 1 x i32> %v
1205 define <vscale x 1 x i32> @vadd_vi_nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1206 ; CHECK-LABEL: vadd_vi_nxv1i32:
1208 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
1209 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1211 %elt.head = insertelement <vscale x 1 x i32> poison, i32 -1, i32 0
1212 %vb = shufflevector <vscale x 1 x i32> %elt.head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
1213 %v = call <vscale x 1 x i32> @llvm.vp.add.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb, <vscale x 1 x i1> %m, i32 %evl)
1214 ret <vscale x 1 x i32> %v
1217 define <vscale x 1 x i32> @vadd_vi_nxv1i32_unmasked(<vscale x 1 x i32> %va, i32 zeroext %evl) {
1218 ; CHECK-LABEL: vadd_vi_nxv1i32_unmasked:
1220 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
1221 ; CHECK-NEXT: vadd.vi v8, v8, -1
1223 %elt.head = insertelement <vscale x 1 x i32> poison, i32 -1, i32 0
1224 %vb = shufflevector <vscale x 1 x i32> %elt.head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
1225 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
1226 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
1227 %v = call <vscale x 1 x i32> @llvm.vp.add.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb, <vscale x 1 x i1> %m, i32 %evl)
1228 ret <vscale x 1 x i32> %v
1231 declare <vscale x 2 x i32> @llvm.vp.add.nxv2i32(<vscale x 2 x i32>, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
1233 define <vscale x 2 x i32> @vadd_vv_nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1234 ; CHECK-LABEL: vadd_vv_nxv2i32:
1236 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
1237 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
1239 %v = call <vscale x 2 x i32> @llvm.vp.add.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, <vscale x 2 x i1> %m, i32 %evl)
1240 ret <vscale x 2 x i32> %v
1243 define <vscale x 2 x i32> @vadd_vv_nxv2i32_unmasked(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, i32 zeroext %evl) {
1244 ; CHECK-LABEL: vadd_vv_nxv2i32_unmasked:
1246 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
1247 ; CHECK-NEXT: vadd.vv v8, v8, v9
1249 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
1250 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
1251 %v = call <vscale x 2 x i32> @llvm.vp.add.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, <vscale x 2 x i1> %m, i32 %evl)
1252 ret <vscale x 2 x i32> %v
1255 define <vscale x 2 x i32> @vadd_vx_nxv2i32(<vscale x 2 x i32> %va, i32 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1256 ; CHECK-LABEL: vadd_vx_nxv2i32:
1258 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
1259 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
1261 %elt.head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
1262 %vb = shufflevector <vscale x 2 x i32> %elt.head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
1263 %v = call <vscale x 2 x i32> @llvm.vp.add.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb, <vscale x 2 x i1> %m, i32 %evl)
1264 ret <vscale x 2 x i32> %v
1267 define <vscale x 2 x i32> @vadd_vx_nxv2i32_unmasked(<vscale x 2 x i32> %va, i32 %b, i32 zeroext %evl) {
1268 ; CHECK-LABEL: vadd_vx_nxv2i32_unmasked:
1270 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
1271 ; CHECK-NEXT: vadd.vx v8, v8, a0
1273 %elt.head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
1274 %vb = shufflevector <vscale x 2 x i32> %elt.head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
1275 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
1276 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
1277 %v = call <vscale x 2 x i32> @llvm.vp.add.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb, <vscale x 2 x i1> %m, i32 %evl)
1278 ret <vscale x 2 x i32> %v
1281 define <vscale x 2 x i32> @vadd_vi_nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1282 ; CHECK-LABEL: vadd_vi_nxv2i32:
1284 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
1285 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1287 %elt.head = insertelement <vscale x 2 x i32> poison, i32 -1, i32 0
1288 %vb = shufflevector <vscale x 2 x i32> %elt.head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
1289 %v = call <vscale x 2 x i32> @llvm.vp.add.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb, <vscale x 2 x i1> %m, i32 %evl)
1290 ret <vscale x 2 x i32> %v
1293 define <vscale x 2 x i32> @vadd_vi_nxv2i32_unmasked(<vscale x 2 x i32> %va, i32 zeroext %evl) {
1294 ; CHECK-LABEL: vadd_vi_nxv2i32_unmasked:
1296 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
1297 ; CHECK-NEXT: vadd.vi v8, v8, -1
1299 %elt.head = insertelement <vscale x 2 x i32> poison, i32 -1, i32 0
1300 %vb = shufflevector <vscale x 2 x i32> %elt.head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
1301 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
1302 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
1303 %v = call <vscale x 2 x i32> @llvm.vp.add.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb, <vscale x 2 x i1> %m, i32 %evl)
1304 ret <vscale x 2 x i32> %v
1307 declare <vscale x 4 x i32> @llvm.vp.add.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1309 define <vscale x 4 x i32> @vadd_vv_nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1310 ; CHECK-LABEL: vadd_vv_nxv4i32:
1312 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1313 ; CHECK-NEXT: vadd.vv v8, v8, v10, v0.t
1315 %v = call <vscale x 4 x i32> @llvm.vp.add.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, <vscale x 4 x i1> %m, i32 %evl)
1316 ret <vscale x 4 x i32> %v
1319 define <vscale x 4 x i32> @vadd_vv_nxv4i32_unmasked(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, i32 zeroext %evl) {
1320 ; CHECK-LABEL: vadd_vv_nxv4i32_unmasked:
1322 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1323 ; CHECK-NEXT: vadd.vv v8, v8, v10
1325 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
1326 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
1327 %v = call <vscale x 4 x i32> @llvm.vp.add.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, <vscale x 4 x i1> %m, i32 %evl)
1328 ret <vscale x 4 x i32> %v
1331 define <vscale x 4 x i32> @vadd_vx_nxv4i32(<vscale x 4 x i32> %va, i32 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1332 ; CHECK-LABEL: vadd_vx_nxv4i32:
1334 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1335 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
1337 %elt.head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
1338 %vb = shufflevector <vscale x 4 x i32> %elt.head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
1339 %v = call <vscale x 4 x i32> @llvm.vp.add.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb, <vscale x 4 x i1> %m, i32 %evl)
1340 ret <vscale x 4 x i32> %v
1343 define <vscale x 4 x i32> @vadd_vx_nxv4i32_unmasked(<vscale x 4 x i32> %va, i32 %b, i32 zeroext %evl) {
1344 ; CHECK-LABEL: vadd_vx_nxv4i32_unmasked:
1346 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1347 ; CHECK-NEXT: vadd.vx v8, v8, a0
1349 %elt.head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
1350 %vb = shufflevector <vscale x 4 x i32> %elt.head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
1351 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
1352 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
1353 %v = call <vscale x 4 x i32> @llvm.vp.add.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb, <vscale x 4 x i1> %m, i32 %evl)
1354 ret <vscale x 4 x i32> %v
1357 define <vscale x 4 x i32> @vadd_vi_nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1358 ; CHECK-LABEL: vadd_vi_nxv4i32:
1360 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1361 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1363 %elt.head = insertelement <vscale x 4 x i32> poison, i32 -1, i32 0
1364 %vb = shufflevector <vscale x 4 x i32> %elt.head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
1365 %v = call <vscale x 4 x i32> @llvm.vp.add.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb, <vscale x 4 x i1> %m, i32 %evl)
1366 ret <vscale x 4 x i32> %v
1369 define <vscale x 4 x i32> @vadd_vi_nxv4i32_unmasked(<vscale x 4 x i32> %va, i32 zeroext %evl) {
1370 ; CHECK-LABEL: vadd_vi_nxv4i32_unmasked:
1372 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1373 ; CHECK-NEXT: vadd.vi v8, v8, -1
1375 %elt.head = insertelement <vscale x 4 x i32> poison, i32 -1, i32 0
1376 %vb = shufflevector <vscale x 4 x i32> %elt.head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
1377 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
1378 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
1379 %v = call <vscale x 4 x i32> @llvm.vp.add.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb, <vscale x 4 x i1> %m, i32 %evl)
1380 ret <vscale x 4 x i32> %v
1383 declare <vscale x 8 x i32> @llvm.vp.add.nxv8i32(<vscale x 8 x i32>, <vscale x 8 x i32>, <vscale x 8 x i1>, i32)
1385 define <vscale x 8 x i32> @vadd_vv_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1386 ; CHECK-LABEL: vadd_vv_nxv8i32:
1388 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1389 ; CHECK-NEXT: vadd.vv v8, v8, v12, v0.t
1391 %v = call <vscale x 8 x i32> @llvm.vp.add.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, <vscale x 8 x i1> %m, i32 %evl)
1392 ret <vscale x 8 x i32> %v
1395 define <vscale x 8 x i32> @vadd_vv_nxv8i32_unmasked(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, i32 zeroext %evl) {
1396 ; CHECK-LABEL: vadd_vv_nxv8i32_unmasked:
1398 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1399 ; CHECK-NEXT: vadd.vv v8, v8, v12
1401 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
1402 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
1403 %v = call <vscale x 8 x i32> @llvm.vp.add.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, <vscale x 8 x i1> %m, i32 %evl)
1404 ret <vscale x 8 x i32> %v
1407 define <vscale x 8 x i32> @vadd_vx_nxv8i32(<vscale x 8 x i32> %va, i32 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1408 ; CHECK-LABEL: vadd_vx_nxv8i32:
1410 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1411 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
1413 %elt.head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
1414 %vb = shufflevector <vscale x 8 x i32> %elt.head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
1415 %v = call <vscale x 8 x i32> @llvm.vp.add.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, <vscale x 8 x i1> %m, i32 %evl)
1416 ret <vscale x 8 x i32> %v
1419 define <vscale x 8 x i32> @vadd_vx_nxv8i32_unmasked(<vscale x 8 x i32> %va, i32 %b, i32 zeroext %evl) {
1420 ; CHECK-LABEL: vadd_vx_nxv8i32_unmasked:
1422 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1423 ; CHECK-NEXT: vadd.vx v8, v8, a0
1425 %elt.head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
1426 %vb = shufflevector <vscale x 8 x i32> %elt.head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
1427 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
1428 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
1429 %v = call <vscale x 8 x i32> @llvm.vp.add.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, <vscale x 8 x i1> %m, i32 %evl)
1430 ret <vscale x 8 x i32> %v
1433 define <vscale x 8 x i32> @vadd_vi_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1434 ; CHECK-LABEL: vadd_vi_nxv8i32:
1436 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1437 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1439 %elt.head = insertelement <vscale x 8 x i32> poison, i32 -1, i32 0
1440 %vb = shufflevector <vscale x 8 x i32> %elt.head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
1441 %v = call <vscale x 8 x i32> @llvm.vp.add.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, <vscale x 8 x i1> %m, i32 %evl)
1442 ret <vscale x 8 x i32> %v
1445 define <vscale x 8 x i32> @vadd_vi_nxv8i32_unmasked(<vscale x 8 x i32> %va, i32 zeroext %evl) {
1446 ; CHECK-LABEL: vadd_vi_nxv8i32_unmasked:
1448 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1449 ; CHECK-NEXT: vadd.vi v8, v8, -1
1451 %elt.head = insertelement <vscale x 8 x i32> poison, i32 -1, i32 0
1452 %vb = shufflevector <vscale x 8 x i32> %elt.head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
1453 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
1454 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
1455 %v = call <vscale x 8 x i32> @llvm.vp.add.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, <vscale x 8 x i1> %m, i32 %evl)
1456 ret <vscale x 8 x i32> %v
1459 declare <vscale x 16 x i32> @llvm.vp.add.nxv16i32(<vscale x 16 x i32>, <vscale x 16 x i32>, <vscale x 16 x i1>, i32)
1461 define <vscale x 16 x i32> @vadd_vv_nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1462 ; CHECK-LABEL: vadd_vv_nxv16i32:
1464 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1465 ; CHECK-NEXT: vadd.vv v8, v8, v16, v0.t
1467 %v = call <vscale x 16 x i32> @llvm.vp.add.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, <vscale x 16 x i1> %m, i32 %evl)
1468 ret <vscale x 16 x i32> %v
1471 define <vscale x 16 x i32> @vadd_vv_nxv16i32_unmasked(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, i32 zeroext %evl) {
1472 ; CHECK-LABEL: vadd_vv_nxv16i32_unmasked:
1474 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1475 ; CHECK-NEXT: vadd.vv v8, v8, v16
1477 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
1478 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
1479 %v = call <vscale x 16 x i32> @llvm.vp.add.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, <vscale x 16 x i1> %m, i32 %evl)
1480 ret <vscale x 16 x i32> %v
1483 define <vscale x 16 x i32> @vadd_vx_nxv16i32(<vscale x 16 x i32> %va, i32 %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1484 ; CHECK-LABEL: vadd_vx_nxv16i32:
1486 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1487 ; CHECK-NEXT: vadd.vx v8, v8, a0, v0.t
1489 %elt.head = insertelement <vscale x 16 x i32> poison, i32 %b, i32 0
1490 %vb = shufflevector <vscale x 16 x i32> %elt.head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
1491 %v = call <vscale x 16 x i32> @llvm.vp.add.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb, <vscale x 16 x i1> %m, i32 %evl)
1492 ret <vscale x 16 x i32> %v
1495 define <vscale x 16 x i32> @vadd_vx_nxv16i32_unmasked(<vscale x 16 x i32> %va, i32 %b, i32 zeroext %evl) {
1496 ; CHECK-LABEL: vadd_vx_nxv16i32_unmasked:
1498 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1499 ; CHECK-NEXT: vadd.vx v8, v8, a0
1501 %elt.head = insertelement <vscale x 16 x i32> poison, i32 %b, i32 0
1502 %vb = shufflevector <vscale x 16 x i32> %elt.head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
1503 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
1504 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
1505 %v = call <vscale x 16 x i32> @llvm.vp.add.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb, <vscale x 16 x i1> %m, i32 %evl)
1506 ret <vscale x 16 x i32> %v
1509 define <vscale x 16 x i32> @vadd_vi_nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1510 ; CHECK-LABEL: vadd_vi_nxv16i32:
1512 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1513 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1515 %elt.head = insertelement <vscale x 16 x i32> poison, i32 -1, i32 0
1516 %vb = shufflevector <vscale x 16 x i32> %elt.head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
1517 %v = call <vscale x 16 x i32> @llvm.vp.add.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb, <vscale x 16 x i1> %m, i32 %evl)
1518 ret <vscale x 16 x i32> %v
1521 define <vscale x 16 x i32> @vadd_vi_nxv16i32_unmasked(<vscale x 16 x i32> %va, i32 zeroext %evl) {
1522 ; CHECK-LABEL: vadd_vi_nxv16i32_unmasked:
1524 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1525 ; CHECK-NEXT: vadd.vi v8, v8, -1
1527 %elt.head = insertelement <vscale x 16 x i32> poison, i32 -1, i32 0
1528 %vb = shufflevector <vscale x 16 x i32> %elt.head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
1529 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
1530 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
1531 %v = call <vscale x 16 x i32> @llvm.vp.add.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb, <vscale x 16 x i1> %m, i32 %evl)
1532 ret <vscale x 16 x i32> %v
1535 ; Test that split-legalization works then the mask needs manual splitting.
1537 declare <vscale x 32 x i32> @llvm.vp.add.nxv32i32(<vscale x 32 x i32>, <vscale x 32 x i32>, <vscale x 32 x i1>, i32)
1539 define <vscale x 32 x i32> @vadd_vi_nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i1> %m, i32 zeroext %evl) {
1540 ; CHECK-LABEL: vadd_vi_nxv32i32:
1542 ; CHECK-NEXT: vmv1r.v v24, v0
1543 ; CHECK-NEXT: csrr a1, vlenb
1544 ; CHECK-NEXT: srli a2, a1, 2
1545 ; CHECK-NEXT: vsetvli a3, zero, e8, mf2, ta, ma
1546 ; CHECK-NEXT: vslidedown.vx v0, v0, a2
1547 ; CHECK-NEXT: slli a1, a1, 1
1548 ; CHECK-NEXT: sub a2, a0, a1
1549 ; CHECK-NEXT: sltu a3, a0, a2
1550 ; CHECK-NEXT: addi a3, a3, -1
1551 ; CHECK-NEXT: and a2, a3, a2
1552 ; CHECK-NEXT: vsetvli zero, a2, e32, m8, ta, ma
1553 ; CHECK-NEXT: vadd.vi v16, v16, -1, v0.t
1554 ; CHECK-NEXT: bltu a0, a1, .LBB118_2
1555 ; CHECK-NEXT: # %bb.1:
1556 ; CHECK-NEXT: mv a0, a1
1557 ; CHECK-NEXT: .LBB118_2:
1558 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1559 ; CHECK-NEXT: vmv1r.v v0, v24
1560 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1562 %elt.head = insertelement <vscale x 32 x i32> poison, i32 -1, i32 0
1563 %vb = shufflevector <vscale x 32 x i32> %elt.head, <vscale x 32 x i32> poison, <vscale x 32 x i32> zeroinitializer
1564 %v = call <vscale x 32 x i32> @llvm.vp.add.nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i32> %vb, <vscale x 32 x i1> %m, i32 %evl)
1565 ret <vscale x 32 x i32> %v
1568 define <vscale x 32 x i32> @vadd_vi_nxv32i32_unmasked(<vscale x 32 x i32> %va, i32 zeroext %evl) {
1569 ; CHECK-LABEL: vadd_vi_nxv32i32_unmasked:
1571 ; CHECK-NEXT: csrr a1, vlenb
1572 ; CHECK-NEXT: slli a1, a1, 1
1573 ; CHECK-NEXT: sub a2, a0, a1
1574 ; CHECK-NEXT: sltu a3, a0, a2
1575 ; CHECK-NEXT: addi a3, a3, -1
1576 ; CHECK-NEXT: and a2, a3, a2
1577 ; CHECK-NEXT: vsetvli zero, a2, e32, m8, ta, ma
1578 ; CHECK-NEXT: vadd.vi v16, v16, -1
1579 ; CHECK-NEXT: bltu a0, a1, .LBB119_2
1580 ; CHECK-NEXT: # %bb.1:
1581 ; CHECK-NEXT: mv a0, a1
1582 ; CHECK-NEXT: .LBB119_2:
1583 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1584 ; CHECK-NEXT: vadd.vi v8, v8, -1
1586 %elt.head = insertelement <vscale x 32 x i32> poison, i32 -1, i32 0
1587 %vb = shufflevector <vscale x 32 x i32> %elt.head, <vscale x 32 x i32> poison, <vscale x 32 x i32> zeroinitializer
1588 %head = insertelement <vscale x 32 x i1> poison, i1 true, i32 0
1589 %m = shufflevector <vscale x 32 x i1> %head, <vscale x 32 x i1> poison, <vscale x 32 x i32> zeroinitializer
1590 %v = call <vscale x 32 x i32> @llvm.vp.add.nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i32> %vb, <vscale x 32 x i1> %m, i32 %evl)
1591 ret <vscale x 32 x i32> %v
1594 ; Test splitting when the %evl is a constant (albeit an unknown one).
1596 declare i32 @llvm.vscale.i32()
1598 ; FIXME: The upper half of the operation is doing nothing.
1599 ; FIXME: The branches comparing vscale vs. vscale should be constant-foldable.
1601 define <vscale x 32 x i32> @vadd_vi_nxv32i32_evl_nx8(<vscale x 32 x i32> %va, <vscale x 32 x i1> %m) {
1602 ; CHECK-LABEL: vadd_vi_nxv32i32_evl_nx8:
1604 ; CHECK-NEXT: vmv1r.v v24, v0
1605 ; CHECK-NEXT: csrr a0, vlenb
1606 ; CHECK-NEXT: srli a1, a0, 2
1607 ; CHECK-NEXT: vsetvli a2, zero, e8, mf2, ta, ma
1608 ; CHECK-NEXT: vslidedown.vx v0, v0, a1
1609 ; CHECK-NEXT: slli a1, a0, 1
1610 ; CHECK-NEXT: sub a2, a0, a1
1611 ; CHECK-NEXT: sltu a3, a0, a2
1612 ; CHECK-NEXT: addi a3, a3, -1
1613 ; CHECK-NEXT: and a2, a3, a2
1614 ; CHECK-NEXT: vsetvli zero, a2, e32, m8, ta, ma
1615 ; CHECK-NEXT: vadd.vi v16, v16, -1, v0.t
1616 ; CHECK-NEXT: bltu a0, a1, .LBB120_2
1617 ; CHECK-NEXT: # %bb.1:
1618 ; CHECK-NEXT: mv a0, a1
1619 ; CHECK-NEXT: .LBB120_2:
1620 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1621 ; CHECK-NEXT: vmv1r.v v0, v24
1622 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1624 %elt.head = insertelement <vscale x 32 x i32> poison, i32 -1, i32 0
1625 %vb = shufflevector <vscale x 32 x i32> %elt.head, <vscale x 32 x i32> poison, <vscale x 32 x i32> zeroinitializer
1626 %evl = call i32 @llvm.vscale.i32()
1627 %evl0 = mul i32 %evl, 8
1628 %v = call <vscale x 32 x i32> @llvm.vp.add.nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i32> %vb, <vscale x 32 x i1> %m, i32 %evl0)
1629 ret <vscale x 32 x i32> %v
1632 ; FIXME: The first vadd.vi should be able to infer that its AVL is equivalent to VLMAX.
1633 ; FIXME: The upper half of the operation is doing nothing but we don't catch
1634 ; that on RV64; we issue a usubsat(and (vscale x 16), 0xffffffff, vscale x 16)
1635 ; (the "original" %evl is the "and", due to known-bits issues with legalizing
1636 ; the i32 %evl to i64) and this isn't detected as 0.
1637 ; This could be resolved in the future with more detailed KnownBits analysis
1640 define <vscale x 32 x i32> @vadd_vi_nxv32i32_evl_nx16(<vscale x 32 x i32> %va, <vscale x 32 x i1> %m) {
1641 ; RV32-LABEL: vadd_vi_nxv32i32_evl_nx16:
1643 ; RV32-NEXT: csrr a0, vlenb
1644 ; RV32-NEXT: slli a0, a0, 1
1645 ; RV32-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1646 ; RV32-NEXT: vadd.vi v8, v8, -1, v0.t
1649 ; RV64-LABEL: vadd_vi_nxv32i32_evl_nx16:
1651 ; RV64-NEXT: csrr a0, vlenb
1652 ; RV64-NEXT: srli a1, a0, 2
1653 ; RV64-NEXT: vsetvli a2, zero, e8, mf2, ta, ma
1654 ; RV64-NEXT: vslidedown.vx v24, v0, a1
1655 ; RV64-NEXT: slli a0, a0, 1
1656 ; RV64-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1657 ; RV64-NEXT: vadd.vi v8, v8, -1, v0.t
1658 ; RV64-NEXT: vsetivli zero, 0, e32, m8, ta, ma
1659 ; RV64-NEXT: vmv1r.v v0, v24
1660 ; RV64-NEXT: vadd.vi v16, v16, -1, v0.t
1662 %elt.head = insertelement <vscale x 32 x i32> poison, i32 -1, i32 0
1663 %vb = shufflevector <vscale x 32 x i32> %elt.head, <vscale x 32 x i32> poison, <vscale x 32 x i32> zeroinitializer
1664 %evl = call i32 @llvm.vscale.i32()
1665 %evl0 = mul i32 %evl, 16
1666 %v = call <vscale x 32 x i32> @llvm.vp.add.nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i32> %vb, <vscale x 32 x i1> %m, i32 %evl0)
1667 ret <vscale x 32 x i32> %v
1670 declare <vscale x 1 x i64> @llvm.vp.add.nxv1i64(<vscale x 1 x i64>, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1672 define <vscale x 1 x i64> @vadd_vv_nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1673 ; CHECK-LABEL: vadd_vv_nxv1i64:
1675 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1676 ; CHECK-NEXT: vadd.vv v8, v8, v9, v0.t
1678 %v = call <vscale x 1 x i64> @llvm.vp.add.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, <vscale x 1 x i1> %m, i32 %evl)
1679 ret <vscale x 1 x i64> %v
1682 define <vscale x 1 x i64> @vadd_vv_nxv1i64_unmasked(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, i32 zeroext %evl) {
1683 ; CHECK-LABEL: vadd_vv_nxv1i64_unmasked:
1685 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1686 ; CHECK-NEXT: vadd.vv v8, v8, v9
1688 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
1689 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
1690 %v = call <vscale x 1 x i64> @llvm.vp.add.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, <vscale x 1 x i1> %m, i32 %evl)
1691 ret <vscale x 1 x i64> %v
1694 define <vscale x 1 x i64> @vadd_vx_nxv1i64(<vscale x 1 x i64> %va, i64 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1695 ; RV32-LABEL: vadd_vx_nxv1i64:
1697 ; RV32-NEXT: addi sp, sp, -16
1698 ; RV32-NEXT: .cfi_def_cfa_offset 16
1699 ; RV32-NEXT: sw a1, 12(sp)
1700 ; RV32-NEXT: sw a0, 8(sp)
1701 ; RV32-NEXT: addi a0, sp, 8
1702 ; RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1703 ; RV32-NEXT: vlse64.v v9, (a0), zero
1704 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1705 ; RV32-NEXT: vadd.vv v8, v8, v9, v0.t
1706 ; RV32-NEXT: addi sp, sp, 16
1709 ; RV64-LABEL: vadd_vx_nxv1i64:
1711 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1712 ; RV64-NEXT: vadd.vx v8, v8, a0, v0.t
1714 %elt.head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
1715 %vb = shufflevector <vscale x 1 x i64> %elt.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
1716 %v = call <vscale x 1 x i64> @llvm.vp.add.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb, <vscale x 1 x i1> %m, i32 %evl)
1717 ret <vscale x 1 x i64> %v
1720 define <vscale x 1 x i64> @vadd_vx_nxv1i64_unmasked(<vscale x 1 x i64> %va, i64 %b, i32 zeroext %evl) {
1721 ; RV32-LABEL: vadd_vx_nxv1i64_unmasked:
1723 ; RV32-NEXT: addi sp, sp, -16
1724 ; RV32-NEXT: .cfi_def_cfa_offset 16
1725 ; RV32-NEXT: sw a1, 12(sp)
1726 ; RV32-NEXT: sw a0, 8(sp)
1727 ; RV32-NEXT: addi a0, sp, 8
1728 ; RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1729 ; RV32-NEXT: vlse64.v v9, (a0), zero
1730 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1731 ; RV32-NEXT: vadd.vv v8, v8, v9
1732 ; RV32-NEXT: addi sp, sp, 16
1735 ; RV64-LABEL: vadd_vx_nxv1i64_unmasked:
1737 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1738 ; RV64-NEXT: vadd.vx v8, v8, a0
1740 %elt.head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
1741 %vb = shufflevector <vscale x 1 x i64> %elt.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
1742 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
1743 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
1744 %v = call <vscale x 1 x i64> @llvm.vp.add.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb, <vscale x 1 x i1> %m, i32 %evl)
1745 ret <vscale x 1 x i64> %v
1748 define <vscale x 1 x i64> @vadd_vi_nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1749 ; CHECK-LABEL: vadd_vi_nxv1i64:
1751 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1752 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1754 %elt.head = insertelement <vscale x 1 x i64> poison, i64 -1, i32 0
1755 %vb = shufflevector <vscale x 1 x i64> %elt.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
1756 %v = call <vscale x 1 x i64> @llvm.vp.add.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb, <vscale x 1 x i1> %m, i32 %evl)
1757 ret <vscale x 1 x i64> %v
1760 define <vscale x 1 x i64> @vadd_vi_nxv1i64_unmasked(<vscale x 1 x i64> %va, i32 zeroext %evl) {
1761 ; CHECK-LABEL: vadd_vi_nxv1i64_unmasked:
1763 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1764 ; CHECK-NEXT: vadd.vi v8, v8, -1
1766 %elt.head = insertelement <vscale x 1 x i64> poison, i64 -1, i32 0
1767 %vb = shufflevector <vscale x 1 x i64> %elt.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
1768 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
1769 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
1770 %v = call <vscale x 1 x i64> @llvm.vp.add.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb, <vscale x 1 x i1> %m, i32 %evl)
1771 ret <vscale x 1 x i64> %v
1774 declare <vscale x 2 x i64> @llvm.vp.add.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1776 define <vscale x 2 x i64> @vadd_vv_nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1777 ; CHECK-LABEL: vadd_vv_nxv2i64:
1779 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1780 ; CHECK-NEXT: vadd.vv v8, v8, v10, v0.t
1782 %v = call <vscale x 2 x i64> @llvm.vp.add.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, <vscale x 2 x i1> %m, i32 %evl)
1783 ret <vscale x 2 x i64> %v
1786 define <vscale x 2 x i64> @vadd_vv_nxv2i64_unmasked(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, i32 zeroext %evl) {
1787 ; CHECK-LABEL: vadd_vv_nxv2i64_unmasked:
1789 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1790 ; CHECK-NEXT: vadd.vv v8, v8, v10
1792 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
1793 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
1794 %v = call <vscale x 2 x i64> @llvm.vp.add.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, <vscale x 2 x i1> %m, i32 %evl)
1795 ret <vscale x 2 x i64> %v
1798 define <vscale x 2 x i64> @vadd_vx_nxv2i64(<vscale x 2 x i64> %va, i64 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1799 ; RV32-LABEL: vadd_vx_nxv2i64:
1801 ; RV32-NEXT: addi sp, sp, -16
1802 ; RV32-NEXT: .cfi_def_cfa_offset 16
1803 ; RV32-NEXT: sw a1, 12(sp)
1804 ; RV32-NEXT: sw a0, 8(sp)
1805 ; RV32-NEXT: addi a0, sp, 8
1806 ; RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1807 ; RV32-NEXT: vlse64.v v10, (a0), zero
1808 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1809 ; RV32-NEXT: vadd.vv v8, v8, v10, v0.t
1810 ; RV32-NEXT: addi sp, sp, 16
1813 ; RV64-LABEL: vadd_vx_nxv2i64:
1815 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1816 ; RV64-NEXT: vadd.vx v8, v8, a0, v0.t
1818 %elt.head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
1819 %vb = shufflevector <vscale x 2 x i64> %elt.head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
1820 %v = call <vscale x 2 x i64> @llvm.vp.add.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb, <vscale x 2 x i1> %m, i32 %evl)
1821 ret <vscale x 2 x i64> %v
1824 define <vscale x 2 x i64> @vadd_vx_nxv2i64_unmasked(<vscale x 2 x i64> %va, i64 %b, i32 zeroext %evl) {
1825 ; RV32-LABEL: vadd_vx_nxv2i64_unmasked:
1827 ; RV32-NEXT: addi sp, sp, -16
1828 ; RV32-NEXT: .cfi_def_cfa_offset 16
1829 ; RV32-NEXT: sw a1, 12(sp)
1830 ; RV32-NEXT: sw a0, 8(sp)
1831 ; RV32-NEXT: addi a0, sp, 8
1832 ; RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1833 ; RV32-NEXT: vlse64.v v10, (a0), zero
1834 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1835 ; RV32-NEXT: vadd.vv v8, v8, v10
1836 ; RV32-NEXT: addi sp, sp, 16
1839 ; RV64-LABEL: vadd_vx_nxv2i64_unmasked:
1841 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1842 ; RV64-NEXT: vadd.vx v8, v8, a0
1844 %elt.head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
1845 %vb = shufflevector <vscale x 2 x i64> %elt.head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
1846 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
1847 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
1848 %v = call <vscale x 2 x i64> @llvm.vp.add.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb, <vscale x 2 x i1> %m, i32 %evl)
1849 ret <vscale x 2 x i64> %v
1852 define <vscale x 2 x i64> @vadd_vi_nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1853 ; CHECK-LABEL: vadd_vi_nxv2i64:
1855 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1856 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1858 %elt.head = insertelement <vscale x 2 x i64> poison, i64 -1, i32 0
1859 %vb = shufflevector <vscale x 2 x i64> %elt.head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
1860 %v = call <vscale x 2 x i64> @llvm.vp.add.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb, <vscale x 2 x i1> %m, i32 %evl)
1861 ret <vscale x 2 x i64> %v
1864 define <vscale x 2 x i64> @vadd_vi_nxv2i64_unmasked(<vscale x 2 x i64> %va, i32 zeroext %evl) {
1865 ; CHECK-LABEL: vadd_vi_nxv2i64_unmasked:
1867 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1868 ; CHECK-NEXT: vadd.vi v8, v8, -1
1870 %elt.head = insertelement <vscale x 2 x i64> poison, i64 -1, i32 0
1871 %vb = shufflevector <vscale x 2 x i64> %elt.head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
1872 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
1873 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
1874 %v = call <vscale x 2 x i64> @llvm.vp.add.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb, <vscale x 2 x i1> %m, i32 %evl)
1875 ret <vscale x 2 x i64> %v
1878 declare <vscale x 4 x i64> @llvm.vp.add.nxv4i64(<vscale x 4 x i64>, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
1880 define <vscale x 4 x i64> @vadd_vv_nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1881 ; CHECK-LABEL: vadd_vv_nxv4i64:
1883 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1884 ; CHECK-NEXT: vadd.vv v8, v8, v12, v0.t
1886 %v = call <vscale x 4 x i64> @llvm.vp.add.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, <vscale x 4 x i1> %m, i32 %evl)
1887 ret <vscale x 4 x i64> %v
1890 define <vscale x 4 x i64> @vadd_vv_nxv4i64_unmasked(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, i32 zeroext %evl) {
1891 ; CHECK-LABEL: vadd_vv_nxv4i64_unmasked:
1893 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1894 ; CHECK-NEXT: vadd.vv v8, v8, v12
1896 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
1897 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
1898 %v = call <vscale x 4 x i64> @llvm.vp.add.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, <vscale x 4 x i1> %m, i32 %evl)
1899 ret <vscale x 4 x i64> %v
1902 define <vscale x 4 x i64> @vadd_vx_nxv4i64(<vscale x 4 x i64> %va, i64 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1903 ; RV32-LABEL: vadd_vx_nxv4i64:
1905 ; RV32-NEXT: addi sp, sp, -16
1906 ; RV32-NEXT: .cfi_def_cfa_offset 16
1907 ; RV32-NEXT: sw a1, 12(sp)
1908 ; RV32-NEXT: sw a0, 8(sp)
1909 ; RV32-NEXT: addi a0, sp, 8
1910 ; RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1911 ; RV32-NEXT: vlse64.v v12, (a0), zero
1912 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
1913 ; RV32-NEXT: vadd.vv v8, v8, v12, v0.t
1914 ; RV32-NEXT: addi sp, sp, 16
1917 ; RV64-LABEL: vadd_vx_nxv4i64:
1919 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
1920 ; RV64-NEXT: vadd.vx v8, v8, a0, v0.t
1922 %elt.head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
1923 %vb = shufflevector <vscale x 4 x i64> %elt.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
1924 %v = call <vscale x 4 x i64> @llvm.vp.add.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb, <vscale x 4 x i1> %m, i32 %evl)
1925 ret <vscale x 4 x i64> %v
1928 define <vscale x 4 x i64> @vadd_vx_nxv4i64_unmasked(<vscale x 4 x i64> %va, i64 %b, i32 zeroext %evl) {
1929 ; RV32-LABEL: vadd_vx_nxv4i64_unmasked:
1931 ; RV32-NEXT: addi sp, sp, -16
1932 ; RV32-NEXT: .cfi_def_cfa_offset 16
1933 ; RV32-NEXT: sw a1, 12(sp)
1934 ; RV32-NEXT: sw a0, 8(sp)
1935 ; RV32-NEXT: addi a0, sp, 8
1936 ; RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1937 ; RV32-NEXT: vlse64.v v12, (a0), zero
1938 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
1939 ; RV32-NEXT: vadd.vv v8, v8, v12
1940 ; RV32-NEXT: addi sp, sp, 16
1943 ; RV64-LABEL: vadd_vx_nxv4i64_unmasked:
1945 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
1946 ; RV64-NEXT: vadd.vx v8, v8, a0
1948 %elt.head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
1949 %vb = shufflevector <vscale x 4 x i64> %elt.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
1950 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
1951 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
1952 %v = call <vscale x 4 x i64> @llvm.vp.add.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb, <vscale x 4 x i1> %m, i32 %evl)
1953 ret <vscale x 4 x i64> %v
1956 define <vscale x 4 x i64> @vadd_vi_nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1957 ; CHECK-LABEL: vadd_vi_nxv4i64:
1959 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1960 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
1962 %elt.head = insertelement <vscale x 4 x i64> poison, i64 -1, i32 0
1963 %vb = shufflevector <vscale x 4 x i64> %elt.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
1964 %v = call <vscale x 4 x i64> @llvm.vp.add.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb, <vscale x 4 x i1> %m, i32 %evl)
1965 ret <vscale x 4 x i64> %v
1968 define <vscale x 4 x i64> @vadd_vi_nxv4i64_unmasked(<vscale x 4 x i64> %va, i32 zeroext %evl) {
1969 ; CHECK-LABEL: vadd_vi_nxv4i64_unmasked:
1971 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1972 ; CHECK-NEXT: vadd.vi v8, v8, -1
1974 %elt.head = insertelement <vscale x 4 x i64> poison, i64 -1, i32 0
1975 %vb = shufflevector <vscale x 4 x i64> %elt.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
1976 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
1977 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
1978 %v = call <vscale x 4 x i64> @llvm.vp.add.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb, <vscale x 4 x i1> %m, i32 %evl)
1979 ret <vscale x 4 x i64> %v
1982 declare <vscale x 8 x i64> @llvm.vp.add.nxv8i64(<vscale x 8 x i64>, <vscale x 8 x i64>, <vscale x 8 x i1>, i32)
1984 define <vscale x 8 x i64> @vadd_vv_nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1985 ; CHECK-LABEL: vadd_vv_nxv8i64:
1987 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1988 ; CHECK-NEXT: vadd.vv v8, v8, v16, v0.t
1990 %v = call <vscale x 8 x i64> @llvm.vp.add.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, <vscale x 8 x i1> %m, i32 %evl)
1991 ret <vscale x 8 x i64> %v
1994 define <vscale x 8 x i64> @vadd_vv_nxv8i64_unmasked(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, i32 zeroext %evl) {
1995 ; CHECK-LABEL: vadd_vv_nxv8i64_unmasked:
1997 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1998 ; CHECK-NEXT: vadd.vv v8, v8, v16
2000 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
2001 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
2002 %v = call <vscale x 8 x i64> @llvm.vp.add.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, <vscale x 8 x i1> %m, i32 %evl)
2003 ret <vscale x 8 x i64> %v
2006 define <vscale x 8 x i64> @vadd_vx_nxv8i64(<vscale x 8 x i64> %va, i64 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
2007 ; RV32-LABEL: vadd_vx_nxv8i64:
2009 ; RV32-NEXT: addi sp, sp, -16
2010 ; RV32-NEXT: .cfi_def_cfa_offset 16
2011 ; RV32-NEXT: sw a1, 12(sp)
2012 ; RV32-NEXT: sw a0, 8(sp)
2013 ; RV32-NEXT: addi a0, sp, 8
2014 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
2015 ; RV32-NEXT: vlse64.v v16, (a0), zero
2016 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
2017 ; RV32-NEXT: vadd.vv v8, v8, v16, v0.t
2018 ; RV32-NEXT: addi sp, sp, 16
2021 ; RV64-LABEL: vadd_vx_nxv8i64:
2023 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2024 ; RV64-NEXT: vadd.vx v8, v8, a0, v0.t
2026 %elt.head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
2027 %vb = shufflevector <vscale x 8 x i64> %elt.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
2028 %v = call <vscale x 8 x i64> @llvm.vp.add.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb, <vscale x 8 x i1> %m, i32 %evl)
2029 ret <vscale x 8 x i64> %v
2032 define <vscale x 8 x i64> @vadd_vx_nxv8i64_unmasked(<vscale x 8 x i64> %va, i64 %b, i32 zeroext %evl) {
2033 ; RV32-LABEL: vadd_vx_nxv8i64_unmasked:
2035 ; RV32-NEXT: addi sp, sp, -16
2036 ; RV32-NEXT: .cfi_def_cfa_offset 16
2037 ; RV32-NEXT: sw a1, 12(sp)
2038 ; RV32-NEXT: sw a0, 8(sp)
2039 ; RV32-NEXT: addi a0, sp, 8
2040 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
2041 ; RV32-NEXT: vlse64.v v16, (a0), zero
2042 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
2043 ; RV32-NEXT: vadd.vv v8, v8, v16
2044 ; RV32-NEXT: addi sp, sp, 16
2047 ; RV64-LABEL: vadd_vx_nxv8i64_unmasked:
2049 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2050 ; RV64-NEXT: vadd.vx v8, v8, a0
2052 %elt.head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
2053 %vb = shufflevector <vscale x 8 x i64> %elt.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
2054 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
2055 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
2056 %v = call <vscale x 8 x i64> @llvm.vp.add.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb, <vscale x 8 x i1> %m, i32 %evl)
2057 ret <vscale x 8 x i64> %v
2060 define <vscale x 8 x i64> @vadd_vi_nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
2061 ; CHECK-LABEL: vadd_vi_nxv8i64:
2063 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
2064 ; CHECK-NEXT: vadd.vi v8, v8, -1, v0.t
2066 %elt.head = insertelement <vscale x 8 x i64> poison, i64 -1, i32 0
2067 %vb = shufflevector <vscale x 8 x i64> %elt.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
2068 %v = call <vscale x 8 x i64> @llvm.vp.add.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb, <vscale x 8 x i1> %m, i32 %evl)
2069 ret <vscale x 8 x i64> %v
2072 define <vscale x 8 x i64> @vadd_vi_nxv8i64_unmasked(<vscale x 8 x i64> %va, i32 zeroext %evl) {
2073 ; CHECK-LABEL: vadd_vi_nxv8i64_unmasked:
2075 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
2076 ; CHECK-NEXT: vadd.vi v8, v8, -1
2078 %elt.head = insertelement <vscale x 8 x i64> poison, i64 -1, i32 0
2079 %vb = shufflevector <vscale x 8 x i64> %elt.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
2080 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
2081 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
2082 %v = call <vscale x 8 x i64> @llvm.vp.add.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb, <vscale x 8 x i1> %m, i32 %evl)
2083 ret <vscale x 8 x i64> %v