1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfh,+v \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=RV32
4 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfh,+v \
5 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=RV64
7 declare <vscale x 1 x i8> @llvm.vp.gather.nxv1i8.nxv1p0(<vscale x 1 x ptr>, <vscale x 1 x i1>, i32)
9 define <vscale x 1 x i8> @vpgather_nxv1i8(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 zeroext %evl) {
10 ; RV32-LABEL: vpgather_nxv1i8:
12 ; RV32-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
13 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
14 ; RV32-NEXT: vmv1r.v v8, v9
17 ; RV64-LABEL: vpgather_nxv1i8:
19 ; RV64-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
20 ; RV64-NEXT: vluxei64.v v9, (zero), v8, v0.t
21 ; RV64-NEXT: vmv1r.v v8, v9
23 %v = call <vscale x 1 x i8> @llvm.vp.gather.nxv1i8.nxv1p0(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 %evl)
24 ret <vscale x 1 x i8> %v
27 declare <vscale x 2 x i8> @llvm.vp.gather.nxv2i8.nxv2p0(<vscale x 2 x ptr>, <vscale x 2 x i1>, i32)
29 define <vscale x 2 x i8> @vpgather_nxv2i8(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
30 ; RV32-LABEL: vpgather_nxv2i8:
32 ; RV32-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
33 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
34 ; RV32-NEXT: vmv1r.v v8, v9
37 ; RV64-LABEL: vpgather_nxv2i8:
39 ; RV64-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
40 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
41 ; RV64-NEXT: vmv1r.v v8, v10
43 %v = call <vscale x 2 x i8> @llvm.vp.gather.nxv2i8.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
44 ret <vscale x 2 x i8> %v
47 define <vscale x 2 x i16> @vpgather_nxv2i8_sextload_nxv2i16(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
48 ; RV32-LABEL: vpgather_nxv2i8_sextload_nxv2i16:
50 ; RV32-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
51 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
52 ; RV32-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
53 ; RV32-NEXT: vsext.vf2 v8, v9
56 ; RV64-LABEL: vpgather_nxv2i8_sextload_nxv2i16:
58 ; RV64-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
59 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
60 ; RV64-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
61 ; RV64-NEXT: vsext.vf2 v8, v10
63 %v = call <vscale x 2 x i8> @llvm.vp.gather.nxv2i8.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
64 %ev = sext <vscale x 2 x i8> %v to <vscale x 2 x i16>
65 ret <vscale x 2 x i16> %ev
68 define <vscale x 2 x i16> @vpgather_nxv2i8_zextload_nxv2i16(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
69 ; RV32-LABEL: vpgather_nxv2i8_zextload_nxv2i16:
71 ; RV32-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
72 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
73 ; RV32-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
74 ; RV32-NEXT: vzext.vf2 v8, v9
77 ; RV64-LABEL: vpgather_nxv2i8_zextload_nxv2i16:
79 ; RV64-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
80 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
81 ; RV64-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
82 ; RV64-NEXT: vzext.vf2 v8, v10
84 %v = call <vscale x 2 x i8> @llvm.vp.gather.nxv2i8.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
85 %ev = zext <vscale x 2 x i8> %v to <vscale x 2 x i16>
86 ret <vscale x 2 x i16> %ev
89 define <vscale x 2 x i32> @vpgather_nxv2i8_sextload_nxv2i32(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
90 ; RV32-LABEL: vpgather_nxv2i8_sextload_nxv2i32:
92 ; RV32-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
93 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
94 ; RV32-NEXT: vsetvli a0, zero, e32, m1, ta, ma
95 ; RV32-NEXT: vsext.vf4 v8, v9
98 ; RV64-LABEL: vpgather_nxv2i8_sextload_nxv2i32:
100 ; RV64-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
101 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
102 ; RV64-NEXT: vsetvli a0, zero, e32, m1, ta, ma
103 ; RV64-NEXT: vsext.vf4 v8, v10
105 %v = call <vscale x 2 x i8> @llvm.vp.gather.nxv2i8.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
106 %ev = sext <vscale x 2 x i8> %v to <vscale x 2 x i32>
107 ret <vscale x 2 x i32> %ev
110 define <vscale x 2 x i32> @vpgather_nxv2i8_zextload_nxv2i32(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
111 ; RV32-LABEL: vpgather_nxv2i8_zextload_nxv2i32:
113 ; RV32-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
114 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
115 ; RV32-NEXT: vsetvli a0, zero, e32, m1, ta, ma
116 ; RV32-NEXT: vzext.vf4 v8, v9
119 ; RV64-LABEL: vpgather_nxv2i8_zextload_nxv2i32:
121 ; RV64-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
122 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
123 ; RV64-NEXT: vsetvli a0, zero, e32, m1, ta, ma
124 ; RV64-NEXT: vzext.vf4 v8, v10
126 %v = call <vscale x 2 x i8> @llvm.vp.gather.nxv2i8.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
127 %ev = zext <vscale x 2 x i8> %v to <vscale x 2 x i32>
128 ret <vscale x 2 x i32> %ev
131 define <vscale x 2 x i64> @vpgather_nxv2i8_sextload_nxv2i64(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
132 ; RV32-LABEL: vpgather_nxv2i8_sextload_nxv2i64:
134 ; RV32-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
135 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
136 ; RV32-NEXT: vsetvli a0, zero, e64, m2, ta, ma
137 ; RV32-NEXT: vsext.vf8 v8, v10
140 ; RV64-LABEL: vpgather_nxv2i8_sextload_nxv2i64:
142 ; RV64-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
143 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
144 ; RV64-NEXT: vsetvli a0, zero, e64, m2, ta, ma
145 ; RV64-NEXT: vsext.vf8 v8, v10
147 %v = call <vscale x 2 x i8> @llvm.vp.gather.nxv2i8.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
148 %ev = sext <vscale x 2 x i8> %v to <vscale x 2 x i64>
149 ret <vscale x 2 x i64> %ev
152 define <vscale x 2 x i64> @vpgather_nxv2i8_zextload_nxv2i64(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
153 ; RV32-LABEL: vpgather_nxv2i8_zextload_nxv2i64:
155 ; RV32-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
156 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
157 ; RV32-NEXT: vsetvli a0, zero, e64, m2, ta, ma
158 ; RV32-NEXT: vzext.vf8 v8, v10
161 ; RV64-LABEL: vpgather_nxv2i8_zextload_nxv2i64:
163 ; RV64-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
164 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
165 ; RV64-NEXT: vsetvli a0, zero, e64, m2, ta, ma
166 ; RV64-NEXT: vzext.vf8 v8, v10
168 %v = call <vscale x 2 x i8> @llvm.vp.gather.nxv2i8.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
169 %ev = zext <vscale x 2 x i8> %v to <vscale x 2 x i64>
170 ret <vscale x 2 x i64> %ev
173 declare <vscale x 4 x i8> @llvm.vp.gather.nxv4i8.nxv4p0(<vscale x 4 x ptr>, <vscale x 4 x i1>, i32)
175 define <vscale x 4 x i8> @vpgather_nxv4i8(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 zeroext %evl) {
176 ; RV32-LABEL: vpgather_nxv4i8:
178 ; RV32-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
179 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
180 ; RV32-NEXT: vmv1r.v v8, v10
183 ; RV64-LABEL: vpgather_nxv4i8:
185 ; RV64-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
186 ; RV64-NEXT: vluxei64.v v12, (zero), v8, v0.t
187 ; RV64-NEXT: vmv1r.v v8, v12
189 %v = call <vscale x 4 x i8> @llvm.vp.gather.nxv4i8.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 %evl)
190 ret <vscale x 4 x i8> %v
193 define <vscale x 4 x i8> @vpgather_truemask_nxv4i8(<vscale x 4 x ptr> %ptrs, i32 zeroext %evl) {
194 ; RV32-LABEL: vpgather_truemask_nxv4i8:
196 ; RV32-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
197 ; RV32-NEXT: vluxei32.v v10, (zero), v8
198 ; RV32-NEXT: vmv1r.v v8, v10
201 ; RV64-LABEL: vpgather_truemask_nxv4i8:
203 ; RV64-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
204 ; RV64-NEXT: vluxei64.v v12, (zero), v8
205 ; RV64-NEXT: vmv1r.v v8, v12
207 %v = call <vscale x 4 x i8> @llvm.vp.gather.nxv4i8.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> splat (i1 1), i32 %evl)
208 ret <vscale x 4 x i8> %v
211 declare <vscale x 8 x i8> @llvm.vp.gather.nxv8i8.nxv8p0(<vscale x 8 x ptr>, <vscale x 8 x i1>, i32)
213 define <vscale x 8 x i8> @vpgather_nxv8i8(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
214 ; RV32-LABEL: vpgather_nxv8i8:
216 ; RV32-NEXT: vsetvli zero, a0, e8, m1, ta, ma
217 ; RV32-NEXT: vluxei32.v v12, (zero), v8, v0.t
218 ; RV32-NEXT: vmv.v.v v8, v12
221 ; RV64-LABEL: vpgather_nxv8i8:
223 ; RV64-NEXT: vsetvli zero, a0, e8, m1, ta, ma
224 ; RV64-NEXT: vluxei64.v v16, (zero), v8, v0.t
225 ; RV64-NEXT: vmv.v.v v8, v16
227 %v = call <vscale x 8 x i8> @llvm.vp.gather.nxv8i8.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
228 ret <vscale x 8 x i8> %v
231 define <vscale x 8 x i8> @vpgather_baseidx_nxv8i8(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
232 ; RV32-LABEL: vpgather_baseidx_nxv8i8:
234 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
235 ; RV32-NEXT: vsext.vf4 v12, v8
236 ; RV32-NEXT: vsetvli zero, a1, e8, m1, ta, ma
237 ; RV32-NEXT: vluxei32.v v8, (a0), v12, v0.t
240 ; RV64-LABEL: vpgather_baseidx_nxv8i8:
242 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
243 ; RV64-NEXT: vsext.vf8 v16, v8
244 ; RV64-NEXT: vsetvli zero, a1, e8, m1, ta, ma
245 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
247 %ptrs = getelementptr inbounds i8, ptr %base, <vscale x 8 x i8> %idxs
248 %v = call <vscale x 8 x i8> @llvm.vp.gather.nxv8i8.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
249 ret <vscale x 8 x i8> %v
252 declare <vscale x 32 x i8> @llvm.vp.gather.nxv32i8.nxv32p0(<vscale x 32 x ptr>, <vscale x 32 x i1>, i32)
254 define <vscale x 32 x i8> @vpgather_baseidx_nxv32i8(ptr %base, <vscale x 32 x i8> %idxs, <vscale x 32 x i1> %m, i32 zeroext %evl) {
255 ; RV32-LABEL: vpgather_baseidx_nxv32i8:
257 ; RV32-NEXT: vmv1r.v v12, v0
258 ; RV32-NEXT: csrr a3, vlenb
259 ; RV32-NEXT: slli a2, a3, 1
260 ; RV32-NEXT: sub a4, a1, a2
261 ; RV32-NEXT: sltu a5, a1, a4
262 ; RV32-NEXT: addi a5, a5, -1
263 ; RV32-NEXT: and a4, a5, a4
264 ; RV32-NEXT: srli a3, a3, 2
265 ; RV32-NEXT: vsetvli a5, zero, e8, mf2, ta, ma
266 ; RV32-NEXT: vslidedown.vx v0, v0, a3
267 ; RV32-NEXT: vsetvli a3, zero, e32, m8, ta, ma
268 ; RV32-NEXT: vsext.vf4 v16, v10
269 ; RV32-NEXT: vsetvli zero, a4, e8, m2, ta, ma
270 ; RV32-NEXT: vluxei32.v v10, (a0), v16, v0.t
271 ; RV32-NEXT: bltu a1, a2, .LBB12_2
272 ; RV32-NEXT: # %bb.1:
273 ; RV32-NEXT: mv a1, a2
274 ; RV32-NEXT: .LBB12_2:
275 ; RV32-NEXT: vsetvli a2, zero, e32, m8, ta, ma
276 ; RV32-NEXT: vsext.vf4 v16, v8
277 ; RV32-NEXT: vmv1r.v v0, v12
278 ; RV32-NEXT: vsetvli zero, a1, e8, m2, ta, ma
279 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
282 ; RV64-LABEL: vpgather_baseidx_nxv32i8:
284 ; RV64-NEXT: vmv1r.v v12, v0
285 ; RV64-NEXT: csrr a2, vlenb
286 ; RV64-NEXT: slli a3, a2, 1
287 ; RV64-NEXT: sub a4, a1, a3
288 ; RV64-NEXT: sltu a5, a1, a4
289 ; RV64-NEXT: addi a5, a5, -1
290 ; RV64-NEXT: and a5, a5, a4
291 ; RV64-NEXT: sub a4, a5, a2
292 ; RV64-NEXT: sltu a6, a5, a4
293 ; RV64-NEXT: addi a6, a6, -1
294 ; RV64-NEXT: and a6, a6, a4
295 ; RV64-NEXT: srli a4, a2, 2
296 ; RV64-NEXT: vsetvli a7, zero, e8, mf2, ta, ma
297 ; RV64-NEXT: vslidedown.vx v13, v0, a4
298 ; RV64-NEXT: srli a4, a2, 3
299 ; RV64-NEXT: vsetvli a7, zero, e8, mf4, ta, ma
300 ; RV64-NEXT: vslidedown.vx v0, v13, a4
301 ; RV64-NEXT: vsetvli a7, zero, e64, m8, ta, ma
302 ; RV64-NEXT: vsext.vf8 v16, v11
303 ; RV64-NEXT: vsetvli zero, a6, e8, m1, ta, ma
304 ; RV64-NEXT: vluxei64.v v11, (a0), v16, v0.t
305 ; RV64-NEXT: bltu a5, a2, .LBB12_2
306 ; RV64-NEXT: # %bb.1:
307 ; RV64-NEXT: mv a5, a2
308 ; RV64-NEXT: .LBB12_2:
309 ; RV64-NEXT: vsetvli a6, zero, e64, m8, ta, ma
310 ; RV64-NEXT: vsext.vf8 v16, v10
311 ; RV64-NEXT: vmv1r.v v0, v13
312 ; RV64-NEXT: vsetvli zero, a5, e8, m1, ta, ma
313 ; RV64-NEXT: vluxei64.v v10, (a0), v16, v0.t
314 ; RV64-NEXT: bltu a1, a3, .LBB12_4
315 ; RV64-NEXT: # %bb.3:
316 ; RV64-NEXT: mv a1, a3
317 ; RV64-NEXT: .LBB12_4:
318 ; RV64-NEXT: sub a3, a1, a2
319 ; RV64-NEXT: sltu a5, a1, a3
320 ; RV64-NEXT: addi a5, a5, -1
321 ; RV64-NEXT: and a3, a5, a3
322 ; RV64-NEXT: vsetvli a5, zero, e8, mf4, ta, ma
323 ; RV64-NEXT: vslidedown.vx v0, v12, a4
324 ; RV64-NEXT: vsetvli a4, zero, e64, m8, ta, ma
325 ; RV64-NEXT: vsext.vf8 v16, v9
326 ; RV64-NEXT: vsetvli zero, a3, e8, m1, ta, ma
327 ; RV64-NEXT: vluxei64.v v9, (a0), v16, v0.t
328 ; RV64-NEXT: bltu a1, a2, .LBB12_6
329 ; RV64-NEXT: # %bb.5:
330 ; RV64-NEXT: mv a1, a2
331 ; RV64-NEXT: .LBB12_6:
332 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
333 ; RV64-NEXT: vsext.vf8 v16, v8
334 ; RV64-NEXT: vmv1r.v v0, v12
335 ; RV64-NEXT: vsetvli zero, a1, e8, m1, ta, ma
336 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
338 %ptrs = getelementptr inbounds i8, ptr %base, <vscale x 32 x i8> %idxs
339 %v = call <vscale x 32 x i8> @llvm.vp.gather.nxv32i8.nxv32p0(<vscale x 32 x ptr> %ptrs, <vscale x 32 x i1> %m, i32 %evl)
340 ret <vscale x 32 x i8> %v
343 declare <vscale x 1 x i16> @llvm.vp.gather.nxv1i16.nxv1p0(<vscale x 1 x ptr>, <vscale x 1 x i1>, i32)
345 define <vscale x 1 x i16> @vpgather_nxv1i16(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 zeroext %evl) {
346 ; RV32-LABEL: vpgather_nxv1i16:
348 ; RV32-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
349 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
350 ; RV32-NEXT: vmv1r.v v8, v9
353 ; RV64-LABEL: vpgather_nxv1i16:
355 ; RV64-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
356 ; RV64-NEXT: vluxei64.v v9, (zero), v8, v0.t
357 ; RV64-NEXT: vmv1r.v v8, v9
359 %v = call <vscale x 1 x i16> @llvm.vp.gather.nxv1i16.nxv1p0(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 %evl)
360 ret <vscale x 1 x i16> %v
363 declare <vscale x 2 x i16> @llvm.vp.gather.nxv2i16.nxv2p0(<vscale x 2 x ptr>, <vscale x 2 x i1>, i32)
365 define <vscale x 2 x i16> @vpgather_nxv2i16(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
366 ; RV32-LABEL: vpgather_nxv2i16:
368 ; RV32-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
369 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
370 ; RV32-NEXT: vmv1r.v v8, v9
373 ; RV64-LABEL: vpgather_nxv2i16:
375 ; RV64-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
376 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
377 ; RV64-NEXT: vmv1r.v v8, v10
379 %v = call <vscale x 2 x i16> @llvm.vp.gather.nxv2i16.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
380 ret <vscale x 2 x i16> %v
383 define <vscale x 2 x i32> @vpgather_nxv2i16_sextload_nxv2i32(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
384 ; RV32-LABEL: vpgather_nxv2i16_sextload_nxv2i32:
386 ; RV32-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
387 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
388 ; RV32-NEXT: vsetvli a0, zero, e32, m1, ta, ma
389 ; RV32-NEXT: vsext.vf2 v8, v9
392 ; RV64-LABEL: vpgather_nxv2i16_sextload_nxv2i32:
394 ; RV64-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
395 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
396 ; RV64-NEXT: vsetvli a0, zero, e32, m1, ta, ma
397 ; RV64-NEXT: vsext.vf2 v8, v10
399 %v = call <vscale x 2 x i16> @llvm.vp.gather.nxv2i16.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
400 %ev = sext <vscale x 2 x i16> %v to <vscale x 2 x i32>
401 ret <vscale x 2 x i32> %ev
404 define <vscale x 2 x i32> @vpgather_nxv2i16_zextload_nxv2i32(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
405 ; RV32-LABEL: vpgather_nxv2i16_zextload_nxv2i32:
407 ; RV32-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
408 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
409 ; RV32-NEXT: vsetvli a0, zero, e32, m1, ta, ma
410 ; RV32-NEXT: vzext.vf2 v8, v9
413 ; RV64-LABEL: vpgather_nxv2i16_zextload_nxv2i32:
415 ; RV64-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
416 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
417 ; RV64-NEXT: vsetvli a0, zero, e32, m1, ta, ma
418 ; RV64-NEXT: vzext.vf2 v8, v10
420 %v = call <vscale x 2 x i16> @llvm.vp.gather.nxv2i16.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
421 %ev = zext <vscale x 2 x i16> %v to <vscale x 2 x i32>
422 ret <vscale x 2 x i32> %ev
425 define <vscale x 2 x i64> @vpgather_nxv2i16_sextload_nxv2i64(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
426 ; RV32-LABEL: vpgather_nxv2i16_sextload_nxv2i64:
428 ; RV32-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
429 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
430 ; RV32-NEXT: vsetvli a0, zero, e64, m2, ta, ma
431 ; RV32-NEXT: vsext.vf4 v8, v10
434 ; RV64-LABEL: vpgather_nxv2i16_sextload_nxv2i64:
436 ; RV64-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
437 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
438 ; RV64-NEXT: vsetvli a0, zero, e64, m2, ta, ma
439 ; RV64-NEXT: vsext.vf4 v8, v10
441 %v = call <vscale x 2 x i16> @llvm.vp.gather.nxv2i16.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
442 %ev = sext <vscale x 2 x i16> %v to <vscale x 2 x i64>
443 ret <vscale x 2 x i64> %ev
446 define <vscale x 2 x i64> @vpgather_nxv2i16_zextload_nxv2i64(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
447 ; RV32-LABEL: vpgather_nxv2i16_zextload_nxv2i64:
449 ; RV32-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
450 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
451 ; RV32-NEXT: vsetvli a0, zero, e64, m2, ta, ma
452 ; RV32-NEXT: vzext.vf4 v8, v10
455 ; RV64-LABEL: vpgather_nxv2i16_zextload_nxv2i64:
457 ; RV64-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
458 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
459 ; RV64-NEXT: vsetvli a0, zero, e64, m2, ta, ma
460 ; RV64-NEXT: vzext.vf4 v8, v10
462 %v = call <vscale x 2 x i16> @llvm.vp.gather.nxv2i16.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
463 %ev = zext <vscale x 2 x i16> %v to <vscale x 2 x i64>
464 ret <vscale x 2 x i64> %ev
467 declare <vscale x 4 x i16> @llvm.vp.gather.nxv4i16.nxv4p0(<vscale x 4 x ptr>, <vscale x 4 x i1>, i32)
469 define <vscale x 4 x i16> @vpgather_nxv4i16(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 zeroext %evl) {
470 ; RV32-LABEL: vpgather_nxv4i16:
472 ; RV32-NEXT: vsetvli zero, a0, e16, m1, ta, ma
473 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
474 ; RV32-NEXT: vmv.v.v v8, v10
477 ; RV64-LABEL: vpgather_nxv4i16:
479 ; RV64-NEXT: vsetvli zero, a0, e16, m1, ta, ma
480 ; RV64-NEXT: vluxei64.v v12, (zero), v8, v0.t
481 ; RV64-NEXT: vmv.v.v v8, v12
483 %v = call <vscale x 4 x i16> @llvm.vp.gather.nxv4i16.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 %evl)
484 ret <vscale x 4 x i16> %v
487 define <vscale x 4 x i16> @vpgather_truemask_nxv4i16(<vscale x 4 x ptr> %ptrs, i32 zeroext %evl) {
488 ; RV32-LABEL: vpgather_truemask_nxv4i16:
490 ; RV32-NEXT: vsetvli zero, a0, e16, m1, ta, ma
491 ; RV32-NEXT: vluxei32.v v10, (zero), v8
492 ; RV32-NEXT: vmv.v.v v8, v10
495 ; RV64-LABEL: vpgather_truemask_nxv4i16:
497 ; RV64-NEXT: vsetvli zero, a0, e16, m1, ta, ma
498 ; RV64-NEXT: vluxei64.v v12, (zero), v8
499 ; RV64-NEXT: vmv.v.v v8, v12
501 %v = call <vscale x 4 x i16> @llvm.vp.gather.nxv4i16.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> splat (i1 1), i32 %evl)
502 ret <vscale x 4 x i16> %v
505 declare <vscale x 8 x i16> @llvm.vp.gather.nxv8i16.nxv8p0(<vscale x 8 x ptr>, <vscale x 8 x i1>, i32)
507 define <vscale x 8 x i16> @vpgather_nxv8i16(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
508 ; RV32-LABEL: vpgather_nxv8i16:
510 ; RV32-NEXT: vsetvli zero, a0, e16, m2, ta, ma
511 ; RV32-NEXT: vluxei32.v v12, (zero), v8, v0.t
512 ; RV32-NEXT: vmv.v.v v8, v12
515 ; RV64-LABEL: vpgather_nxv8i16:
517 ; RV64-NEXT: vsetvli zero, a0, e16, m2, ta, ma
518 ; RV64-NEXT: vluxei64.v v16, (zero), v8, v0.t
519 ; RV64-NEXT: vmv.v.v v8, v16
521 %v = call <vscale x 8 x i16> @llvm.vp.gather.nxv8i16.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
522 ret <vscale x 8 x i16> %v
525 define <vscale x 8 x i16> @vpgather_baseidx_nxv8i8_nxv8i16(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
526 ; RV32-LABEL: vpgather_baseidx_nxv8i8_nxv8i16:
528 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
529 ; RV32-NEXT: vsext.vf4 v12, v8
530 ; RV32-NEXT: vadd.vv v12, v12, v12
531 ; RV32-NEXT: vsetvli zero, a1, e16, m2, ta, ma
532 ; RV32-NEXT: vluxei32.v v8, (a0), v12, v0.t
535 ; RV64-LABEL: vpgather_baseidx_nxv8i8_nxv8i16:
537 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
538 ; RV64-NEXT: vsext.vf8 v16, v8
539 ; RV64-NEXT: vadd.vv v16, v16, v16
540 ; RV64-NEXT: vsetvli zero, a1, e16, m2, ta, ma
541 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
543 %ptrs = getelementptr inbounds i16, ptr %base, <vscale x 8 x i8> %idxs
544 %v = call <vscale x 8 x i16> @llvm.vp.gather.nxv8i16.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
545 ret <vscale x 8 x i16> %v
548 define <vscale x 8 x i16> @vpgather_baseidx_sext_nxv8i8_nxv8i16(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
549 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8i16:
551 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
552 ; RV32-NEXT: vsext.vf4 v12, v8
553 ; RV32-NEXT: vadd.vv v12, v12, v12
554 ; RV32-NEXT: vsetvli zero, a1, e16, m2, ta, ma
555 ; RV32-NEXT: vluxei32.v v8, (a0), v12, v0.t
558 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8i16:
560 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
561 ; RV64-NEXT: vsext.vf8 v16, v8
562 ; RV64-NEXT: vadd.vv v16, v16, v16
563 ; RV64-NEXT: vsetvli zero, a1, e16, m2, ta, ma
564 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
566 %eidxs = sext <vscale x 8 x i8> %idxs to <vscale x 8 x i16>
567 %ptrs = getelementptr inbounds i16, ptr %base, <vscale x 8 x i16> %eidxs
568 %v = call <vscale x 8 x i16> @llvm.vp.gather.nxv8i16.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
569 ret <vscale x 8 x i16> %v
572 define <vscale x 8 x i16> @vpgather_baseidx_zext_nxv8i8_nxv8i16(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
573 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8i16:
575 ; RV32-NEXT: vsetvli a2, zero, e8, m1, ta, ma
576 ; RV32-NEXT: vwaddu.vv v10, v8, v8
577 ; RV32-NEXT: vsetvli zero, a1, e16, m2, ta, ma
578 ; RV32-NEXT: vluxei16.v v8, (a0), v10, v0.t
581 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8i16:
583 ; RV64-NEXT: vsetvli a2, zero, e8, m1, ta, ma
584 ; RV64-NEXT: vwaddu.vv v10, v8, v8
585 ; RV64-NEXT: vsetvli zero, a1, e16, m2, ta, ma
586 ; RV64-NEXT: vluxei16.v v8, (a0), v10, v0.t
588 %eidxs = zext <vscale x 8 x i8> %idxs to <vscale x 8 x i16>
589 %ptrs = getelementptr inbounds i16, ptr %base, <vscale x 8 x i16> %eidxs
590 %v = call <vscale x 8 x i16> @llvm.vp.gather.nxv8i16.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
591 ret <vscale x 8 x i16> %v
594 define <vscale x 8 x i16> @vpgather_baseidx_nxv8i16(ptr %base, <vscale x 8 x i16> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
595 ; RV32-LABEL: vpgather_baseidx_nxv8i16:
597 ; RV32-NEXT: vsetvli a2, zero, e16, m2, ta, ma
598 ; RV32-NEXT: vwadd.vv v12, v8, v8
599 ; RV32-NEXT: vsetvli zero, a1, e16, m2, ta, ma
600 ; RV32-NEXT: vluxei32.v v8, (a0), v12, v0.t
603 ; RV64-LABEL: vpgather_baseidx_nxv8i16:
605 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
606 ; RV64-NEXT: vsext.vf4 v16, v8
607 ; RV64-NEXT: vadd.vv v16, v16, v16
608 ; RV64-NEXT: vsetvli zero, a1, e16, m2, ta, ma
609 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
611 %ptrs = getelementptr inbounds i16, ptr %base, <vscale x 8 x i16> %idxs
612 %v = call <vscale x 8 x i16> @llvm.vp.gather.nxv8i16.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
613 ret <vscale x 8 x i16> %v
616 declare <vscale x 1 x i32> @llvm.vp.gather.nxv1i32.nxv1p0(<vscale x 1 x ptr>, <vscale x 1 x i1>, i32)
618 define <vscale x 1 x i32> @vpgather_nxv1i32(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 zeroext %evl) {
619 ; RV32-LABEL: vpgather_nxv1i32:
621 ; RV32-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
622 ; RV32-NEXT: vluxei32.v v8, (zero), v8, v0.t
625 ; RV64-LABEL: vpgather_nxv1i32:
627 ; RV64-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
628 ; RV64-NEXT: vluxei64.v v9, (zero), v8, v0.t
629 ; RV64-NEXT: vmv1r.v v8, v9
631 %v = call <vscale x 1 x i32> @llvm.vp.gather.nxv1i32.nxv1p0(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 %evl)
632 ret <vscale x 1 x i32> %v
635 declare <vscale x 2 x i32> @llvm.vp.gather.nxv2i32.nxv2p0(<vscale x 2 x ptr>, <vscale x 2 x i1>, i32)
637 define <vscale x 2 x i32> @vpgather_nxv2i32(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
638 ; RV32-LABEL: vpgather_nxv2i32:
640 ; RV32-NEXT: vsetvli zero, a0, e32, m1, ta, ma
641 ; RV32-NEXT: vluxei32.v v8, (zero), v8, v0.t
644 ; RV64-LABEL: vpgather_nxv2i32:
646 ; RV64-NEXT: vsetvli zero, a0, e32, m1, ta, ma
647 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
648 ; RV64-NEXT: vmv.v.v v8, v10
650 %v = call <vscale x 2 x i32> @llvm.vp.gather.nxv2i32.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
651 ret <vscale x 2 x i32> %v
654 define <vscale x 2 x i64> @vpgather_nxv2i32_sextload_nxv2i64(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
655 ; RV32-LABEL: vpgather_nxv2i32_sextload_nxv2i64:
657 ; RV32-NEXT: vsetvli zero, a0, e32, m1, ta, ma
658 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
659 ; RV32-NEXT: vsetvli a0, zero, e64, m2, ta, ma
660 ; RV32-NEXT: vsext.vf2 v8, v10
663 ; RV64-LABEL: vpgather_nxv2i32_sextload_nxv2i64:
665 ; RV64-NEXT: vsetvli zero, a0, e32, m1, ta, ma
666 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
667 ; RV64-NEXT: vsetvli a0, zero, e64, m2, ta, ma
668 ; RV64-NEXT: vsext.vf2 v8, v10
670 %v = call <vscale x 2 x i32> @llvm.vp.gather.nxv2i32.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
671 %ev = sext <vscale x 2 x i32> %v to <vscale x 2 x i64>
672 ret <vscale x 2 x i64> %ev
675 define <vscale x 2 x i64> @vpgather_nxv2i32_zextload_nxv2i64(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
676 ; RV32-LABEL: vpgather_nxv2i32_zextload_nxv2i64:
678 ; RV32-NEXT: vsetvli zero, a0, e32, m1, ta, ma
679 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
680 ; RV32-NEXT: vsetvli a0, zero, e64, m2, ta, ma
681 ; RV32-NEXT: vzext.vf2 v8, v10
684 ; RV64-LABEL: vpgather_nxv2i32_zextload_nxv2i64:
686 ; RV64-NEXT: vsetvli zero, a0, e32, m1, ta, ma
687 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
688 ; RV64-NEXT: vsetvli a0, zero, e64, m2, ta, ma
689 ; RV64-NEXT: vzext.vf2 v8, v10
691 %v = call <vscale x 2 x i32> @llvm.vp.gather.nxv2i32.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
692 %ev = zext <vscale x 2 x i32> %v to <vscale x 2 x i64>
693 ret <vscale x 2 x i64> %ev
696 declare <vscale x 4 x i32> @llvm.vp.gather.nxv4i32.nxv4p0(<vscale x 4 x ptr>, <vscale x 4 x i1>, i32)
698 define <vscale x 4 x i32> @vpgather_nxv4i32(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 zeroext %evl) {
699 ; RV32-LABEL: vpgather_nxv4i32:
701 ; RV32-NEXT: vsetvli zero, a0, e32, m2, ta, ma
702 ; RV32-NEXT: vluxei32.v v8, (zero), v8, v0.t
705 ; RV64-LABEL: vpgather_nxv4i32:
707 ; RV64-NEXT: vsetvli zero, a0, e32, m2, ta, ma
708 ; RV64-NEXT: vluxei64.v v12, (zero), v8, v0.t
709 ; RV64-NEXT: vmv.v.v v8, v12
711 %v = call <vscale x 4 x i32> @llvm.vp.gather.nxv4i32.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 %evl)
712 ret <vscale x 4 x i32> %v
715 define <vscale x 4 x i32> @vpgather_truemask_nxv4i32(<vscale x 4 x ptr> %ptrs, i32 zeroext %evl) {
716 ; RV32-LABEL: vpgather_truemask_nxv4i32:
718 ; RV32-NEXT: vsetvli zero, a0, e32, m2, ta, ma
719 ; RV32-NEXT: vluxei32.v v8, (zero), v8
722 ; RV64-LABEL: vpgather_truemask_nxv4i32:
724 ; RV64-NEXT: vsetvli zero, a0, e32, m2, ta, ma
725 ; RV64-NEXT: vluxei64.v v12, (zero), v8
726 ; RV64-NEXT: vmv.v.v v8, v12
728 %v = call <vscale x 4 x i32> @llvm.vp.gather.nxv4i32.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> splat (i1 1), i32 %evl)
729 ret <vscale x 4 x i32> %v
732 declare <vscale x 8 x i32> @llvm.vp.gather.nxv8i32.nxv8p0(<vscale x 8 x ptr>, <vscale x 8 x i1>, i32)
734 define <vscale x 8 x i32> @vpgather_nxv8i32(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
735 ; RV32-LABEL: vpgather_nxv8i32:
737 ; RV32-NEXT: vsetvli zero, a0, e32, m4, ta, ma
738 ; RV32-NEXT: vluxei32.v v8, (zero), v8, v0.t
741 ; RV64-LABEL: vpgather_nxv8i32:
743 ; RV64-NEXT: vsetvli zero, a0, e32, m4, ta, ma
744 ; RV64-NEXT: vluxei64.v v16, (zero), v8, v0.t
745 ; RV64-NEXT: vmv.v.v v8, v16
747 %v = call <vscale x 8 x i32> @llvm.vp.gather.nxv8i32.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
748 ret <vscale x 8 x i32> %v
751 define <vscale x 8 x i32> @vpgather_baseidx_nxv8i8_nxv8i32(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
752 ; RV32-LABEL: vpgather_baseidx_nxv8i8_nxv8i32:
754 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
755 ; RV32-NEXT: vsext.vf4 v12, v8
756 ; RV32-NEXT: vsll.vi v8, v12, 2
757 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
758 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
761 ; RV64-LABEL: vpgather_baseidx_nxv8i8_nxv8i32:
763 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
764 ; RV64-NEXT: vsext.vf8 v16, v8
765 ; RV64-NEXT: vsll.vi v16, v16, 2
766 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
767 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
769 %ptrs = getelementptr inbounds i32, ptr %base, <vscale x 8 x i8> %idxs
770 %v = call <vscale x 8 x i32> @llvm.vp.gather.nxv8i32.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
771 ret <vscale x 8 x i32> %v
774 define <vscale x 8 x i32> @vpgather_baseidx_sext_nxv8i8_nxv8i32(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
775 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8i32:
777 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
778 ; RV32-NEXT: vsext.vf4 v12, v8
779 ; RV32-NEXT: vsll.vi v8, v12, 2
780 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
781 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
784 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8i32:
786 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
787 ; RV64-NEXT: vsext.vf8 v16, v8
788 ; RV64-NEXT: vsll.vi v16, v16, 2
789 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
790 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
792 %eidxs = sext <vscale x 8 x i8> %idxs to <vscale x 8 x i32>
793 %ptrs = getelementptr inbounds i32, ptr %base, <vscale x 8 x i32> %eidxs
794 %v = call <vscale x 8 x i32> @llvm.vp.gather.nxv8i32.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
795 ret <vscale x 8 x i32> %v
798 define <vscale x 8 x i32> @vpgather_baseidx_zext_nxv8i8_nxv8i32(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
799 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8i32:
801 ; RV32-NEXT: vsetvli a2, zero, e16, m2, ta, ma
802 ; RV32-NEXT: vzext.vf2 v10, v8
803 ; RV32-NEXT: vsll.vi v12, v10, 2
804 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
805 ; RV32-NEXT: vluxei16.v v8, (a0), v12, v0.t
808 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8i32:
810 ; RV64-NEXT: vsetvli a2, zero, e16, m2, ta, ma
811 ; RV64-NEXT: vzext.vf2 v10, v8
812 ; RV64-NEXT: vsll.vi v12, v10, 2
813 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
814 ; RV64-NEXT: vluxei16.v v8, (a0), v12, v0.t
816 %eidxs = zext <vscale x 8 x i8> %idxs to <vscale x 8 x i32>
817 %ptrs = getelementptr inbounds i32, ptr %base, <vscale x 8 x i32> %eidxs
818 %v = call <vscale x 8 x i32> @llvm.vp.gather.nxv8i32.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
819 ret <vscale x 8 x i32> %v
822 define <vscale x 8 x i32> @vpgather_baseidx_nxv8i16_nxv8i32(ptr %base, <vscale x 8 x i16> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
823 ; RV32-LABEL: vpgather_baseidx_nxv8i16_nxv8i32:
825 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
826 ; RV32-NEXT: vsext.vf2 v12, v8
827 ; RV32-NEXT: vsll.vi v8, v12, 2
828 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
829 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
832 ; RV64-LABEL: vpgather_baseidx_nxv8i16_nxv8i32:
834 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
835 ; RV64-NEXT: vsext.vf4 v16, v8
836 ; RV64-NEXT: vsll.vi v16, v16, 2
837 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
838 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
840 %ptrs = getelementptr inbounds i32, ptr %base, <vscale x 8 x i16> %idxs
841 %v = call <vscale x 8 x i32> @llvm.vp.gather.nxv8i32.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
842 ret <vscale x 8 x i32> %v
845 define <vscale x 8 x i32> @vpgather_baseidx_sext_nxv8i16_nxv8i32(ptr %base, <vscale x 8 x i16> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
846 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i16_nxv8i32:
848 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
849 ; RV32-NEXT: vsext.vf2 v12, v8
850 ; RV32-NEXT: vsll.vi v8, v12, 2
851 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
852 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
855 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i16_nxv8i32:
857 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
858 ; RV64-NEXT: vsext.vf4 v16, v8
859 ; RV64-NEXT: vsll.vi v16, v16, 2
860 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
861 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
863 %eidxs = sext <vscale x 8 x i16> %idxs to <vscale x 8 x i32>
864 %ptrs = getelementptr inbounds i32, ptr %base, <vscale x 8 x i32> %eidxs
865 %v = call <vscale x 8 x i32> @llvm.vp.gather.nxv8i32.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
866 ret <vscale x 8 x i32> %v
869 define <vscale x 8 x i32> @vpgather_baseidx_zext_nxv8i16_nxv8i32(ptr %base, <vscale x 8 x i16> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
870 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i16_nxv8i32:
872 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
873 ; RV32-NEXT: vzext.vf2 v12, v8
874 ; RV32-NEXT: vsll.vi v8, v12, 2
875 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
876 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
879 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i16_nxv8i32:
881 ; RV64-NEXT: vsetvli a2, zero, e32, m4, ta, ma
882 ; RV64-NEXT: vzext.vf2 v12, v8
883 ; RV64-NEXT: vsll.vi v8, v12, 2
884 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
885 ; RV64-NEXT: vluxei32.v v8, (a0), v8, v0.t
887 %eidxs = zext <vscale x 8 x i16> %idxs to <vscale x 8 x i32>
888 %ptrs = getelementptr inbounds i32, ptr %base, <vscale x 8 x i32> %eidxs
889 %v = call <vscale x 8 x i32> @llvm.vp.gather.nxv8i32.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
890 ret <vscale x 8 x i32> %v
893 define <vscale x 8 x i32> @vpgather_baseidx_nxv8i32(ptr %base, <vscale x 8 x i32> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
894 ; RV32-LABEL: vpgather_baseidx_nxv8i32:
896 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
897 ; RV32-NEXT: vsll.vi v8, v8, 2
898 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
899 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
902 ; RV64-LABEL: vpgather_baseidx_nxv8i32:
904 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
905 ; RV64-NEXT: vsext.vf2 v16, v8
906 ; RV64-NEXT: vsll.vi v16, v16, 2
907 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
908 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
910 %ptrs = getelementptr inbounds i32, ptr %base, <vscale x 8 x i32> %idxs
911 %v = call <vscale x 8 x i32> @llvm.vp.gather.nxv8i32.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
912 ret <vscale x 8 x i32> %v
915 declare <vscale x 1 x i64> @llvm.vp.gather.nxv1i64.nxv1p0(<vscale x 1 x ptr>, <vscale x 1 x i1>, i32)
917 define <vscale x 1 x i64> @vpgather_nxv1i64(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 zeroext %evl) {
918 ; RV32-LABEL: vpgather_nxv1i64:
920 ; RV32-NEXT: vsetvli zero, a0, e64, m1, ta, ma
921 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
922 ; RV32-NEXT: vmv.v.v v8, v9
925 ; RV64-LABEL: vpgather_nxv1i64:
927 ; RV64-NEXT: vsetvli zero, a0, e64, m1, ta, ma
928 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
930 %v = call <vscale x 1 x i64> @llvm.vp.gather.nxv1i64.nxv1p0(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 %evl)
931 ret <vscale x 1 x i64> %v
934 declare <vscale x 2 x i64> @llvm.vp.gather.nxv2i64.nxv2p0(<vscale x 2 x ptr>, <vscale x 2 x i1>, i32)
936 define <vscale x 2 x i64> @vpgather_nxv2i64(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
937 ; RV32-LABEL: vpgather_nxv2i64:
939 ; RV32-NEXT: vsetvli zero, a0, e64, m2, ta, ma
940 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
941 ; RV32-NEXT: vmv.v.v v8, v10
944 ; RV64-LABEL: vpgather_nxv2i64:
946 ; RV64-NEXT: vsetvli zero, a0, e64, m2, ta, ma
947 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
949 %v = call <vscale x 2 x i64> @llvm.vp.gather.nxv2i64.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
950 ret <vscale x 2 x i64> %v
953 declare <vscale x 4 x i64> @llvm.vp.gather.nxv4i64.nxv4p0(<vscale x 4 x ptr>, <vscale x 4 x i1>, i32)
955 define <vscale x 4 x i64> @vpgather_nxv4i64(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 zeroext %evl) {
956 ; RV32-LABEL: vpgather_nxv4i64:
958 ; RV32-NEXT: vsetvli zero, a0, e64, m4, ta, ma
959 ; RV32-NEXT: vluxei32.v v12, (zero), v8, v0.t
960 ; RV32-NEXT: vmv.v.v v8, v12
963 ; RV64-LABEL: vpgather_nxv4i64:
965 ; RV64-NEXT: vsetvli zero, a0, e64, m4, ta, ma
966 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
968 %v = call <vscale x 4 x i64> @llvm.vp.gather.nxv4i64.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 %evl)
969 ret <vscale x 4 x i64> %v
972 define <vscale x 4 x i64> @vpgather_truemask_nxv4i64(<vscale x 4 x ptr> %ptrs, i32 zeroext %evl) {
973 ; RV32-LABEL: vpgather_truemask_nxv4i64:
975 ; RV32-NEXT: vsetvli zero, a0, e64, m4, ta, ma
976 ; RV32-NEXT: vluxei32.v v12, (zero), v8
977 ; RV32-NEXT: vmv.v.v v8, v12
980 ; RV64-LABEL: vpgather_truemask_nxv4i64:
982 ; RV64-NEXT: vsetvli zero, a0, e64, m4, ta, ma
983 ; RV64-NEXT: vluxei64.v v8, (zero), v8
985 %v = call <vscale x 4 x i64> @llvm.vp.gather.nxv4i64.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> splat (i1 1), i32 %evl)
986 ret <vscale x 4 x i64> %v
989 declare <vscale x 8 x i64> @llvm.vp.gather.nxv8i64.nxv8p0(<vscale x 8 x ptr>, <vscale x 8 x i1>, i32)
991 define <vscale x 8 x i64> @vpgather_nxv8i64(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
992 ; RV32-LABEL: vpgather_nxv8i64:
994 ; RV32-NEXT: vsetvli zero, a0, e64, m8, ta, ma
995 ; RV32-NEXT: vluxei32.v v16, (zero), v8, v0.t
996 ; RV32-NEXT: vmv.v.v v8, v16
999 ; RV64-LABEL: vpgather_nxv8i64:
1001 ; RV64-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1002 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
1004 %v = call <vscale x 8 x i64> @llvm.vp.gather.nxv8i64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1005 ret <vscale x 8 x i64> %v
1008 define <vscale x 8 x i64> @vpgather_baseidx_nxv8i8_nxv8i64(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1009 ; RV32-LABEL: vpgather_baseidx_nxv8i8_nxv8i64:
1011 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1012 ; RV32-NEXT: vsext.vf4 v12, v8
1013 ; RV32-NEXT: vsll.vi v16, v12, 3
1014 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1015 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1018 ; RV64-LABEL: vpgather_baseidx_nxv8i8_nxv8i64:
1020 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1021 ; RV64-NEXT: vsext.vf8 v16, v8
1022 ; RV64-NEXT: vsll.vi v8, v16, 3
1023 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1024 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1026 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i8> %idxs
1027 %v = call <vscale x 8 x i64> @llvm.vp.gather.nxv8i64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1028 ret <vscale x 8 x i64> %v
1031 define <vscale x 8 x i64> @vpgather_baseidx_sext_nxv8i8_nxv8i64(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1032 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8i64:
1034 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1035 ; RV32-NEXT: vsext.vf4 v12, v8
1036 ; RV32-NEXT: vsll.vi v16, v12, 3
1037 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1038 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1041 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8i64:
1043 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1044 ; RV64-NEXT: vsext.vf8 v16, v8
1045 ; RV64-NEXT: vsll.vi v8, v16, 3
1046 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1047 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1049 %eidxs = sext <vscale x 8 x i8> %idxs to <vscale x 8 x i64>
1050 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i64> %eidxs
1051 %v = call <vscale x 8 x i64> @llvm.vp.gather.nxv8i64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1052 ret <vscale x 8 x i64> %v
1055 define <vscale x 8 x i64> @vpgather_baseidx_zext_nxv8i8_nxv8i64(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1056 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8i64:
1058 ; RV32-NEXT: vsetvli a2, zero, e16, m2, ta, ma
1059 ; RV32-NEXT: vzext.vf2 v10, v8
1060 ; RV32-NEXT: vsll.vi v16, v10, 3
1061 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1062 ; RV32-NEXT: vluxei16.v v8, (a0), v16, v0.t
1065 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8i64:
1067 ; RV64-NEXT: vsetvli a2, zero, e16, m2, ta, ma
1068 ; RV64-NEXT: vzext.vf2 v10, v8
1069 ; RV64-NEXT: vsll.vi v16, v10, 3
1070 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1071 ; RV64-NEXT: vluxei16.v v8, (a0), v16, v0.t
1073 %eidxs = zext <vscale x 8 x i8> %idxs to <vscale x 8 x i64>
1074 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i64> %eidxs
1075 %v = call <vscale x 8 x i64> @llvm.vp.gather.nxv8i64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1076 ret <vscale x 8 x i64> %v
1079 define <vscale x 8 x i64> @vpgather_baseidx_nxv8i16_nxv8i64(ptr %base, <vscale x 8 x i16> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1080 ; RV32-LABEL: vpgather_baseidx_nxv8i16_nxv8i64:
1082 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1083 ; RV32-NEXT: vsext.vf2 v12, v8
1084 ; RV32-NEXT: vsll.vi v16, v12, 3
1085 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1086 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1089 ; RV64-LABEL: vpgather_baseidx_nxv8i16_nxv8i64:
1091 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1092 ; RV64-NEXT: vsext.vf4 v16, v8
1093 ; RV64-NEXT: vsll.vi v8, v16, 3
1094 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1095 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1097 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i16> %idxs
1098 %v = call <vscale x 8 x i64> @llvm.vp.gather.nxv8i64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1099 ret <vscale x 8 x i64> %v
1102 define <vscale x 8 x i64> @vpgather_baseidx_sext_nxv8i16_nxv8i64(ptr %base, <vscale x 8 x i16> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1103 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i16_nxv8i64:
1105 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1106 ; RV32-NEXT: vsext.vf2 v12, v8
1107 ; RV32-NEXT: vsll.vi v16, v12, 3
1108 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1109 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1112 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i16_nxv8i64:
1114 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1115 ; RV64-NEXT: vsext.vf4 v16, v8
1116 ; RV64-NEXT: vsll.vi v8, v16, 3
1117 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1118 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1120 %eidxs = sext <vscale x 8 x i16> %idxs to <vscale x 8 x i64>
1121 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i64> %eidxs
1122 %v = call <vscale x 8 x i64> @llvm.vp.gather.nxv8i64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1123 ret <vscale x 8 x i64> %v
1126 define <vscale x 8 x i64> @vpgather_baseidx_zext_nxv8i16_nxv8i64(ptr %base, <vscale x 8 x i16> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1127 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i16_nxv8i64:
1129 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1130 ; RV32-NEXT: vzext.vf2 v12, v8
1131 ; RV32-NEXT: vsll.vi v16, v12, 3
1132 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1133 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1136 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i16_nxv8i64:
1138 ; RV64-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1139 ; RV64-NEXT: vzext.vf2 v12, v8
1140 ; RV64-NEXT: vsll.vi v16, v12, 3
1141 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1142 ; RV64-NEXT: vluxei32.v v8, (a0), v16, v0.t
1144 %eidxs = zext <vscale x 8 x i16> %idxs to <vscale x 8 x i64>
1145 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i64> %eidxs
1146 %v = call <vscale x 8 x i64> @llvm.vp.gather.nxv8i64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1147 ret <vscale x 8 x i64> %v
1150 define <vscale x 8 x i64> @vpgather_baseidx_nxv8i32_nxv8i64(ptr %base, <vscale x 8 x i32> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1151 ; RV32-LABEL: vpgather_baseidx_nxv8i32_nxv8i64:
1153 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1154 ; RV32-NEXT: vsll.vi v16, v8, 3
1155 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1156 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1159 ; RV64-LABEL: vpgather_baseidx_nxv8i32_nxv8i64:
1161 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1162 ; RV64-NEXT: vsext.vf2 v16, v8
1163 ; RV64-NEXT: vsll.vi v8, v16, 3
1164 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1165 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1167 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i32> %idxs
1168 %v = call <vscale x 8 x i64> @llvm.vp.gather.nxv8i64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1169 ret <vscale x 8 x i64> %v
1172 define <vscale x 8 x i64> @vpgather_baseidx_sext_nxv8i32_nxv8i64(ptr %base, <vscale x 8 x i32> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1173 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i32_nxv8i64:
1175 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1176 ; RV32-NEXT: vsll.vi v16, v8, 3
1177 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1178 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1181 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i32_nxv8i64:
1183 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1184 ; RV64-NEXT: vsext.vf2 v16, v8
1185 ; RV64-NEXT: vsll.vi v8, v16, 3
1186 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1187 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1189 %eidxs = sext <vscale x 8 x i32> %idxs to <vscale x 8 x i64>
1190 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i64> %eidxs
1191 %v = call <vscale x 8 x i64> @llvm.vp.gather.nxv8i64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1192 ret <vscale x 8 x i64> %v
1195 define <vscale x 8 x i64> @vpgather_baseidx_zext_nxv8i32_nxv8i64(ptr %base, <vscale x 8 x i32> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1196 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i32_nxv8i64:
1198 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1199 ; RV32-NEXT: vsll.vi v16, v8, 3
1200 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1201 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1204 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i32_nxv8i64:
1206 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1207 ; RV64-NEXT: vzext.vf2 v16, v8
1208 ; RV64-NEXT: vsll.vi v8, v16, 3
1209 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1210 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1212 %eidxs = zext <vscale x 8 x i32> %idxs to <vscale x 8 x i64>
1213 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i64> %eidxs
1214 %v = call <vscale x 8 x i64> @llvm.vp.gather.nxv8i64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1215 ret <vscale x 8 x i64> %v
1218 define <vscale x 8 x i64> @vpgather_baseidx_nxv8i64(ptr %base, <vscale x 8 x i64> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1219 ; RV32-LABEL: vpgather_baseidx_nxv8i64:
1221 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1222 ; RV32-NEXT: vnsrl.wi v16, v8, 0
1223 ; RV32-NEXT: vsll.vi v16, v16, 3
1224 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1225 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1228 ; RV64-LABEL: vpgather_baseidx_nxv8i64:
1230 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1231 ; RV64-NEXT: vsll.vi v8, v8, 3
1232 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1233 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1235 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i64> %idxs
1236 %v = call <vscale x 8 x i64> @llvm.vp.gather.nxv8i64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1237 ret <vscale x 8 x i64> %v
1240 declare <vscale x 1 x half> @llvm.vp.gather.nxv1f16.nxv1p0(<vscale x 1 x ptr>, <vscale x 1 x i1>, i32)
1242 define <vscale x 1 x half> @vpgather_nxv1f16(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1243 ; RV32-LABEL: vpgather_nxv1f16:
1245 ; RV32-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
1246 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
1247 ; RV32-NEXT: vmv1r.v v8, v9
1250 ; RV64-LABEL: vpgather_nxv1f16:
1252 ; RV64-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
1253 ; RV64-NEXT: vluxei64.v v9, (zero), v8, v0.t
1254 ; RV64-NEXT: vmv1r.v v8, v9
1256 %v = call <vscale x 1 x half> @llvm.vp.gather.nxv1f16.nxv1p0(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 %evl)
1257 ret <vscale x 1 x half> %v
1260 declare <vscale x 2 x half> @llvm.vp.gather.nxv2f16.nxv2p0(<vscale x 2 x ptr>, <vscale x 2 x i1>, i32)
1262 define <vscale x 2 x half> @vpgather_nxv2f16(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1263 ; RV32-LABEL: vpgather_nxv2f16:
1265 ; RV32-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
1266 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
1267 ; RV32-NEXT: vmv1r.v v8, v9
1270 ; RV64-LABEL: vpgather_nxv2f16:
1272 ; RV64-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
1273 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
1274 ; RV64-NEXT: vmv1r.v v8, v10
1276 %v = call <vscale x 2 x half> @llvm.vp.gather.nxv2f16.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
1277 ret <vscale x 2 x half> %v
1280 declare <vscale x 4 x half> @llvm.vp.gather.nxv4f16.nxv4p0(<vscale x 4 x ptr>, <vscale x 4 x i1>, i32)
1282 define <vscale x 4 x half> @vpgather_nxv4f16(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1283 ; RV32-LABEL: vpgather_nxv4f16:
1285 ; RV32-NEXT: vsetvli zero, a0, e16, m1, ta, ma
1286 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
1287 ; RV32-NEXT: vmv.v.v v8, v10
1290 ; RV64-LABEL: vpgather_nxv4f16:
1292 ; RV64-NEXT: vsetvli zero, a0, e16, m1, ta, ma
1293 ; RV64-NEXT: vluxei64.v v12, (zero), v8, v0.t
1294 ; RV64-NEXT: vmv.v.v v8, v12
1296 %v = call <vscale x 4 x half> @llvm.vp.gather.nxv4f16.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 %evl)
1297 ret <vscale x 4 x half> %v
1300 define <vscale x 4 x half> @vpgather_truemask_nxv4f16(<vscale x 4 x ptr> %ptrs, i32 zeroext %evl) {
1301 ; RV32-LABEL: vpgather_truemask_nxv4f16:
1303 ; RV32-NEXT: vsetvli zero, a0, e16, m1, ta, ma
1304 ; RV32-NEXT: vluxei32.v v10, (zero), v8
1305 ; RV32-NEXT: vmv.v.v v8, v10
1308 ; RV64-LABEL: vpgather_truemask_nxv4f16:
1310 ; RV64-NEXT: vsetvli zero, a0, e16, m1, ta, ma
1311 ; RV64-NEXT: vluxei64.v v12, (zero), v8
1312 ; RV64-NEXT: vmv.v.v v8, v12
1314 %v = call <vscale x 4 x half> @llvm.vp.gather.nxv4f16.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> splat (i1 1), i32 %evl)
1315 ret <vscale x 4 x half> %v
1318 declare <vscale x 8 x half> @llvm.vp.gather.nxv8f16.nxv8p0(<vscale x 8 x ptr>, <vscale x 8 x i1>, i32)
1320 define <vscale x 8 x half> @vpgather_nxv8f16(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1321 ; RV32-LABEL: vpgather_nxv8f16:
1323 ; RV32-NEXT: vsetvli zero, a0, e16, m2, ta, ma
1324 ; RV32-NEXT: vluxei32.v v12, (zero), v8, v0.t
1325 ; RV32-NEXT: vmv.v.v v8, v12
1328 ; RV64-LABEL: vpgather_nxv8f16:
1330 ; RV64-NEXT: vsetvli zero, a0, e16, m2, ta, ma
1331 ; RV64-NEXT: vluxei64.v v16, (zero), v8, v0.t
1332 ; RV64-NEXT: vmv.v.v v8, v16
1334 %v = call <vscale x 8 x half> @llvm.vp.gather.nxv8f16.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1335 ret <vscale x 8 x half> %v
1338 define <vscale x 8 x half> @vpgather_baseidx_nxv8i8_nxv8f16(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1339 ; RV32-LABEL: vpgather_baseidx_nxv8i8_nxv8f16:
1341 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1342 ; RV32-NEXT: vsext.vf4 v12, v8
1343 ; RV32-NEXT: vadd.vv v12, v12, v12
1344 ; RV32-NEXT: vsetvli zero, a1, e16, m2, ta, ma
1345 ; RV32-NEXT: vluxei32.v v8, (a0), v12, v0.t
1348 ; RV64-LABEL: vpgather_baseidx_nxv8i8_nxv8f16:
1350 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1351 ; RV64-NEXT: vsext.vf8 v16, v8
1352 ; RV64-NEXT: vadd.vv v16, v16, v16
1353 ; RV64-NEXT: vsetvli zero, a1, e16, m2, ta, ma
1354 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
1356 %ptrs = getelementptr inbounds half, ptr %base, <vscale x 8 x i8> %idxs
1357 %v = call <vscale x 8 x half> @llvm.vp.gather.nxv8f16.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1358 ret <vscale x 8 x half> %v
1361 define <vscale x 8 x half> @vpgather_baseidx_sext_nxv8i8_nxv8f16(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1362 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8f16:
1364 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1365 ; RV32-NEXT: vsext.vf4 v12, v8
1366 ; RV32-NEXT: vadd.vv v12, v12, v12
1367 ; RV32-NEXT: vsetvli zero, a1, e16, m2, ta, ma
1368 ; RV32-NEXT: vluxei32.v v8, (a0), v12, v0.t
1371 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8f16:
1373 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1374 ; RV64-NEXT: vsext.vf8 v16, v8
1375 ; RV64-NEXT: vadd.vv v16, v16, v16
1376 ; RV64-NEXT: vsetvli zero, a1, e16, m2, ta, ma
1377 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
1379 %eidxs = sext <vscale x 8 x i8> %idxs to <vscale x 8 x i16>
1380 %ptrs = getelementptr inbounds half, ptr %base, <vscale x 8 x i16> %eidxs
1381 %v = call <vscale x 8 x half> @llvm.vp.gather.nxv8f16.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1382 ret <vscale x 8 x half> %v
1385 define <vscale x 8 x half> @vpgather_baseidx_zext_nxv8i8_nxv8f16(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1386 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8f16:
1388 ; RV32-NEXT: vsetvli a2, zero, e8, m1, ta, ma
1389 ; RV32-NEXT: vwaddu.vv v10, v8, v8
1390 ; RV32-NEXT: vsetvli zero, a1, e16, m2, ta, ma
1391 ; RV32-NEXT: vluxei16.v v8, (a0), v10, v0.t
1394 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8f16:
1396 ; RV64-NEXT: vsetvli a2, zero, e8, m1, ta, ma
1397 ; RV64-NEXT: vwaddu.vv v10, v8, v8
1398 ; RV64-NEXT: vsetvli zero, a1, e16, m2, ta, ma
1399 ; RV64-NEXT: vluxei16.v v8, (a0), v10, v0.t
1401 %eidxs = zext <vscale x 8 x i8> %idxs to <vscale x 8 x i16>
1402 %ptrs = getelementptr inbounds half, ptr %base, <vscale x 8 x i16> %eidxs
1403 %v = call <vscale x 8 x half> @llvm.vp.gather.nxv8f16.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1404 ret <vscale x 8 x half> %v
1407 define <vscale x 8 x half> @vpgather_baseidx_nxv8f16(ptr %base, <vscale x 8 x i16> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1408 ; RV32-LABEL: vpgather_baseidx_nxv8f16:
1410 ; RV32-NEXT: vsetvli a2, zero, e16, m2, ta, ma
1411 ; RV32-NEXT: vwadd.vv v12, v8, v8
1412 ; RV32-NEXT: vsetvli zero, a1, e16, m2, ta, ma
1413 ; RV32-NEXT: vluxei32.v v8, (a0), v12, v0.t
1416 ; RV64-LABEL: vpgather_baseidx_nxv8f16:
1418 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1419 ; RV64-NEXT: vsext.vf4 v16, v8
1420 ; RV64-NEXT: vadd.vv v16, v16, v16
1421 ; RV64-NEXT: vsetvli zero, a1, e16, m2, ta, ma
1422 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
1424 %ptrs = getelementptr inbounds half, ptr %base, <vscale x 8 x i16> %idxs
1425 %v = call <vscale x 8 x half> @llvm.vp.gather.nxv8f16.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1426 ret <vscale x 8 x half> %v
1429 declare <vscale x 1 x float> @llvm.vp.gather.nxv1f32.nxv1p0(<vscale x 1 x ptr>, <vscale x 1 x i1>, i32)
1431 define <vscale x 1 x float> @vpgather_nxv1f32(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1432 ; RV32-LABEL: vpgather_nxv1f32:
1434 ; RV32-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
1435 ; RV32-NEXT: vluxei32.v v8, (zero), v8, v0.t
1438 ; RV64-LABEL: vpgather_nxv1f32:
1440 ; RV64-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
1441 ; RV64-NEXT: vluxei64.v v9, (zero), v8, v0.t
1442 ; RV64-NEXT: vmv1r.v v8, v9
1444 %v = call <vscale x 1 x float> @llvm.vp.gather.nxv1f32.nxv1p0(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 %evl)
1445 ret <vscale x 1 x float> %v
1448 declare <vscale x 2 x float> @llvm.vp.gather.nxv2f32.nxv2p0(<vscale x 2 x ptr>, <vscale x 2 x i1>, i32)
1450 define <vscale x 2 x float> @vpgather_nxv2f32(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1451 ; RV32-LABEL: vpgather_nxv2f32:
1453 ; RV32-NEXT: vsetvli zero, a0, e32, m1, ta, ma
1454 ; RV32-NEXT: vluxei32.v v8, (zero), v8, v0.t
1457 ; RV64-LABEL: vpgather_nxv2f32:
1459 ; RV64-NEXT: vsetvli zero, a0, e32, m1, ta, ma
1460 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
1461 ; RV64-NEXT: vmv.v.v v8, v10
1463 %v = call <vscale x 2 x float> @llvm.vp.gather.nxv2f32.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
1464 ret <vscale x 2 x float> %v
1467 declare <vscale x 4 x float> @llvm.vp.gather.nxv4f32.nxv4p0(<vscale x 4 x ptr>, <vscale x 4 x i1>, i32)
1469 define <vscale x 4 x float> @vpgather_nxv4f32(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1470 ; RV32-LABEL: vpgather_nxv4f32:
1472 ; RV32-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1473 ; RV32-NEXT: vluxei32.v v8, (zero), v8, v0.t
1476 ; RV64-LABEL: vpgather_nxv4f32:
1478 ; RV64-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1479 ; RV64-NEXT: vluxei64.v v12, (zero), v8, v0.t
1480 ; RV64-NEXT: vmv.v.v v8, v12
1482 %v = call <vscale x 4 x float> @llvm.vp.gather.nxv4f32.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 %evl)
1483 ret <vscale x 4 x float> %v
1486 define <vscale x 4 x float> @vpgather_truemask_nxv4f32(<vscale x 4 x ptr> %ptrs, i32 zeroext %evl) {
1487 ; RV32-LABEL: vpgather_truemask_nxv4f32:
1489 ; RV32-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1490 ; RV32-NEXT: vluxei32.v v8, (zero), v8
1493 ; RV64-LABEL: vpgather_truemask_nxv4f32:
1495 ; RV64-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1496 ; RV64-NEXT: vluxei64.v v12, (zero), v8
1497 ; RV64-NEXT: vmv.v.v v8, v12
1499 %v = call <vscale x 4 x float> @llvm.vp.gather.nxv4f32.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> splat (i1 1), i32 %evl)
1500 ret <vscale x 4 x float> %v
1503 declare <vscale x 8 x float> @llvm.vp.gather.nxv8f32.nxv8p0(<vscale x 8 x ptr>, <vscale x 8 x i1>, i32)
1505 define <vscale x 8 x float> @vpgather_nxv8f32(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1506 ; RV32-LABEL: vpgather_nxv8f32:
1508 ; RV32-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1509 ; RV32-NEXT: vluxei32.v v8, (zero), v8, v0.t
1512 ; RV64-LABEL: vpgather_nxv8f32:
1514 ; RV64-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1515 ; RV64-NEXT: vluxei64.v v16, (zero), v8, v0.t
1516 ; RV64-NEXT: vmv.v.v v8, v16
1518 %v = call <vscale x 8 x float> @llvm.vp.gather.nxv8f32.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1519 ret <vscale x 8 x float> %v
1522 define <vscale x 8 x float> @vpgather_baseidx_nxv8i8_nxv8f32(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1523 ; RV32-LABEL: vpgather_baseidx_nxv8i8_nxv8f32:
1525 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1526 ; RV32-NEXT: vsext.vf4 v12, v8
1527 ; RV32-NEXT: vsll.vi v8, v12, 2
1528 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1529 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
1532 ; RV64-LABEL: vpgather_baseidx_nxv8i8_nxv8f32:
1534 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1535 ; RV64-NEXT: vsext.vf8 v16, v8
1536 ; RV64-NEXT: vsll.vi v16, v16, 2
1537 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1538 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
1540 %ptrs = getelementptr inbounds float, ptr %base, <vscale x 8 x i8> %idxs
1541 %v = call <vscale x 8 x float> @llvm.vp.gather.nxv8f32.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1542 ret <vscale x 8 x float> %v
1545 define <vscale x 8 x float> @vpgather_baseidx_sext_nxv8i8_nxv8f32(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1546 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8f32:
1548 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1549 ; RV32-NEXT: vsext.vf4 v12, v8
1550 ; RV32-NEXT: vsll.vi v8, v12, 2
1551 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1552 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
1555 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8f32:
1557 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1558 ; RV64-NEXT: vsext.vf8 v16, v8
1559 ; RV64-NEXT: vsll.vi v16, v16, 2
1560 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1561 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
1563 %eidxs = sext <vscale x 8 x i8> %idxs to <vscale x 8 x i32>
1564 %ptrs = getelementptr inbounds float, ptr %base, <vscale x 8 x i32> %eidxs
1565 %v = call <vscale x 8 x float> @llvm.vp.gather.nxv8f32.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1566 ret <vscale x 8 x float> %v
1569 define <vscale x 8 x float> @vpgather_baseidx_zext_nxv8i8_nxv8f32(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1570 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8f32:
1572 ; RV32-NEXT: vsetvli a2, zero, e16, m2, ta, ma
1573 ; RV32-NEXT: vzext.vf2 v10, v8
1574 ; RV32-NEXT: vsll.vi v12, v10, 2
1575 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1576 ; RV32-NEXT: vluxei16.v v8, (a0), v12, v0.t
1579 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8f32:
1581 ; RV64-NEXT: vsetvli a2, zero, e16, m2, ta, ma
1582 ; RV64-NEXT: vzext.vf2 v10, v8
1583 ; RV64-NEXT: vsll.vi v12, v10, 2
1584 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1585 ; RV64-NEXT: vluxei16.v v8, (a0), v12, v0.t
1587 %eidxs = zext <vscale x 8 x i8> %idxs to <vscale x 8 x i32>
1588 %ptrs = getelementptr inbounds float, ptr %base, <vscale x 8 x i32> %eidxs
1589 %v = call <vscale x 8 x float> @llvm.vp.gather.nxv8f32.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1590 ret <vscale x 8 x float> %v
1593 define <vscale x 8 x float> @vpgather_baseidx_nxv8i16_nxv8f32(ptr %base, <vscale x 8 x i16> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1594 ; RV32-LABEL: vpgather_baseidx_nxv8i16_nxv8f32:
1596 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1597 ; RV32-NEXT: vsext.vf2 v12, v8
1598 ; RV32-NEXT: vsll.vi v8, v12, 2
1599 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1600 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
1603 ; RV64-LABEL: vpgather_baseidx_nxv8i16_nxv8f32:
1605 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1606 ; RV64-NEXT: vsext.vf4 v16, v8
1607 ; RV64-NEXT: vsll.vi v16, v16, 2
1608 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1609 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
1611 %ptrs = getelementptr inbounds float, ptr %base, <vscale x 8 x i16> %idxs
1612 %v = call <vscale x 8 x float> @llvm.vp.gather.nxv8f32.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1613 ret <vscale x 8 x float> %v
1616 define <vscale x 8 x float> @vpgather_baseidx_sext_nxv8i16_nxv8f32(ptr %base, <vscale x 8 x i16> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1617 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i16_nxv8f32:
1619 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1620 ; RV32-NEXT: vsext.vf2 v12, v8
1621 ; RV32-NEXT: vsll.vi v8, v12, 2
1622 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1623 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
1626 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i16_nxv8f32:
1628 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1629 ; RV64-NEXT: vsext.vf4 v16, v8
1630 ; RV64-NEXT: vsll.vi v16, v16, 2
1631 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1632 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
1634 %eidxs = sext <vscale x 8 x i16> %idxs to <vscale x 8 x i32>
1635 %ptrs = getelementptr inbounds float, ptr %base, <vscale x 8 x i32> %eidxs
1636 %v = call <vscale x 8 x float> @llvm.vp.gather.nxv8f32.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1637 ret <vscale x 8 x float> %v
1640 define <vscale x 8 x float> @vpgather_baseidx_zext_nxv8i16_nxv8f32(ptr %base, <vscale x 8 x i16> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1641 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i16_nxv8f32:
1643 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1644 ; RV32-NEXT: vzext.vf2 v12, v8
1645 ; RV32-NEXT: vsll.vi v8, v12, 2
1646 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1647 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
1650 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i16_nxv8f32:
1652 ; RV64-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1653 ; RV64-NEXT: vzext.vf2 v12, v8
1654 ; RV64-NEXT: vsll.vi v8, v12, 2
1655 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1656 ; RV64-NEXT: vluxei32.v v8, (a0), v8, v0.t
1658 %eidxs = zext <vscale x 8 x i16> %idxs to <vscale x 8 x i32>
1659 %ptrs = getelementptr inbounds float, ptr %base, <vscale x 8 x i32> %eidxs
1660 %v = call <vscale x 8 x float> @llvm.vp.gather.nxv8f32.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1661 ret <vscale x 8 x float> %v
1664 define <vscale x 8 x float> @vpgather_baseidx_nxv8f32(ptr %base, <vscale x 8 x i32> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1665 ; RV32-LABEL: vpgather_baseidx_nxv8f32:
1667 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1668 ; RV32-NEXT: vsll.vi v8, v8, 2
1669 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1670 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
1673 ; RV64-LABEL: vpgather_baseidx_nxv8f32:
1675 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1676 ; RV64-NEXT: vsext.vf2 v16, v8
1677 ; RV64-NEXT: vsll.vi v16, v16, 2
1678 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1679 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
1681 %ptrs = getelementptr inbounds float, ptr %base, <vscale x 8 x i32> %idxs
1682 %v = call <vscale x 8 x float> @llvm.vp.gather.nxv8f32.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
1683 ret <vscale x 8 x float> %v
1686 declare <vscale x 1 x double> @llvm.vp.gather.nxv1f64.nxv1p0(<vscale x 1 x ptr>, <vscale x 1 x i1>, i32)
1688 define <vscale x 1 x double> @vpgather_nxv1f64(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1689 ; RV32-LABEL: vpgather_nxv1f64:
1691 ; RV32-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1692 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
1693 ; RV32-NEXT: vmv.v.v v8, v9
1696 ; RV64-LABEL: vpgather_nxv1f64:
1698 ; RV64-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1699 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
1701 %v = call <vscale x 1 x double> @llvm.vp.gather.nxv1f64.nxv1p0(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 %evl)
1702 ret <vscale x 1 x double> %v
1705 declare <vscale x 2 x double> @llvm.vp.gather.nxv2f64.nxv2p0(<vscale x 2 x ptr>, <vscale x 2 x i1>, i32)
1707 define <vscale x 2 x double> @vpgather_nxv2f64(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1708 ; RV32-LABEL: vpgather_nxv2f64:
1710 ; RV32-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1711 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
1712 ; RV32-NEXT: vmv.v.v v8, v10
1715 ; RV64-LABEL: vpgather_nxv2f64:
1717 ; RV64-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1718 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
1720 %v = call <vscale x 2 x double> @llvm.vp.gather.nxv2f64.nxv2p0(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 %evl)
1721 ret <vscale x 2 x double> %v
1724 declare <vscale x 4 x double> @llvm.vp.gather.nxv4f64.nxv4p0(<vscale x 4 x ptr>, <vscale x 4 x i1>, i32)
1726 define <vscale x 4 x double> @vpgather_nxv4f64(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1727 ; RV32-LABEL: vpgather_nxv4f64:
1729 ; RV32-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1730 ; RV32-NEXT: vluxei32.v v12, (zero), v8, v0.t
1731 ; RV32-NEXT: vmv.v.v v8, v12
1734 ; RV64-LABEL: vpgather_nxv4f64:
1736 ; RV64-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1737 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
1739 %v = call <vscale x 4 x double> @llvm.vp.gather.nxv4f64.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 %evl)
1740 ret <vscale x 4 x double> %v
1743 define <vscale x 4 x double> @vpgather_truemask_nxv4f64(<vscale x 4 x ptr> %ptrs, i32 zeroext %evl) {
1744 ; RV32-LABEL: vpgather_truemask_nxv4f64:
1746 ; RV32-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1747 ; RV32-NEXT: vluxei32.v v12, (zero), v8
1748 ; RV32-NEXT: vmv.v.v v8, v12
1751 ; RV64-LABEL: vpgather_truemask_nxv4f64:
1753 ; RV64-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1754 ; RV64-NEXT: vluxei64.v v8, (zero), v8
1756 %v = call <vscale x 4 x double> @llvm.vp.gather.nxv4f64.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> splat (i1 1), i32 %evl)
1757 ret <vscale x 4 x double> %v
1760 declare <vscale x 6 x double> @llvm.vp.gather.nxv6f64.nxv6p0(<vscale x 6 x ptr>, <vscale x 6 x i1>, i32)
1762 define <vscale x 6 x double> @vpgather_nxv6f64(<vscale x 6 x ptr> %ptrs, <vscale x 6 x i1> %m, i32 zeroext %evl) {
1763 ; RV32-LABEL: vpgather_nxv6f64:
1765 ; RV32-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1766 ; RV32-NEXT: vluxei32.v v16, (zero), v8, v0.t
1767 ; RV32-NEXT: vmv.v.v v8, v16
1770 ; RV64-LABEL: vpgather_nxv6f64:
1772 ; RV64-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1773 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
1775 %v = call <vscale x 6 x double> @llvm.vp.gather.nxv6f64.nxv6p0(<vscale x 6 x ptr> %ptrs, <vscale x 6 x i1> %m, i32 %evl)
1776 ret <vscale x 6 x double> %v
1779 define <vscale x 6 x double> @vpgather_baseidx_nxv6i8_nxv6f64(ptr %base, <vscale x 6 x i8> %idxs, <vscale x 6 x i1> %m, i32 zeroext %evl) {
1780 ; RV32-LABEL: vpgather_baseidx_nxv6i8_nxv6f64:
1782 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1783 ; RV32-NEXT: vsext.vf4 v12, v8
1784 ; RV32-NEXT: vsll.vi v16, v12, 3
1785 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1786 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1789 ; RV64-LABEL: vpgather_baseidx_nxv6i8_nxv6f64:
1791 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1792 ; RV64-NEXT: vsext.vf8 v16, v8
1793 ; RV64-NEXT: vsll.vi v8, v16, 3
1794 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1795 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1797 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i8> %idxs
1798 %v = call <vscale x 6 x double> @llvm.vp.gather.nxv6f64.nxv6p0(<vscale x 6 x ptr> %ptrs, <vscale x 6 x i1> %m, i32 %evl)
1799 ret <vscale x 6 x double> %v
1802 define <vscale x 6 x double> @vpgather_baseidx_sext_nxv6i8_nxv6f64(ptr %base, <vscale x 6 x i8> %idxs, <vscale x 6 x i1> %m, i32 zeroext %evl) {
1803 ; RV32-LABEL: vpgather_baseidx_sext_nxv6i8_nxv6f64:
1805 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1806 ; RV32-NEXT: vsext.vf4 v12, v8
1807 ; RV32-NEXT: vsll.vi v16, v12, 3
1808 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1809 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1812 ; RV64-LABEL: vpgather_baseidx_sext_nxv6i8_nxv6f64:
1814 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1815 ; RV64-NEXT: vsext.vf8 v16, v8
1816 ; RV64-NEXT: vsll.vi v8, v16, 3
1817 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1818 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1820 %eidxs = sext <vscale x 6 x i8> %idxs to <vscale x 6 x i64>
1821 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i64> %eidxs
1822 %v = call <vscale x 6 x double> @llvm.vp.gather.nxv6f64.nxv6p0(<vscale x 6 x ptr> %ptrs, <vscale x 6 x i1> %m, i32 %evl)
1823 ret <vscale x 6 x double> %v
1826 define <vscale x 6 x double> @vpgather_baseidx_zext_nxv6i8_nxv6f64(ptr %base, <vscale x 6 x i8> %idxs, <vscale x 6 x i1> %m, i32 zeroext %evl) {
1827 ; RV32-LABEL: vpgather_baseidx_zext_nxv6i8_nxv6f64:
1829 ; RV32-NEXT: vsetvli a2, zero, e16, m2, ta, ma
1830 ; RV32-NEXT: vzext.vf2 v10, v8
1831 ; RV32-NEXT: vsll.vi v16, v10, 3
1832 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1833 ; RV32-NEXT: vluxei16.v v8, (a0), v16, v0.t
1836 ; RV64-LABEL: vpgather_baseidx_zext_nxv6i8_nxv6f64:
1838 ; RV64-NEXT: vsetvli a2, zero, e16, m2, ta, ma
1839 ; RV64-NEXT: vzext.vf2 v10, v8
1840 ; RV64-NEXT: vsll.vi v16, v10, 3
1841 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1842 ; RV64-NEXT: vluxei16.v v8, (a0), v16, v0.t
1844 %eidxs = zext <vscale x 6 x i8> %idxs to <vscale x 6 x i64>
1845 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i64> %eidxs
1846 %v = call <vscale x 6 x double> @llvm.vp.gather.nxv6f64.nxv6p0(<vscale x 6 x ptr> %ptrs, <vscale x 6 x i1> %m, i32 %evl)
1847 ret <vscale x 6 x double> %v
1850 define <vscale x 6 x double> @vpgather_baseidx_nxv6i16_nxv6f64(ptr %base, <vscale x 6 x i16> %idxs, <vscale x 6 x i1> %m, i32 zeroext %evl) {
1851 ; RV32-LABEL: vpgather_baseidx_nxv6i16_nxv6f64:
1853 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1854 ; RV32-NEXT: vsext.vf2 v12, v8
1855 ; RV32-NEXT: vsll.vi v16, v12, 3
1856 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1857 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1860 ; RV64-LABEL: vpgather_baseidx_nxv6i16_nxv6f64:
1862 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1863 ; RV64-NEXT: vsext.vf4 v16, v8
1864 ; RV64-NEXT: vsll.vi v8, v16, 3
1865 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1866 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1868 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i16> %idxs
1869 %v = call <vscale x 6 x double> @llvm.vp.gather.nxv6f64.nxv6p0(<vscale x 6 x ptr> %ptrs, <vscale x 6 x i1> %m, i32 %evl)
1870 ret <vscale x 6 x double> %v
1873 define <vscale x 6 x double> @vpgather_baseidx_sext_nxv6i16_nxv6f64(ptr %base, <vscale x 6 x i16> %idxs, <vscale x 6 x i1> %m, i32 zeroext %evl) {
1874 ; RV32-LABEL: vpgather_baseidx_sext_nxv6i16_nxv6f64:
1876 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1877 ; RV32-NEXT: vsext.vf2 v12, v8
1878 ; RV32-NEXT: vsll.vi v16, v12, 3
1879 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1880 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1883 ; RV64-LABEL: vpgather_baseidx_sext_nxv6i16_nxv6f64:
1885 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1886 ; RV64-NEXT: vsext.vf4 v16, v8
1887 ; RV64-NEXT: vsll.vi v8, v16, 3
1888 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1889 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1891 %eidxs = sext <vscale x 6 x i16> %idxs to <vscale x 6 x i64>
1892 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i64> %eidxs
1893 %v = call <vscale x 6 x double> @llvm.vp.gather.nxv6f64.nxv6p0(<vscale x 6 x ptr> %ptrs, <vscale x 6 x i1> %m, i32 %evl)
1894 ret <vscale x 6 x double> %v
1897 define <vscale x 6 x double> @vpgather_baseidx_zext_nxv6i16_nxv6f64(ptr %base, <vscale x 6 x i16> %idxs, <vscale x 6 x i1> %m, i32 zeroext %evl) {
1898 ; RV32-LABEL: vpgather_baseidx_zext_nxv6i16_nxv6f64:
1900 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1901 ; RV32-NEXT: vzext.vf2 v12, v8
1902 ; RV32-NEXT: vsll.vi v16, v12, 3
1903 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1904 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1907 ; RV64-LABEL: vpgather_baseidx_zext_nxv6i16_nxv6f64:
1909 ; RV64-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1910 ; RV64-NEXT: vzext.vf2 v12, v8
1911 ; RV64-NEXT: vsll.vi v16, v12, 3
1912 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1913 ; RV64-NEXT: vluxei32.v v8, (a0), v16, v0.t
1915 %eidxs = zext <vscale x 6 x i16> %idxs to <vscale x 6 x i64>
1916 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i64> %eidxs
1917 %v = call <vscale x 6 x double> @llvm.vp.gather.nxv6f64.nxv6p0(<vscale x 6 x ptr> %ptrs, <vscale x 6 x i1> %m, i32 %evl)
1918 ret <vscale x 6 x double> %v
1921 define <vscale x 6 x double> @vpgather_baseidx_nxv6i32_nxv6f64(ptr %base, <vscale x 6 x i32> %idxs, <vscale x 6 x i1> %m, i32 zeroext %evl) {
1922 ; RV32-LABEL: vpgather_baseidx_nxv6i32_nxv6f64:
1924 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1925 ; RV32-NEXT: vsll.vi v16, v8, 3
1926 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1927 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1930 ; RV64-LABEL: vpgather_baseidx_nxv6i32_nxv6f64:
1932 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1933 ; RV64-NEXT: vsext.vf2 v16, v8
1934 ; RV64-NEXT: vsll.vi v8, v16, 3
1935 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1936 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1938 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i32> %idxs
1939 %v = call <vscale x 6 x double> @llvm.vp.gather.nxv6f64.nxv6p0(<vscale x 6 x ptr> %ptrs, <vscale x 6 x i1> %m, i32 %evl)
1940 ret <vscale x 6 x double> %v
1943 define <vscale x 6 x double> @vpgather_baseidx_sext_nxv6i32_nxv6f64(ptr %base, <vscale x 6 x i32> %idxs, <vscale x 6 x i1> %m, i32 zeroext %evl) {
1944 ; RV32-LABEL: vpgather_baseidx_sext_nxv6i32_nxv6f64:
1946 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1947 ; RV32-NEXT: vsll.vi v16, v8, 3
1948 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1949 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1952 ; RV64-LABEL: vpgather_baseidx_sext_nxv6i32_nxv6f64:
1954 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1955 ; RV64-NEXT: vsext.vf2 v16, v8
1956 ; RV64-NEXT: vsll.vi v8, v16, 3
1957 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1958 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1960 %eidxs = sext <vscale x 6 x i32> %idxs to <vscale x 6 x i64>
1961 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i64> %eidxs
1962 %v = call <vscale x 6 x double> @llvm.vp.gather.nxv6f64.nxv6p0(<vscale x 6 x ptr> %ptrs, <vscale x 6 x i1> %m, i32 %evl)
1963 ret <vscale x 6 x double> %v
1966 define <vscale x 6 x double> @vpgather_baseidx_zext_nxv6i32_nxv6f64(ptr %base, <vscale x 6 x i32> %idxs, <vscale x 6 x i1> %m, i32 zeroext %evl) {
1967 ; RV32-LABEL: vpgather_baseidx_zext_nxv6i32_nxv6f64:
1969 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1970 ; RV32-NEXT: vsll.vi v16, v8, 3
1971 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1972 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1975 ; RV64-LABEL: vpgather_baseidx_zext_nxv6i32_nxv6f64:
1977 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1978 ; RV64-NEXT: vzext.vf2 v16, v8
1979 ; RV64-NEXT: vsll.vi v8, v16, 3
1980 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1981 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1983 %eidxs = zext <vscale x 6 x i32> %idxs to <vscale x 6 x i64>
1984 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i64> %eidxs
1985 %v = call <vscale x 6 x double> @llvm.vp.gather.nxv6f64.nxv6p0(<vscale x 6 x ptr> %ptrs, <vscale x 6 x i1> %m, i32 %evl)
1986 ret <vscale x 6 x double> %v
1989 define <vscale x 6 x double> @vpgather_baseidx_nxv6f64(ptr %base, <vscale x 6 x i64> %idxs, <vscale x 6 x i1> %m, i32 zeroext %evl) {
1990 ; RV32-LABEL: vpgather_baseidx_nxv6f64:
1992 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1993 ; RV32-NEXT: vnsrl.wi v16, v8, 0
1994 ; RV32-NEXT: vsll.vi v16, v16, 3
1995 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1996 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1999 ; RV64-LABEL: vpgather_baseidx_nxv6f64:
2001 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2002 ; RV64-NEXT: vsll.vi v8, v8, 3
2003 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2004 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
2006 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i64> %idxs
2007 %v = call <vscale x 6 x double> @llvm.vp.gather.nxv6f64.nxv6p0(<vscale x 6 x ptr> %ptrs, <vscale x 6 x i1> %m, i32 %evl)
2008 ret <vscale x 6 x double> %v
2011 declare <vscale x 8 x double> @llvm.vp.gather.nxv8f64.nxv8p0(<vscale x 8 x ptr>, <vscale x 8 x i1>, i32)
2013 define <vscale x 8 x double> @vpgather_nxv8f64(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
2014 ; RV32-LABEL: vpgather_nxv8f64:
2016 ; RV32-NEXT: vsetvli zero, a0, e64, m8, ta, ma
2017 ; RV32-NEXT: vluxei32.v v16, (zero), v8, v0.t
2018 ; RV32-NEXT: vmv.v.v v8, v16
2021 ; RV64-LABEL: vpgather_nxv8f64:
2023 ; RV64-NEXT: vsetvli zero, a0, e64, m8, ta, ma
2024 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
2026 %v = call <vscale x 8 x double> @llvm.vp.gather.nxv8f64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
2027 ret <vscale x 8 x double> %v
2030 define <vscale x 8 x double> @vpgather_baseidx_nxv8i8_nxv8f64(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
2031 ; RV32-LABEL: vpgather_baseidx_nxv8i8_nxv8f64:
2033 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2034 ; RV32-NEXT: vsext.vf4 v12, v8
2035 ; RV32-NEXT: vsll.vi v16, v12, 3
2036 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2037 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2040 ; RV64-LABEL: vpgather_baseidx_nxv8i8_nxv8f64:
2042 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2043 ; RV64-NEXT: vsext.vf8 v16, v8
2044 ; RV64-NEXT: vsll.vi v8, v16, 3
2045 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2046 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
2048 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i8> %idxs
2049 %v = call <vscale x 8 x double> @llvm.vp.gather.nxv8f64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
2050 ret <vscale x 8 x double> %v
2053 define <vscale x 8 x double> @vpgather_baseidx_sext_nxv8i8_nxv8f64(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
2054 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8f64:
2056 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2057 ; RV32-NEXT: vsext.vf4 v12, v8
2058 ; RV32-NEXT: vsll.vi v16, v12, 3
2059 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2060 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2063 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8f64:
2065 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2066 ; RV64-NEXT: vsext.vf8 v16, v8
2067 ; RV64-NEXT: vsll.vi v8, v16, 3
2068 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2069 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
2071 %eidxs = sext <vscale x 8 x i8> %idxs to <vscale x 8 x i64>
2072 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i64> %eidxs
2073 %v = call <vscale x 8 x double> @llvm.vp.gather.nxv8f64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
2074 ret <vscale x 8 x double> %v
2077 define <vscale x 8 x double> @vpgather_baseidx_zext_nxv8i8_nxv8f64(ptr %base, <vscale x 8 x i8> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
2078 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8f64:
2080 ; RV32-NEXT: vsetvli a2, zero, e16, m2, ta, ma
2081 ; RV32-NEXT: vzext.vf2 v10, v8
2082 ; RV32-NEXT: vsll.vi v16, v10, 3
2083 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2084 ; RV32-NEXT: vluxei16.v v8, (a0), v16, v0.t
2087 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8f64:
2089 ; RV64-NEXT: vsetvli a2, zero, e16, m2, ta, ma
2090 ; RV64-NEXT: vzext.vf2 v10, v8
2091 ; RV64-NEXT: vsll.vi v16, v10, 3
2092 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2093 ; RV64-NEXT: vluxei16.v v8, (a0), v16, v0.t
2095 %eidxs = zext <vscale x 8 x i8> %idxs to <vscale x 8 x i64>
2096 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i64> %eidxs
2097 %v = call <vscale x 8 x double> @llvm.vp.gather.nxv8f64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
2098 ret <vscale x 8 x double> %v
2101 define <vscale x 8 x double> @vpgather_baseidx_nxv8i16_nxv8f64(ptr %base, <vscale x 8 x i16> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
2102 ; RV32-LABEL: vpgather_baseidx_nxv8i16_nxv8f64:
2104 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2105 ; RV32-NEXT: vsext.vf2 v12, v8
2106 ; RV32-NEXT: vsll.vi v16, v12, 3
2107 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2108 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2111 ; RV64-LABEL: vpgather_baseidx_nxv8i16_nxv8f64:
2113 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2114 ; RV64-NEXT: vsext.vf4 v16, v8
2115 ; RV64-NEXT: vsll.vi v8, v16, 3
2116 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2117 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
2119 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i16> %idxs
2120 %v = call <vscale x 8 x double> @llvm.vp.gather.nxv8f64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
2121 ret <vscale x 8 x double> %v
2124 define <vscale x 8 x double> @vpgather_baseidx_sext_nxv8i16_nxv8f64(ptr %base, <vscale x 8 x i16> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
2125 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i16_nxv8f64:
2127 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2128 ; RV32-NEXT: vsext.vf2 v12, v8
2129 ; RV32-NEXT: vsll.vi v16, v12, 3
2130 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2131 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2134 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i16_nxv8f64:
2136 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2137 ; RV64-NEXT: vsext.vf4 v16, v8
2138 ; RV64-NEXT: vsll.vi v8, v16, 3
2139 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2140 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
2142 %eidxs = sext <vscale x 8 x i16> %idxs to <vscale x 8 x i64>
2143 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i64> %eidxs
2144 %v = call <vscale x 8 x double> @llvm.vp.gather.nxv8f64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
2145 ret <vscale x 8 x double> %v
2148 define <vscale x 8 x double> @vpgather_baseidx_zext_nxv8i16_nxv8f64(ptr %base, <vscale x 8 x i16> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
2149 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i16_nxv8f64:
2151 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2152 ; RV32-NEXT: vzext.vf2 v12, v8
2153 ; RV32-NEXT: vsll.vi v16, v12, 3
2154 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2155 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2158 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i16_nxv8f64:
2160 ; RV64-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2161 ; RV64-NEXT: vzext.vf2 v12, v8
2162 ; RV64-NEXT: vsll.vi v16, v12, 3
2163 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2164 ; RV64-NEXT: vluxei32.v v8, (a0), v16, v0.t
2166 %eidxs = zext <vscale x 8 x i16> %idxs to <vscale x 8 x i64>
2167 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i64> %eidxs
2168 %v = call <vscale x 8 x double> @llvm.vp.gather.nxv8f64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
2169 ret <vscale x 8 x double> %v
2172 define <vscale x 8 x double> @vpgather_baseidx_nxv8i32_nxv8f64(ptr %base, <vscale x 8 x i32> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
2173 ; RV32-LABEL: vpgather_baseidx_nxv8i32_nxv8f64:
2175 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2176 ; RV32-NEXT: vsll.vi v16, v8, 3
2177 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2178 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2181 ; RV64-LABEL: vpgather_baseidx_nxv8i32_nxv8f64:
2183 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2184 ; RV64-NEXT: vsext.vf2 v16, v8
2185 ; RV64-NEXT: vsll.vi v8, v16, 3
2186 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2187 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
2189 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i32> %idxs
2190 %v = call <vscale x 8 x double> @llvm.vp.gather.nxv8f64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
2191 ret <vscale x 8 x double> %v
2194 define <vscale x 8 x double> @vpgather_baseidx_sext_nxv8i32_nxv8f64(ptr %base, <vscale x 8 x i32> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
2195 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i32_nxv8f64:
2197 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2198 ; RV32-NEXT: vsll.vi v16, v8, 3
2199 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2200 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2203 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i32_nxv8f64:
2205 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2206 ; RV64-NEXT: vsext.vf2 v16, v8
2207 ; RV64-NEXT: vsll.vi v8, v16, 3
2208 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2209 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
2211 %eidxs = sext <vscale x 8 x i32> %idxs to <vscale x 8 x i64>
2212 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i64> %eidxs
2213 %v = call <vscale x 8 x double> @llvm.vp.gather.nxv8f64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
2214 ret <vscale x 8 x double> %v
2217 define <vscale x 8 x double> @vpgather_baseidx_zext_nxv8i32_nxv8f64(ptr %base, <vscale x 8 x i32> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
2218 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i32_nxv8f64:
2220 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2221 ; RV32-NEXT: vsll.vi v16, v8, 3
2222 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2223 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2226 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i32_nxv8f64:
2228 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2229 ; RV64-NEXT: vzext.vf2 v16, v8
2230 ; RV64-NEXT: vsll.vi v8, v16, 3
2231 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2232 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
2234 %eidxs = zext <vscale x 8 x i32> %idxs to <vscale x 8 x i64>
2235 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i64> %eidxs
2236 %v = call <vscale x 8 x double> @llvm.vp.gather.nxv8f64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
2237 ret <vscale x 8 x double> %v
2240 define <vscale x 8 x double> @vpgather_baseidx_nxv8f64(ptr %base, <vscale x 8 x i64> %idxs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
2241 ; RV32-LABEL: vpgather_baseidx_nxv8f64:
2243 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2244 ; RV32-NEXT: vnsrl.wi v16, v8, 0
2245 ; RV32-NEXT: vsll.vi v16, v16, 3
2246 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2247 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2250 ; RV64-LABEL: vpgather_baseidx_nxv8f64:
2252 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2253 ; RV64-NEXT: vsll.vi v8, v8, 3
2254 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2255 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
2257 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i64> %idxs
2258 %v = call <vscale x 8 x double> @llvm.vp.gather.nxv8f64.nxv8p0(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 %evl)
2259 ret <vscale x 8 x double> %v
2262 declare <vscale x 16 x double> @llvm.vp.gather.nxv16f64.nxv16p0(<vscale x 16 x ptr>, <vscale x 16 x i1>, i32)
2264 define <vscale x 16 x double> @vpgather_nxv16f64(<vscale x 16 x ptr> %ptrs, <vscale x 16 x i1> %m, i32 zeroext %evl) {
2265 ; RV32-LABEL: vpgather_nxv16f64:
2267 ; RV32-NEXT: vmv1r.v v24, v0
2268 ; RV32-NEXT: csrr a1, vlenb
2269 ; RV32-NEXT: sub a2, a0, a1
2270 ; RV32-NEXT: sltu a3, a0, a2
2271 ; RV32-NEXT: addi a3, a3, -1
2272 ; RV32-NEXT: srli a4, a1, 3
2273 ; RV32-NEXT: vsetvli a5, zero, e8, mf4, ta, ma
2274 ; RV32-NEXT: vslidedown.vx v0, v0, a4
2275 ; RV32-NEXT: and a2, a3, a2
2276 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
2277 ; RV32-NEXT: vluxei32.v v16, (zero), v12, v0.t
2278 ; RV32-NEXT: bltu a0, a1, .LBB102_2
2279 ; RV32-NEXT: # %bb.1:
2280 ; RV32-NEXT: mv a0, a1
2281 ; RV32-NEXT: .LBB102_2:
2282 ; RV32-NEXT: vmv1r.v v0, v24
2283 ; RV32-NEXT: vsetvli zero, a0, e64, m8, ta, ma
2284 ; RV32-NEXT: vluxei32.v v24, (zero), v8, v0.t
2285 ; RV32-NEXT: vmv.v.v v8, v24
2288 ; RV64-LABEL: vpgather_nxv16f64:
2290 ; RV64-NEXT: vmv1r.v v24, v0
2291 ; RV64-NEXT: csrr a1, vlenb
2292 ; RV64-NEXT: sub a2, a0, a1
2293 ; RV64-NEXT: sltu a3, a0, a2
2294 ; RV64-NEXT: addi a3, a3, -1
2295 ; RV64-NEXT: srli a4, a1, 3
2296 ; RV64-NEXT: vsetvli a5, zero, e8, mf4, ta, ma
2297 ; RV64-NEXT: vslidedown.vx v0, v0, a4
2298 ; RV64-NEXT: and a2, a3, a2
2299 ; RV64-NEXT: vsetvli zero, a2, e64, m8, ta, ma
2300 ; RV64-NEXT: vluxei64.v v16, (zero), v16, v0.t
2301 ; RV64-NEXT: bltu a0, a1, .LBB102_2
2302 ; RV64-NEXT: # %bb.1:
2303 ; RV64-NEXT: mv a0, a1
2304 ; RV64-NEXT: .LBB102_2:
2305 ; RV64-NEXT: vmv1r.v v0, v24
2306 ; RV64-NEXT: vsetvli zero, a0, e64, m8, ta, ma
2307 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
2309 %v = call <vscale x 16 x double> @llvm.vp.gather.nxv16f64.nxv16p0(<vscale x 16 x ptr> %ptrs, <vscale x 16 x i1> %m, i32 %evl)
2310 ret <vscale x 16 x double> %v
2313 define <vscale x 16 x double> @vpgather_baseidx_nxv16i16_nxv16f64(ptr %base, <vscale x 16 x i16> %idxs, <vscale x 16 x i1> %m, i32 zeroext %evl) {
2314 ; RV32-LABEL: vpgather_baseidx_nxv16i16_nxv16f64:
2316 ; RV32-NEXT: vmv1r.v v12, v0
2317 ; RV32-NEXT: vsetvli a2, zero, e32, m8, ta, ma
2318 ; RV32-NEXT: vsext.vf2 v16, v8
2319 ; RV32-NEXT: vsll.vi v24, v16, 3
2320 ; RV32-NEXT: csrr a2, vlenb
2321 ; RV32-NEXT: sub a3, a1, a2
2322 ; RV32-NEXT: srli a4, a2, 3
2323 ; RV32-NEXT: vsetvli a5, zero, e8, mf4, ta, ma
2324 ; RV32-NEXT: vslidedown.vx v0, v0, a4
2325 ; RV32-NEXT: sltu a4, a1, a3
2326 ; RV32-NEXT: addi a4, a4, -1
2327 ; RV32-NEXT: and a3, a4, a3
2328 ; RV32-NEXT: vsetvli zero, a3, e64, m8, ta, ma
2329 ; RV32-NEXT: vluxei32.v v16, (a0), v28, v0.t
2330 ; RV32-NEXT: bltu a1, a2, .LBB103_2
2331 ; RV32-NEXT: # %bb.1:
2332 ; RV32-NEXT: mv a1, a2
2333 ; RV32-NEXT: .LBB103_2:
2334 ; RV32-NEXT: vmv1r.v v0, v12
2335 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2336 ; RV32-NEXT: vluxei32.v v8, (a0), v24, v0.t
2339 ; RV64-LABEL: vpgather_baseidx_nxv16i16_nxv16f64:
2341 ; RV64-NEXT: vmv1r.v v12, v0
2342 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2343 ; RV64-NEXT: vsext.vf4 v16, v10
2344 ; RV64-NEXT: vsll.vi v16, v16, 3
2345 ; RV64-NEXT: csrr a2, vlenb
2346 ; RV64-NEXT: sub a3, a1, a2
2347 ; RV64-NEXT: srli a4, a2, 3
2348 ; RV64-NEXT: vsetvli a5, zero, e8, mf4, ta, ma
2349 ; RV64-NEXT: vslidedown.vx v0, v0, a4
2350 ; RV64-NEXT: sltu a4, a1, a3
2351 ; RV64-NEXT: addi a4, a4, -1
2352 ; RV64-NEXT: and a3, a4, a3
2353 ; RV64-NEXT: vsetvli zero, a3, e64, m8, ta, ma
2354 ; RV64-NEXT: vluxei64.v v16, (a0), v16, v0.t
2355 ; RV64-NEXT: vsetvli a3, zero, e64, m8, ta, ma
2356 ; RV64-NEXT: vsext.vf4 v24, v8
2357 ; RV64-NEXT: vsll.vi v24, v24, 3
2358 ; RV64-NEXT: bltu a1, a2, .LBB103_2
2359 ; RV64-NEXT: # %bb.1:
2360 ; RV64-NEXT: mv a1, a2
2361 ; RV64-NEXT: .LBB103_2:
2362 ; RV64-NEXT: vmv1r.v v0, v12
2363 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2364 ; RV64-NEXT: vluxei64.v v8, (a0), v24, v0.t
2366 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 16 x i16> %idxs
2367 %v = call <vscale x 16 x double> @llvm.vp.gather.nxv16f64.nxv16p0(<vscale x 16 x ptr> %ptrs, <vscale x 16 x i1> %m, i32 %evl)
2368 ret <vscale x 16 x double> %v
2371 define <vscale x 16 x double> @vpgather_baseidx_sext_nxv16i16_nxv16f64(ptr %base, <vscale x 16 x i16> %idxs, <vscale x 16 x i1> %m, i32 zeroext %evl) {
2372 ; RV32-LABEL: vpgather_baseidx_sext_nxv16i16_nxv16f64:
2374 ; RV32-NEXT: vmv1r.v v12, v0
2375 ; RV32-NEXT: vsetvli a2, zero, e32, m8, ta, ma
2376 ; RV32-NEXT: vsext.vf2 v16, v8
2377 ; RV32-NEXT: vsll.vi v24, v16, 3
2378 ; RV32-NEXT: csrr a2, vlenb
2379 ; RV32-NEXT: sub a3, a1, a2
2380 ; RV32-NEXT: srli a4, a2, 3
2381 ; RV32-NEXT: vsetvli a5, zero, e8, mf4, ta, ma
2382 ; RV32-NEXT: vslidedown.vx v0, v0, a4
2383 ; RV32-NEXT: sltu a4, a1, a3
2384 ; RV32-NEXT: addi a4, a4, -1
2385 ; RV32-NEXT: and a3, a4, a3
2386 ; RV32-NEXT: vsetvli zero, a3, e64, m8, ta, ma
2387 ; RV32-NEXT: vluxei32.v v16, (a0), v28, v0.t
2388 ; RV32-NEXT: bltu a1, a2, .LBB104_2
2389 ; RV32-NEXT: # %bb.1:
2390 ; RV32-NEXT: mv a1, a2
2391 ; RV32-NEXT: .LBB104_2:
2392 ; RV32-NEXT: vmv1r.v v0, v12
2393 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2394 ; RV32-NEXT: vluxei32.v v8, (a0), v24, v0.t
2397 ; RV64-LABEL: vpgather_baseidx_sext_nxv16i16_nxv16f64:
2399 ; RV64-NEXT: vmv1r.v v12, v0
2400 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2401 ; RV64-NEXT: vsext.vf4 v16, v10
2402 ; RV64-NEXT: vsll.vi v16, v16, 3
2403 ; RV64-NEXT: csrr a2, vlenb
2404 ; RV64-NEXT: sub a3, a1, a2
2405 ; RV64-NEXT: srli a4, a2, 3
2406 ; RV64-NEXT: vsetvli a5, zero, e8, mf4, ta, ma
2407 ; RV64-NEXT: vslidedown.vx v0, v0, a4
2408 ; RV64-NEXT: sltu a4, a1, a3
2409 ; RV64-NEXT: addi a4, a4, -1
2410 ; RV64-NEXT: and a3, a4, a3
2411 ; RV64-NEXT: vsetvli zero, a3, e64, m8, ta, ma
2412 ; RV64-NEXT: vluxei64.v v16, (a0), v16, v0.t
2413 ; RV64-NEXT: vsetvli a3, zero, e64, m8, ta, ma
2414 ; RV64-NEXT: vsext.vf4 v24, v8
2415 ; RV64-NEXT: vsll.vi v24, v24, 3
2416 ; RV64-NEXT: bltu a1, a2, .LBB104_2
2417 ; RV64-NEXT: # %bb.1:
2418 ; RV64-NEXT: mv a1, a2
2419 ; RV64-NEXT: .LBB104_2:
2420 ; RV64-NEXT: vmv1r.v v0, v12
2421 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2422 ; RV64-NEXT: vluxei64.v v8, (a0), v24, v0.t
2424 %eidxs = sext <vscale x 16 x i16> %idxs to <vscale x 16 x i64>
2425 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 16 x i64> %eidxs
2426 %v = call <vscale x 16 x double> @llvm.vp.gather.nxv16f64.nxv16p0(<vscale x 16 x ptr> %ptrs, <vscale x 16 x i1> %m, i32 %evl)
2427 ret <vscale x 16 x double> %v
2430 define <vscale x 16 x double> @vpgather_baseidx_zext_nxv16i16_nxv16f64(ptr %base, <vscale x 16 x i16> %idxs, <vscale x 16 x i1> %m, i32 zeroext %evl) {
2431 ; RV32-LABEL: vpgather_baseidx_zext_nxv16i16_nxv16f64:
2433 ; RV32-NEXT: vmv1r.v v12, v0
2434 ; RV32-NEXT: vsetvli a2, zero, e32, m8, ta, ma
2435 ; RV32-NEXT: vzext.vf2 v16, v8
2436 ; RV32-NEXT: vsll.vi v24, v16, 3
2437 ; RV32-NEXT: csrr a2, vlenb
2438 ; RV32-NEXT: sub a3, a1, a2
2439 ; RV32-NEXT: srli a4, a2, 3
2440 ; RV32-NEXT: vsetvli a5, zero, e8, mf4, ta, ma
2441 ; RV32-NEXT: vslidedown.vx v0, v0, a4
2442 ; RV32-NEXT: sltu a4, a1, a3
2443 ; RV32-NEXT: addi a4, a4, -1
2444 ; RV32-NEXT: and a3, a4, a3
2445 ; RV32-NEXT: vsetvli zero, a3, e64, m8, ta, ma
2446 ; RV32-NEXT: vluxei32.v v16, (a0), v28, v0.t
2447 ; RV32-NEXT: bltu a1, a2, .LBB105_2
2448 ; RV32-NEXT: # %bb.1:
2449 ; RV32-NEXT: mv a1, a2
2450 ; RV32-NEXT: .LBB105_2:
2451 ; RV32-NEXT: vmv1r.v v0, v12
2452 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2453 ; RV32-NEXT: vluxei32.v v8, (a0), v24, v0.t
2456 ; RV64-LABEL: vpgather_baseidx_zext_nxv16i16_nxv16f64:
2458 ; RV64-NEXT: vmv1r.v v12, v0
2459 ; RV64-NEXT: vsetvli a2, zero, e32, m8, ta, ma
2460 ; RV64-NEXT: vzext.vf2 v16, v8
2461 ; RV64-NEXT: vsll.vi v24, v16, 3
2462 ; RV64-NEXT: csrr a2, vlenb
2463 ; RV64-NEXT: sub a3, a1, a2
2464 ; RV64-NEXT: srli a4, a2, 3
2465 ; RV64-NEXT: vsetvli a5, zero, e8, mf4, ta, ma
2466 ; RV64-NEXT: vslidedown.vx v0, v0, a4
2467 ; RV64-NEXT: sltu a4, a1, a3
2468 ; RV64-NEXT: addi a4, a4, -1
2469 ; RV64-NEXT: and a3, a4, a3
2470 ; RV64-NEXT: vsetvli zero, a3, e64, m8, ta, ma
2471 ; RV64-NEXT: vluxei32.v v16, (a0), v28, v0.t
2472 ; RV64-NEXT: bltu a1, a2, .LBB105_2
2473 ; RV64-NEXT: # %bb.1:
2474 ; RV64-NEXT: mv a1, a2
2475 ; RV64-NEXT: .LBB105_2:
2476 ; RV64-NEXT: vmv1r.v v0, v12
2477 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2478 ; RV64-NEXT: vluxei32.v v8, (a0), v24, v0.t
2480 %eidxs = zext <vscale x 16 x i16> %idxs to <vscale x 16 x i64>
2481 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 16 x i64> %eidxs
2482 %v = call <vscale x 16 x double> @llvm.vp.gather.nxv16f64.nxv16p0(<vscale x 16 x ptr> %ptrs, <vscale x 16 x i1> %m, i32 %evl)
2483 ret <vscale x 16 x double> %v