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 %mhead = insertelement <vscale x 4 x i1> poison, i1 1, i32 0
208 %mtrue = shufflevector <vscale x 4 x i1> %mhead, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
209 %v = call <vscale x 4 x i8> @llvm.vp.gather.nxv4i8.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %mtrue, i32 %evl)
210 ret <vscale x 4 x i8> %v
213 declare <vscale x 8 x i8> @llvm.vp.gather.nxv8i8.nxv8p0(<vscale x 8 x ptr>, <vscale x 8 x i1>, i32)
215 define <vscale x 8 x i8> @vpgather_nxv8i8(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
216 ; RV32-LABEL: vpgather_nxv8i8:
218 ; RV32-NEXT: vsetvli zero, a0, e8, m1, ta, ma
219 ; RV32-NEXT: vluxei32.v v12, (zero), v8, v0.t
220 ; RV32-NEXT: vmv.v.v v8, v12
223 ; RV64-LABEL: vpgather_nxv8i8:
225 ; RV64-NEXT: vsetvli zero, a0, e8, m1, ta, ma
226 ; RV64-NEXT: vluxei64.v v16, (zero), v8, v0.t
227 ; RV64-NEXT: vmv.v.v v8, v16
229 %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)
230 ret <vscale x 8 x i8> %v
233 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) {
234 ; RV32-LABEL: vpgather_baseidx_nxv8i8:
236 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
237 ; RV32-NEXT: vsext.vf4 v12, v8
238 ; RV32-NEXT: vsetvli zero, a1, e8, m1, ta, ma
239 ; RV32-NEXT: vluxei32.v v8, (a0), v12, v0.t
242 ; RV64-LABEL: vpgather_baseidx_nxv8i8:
244 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
245 ; RV64-NEXT: vsext.vf8 v16, v8
246 ; RV64-NEXT: vsetvli zero, a1, e8, m1, ta, ma
247 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
249 %ptrs = getelementptr inbounds i8, ptr %base, <vscale x 8 x i8> %idxs
250 %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)
251 ret <vscale x 8 x i8> %v
254 declare <vscale x 32 x i8> @llvm.vp.gather.nxv32i8.nxv32p0(<vscale x 32 x ptr>, <vscale x 32 x i1>, i32)
256 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) {
257 ; RV32-LABEL: vpgather_baseidx_nxv32i8:
259 ; RV32-NEXT: vmv1r.v v12, v0
260 ; RV32-NEXT: csrr a3, vlenb
261 ; RV32-NEXT: slli a2, a3, 1
262 ; RV32-NEXT: sub a4, a1, a2
263 ; RV32-NEXT: sltu a5, a1, a4
264 ; RV32-NEXT: addi a5, a5, -1
265 ; RV32-NEXT: and a4, a5, a4
266 ; RV32-NEXT: srli a3, a3, 2
267 ; RV32-NEXT: vsetvli a5, zero, e8, mf2, ta, ma
268 ; RV32-NEXT: vslidedown.vx v0, v0, a3
269 ; RV32-NEXT: vsetvli a3, zero, e32, m8, ta, ma
270 ; RV32-NEXT: vsext.vf4 v16, v10
271 ; RV32-NEXT: vsetvli zero, a4, e8, m2, ta, ma
272 ; RV32-NEXT: vluxei32.v v10, (a0), v16, v0.t
273 ; RV32-NEXT: bltu a1, a2, .LBB12_2
274 ; RV32-NEXT: # %bb.1:
275 ; RV32-NEXT: mv a1, a2
276 ; RV32-NEXT: .LBB12_2:
277 ; RV32-NEXT: vsetvli a2, zero, e32, m8, ta, ma
278 ; RV32-NEXT: vsext.vf4 v16, v8
279 ; RV32-NEXT: vsetvli zero, a1, e8, m2, ta, ma
280 ; RV32-NEXT: vmv1r.v v0, v12
281 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
284 ; RV64-LABEL: vpgather_baseidx_nxv32i8:
286 ; RV64-NEXT: vmv1r.v v12, v0
287 ; RV64-NEXT: csrr a2, vlenb
288 ; RV64-NEXT: slli a3, a2, 1
289 ; RV64-NEXT: sub a4, a1, a3
290 ; RV64-NEXT: sltu a5, a1, a4
291 ; RV64-NEXT: addi a5, a5, -1
292 ; RV64-NEXT: and a5, a5, a4
293 ; RV64-NEXT: sub a4, a5, a2
294 ; RV64-NEXT: sltu a6, a5, a4
295 ; RV64-NEXT: addi a6, a6, -1
296 ; RV64-NEXT: and a6, a6, a4
297 ; RV64-NEXT: srli a4, a2, 2
298 ; RV64-NEXT: vsetvli a7, zero, e8, mf2, ta, ma
299 ; RV64-NEXT: vslidedown.vx v13, v0, a4
300 ; RV64-NEXT: srli a4, a2, 3
301 ; RV64-NEXT: vsetvli a7, zero, e8, mf4, ta, ma
302 ; RV64-NEXT: vslidedown.vx v0, v13, a4
303 ; RV64-NEXT: vsetvli a7, zero, e64, m8, ta, ma
304 ; RV64-NEXT: vsext.vf8 v16, v11
305 ; RV64-NEXT: vsetvli zero, a6, e8, m1, ta, ma
306 ; RV64-NEXT: vluxei64.v v11, (a0), v16, v0.t
307 ; RV64-NEXT: bltu a5, a2, .LBB12_2
308 ; RV64-NEXT: # %bb.1:
309 ; RV64-NEXT: mv a5, a2
310 ; RV64-NEXT: .LBB12_2:
311 ; RV64-NEXT: vsetvli a6, zero, e64, m8, ta, ma
312 ; RV64-NEXT: vsext.vf8 v16, v10
313 ; RV64-NEXT: vsetvli zero, a5, e8, m1, ta, ma
314 ; RV64-NEXT: vmv1r.v v0, v13
315 ; RV64-NEXT: vluxei64.v v10, (a0), v16, v0.t
316 ; RV64-NEXT: bltu a1, a3, .LBB12_4
317 ; RV64-NEXT: # %bb.3:
318 ; RV64-NEXT: mv a1, a3
319 ; RV64-NEXT: .LBB12_4:
320 ; RV64-NEXT: sub a3, a1, a2
321 ; RV64-NEXT: sltu a5, a1, a3
322 ; RV64-NEXT: addi a5, a5, -1
323 ; RV64-NEXT: and a3, a5, a3
324 ; RV64-NEXT: vsetvli a5, zero, e8, mf4, ta, ma
325 ; RV64-NEXT: vslidedown.vx v0, v12, a4
326 ; RV64-NEXT: vsetvli a4, zero, e64, m8, ta, ma
327 ; RV64-NEXT: vsext.vf8 v16, v9
328 ; RV64-NEXT: vsetvli zero, a3, e8, m1, ta, ma
329 ; RV64-NEXT: vluxei64.v v9, (a0), v16, v0.t
330 ; RV64-NEXT: bltu a1, a2, .LBB12_6
331 ; RV64-NEXT: # %bb.5:
332 ; RV64-NEXT: mv a1, a2
333 ; RV64-NEXT: .LBB12_6:
334 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
335 ; RV64-NEXT: vsext.vf8 v16, v8
336 ; RV64-NEXT: vsetvli zero, a1, e8, m1, ta, ma
337 ; RV64-NEXT: vmv1r.v v0, v12
338 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
340 %ptrs = getelementptr inbounds i8, ptr %base, <vscale x 32 x i8> %idxs
341 %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)
342 ret <vscale x 32 x i8> %v
345 declare <vscale x 1 x i16> @llvm.vp.gather.nxv1i16.nxv1p0(<vscale x 1 x ptr>, <vscale x 1 x i1>, i32)
347 define <vscale x 1 x i16> @vpgather_nxv1i16(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 zeroext %evl) {
348 ; RV32-LABEL: vpgather_nxv1i16:
350 ; RV32-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
351 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
352 ; RV32-NEXT: vmv1r.v v8, v9
355 ; RV64-LABEL: vpgather_nxv1i16:
357 ; RV64-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
358 ; RV64-NEXT: vluxei64.v v9, (zero), v8, v0.t
359 ; RV64-NEXT: vmv1r.v v8, v9
361 %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)
362 ret <vscale x 1 x i16> %v
365 declare <vscale x 2 x i16> @llvm.vp.gather.nxv2i16.nxv2p0(<vscale x 2 x ptr>, <vscale x 2 x i1>, i32)
367 define <vscale x 2 x i16> @vpgather_nxv2i16(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
368 ; RV32-LABEL: vpgather_nxv2i16:
370 ; RV32-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
371 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
372 ; RV32-NEXT: vmv1r.v v8, v9
375 ; RV64-LABEL: vpgather_nxv2i16:
377 ; RV64-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
378 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
379 ; RV64-NEXT: vmv1r.v v8, v10
381 %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)
382 ret <vscale x 2 x i16> %v
385 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) {
386 ; RV32-LABEL: vpgather_nxv2i16_sextload_nxv2i32:
388 ; RV32-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
389 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
390 ; RV32-NEXT: vsetvli a0, zero, e32, m1, ta, ma
391 ; RV32-NEXT: vsext.vf2 v8, v9
394 ; RV64-LABEL: vpgather_nxv2i16_sextload_nxv2i32:
396 ; RV64-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
397 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
398 ; RV64-NEXT: vsetvli a0, zero, e32, m1, ta, ma
399 ; RV64-NEXT: vsext.vf2 v8, v10
401 %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)
402 %ev = sext <vscale x 2 x i16> %v to <vscale x 2 x i32>
403 ret <vscale x 2 x i32> %ev
406 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) {
407 ; RV32-LABEL: vpgather_nxv2i16_zextload_nxv2i32:
409 ; RV32-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
410 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
411 ; RV32-NEXT: vsetvli a0, zero, e32, m1, ta, ma
412 ; RV32-NEXT: vzext.vf2 v8, v9
415 ; RV64-LABEL: vpgather_nxv2i16_zextload_nxv2i32:
417 ; RV64-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
418 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
419 ; RV64-NEXT: vsetvli a0, zero, e32, m1, ta, ma
420 ; RV64-NEXT: vzext.vf2 v8, v10
422 %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)
423 %ev = zext <vscale x 2 x i16> %v to <vscale x 2 x i32>
424 ret <vscale x 2 x i32> %ev
427 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) {
428 ; RV32-LABEL: vpgather_nxv2i16_sextload_nxv2i64:
430 ; RV32-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
431 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
432 ; RV32-NEXT: vsetvli a0, zero, e64, m2, ta, ma
433 ; RV32-NEXT: vsext.vf4 v8, v10
436 ; RV64-LABEL: vpgather_nxv2i16_sextload_nxv2i64:
438 ; RV64-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
439 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
440 ; RV64-NEXT: vsetvli a0, zero, e64, m2, ta, ma
441 ; RV64-NEXT: vsext.vf4 v8, v10
443 %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)
444 %ev = sext <vscale x 2 x i16> %v to <vscale x 2 x i64>
445 ret <vscale x 2 x i64> %ev
448 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) {
449 ; RV32-LABEL: vpgather_nxv2i16_zextload_nxv2i64:
451 ; RV32-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
452 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
453 ; RV32-NEXT: vsetvli a0, zero, e64, m2, ta, ma
454 ; RV32-NEXT: vzext.vf4 v8, v10
457 ; RV64-LABEL: vpgather_nxv2i16_zextload_nxv2i64:
459 ; RV64-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
460 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
461 ; RV64-NEXT: vsetvli a0, zero, e64, m2, ta, ma
462 ; RV64-NEXT: vzext.vf4 v8, v10
464 %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)
465 %ev = zext <vscale x 2 x i16> %v to <vscale x 2 x i64>
466 ret <vscale x 2 x i64> %ev
469 declare <vscale x 4 x i16> @llvm.vp.gather.nxv4i16.nxv4p0(<vscale x 4 x ptr>, <vscale x 4 x i1>, i32)
471 define <vscale x 4 x i16> @vpgather_nxv4i16(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 zeroext %evl) {
472 ; RV32-LABEL: vpgather_nxv4i16:
474 ; RV32-NEXT: vsetvli zero, a0, e16, m1, ta, ma
475 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
476 ; RV32-NEXT: vmv.v.v v8, v10
479 ; RV64-LABEL: vpgather_nxv4i16:
481 ; RV64-NEXT: vsetvli zero, a0, e16, m1, ta, ma
482 ; RV64-NEXT: vluxei64.v v12, (zero), v8, v0.t
483 ; RV64-NEXT: vmv.v.v v8, v12
485 %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)
486 ret <vscale x 4 x i16> %v
489 define <vscale x 4 x i16> @vpgather_truemask_nxv4i16(<vscale x 4 x ptr> %ptrs, i32 zeroext %evl) {
490 ; RV32-LABEL: vpgather_truemask_nxv4i16:
492 ; RV32-NEXT: vsetvli zero, a0, e16, m1, ta, ma
493 ; RV32-NEXT: vluxei32.v v10, (zero), v8
494 ; RV32-NEXT: vmv.v.v v8, v10
497 ; RV64-LABEL: vpgather_truemask_nxv4i16:
499 ; RV64-NEXT: vsetvli zero, a0, e16, m1, ta, ma
500 ; RV64-NEXT: vluxei64.v v12, (zero), v8
501 ; RV64-NEXT: vmv.v.v v8, v12
503 %mhead = insertelement <vscale x 4 x i1> poison, i1 1, i32 0
504 %mtrue = shufflevector <vscale x 4 x i1> %mhead, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
505 %v = call <vscale x 4 x i16> @llvm.vp.gather.nxv4i16.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %mtrue, i32 %evl)
506 ret <vscale x 4 x i16> %v
509 declare <vscale x 8 x i16> @llvm.vp.gather.nxv8i16.nxv8p0(<vscale x 8 x ptr>, <vscale x 8 x i1>, i32)
511 define <vscale x 8 x i16> @vpgather_nxv8i16(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
512 ; RV32-LABEL: vpgather_nxv8i16:
514 ; RV32-NEXT: vsetvli zero, a0, e16, m2, ta, ma
515 ; RV32-NEXT: vluxei32.v v12, (zero), v8, v0.t
516 ; RV32-NEXT: vmv.v.v v8, v12
519 ; RV64-LABEL: vpgather_nxv8i16:
521 ; RV64-NEXT: vsetvli zero, a0, e16, m2, ta, ma
522 ; RV64-NEXT: vluxei64.v v16, (zero), v8, v0.t
523 ; RV64-NEXT: vmv.v.v v8, v16
525 %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)
526 ret <vscale x 8 x i16> %v
529 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) {
530 ; RV32-LABEL: vpgather_baseidx_nxv8i8_nxv8i16:
532 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
533 ; RV32-NEXT: vsext.vf4 v12, v8
534 ; RV32-NEXT: vadd.vv v12, v12, v12
535 ; RV32-NEXT: vsetvli zero, a1, e16, m2, ta, ma
536 ; RV32-NEXT: vluxei32.v v8, (a0), v12, v0.t
539 ; RV64-LABEL: vpgather_baseidx_nxv8i8_nxv8i16:
541 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
542 ; RV64-NEXT: vsext.vf8 v16, v8
543 ; RV64-NEXT: vadd.vv v16, v16, v16
544 ; RV64-NEXT: vsetvli zero, a1, e16, m2, ta, ma
545 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
547 %ptrs = getelementptr inbounds i16, ptr %base, <vscale x 8 x i8> %idxs
548 %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)
549 ret <vscale x 8 x i16> %v
552 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) {
553 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8i16:
555 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
556 ; RV32-NEXT: vsext.vf4 v12, v8
557 ; RV32-NEXT: vadd.vv v12, v12, v12
558 ; RV32-NEXT: vsetvli zero, a1, e16, m2, ta, ma
559 ; RV32-NEXT: vluxei32.v v8, (a0), v12, v0.t
562 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8i16:
564 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
565 ; RV64-NEXT: vsext.vf8 v16, v8
566 ; RV64-NEXT: vadd.vv v16, v16, v16
567 ; RV64-NEXT: vsetvli zero, a1, e16, m2, ta, ma
568 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
570 %eidxs = sext <vscale x 8 x i8> %idxs to <vscale x 8 x i16>
571 %ptrs = getelementptr inbounds i16, ptr %base, <vscale x 8 x i16> %eidxs
572 %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)
573 ret <vscale x 8 x i16> %v
576 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) {
577 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8i16:
579 ; RV32-NEXT: vsetvli a2, zero, e8, m1, ta, ma
580 ; RV32-NEXT: vwaddu.vv v10, v8, v8
581 ; RV32-NEXT: vsetvli zero, a1, e16, m2, ta, ma
582 ; RV32-NEXT: vluxei16.v v8, (a0), v10, v0.t
585 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8i16:
587 ; RV64-NEXT: vsetvli a2, zero, e8, m1, ta, ma
588 ; RV64-NEXT: vwaddu.vv v10, v8, v8
589 ; RV64-NEXT: vsetvli zero, a1, e16, m2, ta, ma
590 ; RV64-NEXT: vluxei16.v v8, (a0), v10, v0.t
592 %eidxs = zext <vscale x 8 x i8> %idxs to <vscale x 8 x i16>
593 %ptrs = getelementptr inbounds i16, ptr %base, <vscale x 8 x i16> %eidxs
594 %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)
595 ret <vscale x 8 x i16> %v
598 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) {
599 ; RV32-LABEL: vpgather_baseidx_nxv8i16:
601 ; RV32-NEXT: vsetvli a2, zero, e16, m2, ta, ma
602 ; RV32-NEXT: vwadd.vv v12, v8, v8
603 ; RV32-NEXT: vsetvli zero, a1, e16, m2, ta, ma
604 ; RV32-NEXT: vluxei32.v v8, (a0), v12, v0.t
607 ; RV64-LABEL: vpgather_baseidx_nxv8i16:
609 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
610 ; RV64-NEXT: vsext.vf4 v16, v8
611 ; RV64-NEXT: vadd.vv v16, v16, v16
612 ; RV64-NEXT: vsetvli zero, a1, e16, m2, ta, ma
613 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
615 %ptrs = getelementptr inbounds i16, ptr %base, <vscale x 8 x i16> %idxs
616 %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)
617 ret <vscale x 8 x i16> %v
620 declare <vscale x 1 x i32> @llvm.vp.gather.nxv1i32.nxv1p0(<vscale x 1 x ptr>, <vscale x 1 x i1>, i32)
622 define <vscale x 1 x i32> @vpgather_nxv1i32(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 zeroext %evl) {
623 ; RV32-LABEL: vpgather_nxv1i32:
625 ; RV32-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
626 ; RV32-NEXT: vluxei32.v v8, (zero), v8, v0.t
629 ; RV64-LABEL: vpgather_nxv1i32:
631 ; RV64-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
632 ; RV64-NEXT: vluxei64.v v9, (zero), v8, v0.t
633 ; RV64-NEXT: vmv1r.v v8, v9
635 %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)
636 ret <vscale x 1 x i32> %v
639 declare <vscale x 2 x i32> @llvm.vp.gather.nxv2i32.nxv2p0(<vscale x 2 x ptr>, <vscale x 2 x i1>, i32)
641 define <vscale x 2 x i32> @vpgather_nxv2i32(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
642 ; RV32-LABEL: vpgather_nxv2i32:
644 ; RV32-NEXT: vsetvli zero, a0, e32, m1, ta, ma
645 ; RV32-NEXT: vluxei32.v v8, (zero), v8, v0.t
648 ; RV64-LABEL: vpgather_nxv2i32:
650 ; RV64-NEXT: vsetvli zero, a0, e32, m1, ta, ma
651 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
652 ; RV64-NEXT: vmv.v.v v8, v10
654 %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)
655 ret <vscale x 2 x i32> %v
658 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) {
659 ; RV32-LABEL: vpgather_nxv2i32_sextload_nxv2i64:
661 ; RV32-NEXT: vsetvli zero, a0, e32, m1, ta, ma
662 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
663 ; RV32-NEXT: vsetvli a0, zero, e64, m2, ta, ma
664 ; RV32-NEXT: vsext.vf2 v8, v10
667 ; RV64-LABEL: vpgather_nxv2i32_sextload_nxv2i64:
669 ; RV64-NEXT: vsetvli zero, a0, e32, m1, ta, ma
670 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
671 ; RV64-NEXT: vsetvli a0, zero, e64, m2, ta, ma
672 ; RV64-NEXT: vsext.vf2 v8, v10
674 %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)
675 %ev = sext <vscale x 2 x i32> %v to <vscale x 2 x i64>
676 ret <vscale x 2 x i64> %ev
679 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) {
680 ; RV32-LABEL: vpgather_nxv2i32_zextload_nxv2i64:
682 ; RV32-NEXT: vsetvli zero, a0, e32, m1, ta, ma
683 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
684 ; RV32-NEXT: vsetvli a0, zero, e64, m2, ta, ma
685 ; RV32-NEXT: vzext.vf2 v8, v10
688 ; RV64-LABEL: vpgather_nxv2i32_zextload_nxv2i64:
690 ; RV64-NEXT: vsetvli zero, a0, e32, m1, ta, ma
691 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
692 ; RV64-NEXT: vsetvli a0, zero, e64, m2, ta, ma
693 ; RV64-NEXT: vzext.vf2 v8, v10
695 %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)
696 %ev = zext <vscale x 2 x i32> %v to <vscale x 2 x i64>
697 ret <vscale x 2 x i64> %ev
700 declare <vscale x 4 x i32> @llvm.vp.gather.nxv4i32.nxv4p0(<vscale x 4 x ptr>, <vscale x 4 x i1>, i32)
702 define <vscale x 4 x i32> @vpgather_nxv4i32(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 zeroext %evl) {
703 ; RV32-LABEL: vpgather_nxv4i32:
705 ; RV32-NEXT: vsetvli zero, a0, e32, m2, ta, ma
706 ; RV32-NEXT: vluxei32.v v8, (zero), v8, v0.t
709 ; RV64-LABEL: vpgather_nxv4i32:
711 ; RV64-NEXT: vsetvli zero, a0, e32, m2, ta, ma
712 ; RV64-NEXT: vluxei64.v v12, (zero), v8, v0.t
713 ; RV64-NEXT: vmv.v.v v8, v12
715 %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)
716 ret <vscale x 4 x i32> %v
719 define <vscale x 4 x i32> @vpgather_truemask_nxv4i32(<vscale x 4 x ptr> %ptrs, i32 zeroext %evl) {
720 ; RV32-LABEL: vpgather_truemask_nxv4i32:
722 ; RV32-NEXT: vsetvli zero, a0, e32, m2, ta, ma
723 ; RV32-NEXT: vluxei32.v v8, (zero), v8
726 ; RV64-LABEL: vpgather_truemask_nxv4i32:
728 ; RV64-NEXT: vsetvli zero, a0, e32, m2, ta, ma
729 ; RV64-NEXT: vluxei64.v v12, (zero), v8
730 ; RV64-NEXT: vmv.v.v v8, v12
732 %mhead = insertelement <vscale x 4 x i1> poison, i1 1, i32 0
733 %mtrue = shufflevector <vscale x 4 x i1> %mhead, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
734 %v = call <vscale x 4 x i32> @llvm.vp.gather.nxv4i32.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %mtrue, i32 %evl)
735 ret <vscale x 4 x i32> %v
738 declare <vscale x 8 x i32> @llvm.vp.gather.nxv8i32.nxv8p0(<vscale x 8 x ptr>, <vscale x 8 x i1>, i32)
740 define <vscale x 8 x i32> @vpgather_nxv8i32(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
741 ; RV32-LABEL: vpgather_nxv8i32:
743 ; RV32-NEXT: vsetvli zero, a0, e32, m4, ta, ma
744 ; RV32-NEXT: vluxei32.v v8, (zero), v8, v0.t
747 ; RV64-LABEL: vpgather_nxv8i32:
749 ; RV64-NEXT: vsetvli zero, a0, e32, m4, ta, ma
750 ; RV64-NEXT: vluxei64.v v16, (zero), v8, v0.t
751 ; RV64-NEXT: vmv.v.v v8, v16
753 %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)
754 ret <vscale x 8 x i32> %v
757 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) {
758 ; RV32-LABEL: vpgather_baseidx_nxv8i8_nxv8i32:
760 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
761 ; RV32-NEXT: vsext.vf4 v12, v8
762 ; RV32-NEXT: vsll.vi v8, v12, 2
763 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
764 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
767 ; RV64-LABEL: vpgather_baseidx_nxv8i8_nxv8i32:
769 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
770 ; RV64-NEXT: vsext.vf8 v16, v8
771 ; RV64-NEXT: vsll.vi v16, v16, 2
772 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
773 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
775 %ptrs = getelementptr inbounds i32, ptr %base, <vscale x 8 x i8> %idxs
776 %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)
777 ret <vscale x 8 x i32> %v
780 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) {
781 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8i32:
783 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
784 ; RV32-NEXT: vsext.vf4 v12, v8
785 ; RV32-NEXT: vsll.vi v8, v12, 2
786 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
787 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
790 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8i32:
792 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
793 ; RV64-NEXT: vsext.vf8 v16, v8
794 ; RV64-NEXT: vsll.vi v16, v16, 2
795 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
796 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
798 %eidxs = sext <vscale x 8 x i8> %idxs to <vscale x 8 x i32>
799 %ptrs = getelementptr inbounds i32, ptr %base, <vscale x 8 x i32> %eidxs
800 %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)
801 ret <vscale x 8 x i32> %v
804 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) {
805 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8i32:
807 ; RV32-NEXT: vsetvli a2, zero, e16, m2, ta, ma
808 ; RV32-NEXT: vzext.vf2 v10, v8
809 ; RV32-NEXT: vsll.vi v12, v10, 2
810 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
811 ; RV32-NEXT: vluxei16.v v8, (a0), v12, v0.t
814 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8i32:
816 ; RV64-NEXT: vsetvli a2, zero, e16, m2, ta, ma
817 ; RV64-NEXT: vzext.vf2 v10, v8
818 ; RV64-NEXT: vsll.vi v12, v10, 2
819 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
820 ; RV64-NEXT: vluxei16.v v8, (a0), v12, v0.t
822 %eidxs = zext <vscale x 8 x i8> %idxs to <vscale x 8 x i32>
823 %ptrs = getelementptr inbounds i32, ptr %base, <vscale x 8 x i32> %eidxs
824 %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)
825 ret <vscale x 8 x i32> %v
828 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) {
829 ; RV32-LABEL: vpgather_baseidx_nxv8i16_nxv8i32:
831 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
832 ; RV32-NEXT: vsext.vf2 v12, v8
833 ; RV32-NEXT: vsll.vi v8, v12, 2
834 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
835 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
838 ; RV64-LABEL: vpgather_baseidx_nxv8i16_nxv8i32:
840 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
841 ; RV64-NEXT: vsext.vf4 v16, v8
842 ; RV64-NEXT: vsll.vi v16, v16, 2
843 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
844 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
846 %ptrs = getelementptr inbounds i32, ptr %base, <vscale x 8 x i16> %idxs
847 %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)
848 ret <vscale x 8 x i32> %v
851 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) {
852 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i16_nxv8i32:
854 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
855 ; RV32-NEXT: vsext.vf2 v12, v8
856 ; RV32-NEXT: vsll.vi v8, v12, 2
857 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
858 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
861 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i16_nxv8i32:
863 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
864 ; RV64-NEXT: vsext.vf4 v16, v8
865 ; RV64-NEXT: vsll.vi v16, v16, 2
866 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
867 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
869 %eidxs = sext <vscale x 8 x i16> %idxs to <vscale x 8 x i32>
870 %ptrs = getelementptr inbounds i32, ptr %base, <vscale x 8 x i32> %eidxs
871 %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)
872 ret <vscale x 8 x i32> %v
875 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) {
876 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i16_nxv8i32:
878 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
879 ; RV32-NEXT: vzext.vf2 v12, v8
880 ; RV32-NEXT: vsll.vi v8, v12, 2
881 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
882 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
885 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i16_nxv8i32:
887 ; RV64-NEXT: vsetvli a2, zero, e32, m4, ta, ma
888 ; RV64-NEXT: vzext.vf2 v12, v8
889 ; RV64-NEXT: vsll.vi v8, v12, 2
890 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
891 ; RV64-NEXT: vluxei32.v v8, (a0), v8, v0.t
893 %eidxs = zext <vscale x 8 x i16> %idxs to <vscale x 8 x i32>
894 %ptrs = getelementptr inbounds i32, ptr %base, <vscale x 8 x i32> %eidxs
895 %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)
896 ret <vscale x 8 x i32> %v
899 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) {
900 ; RV32-LABEL: vpgather_baseidx_nxv8i32:
902 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
903 ; RV32-NEXT: vsll.vi v8, v8, 2
904 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
905 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
908 ; RV64-LABEL: vpgather_baseidx_nxv8i32:
910 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
911 ; RV64-NEXT: vsext.vf2 v16, v8
912 ; RV64-NEXT: vsll.vi v16, v16, 2
913 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
914 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
916 %ptrs = getelementptr inbounds i32, ptr %base, <vscale x 8 x i32> %idxs
917 %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)
918 ret <vscale x 8 x i32> %v
921 declare <vscale x 1 x i64> @llvm.vp.gather.nxv1i64.nxv1p0(<vscale x 1 x ptr>, <vscale x 1 x i1>, i32)
923 define <vscale x 1 x i64> @vpgather_nxv1i64(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 zeroext %evl) {
924 ; RV32-LABEL: vpgather_nxv1i64:
926 ; RV32-NEXT: vsetvli zero, a0, e64, m1, ta, ma
927 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
928 ; RV32-NEXT: vmv.v.v v8, v9
931 ; RV64-LABEL: vpgather_nxv1i64:
933 ; RV64-NEXT: vsetvli zero, a0, e64, m1, ta, ma
934 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
936 %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)
937 ret <vscale x 1 x i64> %v
940 declare <vscale x 2 x i64> @llvm.vp.gather.nxv2i64.nxv2p0(<vscale x 2 x ptr>, <vscale x 2 x i1>, i32)
942 define <vscale x 2 x i64> @vpgather_nxv2i64(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
943 ; RV32-LABEL: vpgather_nxv2i64:
945 ; RV32-NEXT: vsetvli zero, a0, e64, m2, ta, ma
946 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
947 ; RV32-NEXT: vmv.v.v v8, v10
950 ; RV64-LABEL: vpgather_nxv2i64:
952 ; RV64-NEXT: vsetvli zero, a0, e64, m2, ta, ma
953 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
955 %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)
956 ret <vscale x 2 x i64> %v
959 declare <vscale x 4 x i64> @llvm.vp.gather.nxv4i64.nxv4p0(<vscale x 4 x ptr>, <vscale x 4 x i1>, i32)
961 define <vscale x 4 x i64> @vpgather_nxv4i64(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 zeroext %evl) {
962 ; RV32-LABEL: vpgather_nxv4i64:
964 ; RV32-NEXT: vsetvli zero, a0, e64, m4, ta, ma
965 ; RV32-NEXT: vluxei32.v v12, (zero), v8, v0.t
966 ; RV32-NEXT: vmv.v.v v8, v12
969 ; RV64-LABEL: vpgather_nxv4i64:
971 ; RV64-NEXT: vsetvli zero, a0, e64, m4, ta, ma
972 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
974 %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)
975 ret <vscale x 4 x i64> %v
978 define <vscale x 4 x i64> @vpgather_truemask_nxv4i64(<vscale x 4 x ptr> %ptrs, i32 zeroext %evl) {
979 ; RV32-LABEL: vpgather_truemask_nxv4i64:
981 ; RV32-NEXT: vsetvli zero, a0, e64, m4, ta, ma
982 ; RV32-NEXT: vluxei32.v v12, (zero), v8
983 ; RV32-NEXT: vmv.v.v v8, v12
986 ; RV64-LABEL: vpgather_truemask_nxv4i64:
988 ; RV64-NEXT: vsetvli zero, a0, e64, m4, ta, ma
989 ; RV64-NEXT: vluxei64.v v8, (zero), v8
991 %mhead = insertelement <vscale x 4 x i1> poison, i1 1, i32 0
992 %mtrue = shufflevector <vscale x 4 x i1> %mhead, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
993 %v = call <vscale x 4 x i64> @llvm.vp.gather.nxv4i64.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %mtrue, i32 %evl)
994 ret <vscale x 4 x i64> %v
997 declare <vscale x 8 x i64> @llvm.vp.gather.nxv8i64.nxv8p0(<vscale x 8 x ptr>, <vscale x 8 x i1>, i32)
999 define <vscale x 8 x i64> @vpgather_nxv8i64(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1000 ; RV32-LABEL: vpgather_nxv8i64:
1002 ; RV32-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1003 ; RV32-NEXT: vluxei32.v v16, (zero), v8, v0.t
1004 ; RV32-NEXT: vmv.v.v v8, v16
1007 ; RV64-LABEL: vpgather_nxv8i64:
1009 ; RV64-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1010 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
1012 %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)
1013 ret <vscale x 8 x i64> %v
1016 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) {
1017 ; RV32-LABEL: vpgather_baseidx_nxv8i8_nxv8i64:
1019 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1020 ; RV32-NEXT: vsext.vf4 v12, v8
1021 ; RV32-NEXT: vsll.vi v16, v12, 3
1022 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1023 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1026 ; RV64-LABEL: vpgather_baseidx_nxv8i8_nxv8i64:
1028 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1029 ; RV64-NEXT: vsext.vf8 v16, v8
1030 ; RV64-NEXT: vsll.vi v8, v16, 3
1031 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1032 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1034 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i8> %idxs
1035 %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)
1036 ret <vscale x 8 x i64> %v
1039 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) {
1040 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8i64:
1042 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1043 ; RV32-NEXT: vsext.vf4 v12, v8
1044 ; RV32-NEXT: vsll.vi v16, v12, 3
1045 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1046 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1049 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8i64:
1051 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1052 ; RV64-NEXT: vsext.vf8 v16, v8
1053 ; RV64-NEXT: vsll.vi v8, v16, 3
1054 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1055 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1057 %eidxs = sext <vscale x 8 x i8> %idxs to <vscale x 8 x i64>
1058 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i64> %eidxs
1059 %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)
1060 ret <vscale x 8 x i64> %v
1063 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) {
1064 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8i64:
1066 ; RV32-NEXT: vsetvli a2, zero, e16, m2, ta, ma
1067 ; RV32-NEXT: vzext.vf2 v10, v8
1068 ; RV32-NEXT: vsll.vi v16, v10, 3
1069 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1070 ; RV32-NEXT: vluxei16.v v8, (a0), v16, v0.t
1073 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8i64:
1075 ; RV64-NEXT: vsetvli a2, zero, e16, m2, ta, ma
1076 ; RV64-NEXT: vzext.vf2 v10, v8
1077 ; RV64-NEXT: vsll.vi v16, v10, 3
1078 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1079 ; RV64-NEXT: vluxei16.v v8, (a0), v16, v0.t
1081 %eidxs = zext <vscale x 8 x i8> %idxs to <vscale x 8 x i64>
1082 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i64> %eidxs
1083 %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)
1084 ret <vscale x 8 x i64> %v
1087 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) {
1088 ; RV32-LABEL: vpgather_baseidx_nxv8i16_nxv8i64:
1090 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1091 ; RV32-NEXT: vsext.vf2 v12, v8
1092 ; RV32-NEXT: vsll.vi v16, v12, 3
1093 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1094 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1097 ; RV64-LABEL: vpgather_baseidx_nxv8i16_nxv8i64:
1099 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1100 ; RV64-NEXT: vsext.vf4 v16, v8
1101 ; RV64-NEXT: vsll.vi v8, v16, 3
1102 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1103 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1105 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i16> %idxs
1106 %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)
1107 ret <vscale x 8 x i64> %v
1110 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) {
1111 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i16_nxv8i64:
1113 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1114 ; RV32-NEXT: vsext.vf2 v12, v8
1115 ; RV32-NEXT: vsll.vi v16, v12, 3
1116 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1117 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1120 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i16_nxv8i64:
1122 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1123 ; RV64-NEXT: vsext.vf4 v16, v8
1124 ; RV64-NEXT: vsll.vi v8, v16, 3
1125 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1126 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1128 %eidxs = sext <vscale x 8 x i16> %idxs to <vscale x 8 x i64>
1129 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i64> %eidxs
1130 %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)
1131 ret <vscale x 8 x i64> %v
1134 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) {
1135 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i16_nxv8i64:
1137 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1138 ; RV32-NEXT: vzext.vf2 v12, v8
1139 ; RV32-NEXT: vsll.vi v16, v12, 3
1140 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1141 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1144 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i16_nxv8i64:
1146 ; RV64-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1147 ; RV64-NEXT: vzext.vf2 v12, v8
1148 ; RV64-NEXT: vsll.vi v16, v12, 3
1149 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1150 ; RV64-NEXT: vluxei32.v v8, (a0), v16, v0.t
1152 %eidxs = zext <vscale x 8 x i16> %idxs to <vscale x 8 x i64>
1153 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i64> %eidxs
1154 %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)
1155 ret <vscale x 8 x i64> %v
1158 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) {
1159 ; RV32-LABEL: vpgather_baseidx_nxv8i32_nxv8i64:
1161 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1162 ; RV32-NEXT: vsll.vi v16, v8, 3
1163 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1164 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1167 ; RV64-LABEL: vpgather_baseidx_nxv8i32_nxv8i64:
1169 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1170 ; RV64-NEXT: vsext.vf2 v16, v8
1171 ; RV64-NEXT: vsll.vi v8, v16, 3
1172 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1173 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1175 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i32> %idxs
1176 %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)
1177 ret <vscale x 8 x i64> %v
1180 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) {
1181 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i32_nxv8i64:
1183 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1184 ; RV32-NEXT: vsll.vi v16, v8, 3
1185 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1186 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1189 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i32_nxv8i64:
1191 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1192 ; RV64-NEXT: vsext.vf2 v16, v8
1193 ; RV64-NEXT: vsll.vi v8, v16, 3
1194 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1195 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1197 %eidxs = sext <vscale x 8 x i32> %idxs to <vscale x 8 x i64>
1198 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i64> %eidxs
1199 %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)
1200 ret <vscale x 8 x i64> %v
1203 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) {
1204 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i32_nxv8i64:
1206 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1207 ; RV32-NEXT: vsll.vi v16, v8, 3
1208 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1209 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1212 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i32_nxv8i64:
1214 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1215 ; RV64-NEXT: vzext.vf2 v16, v8
1216 ; RV64-NEXT: vsll.vi v8, v16, 3
1217 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1218 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1220 %eidxs = zext <vscale x 8 x i32> %idxs to <vscale x 8 x i64>
1221 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i64> %eidxs
1222 %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)
1223 ret <vscale x 8 x i64> %v
1226 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) {
1227 ; RV32-LABEL: vpgather_baseidx_nxv8i64:
1229 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1230 ; RV32-NEXT: vnsrl.wi v16, v8, 0
1231 ; RV32-NEXT: vsll.vi v16, v16, 3
1232 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1233 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1236 ; RV64-LABEL: vpgather_baseidx_nxv8i64:
1238 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1239 ; RV64-NEXT: vsll.vi v8, v8, 3
1240 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1241 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1243 %ptrs = getelementptr inbounds i64, ptr %base, <vscale x 8 x i64> %idxs
1244 %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)
1245 ret <vscale x 8 x i64> %v
1248 declare <vscale x 1 x half> @llvm.vp.gather.nxv1f16.nxv1p0(<vscale x 1 x ptr>, <vscale x 1 x i1>, i32)
1250 define <vscale x 1 x half> @vpgather_nxv1f16(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1251 ; RV32-LABEL: vpgather_nxv1f16:
1253 ; RV32-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
1254 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
1255 ; RV32-NEXT: vmv1r.v v8, v9
1258 ; RV64-LABEL: vpgather_nxv1f16:
1260 ; RV64-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
1261 ; RV64-NEXT: vluxei64.v v9, (zero), v8, v0.t
1262 ; RV64-NEXT: vmv1r.v v8, v9
1264 %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)
1265 ret <vscale x 1 x half> %v
1268 declare <vscale x 2 x half> @llvm.vp.gather.nxv2f16.nxv2p0(<vscale x 2 x ptr>, <vscale x 2 x i1>, i32)
1270 define <vscale x 2 x half> @vpgather_nxv2f16(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1271 ; RV32-LABEL: vpgather_nxv2f16:
1273 ; RV32-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
1274 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
1275 ; RV32-NEXT: vmv1r.v v8, v9
1278 ; RV64-LABEL: vpgather_nxv2f16:
1280 ; RV64-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
1281 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
1282 ; RV64-NEXT: vmv1r.v v8, v10
1284 %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)
1285 ret <vscale x 2 x half> %v
1288 declare <vscale x 4 x half> @llvm.vp.gather.nxv4f16.nxv4p0(<vscale x 4 x ptr>, <vscale x 4 x i1>, i32)
1290 define <vscale x 4 x half> @vpgather_nxv4f16(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1291 ; RV32-LABEL: vpgather_nxv4f16:
1293 ; RV32-NEXT: vsetvli zero, a0, e16, m1, ta, ma
1294 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
1295 ; RV32-NEXT: vmv.v.v v8, v10
1298 ; RV64-LABEL: vpgather_nxv4f16:
1300 ; RV64-NEXT: vsetvli zero, a0, e16, m1, ta, ma
1301 ; RV64-NEXT: vluxei64.v v12, (zero), v8, v0.t
1302 ; RV64-NEXT: vmv.v.v v8, v12
1304 %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)
1305 ret <vscale x 4 x half> %v
1308 define <vscale x 4 x half> @vpgather_truemask_nxv4f16(<vscale x 4 x ptr> %ptrs, i32 zeroext %evl) {
1309 ; RV32-LABEL: vpgather_truemask_nxv4f16:
1311 ; RV32-NEXT: vsetvli zero, a0, e16, m1, ta, ma
1312 ; RV32-NEXT: vluxei32.v v10, (zero), v8
1313 ; RV32-NEXT: vmv.v.v v8, v10
1316 ; RV64-LABEL: vpgather_truemask_nxv4f16:
1318 ; RV64-NEXT: vsetvli zero, a0, e16, m1, ta, ma
1319 ; RV64-NEXT: vluxei64.v v12, (zero), v8
1320 ; RV64-NEXT: vmv.v.v v8, v12
1322 %mhead = insertelement <vscale x 4 x i1> poison, i1 1, i32 0
1323 %mtrue = shufflevector <vscale x 4 x i1> %mhead, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
1324 %v = call <vscale x 4 x half> @llvm.vp.gather.nxv4f16.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %mtrue, i32 %evl)
1325 ret <vscale x 4 x half> %v
1328 declare <vscale x 8 x half> @llvm.vp.gather.nxv8f16.nxv8p0(<vscale x 8 x ptr>, <vscale x 8 x i1>, i32)
1330 define <vscale x 8 x half> @vpgather_nxv8f16(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1331 ; RV32-LABEL: vpgather_nxv8f16:
1333 ; RV32-NEXT: vsetvli zero, a0, e16, m2, ta, ma
1334 ; RV32-NEXT: vluxei32.v v12, (zero), v8, v0.t
1335 ; RV32-NEXT: vmv.v.v v8, v12
1338 ; RV64-LABEL: vpgather_nxv8f16:
1340 ; RV64-NEXT: vsetvli zero, a0, e16, m2, ta, ma
1341 ; RV64-NEXT: vluxei64.v v16, (zero), v8, v0.t
1342 ; RV64-NEXT: vmv.v.v v8, v16
1344 %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)
1345 ret <vscale x 8 x half> %v
1348 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) {
1349 ; RV32-LABEL: vpgather_baseidx_nxv8i8_nxv8f16:
1351 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1352 ; RV32-NEXT: vsext.vf4 v12, v8
1353 ; RV32-NEXT: vadd.vv v12, v12, v12
1354 ; RV32-NEXT: vsetvli zero, a1, e16, m2, ta, ma
1355 ; RV32-NEXT: vluxei32.v v8, (a0), v12, v0.t
1358 ; RV64-LABEL: vpgather_baseidx_nxv8i8_nxv8f16:
1360 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1361 ; RV64-NEXT: vsext.vf8 v16, v8
1362 ; RV64-NEXT: vadd.vv v16, v16, v16
1363 ; RV64-NEXT: vsetvli zero, a1, e16, m2, ta, ma
1364 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
1366 %ptrs = getelementptr inbounds half, ptr %base, <vscale x 8 x i8> %idxs
1367 %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)
1368 ret <vscale x 8 x half> %v
1371 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) {
1372 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8f16:
1374 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1375 ; RV32-NEXT: vsext.vf4 v12, v8
1376 ; RV32-NEXT: vadd.vv v12, v12, v12
1377 ; RV32-NEXT: vsetvli zero, a1, e16, m2, ta, ma
1378 ; RV32-NEXT: vluxei32.v v8, (a0), v12, v0.t
1381 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8f16:
1383 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1384 ; RV64-NEXT: vsext.vf8 v16, v8
1385 ; RV64-NEXT: vadd.vv v16, v16, v16
1386 ; RV64-NEXT: vsetvli zero, a1, e16, m2, ta, ma
1387 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
1389 %eidxs = sext <vscale x 8 x i8> %idxs to <vscale x 8 x i16>
1390 %ptrs = getelementptr inbounds half, ptr %base, <vscale x 8 x i16> %eidxs
1391 %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)
1392 ret <vscale x 8 x half> %v
1395 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) {
1396 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8f16:
1398 ; RV32-NEXT: vsetvli a2, zero, e8, m1, ta, ma
1399 ; RV32-NEXT: vwaddu.vv v10, v8, v8
1400 ; RV32-NEXT: vsetvli zero, a1, e16, m2, ta, ma
1401 ; RV32-NEXT: vluxei16.v v8, (a0), v10, v0.t
1404 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8f16:
1406 ; RV64-NEXT: vsetvli a2, zero, e8, m1, ta, ma
1407 ; RV64-NEXT: vwaddu.vv v10, v8, v8
1408 ; RV64-NEXT: vsetvli zero, a1, e16, m2, ta, ma
1409 ; RV64-NEXT: vluxei16.v v8, (a0), v10, v0.t
1411 %eidxs = zext <vscale x 8 x i8> %idxs to <vscale x 8 x i16>
1412 %ptrs = getelementptr inbounds half, ptr %base, <vscale x 8 x i16> %eidxs
1413 %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)
1414 ret <vscale x 8 x half> %v
1417 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) {
1418 ; RV32-LABEL: vpgather_baseidx_nxv8f16:
1420 ; RV32-NEXT: vsetvli a2, zero, e16, m2, ta, ma
1421 ; RV32-NEXT: vwadd.vv v12, v8, v8
1422 ; RV32-NEXT: vsetvli zero, a1, e16, m2, ta, ma
1423 ; RV32-NEXT: vluxei32.v v8, (a0), v12, v0.t
1426 ; RV64-LABEL: vpgather_baseidx_nxv8f16:
1428 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1429 ; RV64-NEXT: vsext.vf4 v16, v8
1430 ; RV64-NEXT: vadd.vv v16, v16, v16
1431 ; RV64-NEXT: vsetvli zero, a1, e16, m2, ta, ma
1432 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
1434 %ptrs = getelementptr inbounds half, ptr %base, <vscale x 8 x i16> %idxs
1435 %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)
1436 ret <vscale x 8 x half> %v
1439 declare <vscale x 1 x float> @llvm.vp.gather.nxv1f32.nxv1p0(<vscale x 1 x ptr>, <vscale x 1 x i1>, i32)
1441 define <vscale x 1 x float> @vpgather_nxv1f32(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1442 ; RV32-LABEL: vpgather_nxv1f32:
1444 ; RV32-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
1445 ; RV32-NEXT: vluxei32.v v8, (zero), v8, v0.t
1448 ; RV64-LABEL: vpgather_nxv1f32:
1450 ; RV64-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
1451 ; RV64-NEXT: vluxei64.v v9, (zero), v8, v0.t
1452 ; RV64-NEXT: vmv1r.v v8, v9
1454 %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)
1455 ret <vscale x 1 x float> %v
1458 declare <vscale x 2 x float> @llvm.vp.gather.nxv2f32.nxv2p0(<vscale x 2 x ptr>, <vscale x 2 x i1>, i32)
1460 define <vscale x 2 x float> @vpgather_nxv2f32(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1461 ; RV32-LABEL: vpgather_nxv2f32:
1463 ; RV32-NEXT: vsetvli zero, a0, e32, m1, ta, ma
1464 ; RV32-NEXT: vluxei32.v v8, (zero), v8, v0.t
1467 ; RV64-LABEL: vpgather_nxv2f32:
1469 ; RV64-NEXT: vsetvli zero, a0, e32, m1, ta, ma
1470 ; RV64-NEXT: vluxei64.v v10, (zero), v8, v0.t
1471 ; RV64-NEXT: vmv.v.v v8, v10
1473 %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)
1474 ret <vscale x 2 x float> %v
1477 declare <vscale x 4 x float> @llvm.vp.gather.nxv4f32.nxv4p0(<vscale x 4 x ptr>, <vscale x 4 x i1>, i32)
1479 define <vscale x 4 x float> @vpgather_nxv4f32(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1480 ; RV32-LABEL: vpgather_nxv4f32:
1482 ; RV32-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1483 ; RV32-NEXT: vluxei32.v v8, (zero), v8, v0.t
1486 ; RV64-LABEL: vpgather_nxv4f32:
1488 ; RV64-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1489 ; RV64-NEXT: vluxei64.v v12, (zero), v8, v0.t
1490 ; RV64-NEXT: vmv.v.v v8, v12
1492 %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)
1493 ret <vscale x 4 x float> %v
1496 define <vscale x 4 x float> @vpgather_truemask_nxv4f32(<vscale x 4 x ptr> %ptrs, i32 zeroext %evl) {
1497 ; RV32-LABEL: vpgather_truemask_nxv4f32:
1499 ; RV32-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1500 ; RV32-NEXT: vluxei32.v v8, (zero), v8
1503 ; RV64-LABEL: vpgather_truemask_nxv4f32:
1505 ; RV64-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1506 ; RV64-NEXT: vluxei64.v v12, (zero), v8
1507 ; RV64-NEXT: vmv.v.v v8, v12
1509 %mhead = insertelement <vscale x 4 x i1> poison, i1 1, i32 0
1510 %mtrue = shufflevector <vscale x 4 x i1> %mhead, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
1511 %v = call <vscale x 4 x float> @llvm.vp.gather.nxv4f32.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %mtrue, i32 %evl)
1512 ret <vscale x 4 x float> %v
1515 declare <vscale x 8 x float> @llvm.vp.gather.nxv8f32.nxv8p0(<vscale x 8 x ptr>, <vscale x 8 x i1>, i32)
1517 define <vscale x 8 x float> @vpgather_nxv8f32(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1518 ; RV32-LABEL: vpgather_nxv8f32:
1520 ; RV32-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1521 ; RV32-NEXT: vluxei32.v v8, (zero), v8, v0.t
1524 ; RV64-LABEL: vpgather_nxv8f32:
1526 ; RV64-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1527 ; RV64-NEXT: vluxei64.v v16, (zero), v8, v0.t
1528 ; RV64-NEXT: vmv.v.v v8, v16
1530 %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)
1531 ret <vscale x 8 x float> %v
1534 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) {
1535 ; RV32-LABEL: vpgather_baseidx_nxv8i8_nxv8f32:
1537 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1538 ; RV32-NEXT: vsext.vf4 v12, v8
1539 ; RV32-NEXT: vsll.vi v8, v12, 2
1540 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1541 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
1544 ; RV64-LABEL: vpgather_baseidx_nxv8i8_nxv8f32:
1546 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1547 ; RV64-NEXT: vsext.vf8 v16, v8
1548 ; RV64-NEXT: vsll.vi v16, v16, 2
1549 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1550 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
1552 %ptrs = getelementptr inbounds float, ptr %base, <vscale x 8 x i8> %idxs
1553 %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)
1554 ret <vscale x 8 x float> %v
1557 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) {
1558 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8f32:
1560 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1561 ; RV32-NEXT: vsext.vf4 v12, v8
1562 ; RV32-NEXT: vsll.vi v8, v12, 2
1563 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1564 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
1567 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8f32:
1569 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1570 ; RV64-NEXT: vsext.vf8 v16, v8
1571 ; RV64-NEXT: vsll.vi v16, v16, 2
1572 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1573 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
1575 %eidxs = sext <vscale x 8 x i8> %idxs to <vscale x 8 x i32>
1576 %ptrs = getelementptr inbounds float, ptr %base, <vscale x 8 x i32> %eidxs
1577 %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)
1578 ret <vscale x 8 x float> %v
1581 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) {
1582 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8f32:
1584 ; RV32-NEXT: vsetvli a2, zero, e16, m2, ta, ma
1585 ; RV32-NEXT: vzext.vf2 v10, v8
1586 ; RV32-NEXT: vsll.vi v12, v10, 2
1587 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1588 ; RV32-NEXT: vluxei16.v v8, (a0), v12, v0.t
1591 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8f32:
1593 ; RV64-NEXT: vsetvli a2, zero, e16, m2, ta, ma
1594 ; RV64-NEXT: vzext.vf2 v10, v8
1595 ; RV64-NEXT: vsll.vi v12, v10, 2
1596 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1597 ; RV64-NEXT: vluxei16.v v8, (a0), v12, v0.t
1599 %eidxs = zext <vscale x 8 x i8> %idxs to <vscale x 8 x i32>
1600 %ptrs = getelementptr inbounds float, ptr %base, <vscale x 8 x i32> %eidxs
1601 %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)
1602 ret <vscale x 8 x float> %v
1605 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) {
1606 ; RV32-LABEL: vpgather_baseidx_nxv8i16_nxv8f32:
1608 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1609 ; RV32-NEXT: vsext.vf2 v12, v8
1610 ; RV32-NEXT: vsll.vi v8, v12, 2
1611 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1612 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
1615 ; RV64-LABEL: vpgather_baseidx_nxv8i16_nxv8f32:
1617 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1618 ; RV64-NEXT: vsext.vf4 v16, v8
1619 ; RV64-NEXT: vsll.vi v16, v16, 2
1620 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1621 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
1623 %ptrs = getelementptr inbounds float, ptr %base, <vscale x 8 x i16> %idxs
1624 %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)
1625 ret <vscale x 8 x float> %v
1628 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) {
1629 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i16_nxv8f32:
1631 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1632 ; RV32-NEXT: vsext.vf2 v12, v8
1633 ; RV32-NEXT: vsll.vi v8, v12, 2
1634 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1635 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
1638 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i16_nxv8f32:
1640 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1641 ; RV64-NEXT: vsext.vf4 v16, v8
1642 ; RV64-NEXT: vsll.vi v16, v16, 2
1643 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1644 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
1646 %eidxs = sext <vscale x 8 x i16> %idxs to <vscale x 8 x i32>
1647 %ptrs = getelementptr inbounds float, ptr %base, <vscale x 8 x i32> %eidxs
1648 %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)
1649 ret <vscale x 8 x float> %v
1652 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) {
1653 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i16_nxv8f32:
1655 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1656 ; RV32-NEXT: vzext.vf2 v12, v8
1657 ; RV32-NEXT: vsll.vi v8, v12, 2
1658 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1659 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
1662 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i16_nxv8f32:
1664 ; RV64-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1665 ; RV64-NEXT: vzext.vf2 v12, v8
1666 ; RV64-NEXT: vsll.vi v8, v12, 2
1667 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1668 ; RV64-NEXT: vluxei32.v v8, (a0), v8, v0.t
1670 %eidxs = zext <vscale x 8 x i16> %idxs to <vscale x 8 x i32>
1671 %ptrs = getelementptr inbounds float, ptr %base, <vscale x 8 x i32> %eidxs
1672 %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)
1673 ret <vscale x 8 x float> %v
1676 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) {
1677 ; RV32-LABEL: vpgather_baseidx_nxv8f32:
1679 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1680 ; RV32-NEXT: vsll.vi v8, v8, 2
1681 ; RV32-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1682 ; RV32-NEXT: vluxei32.v v8, (a0), v8, v0.t
1685 ; RV64-LABEL: vpgather_baseidx_nxv8f32:
1687 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1688 ; RV64-NEXT: vsext.vf2 v16, v8
1689 ; RV64-NEXT: vsll.vi v16, v16, 2
1690 ; RV64-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1691 ; RV64-NEXT: vluxei64.v v8, (a0), v16, v0.t
1693 %ptrs = getelementptr inbounds float, ptr %base, <vscale x 8 x i32> %idxs
1694 %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)
1695 ret <vscale x 8 x float> %v
1698 declare <vscale x 1 x double> @llvm.vp.gather.nxv1f64.nxv1p0(<vscale x 1 x ptr>, <vscale x 1 x i1>, i32)
1700 define <vscale x 1 x double> @vpgather_nxv1f64(<vscale x 1 x ptr> %ptrs, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1701 ; RV32-LABEL: vpgather_nxv1f64:
1703 ; RV32-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1704 ; RV32-NEXT: vluxei32.v v9, (zero), v8, v0.t
1705 ; RV32-NEXT: vmv.v.v v8, v9
1708 ; RV64-LABEL: vpgather_nxv1f64:
1710 ; RV64-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1711 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
1713 %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)
1714 ret <vscale x 1 x double> %v
1717 declare <vscale x 2 x double> @llvm.vp.gather.nxv2f64.nxv2p0(<vscale x 2 x ptr>, <vscale x 2 x i1>, i32)
1719 define <vscale x 2 x double> @vpgather_nxv2f64(<vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1720 ; RV32-LABEL: vpgather_nxv2f64:
1722 ; RV32-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1723 ; RV32-NEXT: vluxei32.v v10, (zero), v8, v0.t
1724 ; RV32-NEXT: vmv.v.v v8, v10
1727 ; RV64-LABEL: vpgather_nxv2f64:
1729 ; RV64-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1730 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
1732 %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)
1733 ret <vscale x 2 x double> %v
1736 declare <vscale x 4 x double> @llvm.vp.gather.nxv4f64.nxv4p0(<vscale x 4 x ptr>, <vscale x 4 x i1>, i32)
1738 define <vscale x 4 x double> @vpgather_nxv4f64(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1739 ; RV32-LABEL: vpgather_nxv4f64:
1741 ; RV32-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1742 ; RV32-NEXT: vluxei32.v v12, (zero), v8, v0.t
1743 ; RV32-NEXT: vmv.v.v v8, v12
1746 ; RV64-LABEL: vpgather_nxv4f64:
1748 ; RV64-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1749 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
1751 %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)
1752 ret <vscale x 4 x double> %v
1755 define <vscale x 4 x double> @vpgather_truemask_nxv4f64(<vscale x 4 x ptr> %ptrs, i32 zeroext %evl) {
1756 ; RV32-LABEL: vpgather_truemask_nxv4f64:
1758 ; RV32-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1759 ; RV32-NEXT: vluxei32.v v12, (zero), v8
1760 ; RV32-NEXT: vmv.v.v v8, v12
1763 ; RV64-LABEL: vpgather_truemask_nxv4f64:
1765 ; RV64-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1766 ; RV64-NEXT: vluxei64.v v8, (zero), v8
1768 %mhead = insertelement <vscale x 4 x i1> poison, i1 1, i32 0
1769 %mtrue = shufflevector <vscale x 4 x i1> %mhead, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
1770 %v = call <vscale x 4 x double> @llvm.vp.gather.nxv4f64.nxv4p0(<vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %mtrue, i32 %evl)
1771 ret <vscale x 4 x double> %v
1774 declare <vscale x 6 x double> @llvm.vp.gather.nxv6f64.nxv6p0(<vscale x 6 x ptr>, <vscale x 6 x i1>, i32)
1776 define <vscale x 6 x double> @vpgather_nxv6f64(<vscale x 6 x ptr> %ptrs, <vscale x 6 x i1> %m, i32 zeroext %evl) {
1777 ; RV32-LABEL: vpgather_nxv6f64:
1779 ; RV32-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1780 ; RV32-NEXT: vluxei32.v v16, (zero), v8, v0.t
1781 ; RV32-NEXT: vmv.v.v v8, v16
1784 ; RV64-LABEL: vpgather_nxv6f64:
1786 ; RV64-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1787 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
1789 %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)
1790 ret <vscale x 6 x double> %v
1793 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) {
1794 ; RV32-LABEL: vpgather_baseidx_nxv6i8_nxv6f64:
1796 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1797 ; RV32-NEXT: vsext.vf4 v12, v8
1798 ; RV32-NEXT: vsll.vi v16, v12, 3
1799 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1800 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1803 ; RV64-LABEL: vpgather_baseidx_nxv6i8_nxv6f64:
1805 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1806 ; RV64-NEXT: vsext.vf8 v16, v8
1807 ; RV64-NEXT: vsll.vi v8, v16, 3
1808 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1809 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1811 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i8> %idxs
1812 %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)
1813 ret <vscale x 6 x double> %v
1816 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) {
1817 ; RV32-LABEL: vpgather_baseidx_sext_nxv6i8_nxv6f64:
1819 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1820 ; RV32-NEXT: vsext.vf4 v12, v8
1821 ; RV32-NEXT: vsll.vi v16, v12, 3
1822 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1823 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1826 ; RV64-LABEL: vpgather_baseidx_sext_nxv6i8_nxv6f64:
1828 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1829 ; RV64-NEXT: vsext.vf8 v16, v8
1830 ; RV64-NEXT: vsll.vi v8, v16, 3
1831 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1832 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1834 %eidxs = sext <vscale x 6 x i8> %idxs to <vscale x 6 x i64>
1835 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i64> %eidxs
1836 %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)
1837 ret <vscale x 6 x double> %v
1840 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) {
1841 ; RV32-LABEL: vpgather_baseidx_zext_nxv6i8_nxv6f64:
1843 ; RV32-NEXT: vsetvli a2, zero, e16, m2, ta, ma
1844 ; RV32-NEXT: vzext.vf2 v10, v8
1845 ; RV32-NEXT: vsll.vi v16, v10, 3
1846 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1847 ; RV32-NEXT: vluxei16.v v8, (a0), v16, v0.t
1850 ; RV64-LABEL: vpgather_baseidx_zext_nxv6i8_nxv6f64:
1852 ; RV64-NEXT: vsetvli a2, zero, e16, m2, ta, ma
1853 ; RV64-NEXT: vzext.vf2 v10, v8
1854 ; RV64-NEXT: vsll.vi v16, v10, 3
1855 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1856 ; RV64-NEXT: vluxei16.v v8, (a0), v16, v0.t
1858 %eidxs = zext <vscale x 6 x i8> %idxs to <vscale x 6 x i64>
1859 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i64> %eidxs
1860 %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)
1861 ret <vscale x 6 x double> %v
1864 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) {
1865 ; RV32-LABEL: vpgather_baseidx_nxv6i16_nxv6f64:
1867 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1868 ; RV32-NEXT: vsext.vf2 v12, v8
1869 ; RV32-NEXT: vsll.vi v16, v12, 3
1870 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1871 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1874 ; RV64-LABEL: vpgather_baseidx_nxv6i16_nxv6f64:
1876 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1877 ; RV64-NEXT: vsext.vf4 v16, v8
1878 ; RV64-NEXT: vsll.vi v8, v16, 3
1879 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1880 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1882 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i16> %idxs
1883 %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)
1884 ret <vscale x 6 x double> %v
1887 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) {
1888 ; RV32-LABEL: vpgather_baseidx_sext_nxv6i16_nxv6f64:
1890 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1891 ; RV32-NEXT: vsext.vf2 v12, v8
1892 ; RV32-NEXT: vsll.vi v16, v12, 3
1893 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1894 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1897 ; RV64-LABEL: vpgather_baseidx_sext_nxv6i16_nxv6f64:
1899 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1900 ; RV64-NEXT: vsext.vf4 v16, v8
1901 ; RV64-NEXT: vsll.vi v8, v16, 3
1902 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1903 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1905 %eidxs = sext <vscale x 6 x i16> %idxs to <vscale x 6 x i64>
1906 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i64> %eidxs
1907 %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)
1908 ret <vscale x 6 x double> %v
1911 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) {
1912 ; RV32-LABEL: vpgather_baseidx_zext_nxv6i16_nxv6f64:
1914 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1915 ; RV32-NEXT: vzext.vf2 v12, v8
1916 ; RV32-NEXT: vsll.vi v16, v12, 3
1917 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1918 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1921 ; RV64-LABEL: vpgather_baseidx_zext_nxv6i16_nxv6f64:
1923 ; RV64-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1924 ; RV64-NEXT: vzext.vf2 v12, v8
1925 ; RV64-NEXT: vsll.vi v16, v12, 3
1926 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1927 ; RV64-NEXT: vluxei32.v v8, (a0), v16, v0.t
1929 %eidxs = zext <vscale x 6 x i16> %idxs to <vscale x 6 x i64>
1930 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i64> %eidxs
1931 %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)
1932 ret <vscale x 6 x double> %v
1935 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) {
1936 ; RV32-LABEL: vpgather_baseidx_nxv6i32_nxv6f64:
1938 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1939 ; RV32-NEXT: vsll.vi v16, v8, 3
1940 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1941 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1944 ; RV64-LABEL: vpgather_baseidx_nxv6i32_nxv6f64:
1946 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1947 ; RV64-NEXT: vsext.vf2 v16, v8
1948 ; RV64-NEXT: vsll.vi v8, v16, 3
1949 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1950 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1952 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i32> %idxs
1953 %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)
1954 ret <vscale x 6 x double> %v
1957 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) {
1958 ; RV32-LABEL: vpgather_baseidx_sext_nxv6i32_nxv6f64:
1960 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1961 ; RV32-NEXT: vsll.vi v16, v8, 3
1962 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1963 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1966 ; RV64-LABEL: vpgather_baseidx_sext_nxv6i32_nxv6f64:
1968 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1969 ; RV64-NEXT: vsext.vf2 v16, v8
1970 ; RV64-NEXT: vsll.vi v8, v16, 3
1971 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1972 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1974 %eidxs = sext <vscale x 6 x i32> %idxs to <vscale x 6 x i64>
1975 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i64> %eidxs
1976 %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)
1977 ret <vscale x 6 x double> %v
1980 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) {
1981 ; RV32-LABEL: vpgather_baseidx_zext_nxv6i32_nxv6f64:
1983 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
1984 ; RV32-NEXT: vsll.vi v16, v8, 3
1985 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1986 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
1989 ; RV64-LABEL: vpgather_baseidx_zext_nxv6i32_nxv6f64:
1991 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1992 ; RV64-NEXT: vzext.vf2 v16, v8
1993 ; RV64-NEXT: vsll.vi v8, v16, 3
1994 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1995 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
1997 %eidxs = zext <vscale x 6 x i32> %idxs to <vscale x 6 x i64>
1998 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i64> %eidxs
1999 %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)
2000 ret <vscale x 6 x double> %v
2003 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) {
2004 ; RV32-LABEL: vpgather_baseidx_nxv6f64:
2006 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2007 ; RV32-NEXT: vnsrl.wi v16, v8, 0
2008 ; RV32-NEXT: vsll.vi v16, v16, 3
2009 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2010 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2013 ; RV64-LABEL: vpgather_baseidx_nxv6f64:
2015 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2016 ; RV64-NEXT: vsll.vi v8, v8, 3
2017 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2018 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
2020 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 6 x i64> %idxs
2021 %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)
2022 ret <vscale x 6 x double> %v
2025 declare <vscale x 8 x double> @llvm.vp.gather.nxv8f64.nxv8p0(<vscale x 8 x ptr>, <vscale x 8 x i1>, i32)
2027 define <vscale x 8 x double> @vpgather_nxv8f64(<vscale x 8 x ptr> %ptrs, <vscale x 8 x i1> %m, i32 zeroext %evl) {
2028 ; RV32-LABEL: vpgather_nxv8f64:
2030 ; RV32-NEXT: vsetvli zero, a0, e64, m8, ta, ma
2031 ; RV32-NEXT: vluxei32.v v16, (zero), v8, v0.t
2032 ; RV32-NEXT: vmv.v.v v8, v16
2035 ; RV64-LABEL: vpgather_nxv8f64:
2037 ; RV64-NEXT: vsetvli zero, a0, e64, m8, ta, ma
2038 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
2040 %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)
2041 ret <vscale x 8 x double> %v
2044 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) {
2045 ; RV32-LABEL: vpgather_baseidx_nxv8i8_nxv8f64:
2047 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2048 ; RV32-NEXT: vsext.vf4 v12, v8
2049 ; RV32-NEXT: vsll.vi v16, v12, 3
2050 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2051 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2054 ; RV64-LABEL: vpgather_baseidx_nxv8i8_nxv8f64:
2056 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2057 ; RV64-NEXT: vsext.vf8 v16, v8
2058 ; RV64-NEXT: vsll.vi v8, v16, 3
2059 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2060 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
2062 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i8> %idxs
2063 %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)
2064 ret <vscale x 8 x double> %v
2067 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) {
2068 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8f64:
2070 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2071 ; RV32-NEXT: vsext.vf4 v12, v8
2072 ; RV32-NEXT: vsll.vi v16, v12, 3
2073 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2074 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2077 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i8_nxv8f64:
2079 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2080 ; RV64-NEXT: vsext.vf8 v16, v8
2081 ; RV64-NEXT: vsll.vi v8, v16, 3
2082 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2083 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
2085 %eidxs = sext <vscale x 8 x i8> %idxs to <vscale x 8 x i64>
2086 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i64> %eidxs
2087 %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)
2088 ret <vscale x 8 x double> %v
2091 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) {
2092 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8f64:
2094 ; RV32-NEXT: vsetvli a2, zero, e16, m2, ta, ma
2095 ; RV32-NEXT: vzext.vf2 v10, v8
2096 ; RV32-NEXT: vsll.vi v16, v10, 3
2097 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2098 ; RV32-NEXT: vluxei16.v v8, (a0), v16, v0.t
2101 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i8_nxv8f64:
2103 ; RV64-NEXT: vsetvli a2, zero, e16, m2, ta, ma
2104 ; RV64-NEXT: vzext.vf2 v10, v8
2105 ; RV64-NEXT: vsll.vi v16, v10, 3
2106 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2107 ; RV64-NEXT: vluxei16.v v8, (a0), v16, v0.t
2109 %eidxs = zext <vscale x 8 x i8> %idxs to <vscale x 8 x i64>
2110 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i64> %eidxs
2111 %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)
2112 ret <vscale x 8 x double> %v
2115 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) {
2116 ; RV32-LABEL: vpgather_baseidx_nxv8i16_nxv8f64:
2118 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2119 ; RV32-NEXT: vsext.vf2 v12, v8
2120 ; RV32-NEXT: vsll.vi v16, v12, 3
2121 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2122 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2125 ; RV64-LABEL: vpgather_baseidx_nxv8i16_nxv8f64:
2127 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2128 ; RV64-NEXT: vsext.vf4 v16, v8
2129 ; RV64-NEXT: vsll.vi v8, v16, 3
2130 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2131 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
2133 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i16> %idxs
2134 %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)
2135 ret <vscale x 8 x double> %v
2138 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) {
2139 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i16_nxv8f64:
2141 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2142 ; RV32-NEXT: vsext.vf2 v12, v8
2143 ; RV32-NEXT: vsll.vi v16, v12, 3
2144 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2145 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2148 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i16_nxv8f64:
2150 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2151 ; RV64-NEXT: vsext.vf4 v16, v8
2152 ; RV64-NEXT: vsll.vi v8, v16, 3
2153 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2154 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
2156 %eidxs = sext <vscale x 8 x i16> %idxs to <vscale x 8 x i64>
2157 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i64> %eidxs
2158 %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)
2159 ret <vscale x 8 x double> %v
2162 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) {
2163 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i16_nxv8f64:
2165 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2166 ; RV32-NEXT: vzext.vf2 v12, v8
2167 ; RV32-NEXT: vsll.vi v16, v12, 3
2168 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2169 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2172 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i16_nxv8f64:
2174 ; RV64-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2175 ; RV64-NEXT: vzext.vf2 v12, v8
2176 ; RV64-NEXT: vsll.vi v16, v12, 3
2177 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2178 ; RV64-NEXT: vluxei32.v v8, (a0), v16, v0.t
2180 %eidxs = zext <vscale x 8 x i16> %idxs to <vscale x 8 x i64>
2181 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i64> %eidxs
2182 %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)
2183 ret <vscale x 8 x double> %v
2186 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) {
2187 ; RV32-LABEL: vpgather_baseidx_nxv8i32_nxv8f64:
2189 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2190 ; RV32-NEXT: vsll.vi v16, v8, 3
2191 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2192 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2195 ; RV64-LABEL: vpgather_baseidx_nxv8i32_nxv8f64:
2197 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2198 ; RV64-NEXT: vsext.vf2 v16, v8
2199 ; RV64-NEXT: vsll.vi v8, v16, 3
2200 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2201 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
2203 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i32> %idxs
2204 %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)
2205 ret <vscale x 8 x double> %v
2208 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) {
2209 ; RV32-LABEL: vpgather_baseidx_sext_nxv8i32_nxv8f64:
2211 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2212 ; RV32-NEXT: vsll.vi v16, v8, 3
2213 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2214 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2217 ; RV64-LABEL: vpgather_baseidx_sext_nxv8i32_nxv8f64:
2219 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2220 ; RV64-NEXT: vsext.vf2 v16, v8
2221 ; RV64-NEXT: vsll.vi v8, v16, 3
2222 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2223 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
2225 %eidxs = sext <vscale x 8 x i32> %idxs to <vscale x 8 x i64>
2226 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i64> %eidxs
2227 %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)
2228 ret <vscale x 8 x double> %v
2231 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) {
2232 ; RV32-LABEL: vpgather_baseidx_zext_nxv8i32_nxv8f64:
2234 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2235 ; RV32-NEXT: vsll.vi v16, v8, 3
2236 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2237 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2240 ; RV64-LABEL: vpgather_baseidx_zext_nxv8i32_nxv8f64:
2242 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2243 ; RV64-NEXT: vzext.vf2 v16, v8
2244 ; RV64-NEXT: vsll.vi v8, v16, 3
2245 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2246 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
2248 %eidxs = zext <vscale x 8 x i32> %idxs to <vscale x 8 x i64>
2249 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i64> %eidxs
2250 %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)
2251 ret <vscale x 8 x double> %v
2254 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) {
2255 ; RV32-LABEL: vpgather_baseidx_nxv8f64:
2257 ; RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
2258 ; RV32-NEXT: vnsrl.wi v16, v8, 0
2259 ; RV32-NEXT: vsll.vi v16, v16, 3
2260 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2261 ; RV32-NEXT: vluxei32.v v8, (a0), v16, v0.t
2264 ; RV64-LABEL: vpgather_baseidx_nxv8f64:
2266 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2267 ; RV64-NEXT: vsll.vi v8, v8, 3
2268 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2269 ; RV64-NEXT: vluxei64.v v8, (a0), v8, v0.t
2271 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 8 x i64> %idxs
2272 %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)
2273 ret <vscale x 8 x double> %v
2276 declare <vscale x 16 x double> @llvm.vp.gather.nxv16f64.nxv16p0(<vscale x 16 x ptr>, <vscale x 16 x i1>, i32)
2278 define <vscale x 16 x double> @vpgather_nxv16f64(<vscale x 16 x ptr> %ptrs, <vscale x 16 x i1> %m, i32 zeroext %evl) {
2279 ; RV32-LABEL: vpgather_nxv16f64:
2281 ; RV32-NEXT: vmv1r.v v24, v0
2282 ; RV32-NEXT: csrr a1, vlenb
2283 ; RV32-NEXT: sub a2, a0, a1
2284 ; RV32-NEXT: sltu a3, a0, a2
2285 ; RV32-NEXT: addi a3, a3, -1
2286 ; RV32-NEXT: and a2, a3, a2
2287 ; RV32-NEXT: srli a3, a1, 3
2288 ; RV32-NEXT: vsetvli a4, zero, e8, mf4, ta, ma
2289 ; RV32-NEXT: vslidedown.vx v0, v0, a3
2290 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
2291 ; RV32-NEXT: vluxei32.v v16, (zero), v12, v0.t
2292 ; RV32-NEXT: bltu a0, a1, .LBB102_2
2293 ; RV32-NEXT: # %bb.1:
2294 ; RV32-NEXT: mv a0, a1
2295 ; RV32-NEXT: .LBB102_2:
2296 ; RV32-NEXT: vsetvli zero, a0, e64, m8, ta, ma
2297 ; RV32-NEXT: vmv1r.v v0, v24
2298 ; RV32-NEXT: vluxei32.v v24, (zero), v8, v0.t
2299 ; RV32-NEXT: vmv.v.v v8, v24
2302 ; RV64-LABEL: vpgather_nxv16f64:
2304 ; RV64-NEXT: vmv1r.v v24, v0
2305 ; RV64-NEXT: csrr a1, vlenb
2306 ; RV64-NEXT: sub a2, a0, a1
2307 ; RV64-NEXT: sltu a3, a0, a2
2308 ; RV64-NEXT: addi a3, a3, -1
2309 ; RV64-NEXT: and a2, a3, a2
2310 ; RV64-NEXT: srli a3, a1, 3
2311 ; RV64-NEXT: vsetvli a4, zero, e8, mf4, ta, ma
2312 ; RV64-NEXT: vslidedown.vx v0, v0, a3
2313 ; RV64-NEXT: vsetvli zero, a2, e64, m8, ta, ma
2314 ; RV64-NEXT: vluxei64.v v16, (zero), v16, v0.t
2315 ; RV64-NEXT: bltu a0, a1, .LBB102_2
2316 ; RV64-NEXT: # %bb.1:
2317 ; RV64-NEXT: mv a0, a1
2318 ; RV64-NEXT: .LBB102_2:
2319 ; RV64-NEXT: vsetvli zero, a0, e64, m8, ta, ma
2320 ; RV64-NEXT: vmv1r.v v0, v24
2321 ; RV64-NEXT: vluxei64.v v8, (zero), v8, v0.t
2323 %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)
2324 ret <vscale x 16 x double> %v
2327 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) {
2328 ; RV32-LABEL: vpgather_baseidx_nxv16i16_nxv16f64:
2330 ; RV32-NEXT: vmv1r.v v12, v0
2331 ; RV32-NEXT: vsetvli a2, zero, e32, m8, ta, ma
2332 ; RV32-NEXT: vsext.vf2 v16, v8
2333 ; RV32-NEXT: vsll.vi v24, v16, 3
2334 ; RV32-NEXT: csrr a2, vlenb
2335 ; RV32-NEXT: sub a3, a1, a2
2336 ; RV32-NEXT: sltu a4, a1, a3
2337 ; RV32-NEXT: addi a4, a4, -1
2338 ; RV32-NEXT: and a3, a4, a3
2339 ; RV32-NEXT: srli a4, a2, 3
2340 ; RV32-NEXT: vsetvli a5, zero, e8, mf4, ta, ma
2341 ; RV32-NEXT: vslidedown.vx v0, v0, a4
2342 ; RV32-NEXT: vsetvli zero, a3, e64, m8, ta, ma
2343 ; RV32-NEXT: vluxei32.v v16, (a0), v28, v0.t
2344 ; RV32-NEXT: bltu a1, a2, .LBB103_2
2345 ; RV32-NEXT: # %bb.1:
2346 ; RV32-NEXT: mv a1, a2
2347 ; RV32-NEXT: .LBB103_2:
2348 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2349 ; RV32-NEXT: vmv1r.v v0, v12
2350 ; RV32-NEXT: vluxei32.v v8, (a0), v24, v0.t
2353 ; RV64-LABEL: vpgather_baseidx_nxv16i16_nxv16f64:
2355 ; RV64-NEXT: vmv1r.v v12, v0
2356 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2357 ; RV64-NEXT: vsext.vf4 v16, v8
2358 ; RV64-NEXT: vsll.vi v24, v16, 3
2359 ; RV64-NEXT: vsext.vf4 v16, v10
2360 ; RV64-NEXT: vsll.vi v16, v16, 3
2361 ; RV64-NEXT: csrr a2, vlenb
2362 ; RV64-NEXT: sub a3, a1, a2
2363 ; RV64-NEXT: sltu a4, a1, a3
2364 ; RV64-NEXT: addi a4, a4, -1
2365 ; RV64-NEXT: and a3, a4, a3
2366 ; RV64-NEXT: srli a4, a2, 3
2367 ; RV64-NEXT: vsetvli a5, zero, e8, mf4, ta, ma
2368 ; RV64-NEXT: vslidedown.vx v0, v0, a4
2369 ; RV64-NEXT: vsetvli zero, a3, e64, m8, ta, ma
2370 ; RV64-NEXT: vluxei64.v v16, (a0), v16, v0.t
2371 ; RV64-NEXT: bltu a1, a2, .LBB103_2
2372 ; RV64-NEXT: # %bb.1:
2373 ; RV64-NEXT: mv a1, a2
2374 ; RV64-NEXT: .LBB103_2:
2375 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2376 ; RV64-NEXT: vmv1r.v v0, v12
2377 ; RV64-NEXT: vluxei64.v v8, (a0), v24, v0.t
2379 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 16 x i16> %idxs
2380 %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)
2381 ret <vscale x 16 x double> %v
2384 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) {
2385 ; RV32-LABEL: vpgather_baseidx_sext_nxv16i16_nxv16f64:
2387 ; RV32-NEXT: vmv1r.v v12, v0
2388 ; RV32-NEXT: vsetvli a2, zero, e32, m8, ta, ma
2389 ; RV32-NEXT: vsext.vf2 v16, v8
2390 ; RV32-NEXT: vsll.vi v24, v16, 3
2391 ; RV32-NEXT: csrr a2, vlenb
2392 ; RV32-NEXT: sub a3, a1, a2
2393 ; RV32-NEXT: sltu a4, a1, a3
2394 ; RV32-NEXT: addi a4, a4, -1
2395 ; RV32-NEXT: and a3, a4, a3
2396 ; RV32-NEXT: srli a4, a2, 3
2397 ; RV32-NEXT: vsetvli a5, zero, e8, mf4, ta, ma
2398 ; RV32-NEXT: vslidedown.vx v0, v0, a4
2399 ; RV32-NEXT: vsetvli zero, a3, e64, m8, ta, ma
2400 ; RV32-NEXT: vluxei32.v v16, (a0), v28, v0.t
2401 ; RV32-NEXT: bltu a1, a2, .LBB104_2
2402 ; RV32-NEXT: # %bb.1:
2403 ; RV32-NEXT: mv a1, a2
2404 ; RV32-NEXT: .LBB104_2:
2405 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2406 ; RV32-NEXT: vmv1r.v v0, v12
2407 ; RV32-NEXT: vluxei32.v v8, (a0), v24, v0.t
2410 ; RV64-LABEL: vpgather_baseidx_sext_nxv16i16_nxv16f64:
2412 ; RV64-NEXT: vmv1r.v v12, v0
2413 ; RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
2414 ; RV64-NEXT: vsext.vf4 v16, v10
2415 ; RV64-NEXT: vsext.vf4 v24, v8
2416 ; RV64-NEXT: vsll.vi v24, v24, 3
2417 ; RV64-NEXT: vsll.vi v16, v16, 3
2418 ; RV64-NEXT: csrr a2, vlenb
2419 ; RV64-NEXT: sub a3, a1, a2
2420 ; RV64-NEXT: sltu a4, a1, a3
2421 ; RV64-NEXT: addi a4, a4, -1
2422 ; RV64-NEXT: and a3, a4, a3
2423 ; RV64-NEXT: srli a4, a2, 3
2424 ; RV64-NEXT: vsetvli a5, zero, e8, mf4, ta, ma
2425 ; RV64-NEXT: vslidedown.vx v0, v0, a4
2426 ; RV64-NEXT: vsetvli zero, a3, e64, m8, ta, ma
2427 ; RV64-NEXT: vluxei64.v v16, (a0), v16, v0.t
2428 ; RV64-NEXT: bltu a1, a2, .LBB104_2
2429 ; RV64-NEXT: # %bb.1:
2430 ; RV64-NEXT: mv a1, a2
2431 ; RV64-NEXT: .LBB104_2:
2432 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2433 ; RV64-NEXT: vmv1r.v v0, v12
2434 ; RV64-NEXT: vluxei64.v v8, (a0), v24, v0.t
2436 %eidxs = sext <vscale x 16 x i16> %idxs to <vscale x 16 x i64>
2437 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 16 x i64> %eidxs
2438 %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)
2439 ret <vscale x 16 x double> %v
2442 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) {
2443 ; RV32-LABEL: vpgather_baseidx_zext_nxv16i16_nxv16f64:
2445 ; RV32-NEXT: vmv1r.v v12, v0
2446 ; RV32-NEXT: vsetvli a2, zero, e32, m8, ta, ma
2447 ; RV32-NEXT: vzext.vf2 v16, v8
2448 ; RV32-NEXT: vsll.vi v24, v16, 3
2449 ; RV32-NEXT: csrr a2, vlenb
2450 ; RV32-NEXT: sub a3, a1, a2
2451 ; RV32-NEXT: sltu a4, a1, a3
2452 ; RV32-NEXT: addi a4, a4, -1
2453 ; RV32-NEXT: and a3, a4, a3
2454 ; RV32-NEXT: srli a4, a2, 3
2455 ; RV32-NEXT: vsetvli a5, zero, e8, mf4, ta, ma
2456 ; RV32-NEXT: vslidedown.vx v0, v0, a4
2457 ; RV32-NEXT: vsetvli zero, a3, e64, m8, ta, ma
2458 ; RV32-NEXT: vluxei32.v v16, (a0), v28, v0.t
2459 ; RV32-NEXT: bltu a1, a2, .LBB105_2
2460 ; RV32-NEXT: # %bb.1:
2461 ; RV32-NEXT: mv a1, a2
2462 ; RV32-NEXT: .LBB105_2:
2463 ; RV32-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2464 ; RV32-NEXT: vmv1r.v v0, v12
2465 ; RV32-NEXT: vluxei32.v v8, (a0), v24, v0.t
2468 ; RV64-LABEL: vpgather_baseidx_zext_nxv16i16_nxv16f64:
2470 ; RV64-NEXT: vmv1r.v v12, v0
2471 ; RV64-NEXT: vsetvli a2, zero, e32, m8, ta, ma
2472 ; RV64-NEXT: vzext.vf2 v16, v8
2473 ; RV64-NEXT: vsll.vi v24, v16, 3
2474 ; RV64-NEXT: csrr a2, vlenb
2475 ; RV64-NEXT: sub a3, a1, a2
2476 ; RV64-NEXT: sltu a4, a1, a3
2477 ; RV64-NEXT: addi a4, a4, -1
2478 ; RV64-NEXT: and a3, a4, a3
2479 ; RV64-NEXT: srli a4, a2, 3
2480 ; RV64-NEXT: vsetvli a5, zero, e8, mf4, ta, ma
2481 ; RV64-NEXT: vslidedown.vx v0, v0, a4
2482 ; RV64-NEXT: vsetvli zero, a3, e64, m8, ta, ma
2483 ; RV64-NEXT: vluxei32.v v16, (a0), v28, v0.t
2484 ; RV64-NEXT: bltu a1, a2, .LBB105_2
2485 ; RV64-NEXT: # %bb.1:
2486 ; RV64-NEXT: mv a1, a2
2487 ; RV64-NEXT: .LBB105_2:
2488 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
2489 ; RV64-NEXT: vmv1r.v v0, v12
2490 ; RV64-NEXT: vluxei32.v v8, (a0), v24, v0.t
2492 %eidxs = zext <vscale x 16 x i16> %idxs to <vscale x 16 x i64>
2493 %ptrs = getelementptr inbounds double, ptr %base, <vscale x 16 x i64> %eidxs
2494 %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)
2495 ret <vscale x 16 x double> %v