1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs \
3 ; RUN: < %s | FileCheck %s
5 declare <vscale x 1 x i1> @llvm.experimental.vp.splice.nxv1i1(<vscale x 1 x i1>, <vscale x 1 x i1>, i32, <vscale x 1 x i1>, i32, i32)
6 declare <vscale x 2 x i1> @llvm.experimental.vp.splice.nxv2i1(<vscale x 2 x i1>, <vscale x 2 x i1>, i32, <vscale x 2 x i1>, i32, i32)
7 declare <vscale x 4 x i1> @llvm.experimental.vp.splice.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>, i32, <vscale x 4 x i1>, i32, i32)
8 declare <vscale x 8 x i1> @llvm.experimental.vp.splice.nxv8i1(<vscale x 8 x i1>, <vscale x 8 x i1>, i32, <vscale x 8 x i1>, i32, i32)
9 declare <vscale x 16 x i1> @llvm.experimental.vp.splice.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>, i32, <vscale x 16 x i1>, i32, i32)
10 declare <vscale x 32 x i1> @llvm.experimental.vp.splice.nxv32i1(<vscale x 32 x i1>, <vscale x 32 x i1>, i32, <vscale x 32 x i1>, i32, i32)
11 declare <vscale x 64 x i1> @llvm.experimental.vp.splice.nxv64i1(<vscale x 64 x i1>, <vscale x 64 x i1>, i32, <vscale x 64 x i1>, i32, i32)
13 define <vscale x 1 x i1> @test_vp_splice_nxv1i1(<vscale x 1 x i1> %va, <vscale x 1 x i1> %vb, i32 zeroext %evla, i32 zeroext %evlb) {
14 ; CHECK-LABEL: test_vp_splice_nxv1i1:
16 ; CHECK-NEXT: vmv1r.v v9, v0
17 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
18 ; CHECK-NEXT: vmv.v.i v10, 0
19 ; CHECK-NEXT: vmv1r.v v0, v8
20 ; CHECK-NEXT: vmerge.vim v8, v10, 1, v0
21 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
22 ; CHECK-NEXT: vmv.v.i v10, 0
23 ; CHECK-NEXT: vmv1r.v v0, v9
24 ; CHECK-NEXT: vmerge.vim v9, v10, 1, v0
25 ; CHECK-NEXT: addi a0, a0, -5
26 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
27 ; CHECK-NEXT: vslidedown.vi v9, v9, 5
28 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
29 ; CHECK-NEXT: vslideup.vx v9, v8, a0
30 ; CHECK-NEXT: vmsne.vi v0, v9, 0
33 %v = call <vscale x 1 x i1> @llvm.experimental.vp.splice.nxv1i1(<vscale x 1 x i1> %va, <vscale x 1 x i1> %vb, i32 5, <vscale x 1 x i1> splat (i1 1), i32 %evla, i32 %evlb)
34 ret <vscale x 1 x i1> %v
37 define <vscale x 1 x i1> @test_vp_splice_nxv1i1_negative_offset(<vscale x 1 x i1> %va, <vscale x 1 x i1> %vb, i32 zeroext %evla, i32 zeroext %evlb) {
38 ; CHECK-LABEL: test_vp_splice_nxv1i1_negative_offset:
40 ; CHECK-NEXT: vmv1r.v v9, v0
41 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
42 ; CHECK-NEXT: vmv.v.i v10, 0
43 ; CHECK-NEXT: vmv1r.v v0, v8
44 ; CHECK-NEXT: vmerge.vim v8, v10, 1, v0
45 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
46 ; CHECK-NEXT: vmv.v.i v10, 0
47 ; CHECK-NEXT: vmv1r.v v0, v9
48 ; CHECK-NEXT: vmerge.vim v9, v10, 1, v0
49 ; CHECK-NEXT: addi a0, a0, -5
50 ; CHECK-NEXT: vsetivli zero, 5, e8, mf8, ta, ma
51 ; CHECK-NEXT: vslidedown.vx v9, v9, a0
52 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
53 ; CHECK-NEXT: vslideup.vi v9, v8, 5
54 ; CHECK-NEXT: vmsne.vi v0, v9, 0
57 %v = call <vscale x 1 x i1> @llvm.experimental.vp.splice.nxv1i1(<vscale x 1 x i1> %va, <vscale x 1 x i1> %vb, i32 -5, <vscale x 1 x i1> splat (i1 1), i32 %evla, i32 %evlb)
58 ret <vscale x 1 x i1> %v
61 define <vscale x 1 x i1> @test_vp_splice_nxv1i1_masked(<vscale x 1 x i1> %va, <vscale x 1 x i1> %vb, <vscale x 1 x i1> %mask, i32 zeroext %evla, i32 zeroext %evlb) {
62 ; CHECK-LABEL: test_vp_splice_nxv1i1_masked:
64 ; CHECK-NEXT: vmv1r.v v10, v0
65 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
66 ; CHECK-NEXT: vmv.v.i v11, 0
67 ; CHECK-NEXT: vmv1r.v v0, v8
68 ; CHECK-NEXT: vmerge.vim v8, v11, 1, v0
69 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
70 ; CHECK-NEXT: vmv.v.i v11, 0
71 ; CHECK-NEXT: vmv1r.v v0, v10
72 ; CHECK-NEXT: vmerge.vim v10, v11, 1, v0
73 ; CHECK-NEXT: addi a0, a0, -5
74 ; CHECK-NEXT: vmv1r.v v0, v9
75 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
76 ; CHECK-NEXT: vslidedown.vi v10, v10, 5, v0.t
77 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, mu
78 ; CHECK-NEXT: vslideup.vx v10, v8, a0, v0.t
79 ; CHECK-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
80 ; CHECK-NEXT: vmsne.vi v0, v10, 0, v0.t
82 %v = call <vscale x 1 x i1> @llvm.experimental.vp.splice.nxv1i1(<vscale x 1 x i1> %va, <vscale x 1 x i1> %vb, i32 5, <vscale x 1 x i1> %mask, i32 %evla, i32 %evlb)
83 ret <vscale x 1 x i1> %v
86 define <vscale x 2 x i1> @test_vp_splice_nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> %vb, i32 zeroext %evla, i32 zeroext %evlb) {
87 ; CHECK-LABEL: test_vp_splice_nxv2i1:
89 ; CHECK-NEXT: vmv1r.v v9, v0
90 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
91 ; CHECK-NEXT: vmv.v.i v10, 0
92 ; CHECK-NEXT: vmv1r.v v0, v8
93 ; CHECK-NEXT: vmerge.vim v8, v10, 1, v0
94 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
95 ; CHECK-NEXT: vmv.v.i v10, 0
96 ; CHECK-NEXT: vmv1r.v v0, v9
97 ; CHECK-NEXT: vmerge.vim v9, v10, 1, v0
98 ; CHECK-NEXT: addi a0, a0, -5
99 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
100 ; CHECK-NEXT: vslidedown.vi v9, v9, 5
101 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
102 ; CHECK-NEXT: vslideup.vx v9, v8, a0
103 ; CHECK-NEXT: vmsne.vi v0, v9, 0
106 %v = call <vscale x 2 x i1> @llvm.experimental.vp.splice.nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> %vb, i32 5, <vscale x 2 x i1> splat (i1 1), i32 %evla, i32 %evlb)
107 ret <vscale x 2 x i1> %v
110 define <vscale x 2 x i1> @test_vp_splice_nxv2i1_negative_offset(<vscale x 2 x i1> %va, <vscale x 2 x i1> %vb, i32 zeroext %evla, i32 zeroext %evlb) {
111 ; CHECK-LABEL: test_vp_splice_nxv2i1_negative_offset:
113 ; CHECK-NEXT: vmv1r.v v9, v0
114 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
115 ; CHECK-NEXT: vmv.v.i v10, 0
116 ; CHECK-NEXT: vmv1r.v v0, v8
117 ; CHECK-NEXT: vmerge.vim v8, v10, 1, v0
118 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
119 ; CHECK-NEXT: vmv.v.i v10, 0
120 ; CHECK-NEXT: vmv1r.v v0, v9
121 ; CHECK-NEXT: vmerge.vim v9, v10, 1, v0
122 ; CHECK-NEXT: addi a0, a0, -5
123 ; CHECK-NEXT: vsetivli zero, 5, e8, mf4, ta, ma
124 ; CHECK-NEXT: vslidedown.vx v9, v9, a0
125 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
126 ; CHECK-NEXT: vslideup.vi v9, v8, 5
127 ; CHECK-NEXT: vmsne.vi v0, v9, 0
130 %v = call <vscale x 2 x i1> @llvm.experimental.vp.splice.nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> %vb, i32 -5, <vscale x 2 x i1> splat (i1 1), i32 %evla, i32 %evlb)
131 ret <vscale x 2 x i1> %v
134 define <vscale x 2 x i1> @test_vp_splice_nxv2i1_masked(<vscale x 2 x i1> %va, <vscale x 2 x i1> %vb, <vscale x 2 x i1> %mask, i32 zeroext %evla, i32 zeroext %evlb) {
135 ; CHECK-LABEL: test_vp_splice_nxv2i1_masked:
137 ; CHECK-NEXT: vmv1r.v v10, v0
138 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
139 ; CHECK-NEXT: vmv.v.i v11, 0
140 ; CHECK-NEXT: vmv1r.v v0, v8
141 ; CHECK-NEXT: vmerge.vim v8, v11, 1, v0
142 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
143 ; CHECK-NEXT: vmv.v.i v11, 0
144 ; CHECK-NEXT: vmv1r.v v0, v10
145 ; CHECK-NEXT: vmerge.vim v10, v11, 1, v0
146 ; CHECK-NEXT: addi a0, a0, -5
147 ; CHECK-NEXT: vmv1r.v v0, v9
148 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
149 ; CHECK-NEXT: vslidedown.vi v10, v10, 5, v0.t
150 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, mu
151 ; CHECK-NEXT: vslideup.vx v10, v8, a0, v0.t
152 ; CHECK-NEXT: vsetvli zero, zero, e8, mf4, ta, ma
153 ; CHECK-NEXT: vmsne.vi v0, v10, 0, v0.t
155 %v = call <vscale x 2 x i1> @llvm.experimental.vp.splice.nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> %vb, i32 5, <vscale x 2 x i1> %mask, i32 %evla, i32 %evlb)
156 ret <vscale x 2 x i1> %v
159 define <vscale x 4 x i1> @test_vp_splice_nxv4i1(<vscale x 4 x i1> %va, <vscale x 4 x i1> %vb, i32 zeroext %evla, i32 zeroext %evlb) {
160 ; CHECK-LABEL: test_vp_splice_nxv4i1:
162 ; CHECK-NEXT: vmv1r.v v9, v0
163 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
164 ; CHECK-NEXT: vmv.v.i v10, 0
165 ; CHECK-NEXT: vmv1r.v v0, v8
166 ; CHECK-NEXT: vmerge.vim v8, v10, 1, v0
167 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
168 ; CHECK-NEXT: vmv.v.i v10, 0
169 ; CHECK-NEXT: vmv1r.v v0, v9
170 ; CHECK-NEXT: vmerge.vim v9, v10, 1, v0
171 ; CHECK-NEXT: addi a0, a0, -5
172 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
173 ; CHECK-NEXT: vslidedown.vi v9, v9, 5
174 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
175 ; CHECK-NEXT: vslideup.vx v9, v8, a0
176 ; CHECK-NEXT: vmsne.vi v0, v9, 0
179 %v = call <vscale x 4 x i1> @llvm.experimental.vp.splice.nxv4i1(<vscale x 4 x i1> %va, <vscale x 4 x i1> %vb, i32 5, <vscale x 4 x i1> splat (i1 1), i32 %evla, i32 %evlb)
180 ret <vscale x 4 x i1> %v
183 define <vscale x 4 x i1> @test_vp_splice_nxv4i1_negative_offset(<vscale x 4 x i1> %va, <vscale x 4 x i1> %vb, i32 zeroext %evla, i32 zeroext %evlb) {
184 ; CHECK-LABEL: test_vp_splice_nxv4i1_negative_offset:
186 ; CHECK-NEXT: vmv1r.v v9, v0
187 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
188 ; CHECK-NEXT: vmv.v.i v10, 0
189 ; CHECK-NEXT: vmv1r.v v0, v8
190 ; CHECK-NEXT: vmerge.vim v8, v10, 1, v0
191 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
192 ; CHECK-NEXT: vmv.v.i v10, 0
193 ; CHECK-NEXT: vmv1r.v v0, v9
194 ; CHECK-NEXT: vmerge.vim v9, v10, 1, v0
195 ; CHECK-NEXT: addi a0, a0, -5
196 ; CHECK-NEXT: vsetivli zero, 5, e8, mf2, ta, ma
197 ; CHECK-NEXT: vslidedown.vx v9, v9, a0
198 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
199 ; CHECK-NEXT: vslideup.vi v9, v8, 5
200 ; CHECK-NEXT: vmsne.vi v0, v9, 0
203 %v = call <vscale x 4 x i1> @llvm.experimental.vp.splice.nxv4i1(<vscale x 4 x i1> %va, <vscale x 4 x i1> %vb, i32 -5, <vscale x 4 x i1> splat (i1 1), i32 %evla, i32 %evlb)
204 ret <vscale x 4 x i1> %v
207 define <vscale x 4 x i1> @test_vp_splice_nxv4i1_masked(<vscale x 4 x i1> %va, <vscale x 4 x i1> %vb, <vscale x 4 x i1> %mask, i32 zeroext %evla, i32 zeroext %evlb) {
208 ; CHECK-LABEL: test_vp_splice_nxv4i1_masked:
210 ; CHECK-NEXT: vmv1r.v v10, v0
211 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
212 ; CHECK-NEXT: vmv.v.i v11, 0
213 ; CHECK-NEXT: vmv1r.v v0, v8
214 ; CHECK-NEXT: vmerge.vim v8, v11, 1, v0
215 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
216 ; CHECK-NEXT: vmv.v.i v11, 0
217 ; CHECK-NEXT: vmv1r.v v0, v10
218 ; CHECK-NEXT: vmerge.vim v10, v11, 1, v0
219 ; CHECK-NEXT: addi a0, a0, -5
220 ; CHECK-NEXT: vmv1r.v v0, v9
221 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
222 ; CHECK-NEXT: vslidedown.vi v10, v10, 5, v0.t
223 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, mu
224 ; CHECK-NEXT: vslideup.vx v10, v8, a0, v0.t
225 ; CHECK-NEXT: vsetvli zero, zero, e8, mf2, ta, ma
226 ; CHECK-NEXT: vmsne.vi v0, v10, 0, v0.t
228 %v = call <vscale x 4 x i1> @llvm.experimental.vp.splice.nxv4i1(<vscale x 4 x i1> %va, <vscale x 4 x i1> %vb, i32 5, <vscale x 4 x i1> %mask, i32 %evla, i32 %evlb)
229 ret <vscale x 4 x i1> %v
232 define <vscale x 8 x i1> @test_vp_splice_nxv8i1(<vscale x 8 x i1> %va, <vscale x 8 x i1> %vb, i32 zeroext %evla, i32 zeroext %evlb) {
233 ; CHECK-LABEL: test_vp_splice_nxv8i1:
235 ; CHECK-NEXT: vmv1r.v v9, v0
236 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
237 ; CHECK-NEXT: vmv.v.i v10, 0
238 ; CHECK-NEXT: vmv1r.v v0, v8
239 ; CHECK-NEXT: vmerge.vim v8, v10, 1, v0
240 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
241 ; CHECK-NEXT: vmv.v.i v10, 0
242 ; CHECK-NEXT: vmv1r.v v0, v9
243 ; CHECK-NEXT: vmerge.vim v9, v10, 1, v0
244 ; CHECK-NEXT: addi a0, a0, -5
245 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
246 ; CHECK-NEXT: vslidedown.vi v9, v9, 5
247 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
248 ; CHECK-NEXT: vslideup.vx v9, v8, a0
249 ; CHECK-NEXT: vmsne.vi v0, v9, 0
252 %v = call <vscale x 8 x i1> @llvm.experimental.vp.splice.nxv8i1(<vscale x 8 x i1> %va, <vscale x 8 x i1> %vb, i32 5, <vscale x 8 x i1> splat (i1 1), i32 %evla, i32 %evlb)
253 ret <vscale x 8 x i1> %v
256 define <vscale x 8 x i1> @test_vp_splice_nxv8i1_negative_offset(<vscale x 8 x i1> %va, <vscale x 8 x i1> %vb, i32 zeroext %evla, i32 zeroext %evlb) {
257 ; CHECK-LABEL: test_vp_splice_nxv8i1_negative_offset:
259 ; CHECK-NEXT: vmv1r.v v9, v0
260 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
261 ; CHECK-NEXT: vmv.v.i v10, 0
262 ; CHECK-NEXT: vmv1r.v v0, v8
263 ; CHECK-NEXT: vmerge.vim v8, v10, 1, v0
264 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
265 ; CHECK-NEXT: vmv.v.i v10, 0
266 ; CHECK-NEXT: vmv1r.v v0, v9
267 ; CHECK-NEXT: vmerge.vim v9, v10, 1, v0
268 ; CHECK-NEXT: addi a0, a0, -5
269 ; CHECK-NEXT: vsetivli zero, 5, e8, m1, ta, ma
270 ; CHECK-NEXT: vslidedown.vx v9, v9, a0
271 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
272 ; CHECK-NEXT: vslideup.vi v9, v8, 5
273 ; CHECK-NEXT: vmsne.vi v0, v9, 0
276 %v = call <vscale x 8 x i1> @llvm.experimental.vp.splice.nxv8i1(<vscale x 8 x i1> %va, <vscale x 8 x i1> %vb, i32 -5, <vscale x 8 x i1> splat (i1 1), i32 %evla, i32 %evlb)
277 ret <vscale x 8 x i1> %v
280 define <vscale x 8 x i1> @test_vp_splice_nxv8i1_masked(<vscale x 8 x i1> %va, <vscale x 8 x i1> %vb, <vscale x 8 x i1> %mask, i32 zeroext %evla, i32 zeroext %evlb) {
281 ; CHECK-LABEL: test_vp_splice_nxv8i1_masked:
283 ; CHECK-NEXT: vmv1r.v v10, v0
284 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
285 ; CHECK-NEXT: vmv.v.i v11, 0
286 ; CHECK-NEXT: vmv1r.v v0, v8
287 ; CHECK-NEXT: vmerge.vim v8, v11, 1, v0
288 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
289 ; CHECK-NEXT: vmv.v.i v11, 0
290 ; CHECK-NEXT: vmv1r.v v0, v10
291 ; CHECK-NEXT: vmerge.vim v10, v11, 1, v0
292 ; CHECK-NEXT: addi a0, a0, -5
293 ; CHECK-NEXT: vmv1r.v v0, v9
294 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
295 ; CHECK-NEXT: vslidedown.vi v10, v10, 5, v0.t
296 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, mu
297 ; CHECK-NEXT: vslideup.vx v10, v8, a0, v0.t
298 ; CHECK-NEXT: vsetvli zero, zero, e8, m1, ta, ma
299 ; CHECK-NEXT: vmsne.vi v0, v10, 0, v0.t
301 %v = call <vscale x 8 x i1> @llvm.experimental.vp.splice.nxv8i1(<vscale x 8 x i1> %va, <vscale x 8 x i1> %vb, i32 5, <vscale x 8 x i1> %mask, i32 %evla, i32 %evlb)
302 ret <vscale x 8 x i1> %v
305 define <vscale x 16 x i1> @test_vp_splice_nxv16i1(<vscale x 16 x i1> %va, <vscale x 16 x i1> %vb, i32 zeroext %evla, i32 zeroext %evlb) {
306 ; CHECK-LABEL: test_vp_splice_nxv16i1:
308 ; CHECK-NEXT: vmv1r.v v9, v0
309 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
310 ; CHECK-NEXT: vmv.v.i v10, 0
311 ; CHECK-NEXT: vmv1r.v v0, v8
312 ; CHECK-NEXT: vmerge.vim v10, v10, 1, v0
313 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
314 ; CHECK-NEXT: vmv.v.i v12, 0
315 ; CHECK-NEXT: vmv1r.v v0, v9
316 ; CHECK-NEXT: vmerge.vim v8, v12, 1, v0
317 ; CHECK-NEXT: addi a0, a0, -5
318 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
319 ; CHECK-NEXT: vslidedown.vi v8, v8, 5
320 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
321 ; CHECK-NEXT: vslideup.vx v8, v10, a0
322 ; CHECK-NEXT: vmsne.vi v0, v8, 0
325 %v = call <vscale x 16 x i1> @llvm.experimental.vp.splice.nxv16i1(<vscale x 16 x i1> %va, <vscale x 16 x i1> %vb, i32 5, <vscale x 16 x i1> splat (i1 1), i32 %evla, i32 %evlb)
326 ret <vscale x 16 x i1> %v
329 define <vscale x 16 x i1> @test_vp_splice_nxv16i1_negative_offset(<vscale x 16 x i1> %va, <vscale x 16 x i1> %vb, i32 zeroext %evla, i32 zeroext %evlb) {
330 ; CHECK-LABEL: test_vp_splice_nxv16i1_negative_offset:
332 ; CHECK-NEXT: vmv1r.v v9, v0
333 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
334 ; CHECK-NEXT: vmv.v.i v10, 0
335 ; CHECK-NEXT: vmv1r.v v0, v8
336 ; CHECK-NEXT: vmerge.vim v10, v10, 1, v0
337 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
338 ; CHECK-NEXT: vmv.v.i v12, 0
339 ; CHECK-NEXT: vmv1r.v v0, v9
340 ; CHECK-NEXT: vmerge.vim v8, v12, 1, v0
341 ; CHECK-NEXT: addi a0, a0, -5
342 ; CHECK-NEXT: vsetivli zero, 5, e8, m2, ta, ma
343 ; CHECK-NEXT: vslidedown.vx v8, v8, a0
344 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
345 ; CHECK-NEXT: vslideup.vi v8, v10, 5
346 ; CHECK-NEXT: vmsne.vi v0, v8, 0
349 %v = call <vscale x 16 x i1> @llvm.experimental.vp.splice.nxv16i1(<vscale x 16 x i1> %va, <vscale x 16 x i1> %vb, i32 -5, <vscale x 16 x i1> splat (i1 1), i32 %evla, i32 %evlb)
350 ret <vscale x 16 x i1> %v
353 define <vscale x 16 x i1> @test_vp_splice_nxv16i1_masked(<vscale x 16 x i1> %va, <vscale x 16 x i1> %vb, <vscale x 16 x i1> %mask, i32 zeroext %evla, i32 zeroext %evlb) {
354 ; CHECK-LABEL: test_vp_splice_nxv16i1_masked:
356 ; CHECK-NEXT: vmv1r.v v10, v0
357 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
358 ; CHECK-NEXT: vmv.v.i v12, 0
359 ; CHECK-NEXT: vmv1r.v v0, v8
360 ; CHECK-NEXT: vmerge.vim v12, v12, 1, v0
361 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
362 ; CHECK-NEXT: vmv.v.i v14, 0
363 ; CHECK-NEXT: vmv1r.v v0, v10
364 ; CHECK-NEXT: vmerge.vim v10, v14, 1, v0
365 ; CHECK-NEXT: addi a0, a0, -5
366 ; CHECK-NEXT: vmv1r.v v0, v9
367 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
368 ; CHECK-NEXT: vslidedown.vi v10, v10, 5, v0.t
369 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, mu
370 ; CHECK-NEXT: vslideup.vx v10, v12, a0, v0.t
371 ; CHECK-NEXT: vsetvli zero, zero, e8, m2, ta, ma
372 ; CHECK-NEXT: vmsne.vi v8, v10, 0, v0.t
373 ; CHECK-NEXT: vmv1r.v v0, v8
375 %v = call <vscale x 16 x i1> @llvm.experimental.vp.splice.nxv16i1(<vscale x 16 x i1> %va, <vscale x 16 x i1> %vb, i32 5, <vscale x 16 x i1> %mask, i32 %evla, i32 %evlb)
376 ret <vscale x 16 x i1> %v
379 define <vscale x 32 x i1> @test_vp_splice_nxv32i1(<vscale x 32 x i1> %va, <vscale x 32 x i1> %vb, i32 zeroext %evla, i32 zeroext %evlb) {
380 ; CHECK-LABEL: test_vp_splice_nxv32i1:
382 ; CHECK-NEXT: vmv1r.v v9, v0
383 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
384 ; CHECK-NEXT: vmv.v.i v12, 0
385 ; CHECK-NEXT: vmv1r.v v0, v8
386 ; CHECK-NEXT: vmerge.vim v12, v12, 1, v0
387 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
388 ; CHECK-NEXT: vmv.v.i v16, 0
389 ; CHECK-NEXT: vmv1r.v v0, v9
390 ; CHECK-NEXT: vmerge.vim v8, v16, 1, v0
391 ; CHECK-NEXT: addi a0, a0, -5
392 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
393 ; CHECK-NEXT: vslidedown.vi v8, v8, 5
394 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
395 ; CHECK-NEXT: vslideup.vx v8, v12, a0
396 ; CHECK-NEXT: vmsne.vi v0, v8, 0
399 %v = call <vscale x 32 x i1> @llvm.experimental.vp.splice.nxv32i1(<vscale x 32 x i1> %va, <vscale x 32 x i1> %vb, i32 5, <vscale x 32 x i1> splat (i1 1), i32 %evla, i32 %evlb)
400 ret <vscale x 32 x i1> %v
403 define <vscale x 32 x i1> @test_vp_splice_nxv32i1_negative_offset(<vscale x 32 x i1> %va, <vscale x 32 x i1> %vb, i32 zeroext %evla, i32 zeroext %evlb) {
404 ; CHECK-LABEL: test_vp_splice_nxv32i1_negative_offset:
406 ; CHECK-NEXT: vmv1r.v v9, v0
407 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
408 ; CHECK-NEXT: vmv.v.i v12, 0
409 ; CHECK-NEXT: vmv1r.v v0, v8
410 ; CHECK-NEXT: vmerge.vim v12, v12, 1, v0
411 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
412 ; CHECK-NEXT: vmv.v.i v16, 0
413 ; CHECK-NEXT: vmv1r.v v0, v9
414 ; CHECK-NEXT: vmerge.vim v8, v16, 1, v0
415 ; CHECK-NEXT: addi a0, a0, -5
416 ; CHECK-NEXT: vsetivli zero, 5, e8, m4, ta, ma
417 ; CHECK-NEXT: vslidedown.vx v8, v8, a0
418 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
419 ; CHECK-NEXT: vslideup.vi v8, v12, 5
420 ; CHECK-NEXT: vmsne.vi v0, v8, 0
423 %v = call <vscale x 32 x i1> @llvm.experimental.vp.splice.nxv32i1(<vscale x 32 x i1> %va, <vscale x 32 x i1> %vb, i32 -5, <vscale x 32 x i1> splat (i1 1), i32 %evla, i32 %evlb)
424 ret <vscale x 32 x i1> %v
427 define <vscale x 32 x i1> @test_vp_splice_nxv32i1_masked(<vscale x 32 x i1> %va, <vscale x 32 x i1> %vb, <vscale x 32 x i1> %mask, i32 zeroext %evla, i32 zeroext %evlb) {
428 ; CHECK-LABEL: test_vp_splice_nxv32i1_masked:
430 ; CHECK-NEXT: vmv1r.v v10, v0
431 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
432 ; CHECK-NEXT: vmv.v.i v12, 0
433 ; CHECK-NEXT: vmv1r.v v0, v8
434 ; CHECK-NEXT: vmerge.vim v12, v12, 1, v0
435 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
436 ; CHECK-NEXT: vmv.v.i v16, 0
437 ; CHECK-NEXT: vmv1r.v v0, v10
438 ; CHECK-NEXT: vmerge.vim v16, v16, 1, v0
439 ; CHECK-NEXT: addi a0, a0, -5
440 ; CHECK-NEXT: vmv1r.v v0, v9
441 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
442 ; CHECK-NEXT: vslidedown.vi v16, v16, 5, v0.t
443 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, mu
444 ; CHECK-NEXT: vslideup.vx v16, v12, a0, v0.t
445 ; CHECK-NEXT: vsetvli zero, zero, e8, m4, ta, ma
446 ; CHECK-NEXT: vmsne.vi v8, v16, 0, v0.t
447 ; CHECK-NEXT: vmv1r.v v0, v8
449 %v = call <vscale x 32 x i1> @llvm.experimental.vp.splice.nxv32i1(<vscale x 32 x i1> %va, <vscale x 32 x i1> %vb, i32 5, <vscale x 32 x i1> %mask, i32 %evla, i32 %evlb)
450 ret <vscale x 32 x i1> %v
453 define <vscale x 64 x i1> @test_vp_splice_nxv64i1(<vscale x 64 x i1> %va, <vscale x 64 x i1> %vb, i32 zeroext %evla, i32 zeroext %evlb) {
454 ; CHECK-LABEL: test_vp_splice_nxv64i1:
456 ; CHECK-NEXT: vmv1r.v v9, v0
457 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
458 ; CHECK-NEXT: vmv.v.i v16, 0
459 ; CHECK-NEXT: vmv1r.v v0, v8
460 ; CHECK-NEXT: vmerge.vim v16, v16, 1, v0
461 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
462 ; CHECK-NEXT: vmv.v.i v24, 0
463 ; CHECK-NEXT: vmv1r.v v0, v9
464 ; CHECK-NEXT: vmerge.vim v8, v24, 1, v0
465 ; CHECK-NEXT: addi a0, a0, -5
466 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
467 ; CHECK-NEXT: vslidedown.vi v8, v8, 5
468 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
469 ; CHECK-NEXT: vslideup.vx v8, v16, a0
470 ; CHECK-NEXT: vmsne.vi v0, v8, 0
473 %v = call <vscale x 64 x i1> @llvm.experimental.vp.splice.nxv64i1(<vscale x 64 x i1> %va, <vscale x 64 x i1> %vb, i32 5, <vscale x 64 x i1> splat (i1 1), i32 %evla, i32 %evlb)
474 ret <vscale x 64 x i1> %v
477 define <vscale x 64 x i1> @test_vp_splice_nxv64i1_negative_offset(<vscale x 64 x i1> %va, <vscale x 64 x i1> %vb, i32 zeroext %evla, i32 zeroext %evlb) {
478 ; CHECK-LABEL: test_vp_splice_nxv64i1_negative_offset:
480 ; CHECK-NEXT: vmv1r.v v9, v0
481 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
482 ; CHECK-NEXT: vmv.v.i v16, 0
483 ; CHECK-NEXT: vmv1r.v v0, v8
484 ; CHECK-NEXT: vmerge.vim v16, v16, 1, v0
485 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
486 ; CHECK-NEXT: vmv.v.i v24, 0
487 ; CHECK-NEXT: vmv1r.v v0, v9
488 ; CHECK-NEXT: vmerge.vim v8, v24, 1, v0
489 ; CHECK-NEXT: addi a0, a0, -5
490 ; CHECK-NEXT: vsetivli zero, 5, e8, m8, ta, ma
491 ; CHECK-NEXT: vslidedown.vx v8, v8, a0
492 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
493 ; CHECK-NEXT: vslideup.vi v8, v16, 5
494 ; CHECK-NEXT: vmsne.vi v0, v8, 0
497 %v = call <vscale x 64 x i1> @llvm.experimental.vp.splice.nxv64i1(<vscale x 64 x i1> %va, <vscale x 64 x i1> %vb, i32 -5, <vscale x 64 x i1> splat (i1 1), i32 %evla, i32 %evlb)
498 ret <vscale x 64 x i1> %v
501 define <vscale x 64 x i1> @test_vp_splice_nxv64i1_masked(<vscale x 64 x i1> %va, <vscale x 64 x i1> %vb, <vscale x 64 x i1> %mask, i32 zeroext %evla, i32 zeroext %evlb) {
502 ; CHECK-LABEL: test_vp_splice_nxv64i1_masked:
504 ; CHECK-NEXT: vmv1r.v v10, v0
505 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
506 ; CHECK-NEXT: vmv.v.i v16, 0
507 ; CHECK-NEXT: vmv1r.v v0, v8
508 ; CHECK-NEXT: vmerge.vim v16, v16, 1, v0
509 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
510 ; CHECK-NEXT: vmv.v.i v24, 0
511 ; CHECK-NEXT: vmv1r.v v0, v10
512 ; CHECK-NEXT: vmerge.vim v24, v24, 1, v0
513 ; CHECK-NEXT: addi a0, a0, -5
514 ; CHECK-NEXT: vmv1r.v v0, v9
515 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
516 ; CHECK-NEXT: vslidedown.vi v24, v24, 5, v0.t
517 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, mu
518 ; CHECK-NEXT: vslideup.vx v24, v16, a0, v0.t
519 ; CHECK-NEXT: vsetvli zero, zero, e8, m8, ta, ma
520 ; CHECK-NEXT: vmsne.vi v8, v24, 0, v0.t
521 ; CHECK-NEXT: vmv1r.v v0, v8
523 %v = call <vscale x 64 x i1> @llvm.experimental.vp.splice.nxv64i1(<vscale x 64 x i1> %va, <vscale x 64 x i1> %vb, i32 5, <vscale x 64 x i1> %mask, i32 %evla, i32 %evlb)
524 ret <vscale x 64 x i1> %v