1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfh,+v,+m -target-abi=ilp32d \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFH,RV32
4 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfh,+v,+m -target-abi=lp64d \
5 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFH,RV64
6 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfhmin,+v,+m -target-abi=ilp32d \
7 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFHMIN,RV32ZVFHMIN
8 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfhmin,+v,+m -target-abi=lp64d \
9 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFHMIN,RV64ZVFHMIN
11 declare <4 x i1> @llvm.vp.merge.v4i1(<4 x i1>, <4 x i1>, <4 x i1>, i32)
13 define <4 x i1> @vpmerge_vv_v4i1(<4 x i1> %va, <4 x i1> %vb, <4 x i1> %m, i32 zeroext %evl) {
14 ; RV32-LABEL: vpmerge_vv_v4i1:
16 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
17 ; RV32-NEXT: vid.v v10
18 ; RV32-NEXT: vmsltu.vx v10, v10, a0
19 ; RV32-NEXT: vmand.mm v9, v9, v10
20 ; RV32-NEXT: vmandn.mm v8, v8, v9
21 ; RV32-NEXT: vmand.mm v9, v0, v9
22 ; RV32-NEXT: vmor.mm v0, v9, v8
25 ; RV64-LABEL: vpmerge_vv_v4i1:
27 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
28 ; RV64-NEXT: vid.v v10
29 ; RV64-NEXT: vmsltu.vx v12, v10, a0
30 ; RV64-NEXT: vmand.mm v9, v9, v12
31 ; RV64-NEXT: vmandn.mm v8, v8, v9
32 ; RV64-NEXT: vmand.mm v9, v0, v9
33 ; RV64-NEXT: vmor.mm v0, v9, v8
36 ; RV32ZVFHMIN-LABEL: vpmerge_vv_v4i1:
37 ; RV32ZVFHMIN: # %bb.0:
38 ; RV32ZVFHMIN-NEXT: vsetivli zero, 4, e32, m1, ta, ma
39 ; RV32ZVFHMIN-NEXT: vid.v v10
40 ; RV32ZVFHMIN-NEXT: vmsltu.vx v10, v10, a0
41 ; RV32ZVFHMIN-NEXT: vmand.mm v9, v9, v10
42 ; RV32ZVFHMIN-NEXT: vmandn.mm v8, v8, v9
43 ; RV32ZVFHMIN-NEXT: vmand.mm v9, v0, v9
44 ; RV32ZVFHMIN-NEXT: vmor.mm v0, v9, v8
45 ; RV32ZVFHMIN-NEXT: ret
47 ; RV64ZVFHMIN-LABEL: vpmerge_vv_v4i1:
48 ; RV64ZVFHMIN: # %bb.0:
49 ; RV64ZVFHMIN-NEXT: vsetivli zero, 4, e64, m2, ta, ma
50 ; RV64ZVFHMIN-NEXT: vid.v v10
51 ; RV64ZVFHMIN-NEXT: vmsltu.vx v12, v10, a0
52 ; RV64ZVFHMIN-NEXT: vmand.mm v9, v9, v12
53 ; RV64ZVFHMIN-NEXT: vmandn.mm v8, v8, v9
54 ; RV64ZVFHMIN-NEXT: vmand.mm v9, v0, v9
55 ; RV64ZVFHMIN-NEXT: vmor.mm v0, v9, v8
56 ; RV64ZVFHMIN-NEXT: ret
57 %v = call <4 x i1> @llvm.vp.merge.v4i1(<4 x i1> %m, <4 x i1> %va, <4 x i1> %vb, i32 %evl)
61 declare <2 x i8> @llvm.vp.merge.v2i8(<2 x i1>, <2 x i8>, <2 x i8>, i32)
63 define <2 x i8> @vpmerge_vv_v2i8(<2 x i8> %va, <2 x i8> %vb, <2 x i1> %m, i32 zeroext %evl) {
64 ; CHECK-LABEL: vpmerge_vv_v2i8:
66 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, tu, ma
67 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
68 ; CHECK-NEXT: vmv1r.v v8, v9
70 %v = call <2 x i8> @llvm.vp.merge.v2i8(<2 x i1> %m, <2 x i8> %va, <2 x i8> %vb, i32 %evl)
74 define <2 x i8> @vpmerge_vx_v2i8(i8 %a, <2 x i8> %vb, <2 x i1> %m, i32 zeroext %evl) {
75 ; CHECK-LABEL: vpmerge_vx_v2i8:
77 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, tu, ma
78 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
80 %elt.head = insertelement <2 x i8> poison, i8 %a, i32 0
81 %va = shufflevector <2 x i8> %elt.head, <2 x i8> poison, <2 x i32> zeroinitializer
82 %v = call <2 x i8> @llvm.vp.merge.v2i8(<2 x i1> %m, <2 x i8> %va, <2 x i8> %vb, i32 %evl)
86 define <2 x i8> @vpmerge_vi_v2i8(<2 x i8> %vb, <2 x i1> %m, i32 zeroext %evl) {
87 ; CHECK-LABEL: vpmerge_vi_v2i8:
89 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, tu, ma
90 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
92 %v = call <2 x i8> @llvm.vp.merge.v2i8(<2 x i1> %m, <2 x i8> splat (i8 2), <2 x i8> %vb, i32 %evl)
96 declare <4 x i8> @llvm.vp.merge.v4i8(<4 x i1>, <4 x i8>, <4 x i8>, i32)
98 define <4 x i8> @vpmerge_vv_v4i8(<4 x i8> %va, <4 x i8> %vb, <4 x i1> %m, i32 zeroext %evl) {
99 ; CHECK-LABEL: vpmerge_vv_v4i8:
101 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, tu, ma
102 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
103 ; CHECK-NEXT: vmv1r.v v8, v9
105 %v = call <4 x i8> @llvm.vp.merge.v4i8(<4 x i1> %m, <4 x i8> %va, <4 x i8> %vb, i32 %evl)
109 define <4 x i8> @vpmerge_vx_v4i8(i8 %a, <4 x i8> %vb, <4 x i1> %m, i32 zeroext %evl) {
110 ; CHECK-LABEL: vpmerge_vx_v4i8:
112 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, tu, ma
113 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
115 %elt.head = insertelement <4 x i8> poison, i8 %a, i32 0
116 %va = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
117 %v = call <4 x i8> @llvm.vp.merge.v4i8(<4 x i1> %m, <4 x i8> %va, <4 x i8> %vb, i32 %evl)
121 define <4 x i8> @vpmerge_vi_v4i8(<4 x i8> %vb, <4 x i1> %m, i32 zeroext %evl) {
122 ; CHECK-LABEL: vpmerge_vi_v4i8:
124 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, tu, ma
125 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
127 %v = call <4 x i8> @llvm.vp.merge.v4i8(<4 x i1> %m, <4 x i8> splat (i8 2), <4 x i8> %vb, i32 %evl)
131 declare <6 x i8> @llvm.vp.merge.v6i8(<6 x i1>, <6 x i8>, <6 x i8>, i32)
133 define <6 x i8> @vpmerge_vv_v6i8(<6 x i8> %va, <6 x i8> %vb, <6 x i1> %m, i32 zeroext %evl) {
134 ; CHECK-LABEL: vpmerge_vv_v6i8:
136 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, tu, ma
137 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
138 ; CHECK-NEXT: vmv1r.v v8, v9
140 %v = call <6 x i8> @llvm.vp.merge.v6i8(<6 x i1> %m, <6 x i8> %va, <6 x i8> %vb, i32 %evl)
144 define <6 x i8> @vpmerge_vx_v6i8(i8 %a, <6 x i8> %vb, <6 x i1> %m, i32 zeroext %evl) {
145 ; CHECK-LABEL: vpmerge_vx_v6i8:
147 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, tu, ma
148 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
150 %elt.head = insertelement <6 x i8> poison, i8 %a, i32 0
151 %va = shufflevector <6 x i8> %elt.head, <6 x i8> poison, <6 x i32> zeroinitializer
152 %v = call <6 x i8> @llvm.vp.merge.v6i8(<6 x i1> %m, <6 x i8> %va, <6 x i8> %vb, i32 %evl)
156 define <6 x i8> @vpmerge_vi_v6i8(<6 x i8> %vb, <6 x i1> %m, i32 zeroext %evl) {
157 ; CHECK-LABEL: vpmerge_vi_v6i8:
159 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, tu, ma
160 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
162 %v = call <6 x i8> @llvm.vp.merge.v6i8(<6 x i1> %m, <6 x i8> splat (i8 2), <6 x i8> %vb, i32 %evl)
166 declare <8 x i7> @llvm.vp.merge.v8i7(<8 x i1>, <8 x i7>, <8 x i7>, i32)
168 define <8 x i7> @vpmerge_vv_v8i7(<8 x i7> %va, <8 x i7> %vb, <8 x i1> %m, i32 zeroext %evl) {
169 ; CHECK-LABEL: vpmerge_vv_v8i7:
171 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, tu, ma
172 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
173 ; CHECK-NEXT: vmv1r.v v8, v9
175 %v = call <8 x i7> @llvm.vp.merge.v8i7(<8 x i1> %m, <8 x i7> %va, <8 x i7> %vb, i32 %evl)
179 define <8 x i7> @vpmerge_vx_v8i7(i7 %a, <8 x i7> %vb, <8 x i1> %m, i32 zeroext %evl) {
180 ; CHECK-LABEL: vpmerge_vx_v8i7:
182 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, tu, ma
183 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
185 %elt.head = insertelement <8 x i7> poison, i7 %a, i32 0
186 %va = shufflevector <8 x i7> %elt.head, <8 x i7> poison, <8 x i32> zeroinitializer
187 %v = call <8 x i7> @llvm.vp.merge.v8i7(<8 x i1> %m, <8 x i7> %va, <8 x i7> %vb, i32 %evl)
191 define <8 x i7> @vpmerge_vi_v8i7(<8 x i7> %vb, <8 x i1> %m, i32 zeroext %evl) {
192 ; CHECK-LABEL: vpmerge_vi_v8i7:
194 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, tu, ma
195 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
197 %v = call <8 x i7> @llvm.vp.merge.v8i7(<8 x i1> %m, <8 x i7> splat (i7 2), <8 x i7> %vb, i32 %evl)
201 declare <8 x i8> @llvm.vp.merge.v8i8(<8 x i1>, <8 x i8>, <8 x i8>, i32)
203 define <8 x i8> @vpmerge_vv_v8i8(<8 x i8> %va, <8 x i8> %vb, <8 x i1> %m, i32 zeroext %evl) {
204 ; CHECK-LABEL: vpmerge_vv_v8i8:
206 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, tu, ma
207 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
208 ; CHECK-NEXT: vmv1r.v v8, v9
210 %v = call <8 x i8> @llvm.vp.merge.v8i8(<8 x i1> %m, <8 x i8> %va, <8 x i8> %vb, i32 %evl)
214 define <8 x i8> @vpmerge_vx_v8i8(i8 %a, <8 x i8> %vb, <8 x i1> %m, i32 zeroext %evl) {
215 ; CHECK-LABEL: vpmerge_vx_v8i8:
217 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, tu, ma
218 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
220 %elt.head = insertelement <8 x i8> poison, i8 %a, i32 0
221 %va = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
222 %v = call <8 x i8> @llvm.vp.merge.v8i8(<8 x i1> %m, <8 x i8> %va, <8 x i8> %vb, i32 %evl)
226 define <8 x i8> @vpmerge_vi_v8i8(<8 x i8> %vb, <8 x i1> %m, i32 zeroext %evl) {
227 ; CHECK-LABEL: vpmerge_vi_v8i8:
229 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, tu, ma
230 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
232 %v = call <8 x i8> @llvm.vp.merge.v8i8(<8 x i1> %m, <8 x i8> splat (i8 2), <8 x i8> %vb, i32 %evl)
236 declare <16 x i8> @llvm.vp.merge.v16i8(<16 x i1>, <16 x i8>, <16 x i8>, i32)
238 define <16 x i8> @vpmerge_vv_v16i8(<16 x i8> %va, <16 x i8> %vb, <16 x i1> %m, i32 zeroext %evl) {
239 ; CHECK-LABEL: vpmerge_vv_v16i8:
241 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, tu, ma
242 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
243 ; CHECK-NEXT: vmv1r.v v8, v9
245 %v = call <16 x i8> @llvm.vp.merge.v16i8(<16 x i1> %m, <16 x i8> %va, <16 x i8> %vb, i32 %evl)
249 define <16 x i8> @vpmerge_vx_v16i8(i8 %a, <16 x i8> %vb, <16 x i1> %m, i32 zeroext %evl) {
250 ; CHECK-LABEL: vpmerge_vx_v16i8:
252 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, tu, ma
253 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
255 %elt.head = insertelement <16 x i8> poison, i8 %a, i32 0
256 %va = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
257 %v = call <16 x i8> @llvm.vp.merge.v16i8(<16 x i1> %m, <16 x i8> %va, <16 x i8> %vb, i32 %evl)
261 define <16 x i8> @vpmerge_vi_v16i8(<16 x i8> %vb, <16 x i1> %m, i32 zeroext %evl) {
262 ; CHECK-LABEL: vpmerge_vi_v16i8:
264 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, tu, ma
265 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
267 %v = call <16 x i8> @llvm.vp.merge.v16i8(<16 x i1> %m, <16 x i8> splat (i8 2), <16 x i8> %vb, i32 %evl)
271 declare <2 x i16> @llvm.vp.merge.v2i16(<2 x i1>, <2 x i16>, <2 x i16>, i32)
273 define <2 x i16> @vpmerge_vv_v2i16(<2 x i16> %va, <2 x i16> %vb, <2 x i1> %m, i32 zeroext %evl) {
274 ; CHECK-LABEL: vpmerge_vv_v2i16:
276 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, tu, ma
277 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
278 ; CHECK-NEXT: vmv1r.v v8, v9
280 %v = call <2 x i16> @llvm.vp.merge.v2i16(<2 x i1> %m, <2 x i16> %va, <2 x i16> %vb, i32 %evl)
284 define <2 x i16> @vpmerge_vx_v2i16(i16 %a, <2 x i16> %vb, <2 x i1> %m, i32 zeroext %evl) {
285 ; CHECK-LABEL: vpmerge_vx_v2i16:
287 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, tu, ma
288 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
290 %elt.head = insertelement <2 x i16> poison, i16 %a, i32 0
291 %va = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
292 %v = call <2 x i16> @llvm.vp.merge.v2i16(<2 x i1> %m, <2 x i16> %va, <2 x i16> %vb, i32 %evl)
296 define <2 x i16> @vpmerge_vi_v2i16(<2 x i16> %vb, <2 x i1> %m, i32 zeroext %evl) {
297 ; CHECK-LABEL: vpmerge_vi_v2i16:
299 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, tu, ma
300 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
302 %v = call <2 x i16> @llvm.vp.merge.v2i16(<2 x i1> %m, <2 x i16> splat (i16 2), <2 x i16> %vb, i32 %evl)
306 declare <4 x i16> @llvm.vp.merge.v4i16(<4 x i1>, <4 x i16>, <4 x i16>, i32)
308 define <4 x i16> @vpmerge_vv_v4i16(<4 x i16> %va, <4 x i16> %vb, <4 x i1> %m, i32 zeroext %evl) {
309 ; CHECK-LABEL: vpmerge_vv_v4i16:
311 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, tu, ma
312 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
313 ; CHECK-NEXT: vmv1r.v v8, v9
315 %v = call <4 x i16> @llvm.vp.merge.v4i16(<4 x i1> %m, <4 x i16> %va, <4 x i16> %vb, i32 %evl)
319 define <4 x i16> @vpmerge_vx_v4i16(i16 %a, <4 x i16> %vb, <4 x i1> %m, i32 zeroext %evl) {
320 ; CHECK-LABEL: vpmerge_vx_v4i16:
322 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, tu, ma
323 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
325 %elt.head = insertelement <4 x i16> poison, i16 %a, i32 0
326 %va = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
327 %v = call <4 x i16> @llvm.vp.merge.v4i16(<4 x i1> %m, <4 x i16> %va, <4 x i16> %vb, i32 %evl)
331 define <4 x i16> @vpmerge_vi_v4i16(<4 x i16> %vb, <4 x i1> %m, i32 zeroext %evl) {
332 ; CHECK-LABEL: vpmerge_vi_v4i16:
334 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, tu, ma
335 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
337 %v = call <4 x i16> @llvm.vp.merge.v4i16(<4 x i1> %m, <4 x i16> splat (i16 2), <4 x i16> %vb, i32 %evl)
341 declare <8 x i16> @llvm.vp.merge.v8i16(<8 x i1>, <8 x i16>, <8 x i16>, i32)
343 define <8 x i16> @vpmerge_vv_v8i16(<8 x i16> %va, <8 x i16> %vb, <8 x i1> %m, i32 zeroext %evl) {
344 ; CHECK-LABEL: vpmerge_vv_v8i16:
346 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, tu, ma
347 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
348 ; CHECK-NEXT: vmv1r.v v8, v9
350 %v = call <8 x i16> @llvm.vp.merge.v8i16(<8 x i1> %m, <8 x i16> %va, <8 x i16> %vb, i32 %evl)
354 define <8 x i16> @vpmerge_vx_v8i16(i16 %a, <8 x i16> %vb, <8 x i1> %m, i32 zeroext %evl) {
355 ; CHECK-LABEL: vpmerge_vx_v8i16:
357 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, tu, ma
358 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
360 %elt.head = insertelement <8 x i16> poison, i16 %a, i32 0
361 %va = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
362 %v = call <8 x i16> @llvm.vp.merge.v8i16(<8 x i1> %m, <8 x i16> %va, <8 x i16> %vb, i32 %evl)
366 define <8 x i16> @vpmerge_vi_v8i16(<8 x i16> %vb, <8 x i1> %m, i32 zeroext %evl) {
367 ; CHECK-LABEL: vpmerge_vi_v8i16:
369 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, tu, ma
370 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
372 %v = call <8 x i16> @llvm.vp.merge.v8i16(<8 x i1> %m, <8 x i16> splat (i16 2), <8 x i16> %vb, i32 %evl)
376 declare <16 x i16> @llvm.vp.merge.v16i16(<16 x i1>, <16 x i16>, <16 x i16>, i32)
378 define <16 x i16> @vpmerge_vv_v16i16(<16 x i16> %va, <16 x i16> %vb, <16 x i1> %m, i32 zeroext %evl) {
379 ; CHECK-LABEL: vpmerge_vv_v16i16:
381 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, tu, ma
382 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
383 ; CHECK-NEXT: vmv2r.v v8, v10
385 %v = call <16 x i16> @llvm.vp.merge.v16i16(<16 x i1> %m, <16 x i16> %va, <16 x i16> %vb, i32 %evl)
389 define <16 x i16> @vpmerge_vx_v16i16(i16 %a, <16 x i16> %vb, <16 x i1> %m, i32 zeroext %evl) {
390 ; CHECK-LABEL: vpmerge_vx_v16i16:
392 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, tu, ma
393 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
395 %elt.head = insertelement <16 x i16> poison, i16 %a, i32 0
396 %va = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
397 %v = call <16 x i16> @llvm.vp.merge.v16i16(<16 x i1> %m, <16 x i16> %va, <16 x i16> %vb, i32 %evl)
401 define <16 x i16> @vpmerge_vi_v16i16(<16 x i16> %vb, <16 x i1> %m, i32 zeroext %evl) {
402 ; CHECK-LABEL: vpmerge_vi_v16i16:
404 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, tu, ma
405 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
407 %v = call <16 x i16> @llvm.vp.merge.v16i16(<16 x i1> %m, <16 x i16> splat (i16 2), <16 x i16> %vb, i32 %evl)
411 declare <2 x i32> @llvm.vp.merge.v2i32(<2 x i1>, <2 x i32>, <2 x i32>, i32)
413 define <2 x i32> @vpmerge_vv_v2i32(<2 x i32> %va, <2 x i32> %vb, <2 x i1> %m, i32 zeroext %evl) {
414 ; CHECK-LABEL: vpmerge_vv_v2i32:
416 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, tu, ma
417 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
418 ; CHECK-NEXT: vmv1r.v v8, v9
420 %v = call <2 x i32> @llvm.vp.merge.v2i32(<2 x i1> %m, <2 x i32> %va, <2 x i32> %vb, i32 %evl)
424 define <2 x i32> @vpmerge_vx_v2i32(i32 %a, <2 x i32> %vb, <2 x i1> %m, i32 zeroext %evl) {
425 ; CHECK-LABEL: vpmerge_vx_v2i32:
427 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, tu, ma
428 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
430 %elt.head = insertelement <2 x i32> poison, i32 %a, i32 0
431 %va = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
432 %v = call <2 x i32> @llvm.vp.merge.v2i32(<2 x i1> %m, <2 x i32> %va, <2 x i32> %vb, i32 %evl)
436 define <2 x i32> @vpmerge_vi_v2i32(<2 x i32> %vb, <2 x i1> %m, i32 zeroext %evl) {
437 ; CHECK-LABEL: vpmerge_vi_v2i32:
439 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, tu, ma
440 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
442 %v = call <2 x i32> @llvm.vp.merge.v2i32(<2 x i1> %m, <2 x i32> splat (i32 2), <2 x i32> %vb, i32 %evl)
446 declare <4 x i32> @llvm.vp.merge.v4i32(<4 x i1>, <4 x i32>, <4 x i32>, i32)
448 define <4 x i32> @vpmerge_vv_v4i32(<4 x i32> %va, <4 x i32> %vb, <4 x i1> %m, i32 zeroext %evl) {
449 ; CHECK-LABEL: vpmerge_vv_v4i32:
451 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, ma
452 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
453 ; CHECK-NEXT: vmv1r.v v8, v9
455 %v = call <4 x i32> @llvm.vp.merge.v4i32(<4 x i1> %m, <4 x i32> %va, <4 x i32> %vb, i32 %evl)
459 define <4 x i32> @vpmerge_vx_v4i32(i32 %a, <4 x i32> %vb, <4 x i1> %m, i32 zeroext %evl) {
460 ; CHECK-LABEL: vpmerge_vx_v4i32:
462 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, tu, ma
463 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
465 %elt.head = insertelement <4 x i32> poison, i32 %a, i32 0
466 %va = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
467 %v = call <4 x i32> @llvm.vp.merge.v4i32(<4 x i1> %m, <4 x i32> %va, <4 x i32> %vb, i32 %evl)
471 define <4 x i32> @vpmerge_vi_v4i32(<4 x i32> %vb, <4 x i1> %m, i32 zeroext %evl) {
472 ; CHECK-LABEL: vpmerge_vi_v4i32:
474 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, ma
475 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
477 %v = call <4 x i32> @llvm.vp.merge.v4i32(<4 x i1> %m, <4 x i32> splat (i32 2), <4 x i32> %vb, i32 %evl)
481 declare <8 x i32> @llvm.vp.merge.v8i32(<8 x i1>, <8 x i32>, <8 x i32>, i32)
483 define <8 x i32> @vpmerge_vv_v8i32(<8 x i32> %va, <8 x i32> %vb, <8 x i1> %m, i32 zeroext %evl) {
484 ; CHECK-LABEL: vpmerge_vv_v8i32:
486 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, tu, ma
487 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
488 ; CHECK-NEXT: vmv2r.v v8, v10
490 %v = call <8 x i32> @llvm.vp.merge.v8i32(<8 x i1> %m, <8 x i32> %va, <8 x i32> %vb, i32 %evl)
494 define <8 x i32> @vpmerge_vx_v8i32(i32 %a, <8 x i32> %vb, <8 x i1> %m, i32 zeroext %evl) {
495 ; CHECK-LABEL: vpmerge_vx_v8i32:
497 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, tu, ma
498 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
500 %elt.head = insertelement <8 x i32> poison, i32 %a, i32 0
501 %va = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
502 %v = call <8 x i32> @llvm.vp.merge.v8i32(<8 x i1> %m, <8 x i32> %va, <8 x i32> %vb, i32 %evl)
506 define <8 x i32> @vpmerge_vi_v8i32(<8 x i32> %vb, <8 x i1> %m, i32 zeroext %evl) {
507 ; CHECK-LABEL: vpmerge_vi_v8i32:
509 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, tu, ma
510 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
512 %v = call <8 x i32> @llvm.vp.merge.v8i32(<8 x i1> %m, <8 x i32> splat (i32 2), <8 x i32> %vb, i32 %evl)
516 declare <16 x i32> @llvm.vp.merge.v16i32(<16 x i1>, <16 x i32>, <16 x i32>, i32)
518 define <16 x i32> @vpmerge_vv_v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i1> %m, i32 zeroext %evl) {
519 ; CHECK-LABEL: vpmerge_vv_v16i32:
521 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, tu, ma
522 ; CHECK-NEXT: vmerge.vvm v12, v12, v8, v0
523 ; CHECK-NEXT: vmv4r.v v8, v12
525 %v = call <16 x i32> @llvm.vp.merge.v16i32(<16 x i1> %m, <16 x i32> %va, <16 x i32> %vb, i32 %evl)
529 define <16 x i32> @vpmerge_vx_v16i32(i32 %a, <16 x i32> %vb, <16 x i1> %m, i32 zeroext %evl) {
530 ; CHECK-LABEL: vpmerge_vx_v16i32:
532 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, tu, ma
533 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
535 %elt.head = insertelement <16 x i32> poison, i32 %a, i32 0
536 %va = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
537 %v = call <16 x i32> @llvm.vp.merge.v16i32(<16 x i1> %m, <16 x i32> %va, <16 x i32> %vb, i32 %evl)
541 define <16 x i32> @vpmerge_vi_v16i32(<16 x i32> %vb, <16 x i1> %m, i32 zeroext %evl) {
542 ; CHECK-LABEL: vpmerge_vi_v16i32:
544 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, tu, ma
545 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
547 %v = call <16 x i32> @llvm.vp.merge.v16i32(<16 x i1> %m, <16 x i32> splat (i32 2), <16 x i32> %vb, i32 %evl)
551 declare <2 x i64> @llvm.vp.merge.v2i64(<2 x i1>, <2 x i64>, <2 x i64>, i32)
553 define <2 x i64> @vpmerge_vv_v2i64(<2 x i64> %va, <2 x i64> %vb, <2 x i1> %m, i32 zeroext %evl) {
554 ; CHECK-LABEL: vpmerge_vv_v2i64:
556 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, tu, ma
557 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
558 ; CHECK-NEXT: vmv1r.v v8, v9
560 %v = call <2 x i64> @llvm.vp.merge.v2i64(<2 x i1> %m, <2 x i64> %va, <2 x i64> %vb, i32 %evl)
564 define <2 x i64> @vpmerge_vx_v2i64(i64 %a, <2 x i64> %vb, <2 x i1> %m, i32 zeroext %evl) {
565 ; RV32-LABEL: vpmerge_vx_v2i64:
567 ; RV32-NEXT: addi sp, sp, -16
568 ; RV32-NEXT: .cfi_def_cfa_offset 16
569 ; RV32-NEXT: sw a1, 12(sp)
570 ; RV32-NEXT: sw a0, 8(sp)
571 ; RV32-NEXT: addi a0, sp, 8
572 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
573 ; RV32-NEXT: vlse64.v v9, (a0), zero
574 ; RV32-NEXT: vsetvli zero, a2, e64, m1, tu, ma
575 ; RV32-NEXT: vmerge.vvm v8, v8, v9, v0
576 ; RV32-NEXT: addi sp, sp, 16
579 ; RV64-LABEL: vpmerge_vx_v2i64:
581 ; RV64-NEXT: vsetvli zero, a1, e64, m1, tu, ma
582 ; RV64-NEXT: vmerge.vxm v8, v8, a0, v0
585 ; RV32ZVFHMIN-LABEL: vpmerge_vx_v2i64:
586 ; RV32ZVFHMIN: # %bb.0:
587 ; RV32ZVFHMIN-NEXT: addi sp, sp, -16
588 ; RV32ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
589 ; RV32ZVFHMIN-NEXT: sw a1, 12(sp)
590 ; RV32ZVFHMIN-NEXT: sw a0, 8(sp)
591 ; RV32ZVFHMIN-NEXT: addi a0, sp, 8
592 ; RV32ZVFHMIN-NEXT: vsetivli zero, 2, e64, m1, ta, ma
593 ; RV32ZVFHMIN-NEXT: vlse64.v v9, (a0), zero
594 ; RV32ZVFHMIN-NEXT: vsetvli zero, a2, e64, m1, tu, ma
595 ; RV32ZVFHMIN-NEXT: vmerge.vvm v8, v8, v9, v0
596 ; RV32ZVFHMIN-NEXT: addi sp, sp, 16
597 ; RV32ZVFHMIN-NEXT: ret
599 ; RV64ZVFHMIN-LABEL: vpmerge_vx_v2i64:
600 ; RV64ZVFHMIN: # %bb.0:
601 ; RV64ZVFHMIN-NEXT: vsetvli zero, a1, e64, m1, tu, ma
602 ; RV64ZVFHMIN-NEXT: vmerge.vxm v8, v8, a0, v0
603 ; RV64ZVFHMIN-NEXT: ret
604 %elt.head = insertelement <2 x i64> poison, i64 %a, i32 0
605 %va = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
606 %v = call <2 x i64> @llvm.vp.merge.v2i64(<2 x i1> %m, <2 x i64> %va, <2 x i64> %vb, i32 %evl)
610 define <2 x i64> @vpmerge_vi_v2i64(<2 x i64> %vb, <2 x i1> %m, i32 zeroext %evl) {
611 ; CHECK-LABEL: vpmerge_vi_v2i64:
613 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, tu, ma
614 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
616 %v = call <2 x i64> @llvm.vp.merge.v2i64(<2 x i1> %m, <2 x i64> splat (i64 2), <2 x i64> %vb, i32 %evl)
620 declare <4 x i64> @llvm.vp.merge.v4i64(<4 x i1>, <4 x i64>, <4 x i64>, i32)
622 define <4 x i64> @vpmerge_vv_v4i64(<4 x i64> %va, <4 x i64> %vb, <4 x i1> %m, i32 zeroext %evl) {
623 ; CHECK-LABEL: vpmerge_vv_v4i64:
625 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, tu, ma
626 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
627 ; CHECK-NEXT: vmv2r.v v8, v10
629 %v = call <4 x i64> @llvm.vp.merge.v4i64(<4 x i1> %m, <4 x i64> %va, <4 x i64> %vb, i32 %evl)
633 define <4 x i64> @vpmerge_vx_v4i64(i64 %a, <4 x i64> %vb, <4 x i1> %m, i32 zeroext %evl) {
634 ; RV32-LABEL: vpmerge_vx_v4i64:
636 ; RV32-NEXT: addi sp, sp, -16
637 ; RV32-NEXT: .cfi_def_cfa_offset 16
638 ; RV32-NEXT: sw a1, 12(sp)
639 ; RV32-NEXT: sw a0, 8(sp)
640 ; RV32-NEXT: addi a0, sp, 8
641 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
642 ; RV32-NEXT: vlse64.v v10, (a0), zero
643 ; RV32-NEXT: vsetvli zero, a2, e64, m2, tu, ma
644 ; RV32-NEXT: vmerge.vvm v8, v8, v10, v0
645 ; RV32-NEXT: addi sp, sp, 16
648 ; RV64-LABEL: vpmerge_vx_v4i64:
650 ; RV64-NEXT: vsetvli zero, a1, e64, m2, tu, ma
651 ; RV64-NEXT: vmerge.vxm v8, v8, a0, v0
654 ; RV32ZVFHMIN-LABEL: vpmerge_vx_v4i64:
655 ; RV32ZVFHMIN: # %bb.0:
656 ; RV32ZVFHMIN-NEXT: addi sp, sp, -16
657 ; RV32ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
658 ; RV32ZVFHMIN-NEXT: sw a1, 12(sp)
659 ; RV32ZVFHMIN-NEXT: sw a0, 8(sp)
660 ; RV32ZVFHMIN-NEXT: addi a0, sp, 8
661 ; RV32ZVFHMIN-NEXT: vsetivli zero, 4, e64, m2, ta, ma
662 ; RV32ZVFHMIN-NEXT: vlse64.v v10, (a0), zero
663 ; RV32ZVFHMIN-NEXT: vsetvli zero, a2, e64, m2, tu, ma
664 ; RV32ZVFHMIN-NEXT: vmerge.vvm v8, v8, v10, v0
665 ; RV32ZVFHMIN-NEXT: addi sp, sp, 16
666 ; RV32ZVFHMIN-NEXT: ret
668 ; RV64ZVFHMIN-LABEL: vpmerge_vx_v4i64:
669 ; RV64ZVFHMIN: # %bb.0:
670 ; RV64ZVFHMIN-NEXT: vsetvli zero, a1, e64, m2, tu, ma
671 ; RV64ZVFHMIN-NEXT: vmerge.vxm v8, v8, a0, v0
672 ; RV64ZVFHMIN-NEXT: ret
673 %elt.head = insertelement <4 x i64> poison, i64 %a, i32 0
674 %va = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
675 %v = call <4 x i64> @llvm.vp.merge.v4i64(<4 x i1> %m, <4 x i64> %va, <4 x i64> %vb, i32 %evl)
679 define <4 x i64> @vpmerge_vi_v4i64(<4 x i64> %vb, <4 x i1> %m, i32 zeroext %evl) {
680 ; CHECK-LABEL: vpmerge_vi_v4i64:
682 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, tu, ma
683 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
685 %v = call <4 x i64> @llvm.vp.merge.v4i64(<4 x i1> %m, <4 x i64> splat (i64 2), <4 x i64> %vb, i32 %evl)
689 declare <8 x i64> @llvm.vp.merge.v8i64(<8 x i1>, <8 x i64>, <8 x i64>, i32)
691 define <8 x i64> @vpmerge_vv_v8i64(<8 x i64> %va, <8 x i64> %vb, <8 x i1> %m, i32 zeroext %evl) {
692 ; CHECK-LABEL: vpmerge_vv_v8i64:
694 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, tu, ma
695 ; CHECK-NEXT: vmerge.vvm v12, v12, v8, v0
696 ; CHECK-NEXT: vmv4r.v v8, v12
698 %v = call <8 x i64> @llvm.vp.merge.v8i64(<8 x i1> %m, <8 x i64> %va, <8 x i64> %vb, i32 %evl)
702 define <8 x i64> @vpmerge_vx_v8i64(i64 %a, <8 x i64> %vb, <8 x i1> %m, i32 zeroext %evl) {
703 ; RV32-LABEL: vpmerge_vx_v8i64:
705 ; RV32-NEXT: addi sp, sp, -16
706 ; RV32-NEXT: .cfi_def_cfa_offset 16
707 ; RV32-NEXT: sw a1, 12(sp)
708 ; RV32-NEXT: sw a0, 8(sp)
709 ; RV32-NEXT: addi a0, sp, 8
710 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
711 ; RV32-NEXT: vlse64.v v12, (a0), zero
712 ; RV32-NEXT: vsetvli zero, a2, e64, m4, tu, ma
713 ; RV32-NEXT: vmerge.vvm v8, v8, v12, v0
714 ; RV32-NEXT: addi sp, sp, 16
717 ; RV64-LABEL: vpmerge_vx_v8i64:
719 ; RV64-NEXT: vsetvli zero, a1, e64, m4, tu, ma
720 ; RV64-NEXT: vmerge.vxm v8, v8, a0, v0
723 ; RV32ZVFHMIN-LABEL: vpmerge_vx_v8i64:
724 ; RV32ZVFHMIN: # %bb.0:
725 ; RV32ZVFHMIN-NEXT: addi sp, sp, -16
726 ; RV32ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
727 ; RV32ZVFHMIN-NEXT: sw a1, 12(sp)
728 ; RV32ZVFHMIN-NEXT: sw a0, 8(sp)
729 ; RV32ZVFHMIN-NEXT: addi a0, sp, 8
730 ; RV32ZVFHMIN-NEXT: vsetivli zero, 8, e64, m4, ta, ma
731 ; RV32ZVFHMIN-NEXT: vlse64.v v12, (a0), zero
732 ; RV32ZVFHMIN-NEXT: vsetvli zero, a2, e64, m4, tu, ma
733 ; RV32ZVFHMIN-NEXT: vmerge.vvm v8, v8, v12, v0
734 ; RV32ZVFHMIN-NEXT: addi sp, sp, 16
735 ; RV32ZVFHMIN-NEXT: ret
737 ; RV64ZVFHMIN-LABEL: vpmerge_vx_v8i64:
738 ; RV64ZVFHMIN: # %bb.0:
739 ; RV64ZVFHMIN-NEXT: vsetvli zero, a1, e64, m4, tu, ma
740 ; RV64ZVFHMIN-NEXT: vmerge.vxm v8, v8, a0, v0
741 ; RV64ZVFHMIN-NEXT: ret
742 %elt.head = insertelement <8 x i64> poison, i64 %a, i32 0
743 %va = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
744 %v = call <8 x i64> @llvm.vp.merge.v8i64(<8 x i1> %m, <8 x i64> %va, <8 x i64> %vb, i32 %evl)
748 define <8 x i64> @vpmerge_vi_v8i64(<8 x i64> %vb, <8 x i1> %m, i32 zeroext %evl) {
749 ; CHECK-LABEL: vpmerge_vi_v8i64:
751 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, tu, ma
752 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
754 %v = call <8 x i64> @llvm.vp.merge.v8i64(<8 x i1> %m, <8 x i64> splat (i64 2), <8 x i64> %vb, i32 %evl)
758 declare <16 x i64> @llvm.vp.merge.v16i64(<16 x i1>, <16 x i64>, <16 x i64>, i32)
760 define <16 x i64> @vpmerge_vv_v16i64(<16 x i64> %va, <16 x i64> %vb, <16 x i1> %m, i32 zeroext %evl) {
761 ; CHECK-LABEL: vpmerge_vv_v16i64:
763 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, tu, ma
764 ; CHECK-NEXT: vmerge.vvm v16, v16, v8, v0
765 ; CHECK-NEXT: vmv8r.v v8, v16
767 %v = call <16 x i64> @llvm.vp.merge.v16i64(<16 x i1> %m, <16 x i64> %va, <16 x i64> %vb, i32 %evl)
771 define <16 x i64> @vpmerge_vx_v16i64(i64 %a, <16 x i64> %vb, <16 x i1> %m, i32 zeroext %evl) {
772 ; RV32-LABEL: vpmerge_vx_v16i64:
774 ; RV32-NEXT: addi sp, sp, -16
775 ; RV32-NEXT: .cfi_def_cfa_offset 16
776 ; RV32-NEXT: sw a1, 12(sp)
777 ; RV32-NEXT: sw a0, 8(sp)
778 ; RV32-NEXT: addi a0, sp, 8
779 ; RV32-NEXT: vsetivli zero, 16, e64, m8, ta, ma
780 ; RV32-NEXT: vlse64.v v16, (a0), zero
781 ; RV32-NEXT: vsetvli zero, a2, e64, m8, tu, ma
782 ; RV32-NEXT: vmerge.vvm v8, v8, v16, v0
783 ; RV32-NEXT: addi sp, sp, 16
786 ; RV64-LABEL: vpmerge_vx_v16i64:
788 ; RV64-NEXT: vsetvli zero, a1, e64, m8, tu, ma
789 ; RV64-NEXT: vmerge.vxm v8, v8, a0, v0
792 ; RV32ZVFHMIN-LABEL: vpmerge_vx_v16i64:
793 ; RV32ZVFHMIN: # %bb.0:
794 ; RV32ZVFHMIN-NEXT: addi sp, sp, -16
795 ; RV32ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
796 ; RV32ZVFHMIN-NEXT: sw a1, 12(sp)
797 ; RV32ZVFHMIN-NEXT: sw a0, 8(sp)
798 ; RV32ZVFHMIN-NEXT: addi a0, sp, 8
799 ; RV32ZVFHMIN-NEXT: vsetivli zero, 16, e64, m8, ta, ma
800 ; RV32ZVFHMIN-NEXT: vlse64.v v16, (a0), zero
801 ; RV32ZVFHMIN-NEXT: vsetvli zero, a2, e64, m8, tu, ma
802 ; RV32ZVFHMIN-NEXT: vmerge.vvm v8, v8, v16, v0
803 ; RV32ZVFHMIN-NEXT: addi sp, sp, 16
804 ; RV32ZVFHMIN-NEXT: ret
806 ; RV64ZVFHMIN-LABEL: vpmerge_vx_v16i64:
807 ; RV64ZVFHMIN: # %bb.0:
808 ; RV64ZVFHMIN-NEXT: vsetvli zero, a1, e64, m8, tu, ma
809 ; RV64ZVFHMIN-NEXT: vmerge.vxm v8, v8, a0, v0
810 ; RV64ZVFHMIN-NEXT: ret
811 %elt.head = insertelement <16 x i64> poison, i64 %a, i32 0
812 %va = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
813 %v = call <16 x i64> @llvm.vp.merge.v16i64(<16 x i1> %m, <16 x i64> %va, <16 x i64> %vb, i32 %evl)
817 define <16 x i64> @vpmerge_vi_v16i64(<16 x i64> %vb, <16 x i1> %m, i32 zeroext %evl) {
818 ; CHECK-LABEL: vpmerge_vi_v16i64:
820 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, tu, ma
821 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
823 %v = call <16 x i64> @llvm.vp.merge.v16i64(<16 x i1> %m, <16 x i64> splat (i64 2), <16 x i64> %vb, i32 %evl)
827 declare <2 x half> @llvm.vp.merge.v2f16(<2 x i1>, <2 x half>, <2 x half>, i32)
829 define <2 x half> @vpmerge_vv_v2f16(<2 x half> %va, <2 x half> %vb, <2 x i1> %m, i32 zeroext %evl) {
830 ; CHECK-LABEL: vpmerge_vv_v2f16:
832 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, tu, ma
833 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
834 ; CHECK-NEXT: vmv1r.v v8, v9
836 %v = call <2 x half> @llvm.vp.merge.v2f16(<2 x i1> %m, <2 x half> %va, <2 x half> %vb, i32 %evl)
840 define <2 x half> @vpmerge_vf_v2f16(half %a, <2 x half> %vb, <2 x i1> %m, i32 zeroext %evl) {
841 ; ZVFH-LABEL: vpmerge_vf_v2f16:
843 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, tu, ma
844 ; ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
847 ; ZVFHMIN-LABEL: vpmerge_vf_v2f16:
849 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
850 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
851 ; ZVFHMIN-NEXT: vfmv.v.f v9, fa5
852 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf4, tu, mu
853 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9, v0.t
855 %elt.head = insertelement <2 x half> poison, half %a, i32 0
856 %va = shufflevector <2 x half> %elt.head, <2 x half> poison, <2 x i32> zeroinitializer
857 %v = call <2 x half> @llvm.vp.merge.v2f16(<2 x i1> %m, <2 x half> %va, <2 x half> %vb, i32 %evl)
861 declare <4 x half> @llvm.vp.merge.v4f16(<4 x i1>, <4 x half>, <4 x half>, i32)
863 define <4 x half> @vpmerge_vv_v4f16(<4 x half> %va, <4 x half> %vb, <4 x i1> %m, i32 zeroext %evl) {
864 ; CHECK-LABEL: vpmerge_vv_v4f16:
866 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, tu, ma
867 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
868 ; CHECK-NEXT: vmv1r.v v8, v9
870 %v = call <4 x half> @llvm.vp.merge.v4f16(<4 x i1> %m, <4 x half> %va, <4 x half> %vb, i32 %evl)
874 define <4 x half> @vpmerge_vf_v4f16(half %a, <4 x half> %vb, <4 x i1> %m, i32 zeroext %evl) {
875 ; ZVFH-LABEL: vpmerge_vf_v4f16:
877 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, tu, ma
878 ; ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
881 ; ZVFHMIN-LABEL: vpmerge_vf_v4f16:
883 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
884 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m1, ta, ma
885 ; ZVFHMIN-NEXT: vfmv.v.f v9, fa5
886 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf2, tu, mu
887 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9, v0.t
889 %elt.head = insertelement <4 x half> poison, half %a, i32 0
890 %va = shufflevector <4 x half> %elt.head, <4 x half> poison, <4 x i32> zeroinitializer
891 %v = call <4 x half> @llvm.vp.merge.v4f16(<4 x i1> %m, <4 x half> %va, <4 x half> %vb, i32 %evl)
895 declare <8 x half> @llvm.vp.merge.v8f16(<8 x i1>, <8 x half>, <8 x half>, i32)
897 define <8 x half> @vpmerge_vv_v8f16(<8 x half> %va, <8 x half> %vb, <8 x i1> %m, i32 zeroext %evl) {
898 ; CHECK-LABEL: vpmerge_vv_v8f16:
900 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, tu, ma
901 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
902 ; CHECK-NEXT: vmv1r.v v8, v9
904 %v = call <8 x half> @llvm.vp.merge.v8f16(<8 x i1> %m, <8 x half> %va, <8 x half> %vb, i32 %evl)
908 define <8 x half> @vpmerge_vf_v8f16(half %a, <8 x half> %vb, <8 x i1> %m, i32 zeroext %evl) {
909 ; ZVFH-LABEL: vpmerge_vf_v8f16:
911 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, tu, ma
912 ; ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
915 ; ZVFHMIN-LABEL: vpmerge_vf_v8f16:
917 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
918 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m2, ta, ma
919 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
920 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, m1, tu, mu
921 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10, v0.t
923 %elt.head = insertelement <8 x half> poison, half %a, i32 0
924 %va = shufflevector <8 x half> %elt.head, <8 x half> poison, <8 x i32> zeroinitializer
925 %v = call <8 x half> @llvm.vp.merge.v8f16(<8 x i1> %m, <8 x half> %va, <8 x half> %vb, i32 %evl)
929 declare <16 x half> @llvm.vp.merge.v16f16(<16 x i1>, <16 x half>, <16 x half>, i32)
931 define <16 x half> @vpmerge_vv_v16f16(<16 x half> %va, <16 x half> %vb, <16 x i1> %m, i32 zeroext %evl) {
932 ; CHECK-LABEL: vpmerge_vv_v16f16:
934 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, tu, ma
935 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
936 ; CHECK-NEXT: vmv2r.v v8, v10
938 %v = call <16 x half> @llvm.vp.merge.v16f16(<16 x i1> %m, <16 x half> %va, <16 x half> %vb, i32 %evl)
942 define <16 x half> @vpmerge_vf_v16f16(half %a, <16 x half> %vb, <16 x i1> %m, i32 zeroext %evl) {
943 ; ZVFH-LABEL: vpmerge_vf_v16f16:
945 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, tu, ma
946 ; ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
949 ; ZVFHMIN-LABEL: vpmerge_vf_v16f16:
951 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
952 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m4, ta, ma
953 ; ZVFHMIN-NEXT: vfmv.v.f v12, fa5
954 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, m2, tu, mu
955 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12, v0.t
957 %elt.head = insertelement <16 x half> poison, half %a, i32 0
958 %va = shufflevector <16 x half> %elt.head, <16 x half> poison, <16 x i32> zeroinitializer
959 %v = call <16 x half> @llvm.vp.merge.v16f16(<16 x i1> %m, <16 x half> %va, <16 x half> %vb, i32 %evl)
963 declare <2 x float> @llvm.vp.merge.v2f32(<2 x i1>, <2 x float>, <2 x float>, i32)
965 define <2 x float> @vpmerge_vv_v2f32(<2 x float> %va, <2 x float> %vb, <2 x i1> %m, i32 zeroext %evl) {
966 ; CHECK-LABEL: vpmerge_vv_v2f32:
968 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, tu, ma
969 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
970 ; CHECK-NEXT: vmv1r.v v8, v9
972 %v = call <2 x float> @llvm.vp.merge.v2f32(<2 x i1> %m, <2 x float> %va, <2 x float> %vb, i32 %evl)
976 define <2 x float> @vpmerge_vf_v2f32(float %a, <2 x float> %vb, <2 x i1> %m, i32 zeroext %evl) {
977 ; CHECK-LABEL: vpmerge_vf_v2f32:
979 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, tu, ma
980 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
982 %elt.head = insertelement <2 x float> poison, float %a, i32 0
983 %va = shufflevector <2 x float> %elt.head, <2 x float> poison, <2 x i32> zeroinitializer
984 %v = call <2 x float> @llvm.vp.merge.v2f32(<2 x i1> %m, <2 x float> %va, <2 x float> %vb, i32 %evl)
988 declare <4 x float> @llvm.vp.merge.v4f32(<4 x i1>, <4 x float>, <4 x float>, i32)
990 define <4 x float> @vpmerge_vv_v4f32(<4 x float> %va, <4 x float> %vb, <4 x i1> %m, i32 zeroext %evl) {
991 ; CHECK-LABEL: vpmerge_vv_v4f32:
993 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, ma
994 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
995 ; CHECK-NEXT: vmv1r.v v8, v9
997 %v = call <4 x float> @llvm.vp.merge.v4f32(<4 x i1> %m, <4 x float> %va, <4 x float> %vb, i32 %evl)
1001 define <4 x float> @vpmerge_vf_v4f32(float %a, <4 x float> %vb, <4 x i1> %m, i32 zeroext %evl) {
1002 ; CHECK-LABEL: vpmerge_vf_v4f32:
1004 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, ma
1005 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1007 %elt.head = insertelement <4 x float> poison, float %a, i32 0
1008 %va = shufflevector <4 x float> %elt.head, <4 x float> poison, <4 x i32> zeroinitializer
1009 %v = call <4 x float> @llvm.vp.merge.v4f32(<4 x i1> %m, <4 x float> %va, <4 x float> %vb, i32 %evl)
1013 declare <8 x float> @llvm.vp.merge.v8f32(<8 x i1>, <8 x float>, <8 x float>, i32)
1015 define <8 x float> @vpmerge_vv_v8f32(<8 x float> %va, <8 x float> %vb, <8 x i1> %m, i32 zeroext %evl) {
1016 ; CHECK-LABEL: vpmerge_vv_v8f32:
1018 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, tu, ma
1019 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
1020 ; CHECK-NEXT: vmv2r.v v8, v10
1022 %v = call <8 x float> @llvm.vp.merge.v8f32(<8 x i1> %m, <8 x float> %va, <8 x float> %vb, i32 %evl)
1026 define <8 x float> @vpmerge_vf_v8f32(float %a, <8 x float> %vb, <8 x i1> %m, i32 zeroext %evl) {
1027 ; CHECK-LABEL: vpmerge_vf_v8f32:
1029 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, tu, ma
1030 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1032 %elt.head = insertelement <8 x float> poison, float %a, i32 0
1033 %va = shufflevector <8 x float> %elt.head, <8 x float> poison, <8 x i32> zeroinitializer
1034 %v = call <8 x float> @llvm.vp.merge.v8f32(<8 x i1> %m, <8 x float> %va, <8 x float> %vb, i32 %evl)
1038 declare <16 x float> @llvm.vp.merge.v16f32(<16 x i1>, <16 x float>, <16 x float>, i32)
1040 define <16 x float> @vpmerge_vv_v16f32(<16 x float> %va, <16 x float> %vb, <16 x i1> %m, i32 zeroext %evl) {
1041 ; CHECK-LABEL: vpmerge_vv_v16f32:
1043 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, tu, ma
1044 ; CHECK-NEXT: vmerge.vvm v12, v12, v8, v0
1045 ; CHECK-NEXT: vmv4r.v v8, v12
1047 %v = call <16 x float> @llvm.vp.merge.v16f32(<16 x i1> %m, <16 x float> %va, <16 x float> %vb, i32 %evl)
1051 define <16 x float> @vpmerge_vf_v16f32(float %a, <16 x float> %vb, <16 x i1> %m, i32 zeroext %evl) {
1052 ; CHECK-LABEL: vpmerge_vf_v16f32:
1054 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, tu, ma
1055 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1057 %elt.head = insertelement <16 x float> poison, float %a, i32 0
1058 %va = shufflevector <16 x float> %elt.head, <16 x float> poison, <16 x i32> zeroinitializer
1059 %v = call <16 x float> @llvm.vp.merge.v16f32(<16 x i1> %m, <16 x float> %va, <16 x float> %vb, i32 %evl)
1063 declare <2 x double> @llvm.vp.merge.v2f64(<2 x i1>, <2 x double>, <2 x double>, i32)
1065 define <2 x double> @vpmerge_vv_v2f64(<2 x double> %va, <2 x double> %vb, <2 x i1> %m, i32 zeroext %evl) {
1066 ; CHECK-LABEL: vpmerge_vv_v2f64:
1068 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, tu, ma
1069 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
1070 ; CHECK-NEXT: vmv1r.v v8, v9
1072 %v = call <2 x double> @llvm.vp.merge.v2f64(<2 x i1> %m, <2 x double> %va, <2 x double> %vb, i32 %evl)
1076 define <2 x double> @vpmerge_vf_v2f64(double %a, <2 x double> %vb, <2 x i1> %m, i32 zeroext %evl) {
1077 ; CHECK-LABEL: vpmerge_vf_v2f64:
1079 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, tu, ma
1080 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1082 %elt.head = insertelement <2 x double> poison, double %a, i32 0
1083 %va = shufflevector <2 x double> %elt.head, <2 x double> poison, <2 x i32> zeroinitializer
1084 %v = call <2 x double> @llvm.vp.merge.v2f64(<2 x i1> %m, <2 x double> %va, <2 x double> %vb, i32 %evl)
1088 declare <4 x double> @llvm.vp.merge.v4f64(<4 x i1>, <4 x double>, <4 x double>, i32)
1090 define <4 x double> @vpmerge_vv_v4f64(<4 x double> %va, <4 x double> %vb, <4 x i1> %m, i32 zeroext %evl) {
1091 ; CHECK-LABEL: vpmerge_vv_v4f64:
1093 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, tu, ma
1094 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
1095 ; CHECK-NEXT: vmv2r.v v8, v10
1097 %v = call <4 x double> @llvm.vp.merge.v4f64(<4 x i1> %m, <4 x double> %va, <4 x double> %vb, i32 %evl)
1101 define <4 x double> @vpmerge_vf_v4f64(double %a, <4 x double> %vb, <4 x i1> %m, i32 zeroext %evl) {
1102 ; CHECK-LABEL: vpmerge_vf_v4f64:
1104 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, tu, ma
1105 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1107 %elt.head = insertelement <4 x double> poison, double %a, i32 0
1108 %va = shufflevector <4 x double> %elt.head, <4 x double> poison, <4 x i32> zeroinitializer
1109 %v = call <4 x double> @llvm.vp.merge.v4f64(<4 x i1> %m, <4 x double> %va, <4 x double> %vb, i32 %evl)
1113 declare <8 x double> @llvm.vp.merge.v8f64(<8 x i1>, <8 x double>, <8 x double>, i32)
1115 define <8 x double> @vpmerge_vv_v8f64(<8 x double> %va, <8 x double> %vb, <8 x i1> %m, i32 zeroext %evl) {
1116 ; CHECK-LABEL: vpmerge_vv_v8f64:
1118 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, tu, ma
1119 ; CHECK-NEXT: vmerge.vvm v12, v12, v8, v0
1120 ; CHECK-NEXT: vmv4r.v v8, v12
1122 %v = call <8 x double> @llvm.vp.merge.v8f64(<8 x i1> %m, <8 x double> %va, <8 x double> %vb, i32 %evl)
1126 define <8 x double> @vpmerge_vf_v8f64(double %a, <8 x double> %vb, <8 x i1> %m, i32 zeroext %evl) {
1127 ; CHECK-LABEL: vpmerge_vf_v8f64:
1129 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, tu, ma
1130 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1132 %elt.head = insertelement <8 x double> poison, double %a, i32 0
1133 %va = shufflevector <8 x double> %elt.head, <8 x double> poison, <8 x i32> zeroinitializer
1134 %v = call <8 x double> @llvm.vp.merge.v8f64(<8 x i1> %m, <8 x double> %va, <8 x double> %vb, i32 %evl)
1138 declare <16 x double> @llvm.vp.merge.v16f64(<16 x i1>, <16 x double>, <16 x double>, i32)
1140 define <16 x double> @vpmerge_vv_v16f64(<16 x double> %va, <16 x double> %vb, <16 x i1> %m, i32 zeroext %evl) {
1141 ; CHECK-LABEL: vpmerge_vv_v16f64:
1143 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, tu, ma
1144 ; CHECK-NEXT: vmerge.vvm v16, v16, v8, v0
1145 ; CHECK-NEXT: vmv8r.v v8, v16
1147 %v = call <16 x double> @llvm.vp.merge.v16f64(<16 x i1> %m, <16 x double> %va, <16 x double> %vb, i32 %evl)
1148 ret <16 x double> %v
1151 define <16 x double> @vpmerge_vf_v16f64(double %a, <16 x double> %vb, <16 x i1> %m, i32 zeroext %evl) {
1152 ; CHECK-LABEL: vpmerge_vf_v16f64:
1154 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, tu, ma
1155 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1157 %elt.head = insertelement <16 x double> poison, double %a, i32 0
1158 %va = shufflevector <16 x double> %elt.head, <16 x double> poison, <16 x i32> zeroinitializer
1159 %v = call <16 x double> @llvm.vp.merge.v16f64(<16 x i1> %m, <16 x double> %va, <16 x double> %vb, i32 %evl)
1160 ret <16 x double> %v
1163 declare <32 x double> @llvm.vp.merge.v32f64(<32 x i1>, <32 x double>, <32 x double>, i32)
1165 define <32 x double> @vpmerge_vv_v32f64(<32 x double> %va, <32 x double> %vb, <32 x i1> %m, i32 zeroext %evl) {
1166 ; CHECK-LABEL: vpmerge_vv_v32f64:
1168 ; CHECK-NEXT: addi sp, sp, -16
1169 ; CHECK-NEXT: .cfi_def_cfa_offset 16
1170 ; CHECK-NEXT: csrr a1, vlenb
1171 ; CHECK-NEXT: slli a1, a1, 4
1172 ; CHECK-NEXT: sub sp, sp, a1
1173 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x10, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 16 * vlenb
1174 ; CHECK-NEXT: addi a1, a0, 128
1175 ; CHECK-NEXT: vsetivli zero, 16, e64, m8, ta, ma
1176 ; CHECK-NEXT: vle64.v v24, (a1)
1177 ; CHECK-NEXT: csrr a1, vlenb
1178 ; CHECK-NEXT: slli a1, a1, 3
1179 ; CHECK-NEXT: add a1, sp, a1
1180 ; CHECK-NEXT: addi a1, a1, 16
1181 ; CHECK-NEXT: vs8r.v v24, (a1) # Unknown-size Folded Spill
1182 ; CHECK-NEXT: vle64.v v24, (a0)
1183 ; CHECK-NEXT: li a1, 16
1184 ; CHECK-NEXT: addi a0, sp, 16
1185 ; CHECK-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
1186 ; CHECK-NEXT: mv a0, a2
1187 ; CHECK-NEXT: bltu a2, a1, .LBB79_2
1188 ; CHECK-NEXT: # %bb.1:
1189 ; CHECK-NEXT: li a0, 16
1190 ; CHECK-NEXT: .LBB79_2:
1191 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, tu, ma
1192 ; CHECK-NEXT: vmerge.vvm v24, v24, v8, v0
1193 ; CHECK-NEXT: addi a0, a2, -16
1194 ; CHECK-NEXT: sltu a1, a2, a0
1195 ; CHECK-NEXT: addi a1, a1, -1
1196 ; CHECK-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
1197 ; CHECK-NEXT: vslidedown.vi v0, v0, 2
1198 ; CHECK-NEXT: and a0, a1, a0
1199 ; CHECK-NEXT: csrr a1, vlenb
1200 ; CHECK-NEXT: slli a1, a1, 3
1201 ; CHECK-NEXT: add a1, sp, a1
1202 ; CHECK-NEXT: addi a1, a1, 16
1203 ; CHECK-NEXT: vl8r.v v16, (a1) # Unknown-size Folded Reload
1204 ; CHECK-NEXT: addi a1, sp, 16
1205 ; CHECK-NEXT: vl8r.v v8, (a1) # Unknown-size Folded Reload
1206 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, tu, ma
1207 ; CHECK-NEXT: vmerge.vvm v16, v16, v8, v0
1208 ; CHECK-NEXT: vmv8r.v v8, v24
1209 ; CHECK-NEXT: csrr a0, vlenb
1210 ; CHECK-NEXT: slli a0, a0, 4
1211 ; CHECK-NEXT: add sp, sp, a0
1212 ; CHECK-NEXT: addi sp, sp, 16
1214 %v = call <32 x double> @llvm.vp.merge.v32f64(<32 x i1> %m, <32 x double> %va, <32 x double> %vb, i32 %evl)
1215 ret <32 x double> %v
1218 define <32 x double> @vpmerge_vf_v32f64(double %a, <32 x double> %vb, <32 x i1> %m, i32 zeroext %evl) {
1219 ; CHECK-LABEL: vpmerge_vf_v32f64:
1221 ; CHECK-NEXT: li a2, 16
1222 ; CHECK-NEXT: mv a1, a0
1223 ; CHECK-NEXT: bltu a0, a2, .LBB80_2
1224 ; CHECK-NEXT: # %bb.1:
1225 ; CHECK-NEXT: li a1, 16
1226 ; CHECK-NEXT: .LBB80_2:
1227 ; CHECK-NEXT: vsetvli zero, a1, e64, m8, tu, ma
1228 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1229 ; CHECK-NEXT: addi a1, a0, -16
1230 ; CHECK-NEXT: sltu a0, a0, a1
1231 ; CHECK-NEXT: addi a0, a0, -1
1232 ; CHECK-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
1233 ; CHECK-NEXT: vslidedown.vi v0, v0, 2
1234 ; CHECK-NEXT: and a0, a0, a1
1235 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, tu, ma
1236 ; CHECK-NEXT: vfmerge.vfm v16, v16, fa0, v0
1238 %elt.head = insertelement <32 x double> poison, double %a, i32 0
1239 %va = shufflevector <32 x double> %elt.head, <32 x double> poison, <32 x i32> zeroinitializer
1240 %v = call <32 x double> @llvm.vp.merge.v32f64(<32 x i1> %m, <32 x double> %va, <32 x double> %vb, i32 %evl)
1241 ret <32 x double> %v