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 %elt.head = insertelement <2 x i8> poison, i8 2, i32 0
93 %va = shufflevector <2 x i8> %elt.head, <2 x i8> poison, <2 x i32> zeroinitializer
94 %v = call <2 x i8> @llvm.vp.merge.v2i8(<2 x i1> %m, <2 x i8> %va, <2 x i8> %vb, i32 %evl)
98 declare <4 x i8> @llvm.vp.merge.v4i8(<4 x i1>, <4 x i8>, <4 x i8>, i32)
100 define <4 x i8> @vpmerge_vv_v4i8(<4 x i8> %va, <4 x i8> %vb, <4 x i1> %m, i32 zeroext %evl) {
101 ; CHECK-LABEL: vpmerge_vv_v4i8:
103 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, tu, ma
104 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
105 ; CHECK-NEXT: vmv1r.v v8, v9
107 %v = call <4 x i8> @llvm.vp.merge.v4i8(<4 x i1> %m, <4 x i8> %va, <4 x i8> %vb, i32 %evl)
111 define <4 x i8> @vpmerge_vx_v4i8(i8 %a, <4 x i8> %vb, <4 x i1> %m, i32 zeroext %evl) {
112 ; CHECK-LABEL: vpmerge_vx_v4i8:
114 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, tu, ma
115 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
117 %elt.head = insertelement <4 x i8> poison, i8 %a, i32 0
118 %va = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
119 %v = call <4 x i8> @llvm.vp.merge.v4i8(<4 x i1> %m, <4 x i8> %va, <4 x i8> %vb, i32 %evl)
123 define <4 x i8> @vpmerge_vi_v4i8(<4 x i8> %vb, <4 x i1> %m, i32 zeroext %evl) {
124 ; CHECK-LABEL: vpmerge_vi_v4i8:
126 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, tu, ma
127 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
129 %elt.head = insertelement <4 x i8> poison, i8 2, i32 0
130 %va = shufflevector <4 x i8> %elt.head, <4 x i8> poison, <4 x i32> zeroinitializer
131 %v = call <4 x i8> @llvm.vp.merge.v4i8(<4 x i1> %m, <4 x i8> %va, <4 x i8> %vb, i32 %evl)
135 declare <6 x i8> @llvm.vp.merge.v6i8(<6 x i1>, <6 x i8>, <6 x i8>, i32)
137 define <6 x i8> @vpmerge_vv_v6i8(<6 x i8> %va, <6 x i8> %vb, <6 x i1> %m, i32 zeroext %evl) {
138 ; CHECK-LABEL: vpmerge_vv_v6i8:
140 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, tu, ma
141 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
142 ; CHECK-NEXT: vmv1r.v v8, v9
144 %v = call <6 x i8> @llvm.vp.merge.v6i8(<6 x i1> %m, <6 x i8> %va, <6 x i8> %vb, i32 %evl)
148 define <6 x i8> @vpmerge_vx_v6i8(i8 %a, <6 x i8> %vb, <6 x i1> %m, i32 zeroext %evl) {
149 ; CHECK-LABEL: vpmerge_vx_v6i8:
151 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, tu, ma
152 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
154 %elt.head = insertelement <6 x i8> poison, i8 %a, i32 0
155 %va = shufflevector <6 x i8> %elt.head, <6 x i8> poison, <6 x i32> zeroinitializer
156 %v = call <6 x i8> @llvm.vp.merge.v6i8(<6 x i1> %m, <6 x i8> %va, <6 x i8> %vb, i32 %evl)
160 define <6 x i8> @vpmerge_vi_v6i8(<6 x i8> %vb, <6 x i1> %m, i32 zeroext %evl) {
161 ; CHECK-LABEL: vpmerge_vi_v6i8:
163 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, tu, ma
164 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
166 %elt.head = insertelement <6 x i8> poison, i8 2, i32 0
167 %va = shufflevector <6 x i8> %elt.head, <6 x i8> poison, <6 x i32> zeroinitializer
168 %v = call <6 x i8> @llvm.vp.merge.v6i8(<6 x i1> %m, <6 x i8> %va, <6 x i8> %vb, i32 %evl)
172 declare <8 x i7> @llvm.vp.merge.v8i7(<8 x i1>, <8 x i7>, <8 x i7>, i32)
174 define <8 x i7> @vpmerge_vv_v8i7(<8 x i7> %va, <8 x i7> %vb, <8 x i1> %m, i32 zeroext %evl) {
175 ; CHECK-LABEL: vpmerge_vv_v8i7:
177 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, tu, ma
178 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
179 ; CHECK-NEXT: vmv1r.v v8, v9
181 %v = call <8 x i7> @llvm.vp.merge.v8i7(<8 x i1> %m, <8 x i7> %va, <8 x i7> %vb, i32 %evl)
185 define <8 x i7> @vpmerge_vx_v8i7(i7 %a, <8 x i7> %vb, <8 x i1> %m, i32 zeroext %evl) {
186 ; CHECK-LABEL: vpmerge_vx_v8i7:
188 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, tu, ma
189 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
191 %elt.head = insertelement <8 x i7> poison, i7 %a, i32 0
192 %va = shufflevector <8 x i7> %elt.head, <8 x i7> poison, <8 x i32> zeroinitializer
193 %v = call <8 x i7> @llvm.vp.merge.v8i7(<8 x i1> %m, <8 x i7> %va, <8 x i7> %vb, i32 %evl)
197 define <8 x i7> @vpmerge_vi_v8i7(<8 x i7> %vb, <8 x i1> %m, i32 zeroext %evl) {
198 ; CHECK-LABEL: vpmerge_vi_v8i7:
200 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, tu, ma
201 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
203 %elt.head = insertelement <8 x i7> poison, i7 2, i32 0
204 %va = shufflevector <8 x i7> %elt.head, <8 x i7> poison, <8 x i32> zeroinitializer
205 %v = call <8 x i7> @llvm.vp.merge.v8i7(<8 x i1> %m, <8 x i7> %va, <8 x i7> %vb, i32 %evl)
209 declare <8 x i8> @llvm.vp.merge.v8i8(<8 x i1>, <8 x i8>, <8 x i8>, i32)
211 define <8 x i8> @vpmerge_vv_v8i8(<8 x i8> %va, <8 x i8> %vb, <8 x i1> %m, i32 zeroext %evl) {
212 ; CHECK-LABEL: vpmerge_vv_v8i8:
214 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, tu, ma
215 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
216 ; CHECK-NEXT: vmv1r.v v8, v9
218 %v = call <8 x i8> @llvm.vp.merge.v8i8(<8 x i1> %m, <8 x i8> %va, <8 x i8> %vb, i32 %evl)
222 define <8 x i8> @vpmerge_vx_v8i8(i8 %a, <8 x i8> %vb, <8 x i1> %m, i32 zeroext %evl) {
223 ; CHECK-LABEL: vpmerge_vx_v8i8:
225 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, tu, ma
226 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
228 %elt.head = insertelement <8 x i8> poison, i8 %a, i32 0
229 %va = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
230 %v = call <8 x i8> @llvm.vp.merge.v8i8(<8 x i1> %m, <8 x i8> %va, <8 x i8> %vb, i32 %evl)
234 define <8 x i8> @vpmerge_vi_v8i8(<8 x i8> %vb, <8 x i1> %m, i32 zeroext %evl) {
235 ; CHECK-LABEL: vpmerge_vi_v8i8:
237 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, tu, ma
238 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
240 %elt.head = insertelement <8 x i8> poison, i8 2, i32 0
241 %va = shufflevector <8 x i8> %elt.head, <8 x i8> poison, <8 x i32> zeroinitializer
242 %v = call <8 x i8> @llvm.vp.merge.v8i8(<8 x i1> %m, <8 x i8> %va, <8 x i8> %vb, i32 %evl)
246 declare <16 x i8> @llvm.vp.merge.v16i8(<16 x i1>, <16 x i8>, <16 x i8>, i32)
248 define <16 x i8> @vpmerge_vv_v16i8(<16 x i8> %va, <16 x i8> %vb, <16 x i1> %m, i32 zeroext %evl) {
249 ; CHECK-LABEL: vpmerge_vv_v16i8:
251 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, tu, ma
252 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
253 ; CHECK-NEXT: vmv1r.v v8, v9
255 %v = call <16 x i8> @llvm.vp.merge.v16i8(<16 x i1> %m, <16 x i8> %va, <16 x i8> %vb, i32 %evl)
259 define <16 x i8> @vpmerge_vx_v16i8(i8 %a, <16 x i8> %vb, <16 x i1> %m, i32 zeroext %evl) {
260 ; CHECK-LABEL: vpmerge_vx_v16i8:
262 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, tu, ma
263 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
265 %elt.head = insertelement <16 x i8> poison, i8 %a, i32 0
266 %va = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
267 %v = call <16 x i8> @llvm.vp.merge.v16i8(<16 x i1> %m, <16 x i8> %va, <16 x i8> %vb, i32 %evl)
271 define <16 x i8> @vpmerge_vi_v16i8(<16 x i8> %vb, <16 x i1> %m, i32 zeroext %evl) {
272 ; CHECK-LABEL: vpmerge_vi_v16i8:
274 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, tu, ma
275 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
277 %elt.head = insertelement <16 x i8> poison, i8 2, i32 0
278 %va = shufflevector <16 x i8> %elt.head, <16 x i8> poison, <16 x i32> zeroinitializer
279 %v = call <16 x i8> @llvm.vp.merge.v16i8(<16 x i1> %m, <16 x i8> %va, <16 x i8> %vb, i32 %evl)
283 declare <2 x i16> @llvm.vp.merge.v2i16(<2 x i1>, <2 x i16>, <2 x i16>, i32)
285 define <2 x i16> @vpmerge_vv_v2i16(<2 x i16> %va, <2 x i16> %vb, <2 x i1> %m, i32 zeroext %evl) {
286 ; CHECK-LABEL: vpmerge_vv_v2i16:
288 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, tu, ma
289 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
290 ; CHECK-NEXT: vmv1r.v v8, v9
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_vx_v2i16(i16 %a, <2 x i16> %vb, <2 x i1> %m, i32 zeroext %evl) {
297 ; CHECK-LABEL: vpmerge_vx_v2i16:
299 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, tu, ma
300 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
302 %elt.head = insertelement <2 x i16> poison, i16 %a, i32 0
303 %va = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
304 %v = call <2 x i16> @llvm.vp.merge.v2i16(<2 x i1> %m, <2 x i16> %va, <2 x i16> %vb, i32 %evl)
308 define <2 x i16> @vpmerge_vi_v2i16(<2 x i16> %vb, <2 x i1> %m, i32 zeroext %evl) {
309 ; CHECK-LABEL: vpmerge_vi_v2i16:
311 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, tu, ma
312 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
314 %elt.head = insertelement <2 x i16> poison, i16 2, i32 0
315 %va = shufflevector <2 x i16> %elt.head, <2 x i16> poison, <2 x i32> zeroinitializer
316 %v = call <2 x i16> @llvm.vp.merge.v2i16(<2 x i1> %m, <2 x i16> %va, <2 x i16> %vb, i32 %evl)
320 declare <4 x i16> @llvm.vp.merge.v4i16(<4 x i1>, <4 x i16>, <4 x i16>, i32)
322 define <4 x i16> @vpmerge_vv_v4i16(<4 x i16> %va, <4 x i16> %vb, <4 x i1> %m, i32 zeroext %evl) {
323 ; CHECK-LABEL: vpmerge_vv_v4i16:
325 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, tu, ma
326 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
327 ; CHECK-NEXT: vmv1r.v v8, v9
329 %v = call <4 x i16> @llvm.vp.merge.v4i16(<4 x i1> %m, <4 x i16> %va, <4 x i16> %vb, i32 %evl)
333 define <4 x i16> @vpmerge_vx_v4i16(i16 %a, <4 x i16> %vb, <4 x i1> %m, i32 zeroext %evl) {
334 ; CHECK-LABEL: vpmerge_vx_v4i16:
336 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, tu, ma
337 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
339 %elt.head = insertelement <4 x i16> poison, i16 %a, i32 0
340 %va = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
341 %v = call <4 x i16> @llvm.vp.merge.v4i16(<4 x i1> %m, <4 x i16> %va, <4 x i16> %vb, i32 %evl)
345 define <4 x i16> @vpmerge_vi_v4i16(<4 x i16> %vb, <4 x i1> %m, i32 zeroext %evl) {
346 ; CHECK-LABEL: vpmerge_vi_v4i16:
348 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, tu, ma
349 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
351 %elt.head = insertelement <4 x i16> poison, i16 2, i32 0
352 %va = shufflevector <4 x i16> %elt.head, <4 x i16> poison, <4 x i32> zeroinitializer
353 %v = call <4 x i16> @llvm.vp.merge.v4i16(<4 x i1> %m, <4 x i16> %va, <4 x i16> %vb, i32 %evl)
357 declare <8 x i16> @llvm.vp.merge.v8i16(<8 x i1>, <8 x i16>, <8 x i16>, i32)
359 define <8 x i16> @vpmerge_vv_v8i16(<8 x i16> %va, <8 x i16> %vb, <8 x i1> %m, i32 zeroext %evl) {
360 ; CHECK-LABEL: vpmerge_vv_v8i16:
362 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, tu, ma
363 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
364 ; CHECK-NEXT: vmv1r.v v8, v9
366 %v = call <8 x i16> @llvm.vp.merge.v8i16(<8 x i1> %m, <8 x i16> %va, <8 x i16> %vb, i32 %evl)
370 define <8 x i16> @vpmerge_vx_v8i16(i16 %a, <8 x i16> %vb, <8 x i1> %m, i32 zeroext %evl) {
371 ; CHECK-LABEL: vpmerge_vx_v8i16:
373 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, tu, ma
374 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
376 %elt.head = insertelement <8 x i16> poison, i16 %a, i32 0
377 %va = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
378 %v = call <8 x i16> @llvm.vp.merge.v8i16(<8 x i1> %m, <8 x i16> %va, <8 x i16> %vb, i32 %evl)
382 define <8 x i16> @vpmerge_vi_v8i16(<8 x i16> %vb, <8 x i1> %m, i32 zeroext %evl) {
383 ; CHECK-LABEL: vpmerge_vi_v8i16:
385 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, tu, ma
386 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
388 %elt.head = insertelement <8 x i16> poison, i16 2, i32 0
389 %va = shufflevector <8 x i16> %elt.head, <8 x i16> poison, <8 x i32> zeroinitializer
390 %v = call <8 x i16> @llvm.vp.merge.v8i16(<8 x i1> %m, <8 x i16> %va, <8 x i16> %vb, i32 %evl)
394 declare <16 x i16> @llvm.vp.merge.v16i16(<16 x i1>, <16 x i16>, <16 x i16>, i32)
396 define <16 x i16> @vpmerge_vv_v16i16(<16 x i16> %va, <16 x i16> %vb, <16 x i1> %m, i32 zeroext %evl) {
397 ; CHECK-LABEL: vpmerge_vv_v16i16:
399 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, tu, ma
400 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
401 ; CHECK-NEXT: vmv2r.v v8, v10
403 %v = call <16 x i16> @llvm.vp.merge.v16i16(<16 x i1> %m, <16 x i16> %va, <16 x i16> %vb, i32 %evl)
407 define <16 x i16> @vpmerge_vx_v16i16(i16 %a, <16 x i16> %vb, <16 x i1> %m, i32 zeroext %evl) {
408 ; CHECK-LABEL: vpmerge_vx_v16i16:
410 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, tu, ma
411 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
413 %elt.head = insertelement <16 x i16> poison, i16 %a, i32 0
414 %va = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
415 %v = call <16 x i16> @llvm.vp.merge.v16i16(<16 x i1> %m, <16 x i16> %va, <16 x i16> %vb, i32 %evl)
419 define <16 x i16> @vpmerge_vi_v16i16(<16 x i16> %vb, <16 x i1> %m, i32 zeroext %evl) {
420 ; CHECK-LABEL: vpmerge_vi_v16i16:
422 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, tu, ma
423 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
425 %elt.head = insertelement <16 x i16> poison, i16 2, i32 0
426 %va = shufflevector <16 x i16> %elt.head, <16 x i16> poison, <16 x i32> zeroinitializer
427 %v = call <16 x i16> @llvm.vp.merge.v16i16(<16 x i1> %m, <16 x i16> %va, <16 x i16> %vb, i32 %evl)
431 declare <2 x i32> @llvm.vp.merge.v2i32(<2 x i1>, <2 x i32>, <2 x i32>, i32)
433 define <2 x i32> @vpmerge_vv_v2i32(<2 x i32> %va, <2 x i32> %vb, <2 x i1> %m, i32 zeroext %evl) {
434 ; CHECK-LABEL: vpmerge_vv_v2i32:
436 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, tu, ma
437 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
438 ; CHECK-NEXT: vmv1r.v v8, v9
440 %v = call <2 x i32> @llvm.vp.merge.v2i32(<2 x i1> %m, <2 x i32> %va, <2 x i32> %vb, i32 %evl)
444 define <2 x i32> @vpmerge_vx_v2i32(i32 %a, <2 x i32> %vb, <2 x i1> %m, i32 zeroext %evl) {
445 ; CHECK-LABEL: vpmerge_vx_v2i32:
447 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, tu, ma
448 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
450 %elt.head = insertelement <2 x i32> poison, i32 %a, i32 0
451 %va = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
452 %v = call <2 x i32> @llvm.vp.merge.v2i32(<2 x i1> %m, <2 x i32> %va, <2 x i32> %vb, i32 %evl)
456 define <2 x i32> @vpmerge_vi_v2i32(<2 x i32> %vb, <2 x i1> %m, i32 zeroext %evl) {
457 ; CHECK-LABEL: vpmerge_vi_v2i32:
459 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, tu, ma
460 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
462 %elt.head = insertelement <2 x i32> poison, i32 2, i32 0
463 %va = shufflevector <2 x i32> %elt.head, <2 x i32> poison, <2 x i32> zeroinitializer
464 %v = call <2 x i32> @llvm.vp.merge.v2i32(<2 x i1> %m, <2 x i32> %va, <2 x i32> %vb, i32 %evl)
468 declare <4 x i32> @llvm.vp.merge.v4i32(<4 x i1>, <4 x i32>, <4 x i32>, i32)
470 define <4 x i32> @vpmerge_vv_v4i32(<4 x i32> %va, <4 x i32> %vb, <4 x i1> %m, i32 zeroext %evl) {
471 ; CHECK-LABEL: vpmerge_vv_v4i32:
473 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, ma
474 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
475 ; CHECK-NEXT: vmv1r.v v8, v9
477 %v = call <4 x i32> @llvm.vp.merge.v4i32(<4 x i1> %m, <4 x i32> %va, <4 x i32> %vb, i32 %evl)
481 define <4 x i32> @vpmerge_vx_v4i32(i32 %a, <4 x i32> %vb, <4 x i1> %m, i32 zeroext %evl) {
482 ; CHECK-LABEL: vpmerge_vx_v4i32:
484 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, tu, ma
485 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
487 %elt.head = insertelement <4 x i32> poison, i32 %a, i32 0
488 %va = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
489 %v = call <4 x i32> @llvm.vp.merge.v4i32(<4 x i1> %m, <4 x i32> %va, <4 x i32> %vb, i32 %evl)
493 define <4 x i32> @vpmerge_vi_v4i32(<4 x i32> %vb, <4 x i1> %m, i32 zeroext %evl) {
494 ; CHECK-LABEL: vpmerge_vi_v4i32:
496 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, ma
497 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
499 %elt.head = insertelement <4 x i32> poison, i32 2, i32 0
500 %va = shufflevector <4 x i32> %elt.head, <4 x i32> poison, <4 x i32> zeroinitializer
501 %v = call <4 x i32> @llvm.vp.merge.v4i32(<4 x i1> %m, <4 x i32> %va, <4 x i32> %vb, i32 %evl)
505 declare <8 x i32> @llvm.vp.merge.v8i32(<8 x i1>, <8 x i32>, <8 x i32>, i32)
507 define <8 x i32> @vpmerge_vv_v8i32(<8 x i32> %va, <8 x i32> %vb, <8 x i1> %m, i32 zeroext %evl) {
508 ; CHECK-LABEL: vpmerge_vv_v8i32:
510 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, tu, ma
511 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
512 ; CHECK-NEXT: vmv2r.v v8, v10
514 %v = call <8 x i32> @llvm.vp.merge.v8i32(<8 x i1> %m, <8 x i32> %va, <8 x i32> %vb, i32 %evl)
518 define <8 x i32> @vpmerge_vx_v8i32(i32 %a, <8 x i32> %vb, <8 x i1> %m, i32 zeroext %evl) {
519 ; CHECK-LABEL: vpmerge_vx_v8i32:
521 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, tu, ma
522 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
524 %elt.head = insertelement <8 x i32> poison, i32 %a, i32 0
525 %va = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
526 %v = call <8 x i32> @llvm.vp.merge.v8i32(<8 x i1> %m, <8 x i32> %va, <8 x i32> %vb, i32 %evl)
530 define <8 x i32> @vpmerge_vi_v8i32(<8 x i32> %vb, <8 x i1> %m, i32 zeroext %evl) {
531 ; CHECK-LABEL: vpmerge_vi_v8i32:
533 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, tu, ma
534 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
536 %elt.head = insertelement <8 x i32> poison, i32 2, i32 0
537 %va = shufflevector <8 x i32> %elt.head, <8 x i32> poison, <8 x i32> zeroinitializer
538 %v = call <8 x i32> @llvm.vp.merge.v8i32(<8 x i1> %m, <8 x i32> %va, <8 x i32> %vb, i32 %evl)
542 declare <16 x i32> @llvm.vp.merge.v16i32(<16 x i1>, <16 x i32>, <16 x i32>, i32)
544 define <16 x i32> @vpmerge_vv_v16i32(<16 x i32> %va, <16 x i32> %vb, <16 x i1> %m, i32 zeroext %evl) {
545 ; CHECK-LABEL: vpmerge_vv_v16i32:
547 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, tu, ma
548 ; CHECK-NEXT: vmerge.vvm v12, v12, v8, v0
549 ; CHECK-NEXT: vmv4r.v v8, v12
551 %v = call <16 x i32> @llvm.vp.merge.v16i32(<16 x i1> %m, <16 x i32> %va, <16 x i32> %vb, i32 %evl)
555 define <16 x i32> @vpmerge_vx_v16i32(i32 %a, <16 x i32> %vb, <16 x i1> %m, i32 zeroext %evl) {
556 ; CHECK-LABEL: vpmerge_vx_v16i32:
558 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, tu, ma
559 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
561 %elt.head = insertelement <16 x i32> poison, i32 %a, i32 0
562 %va = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
563 %v = call <16 x i32> @llvm.vp.merge.v16i32(<16 x i1> %m, <16 x i32> %va, <16 x i32> %vb, i32 %evl)
567 define <16 x i32> @vpmerge_vi_v16i32(<16 x i32> %vb, <16 x i1> %m, i32 zeroext %evl) {
568 ; CHECK-LABEL: vpmerge_vi_v16i32:
570 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, tu, ma
571 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
573 %elt.head = insertelement <16 x i32> poison, i32 2, i32 0
574 %va = shufflevector <16 x i32> %elt.head, <16 x i32> poison, <16 x i32> zeroinitializer
575 %v = call <16 x i32> @llvm.vp.merge.v16i32(<16 x i1> %m, <16 x i32> %va, <16 x i32> %vb, i32 %evl)
579 declare <2 x i64> @llvm.vp.merge.v2i64(<2 x i1>, <2 x i64>, <2 x i64>, i32)
581 define <2 x i64> @vpmerge_vv_v2i64(<2 x i64> %va, <2 x i64> %vb, <2 x i1> %m, i32 zeroext %evl) {
582 ; CHECK-LABEL: vpmerge_vv_v2i64:
584 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, tu, ma
585 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
586 ; CHECK-NEXT: vmv1r.v v8, v9
588 %v = call <2 x i64> @llvm.vp.merge.v2i64(<2 x i1> %m, <2 x i64> %va, <2 x i64> %vb, i32 %evl)
592 define <2 x i64> @vpmerge_vx_v2i64(i64 %a, <2 x i64> %vb, <2 x i1> %m, i32 zeroext %evl) {
593 ; RV32-LABEL: vpmerge_vx_v2i64:
595 ; RV32-NEXT: addi sp, sp, -16
596 ; RV32-NEXT: .cfi_def_cfa_offset 16
597 ; RV32-NEXT: sw a1, 12(sp)
598 ; RV32-NEXT: sw a0, 8(sp)
599 ; RV32-NEXT: addi a0, sp, 8
600 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
601 ; RV32-NEXT: vlse64.v v9, (a0), zero
602 ; RV32-NEXT: vsetvli zero, a2, e64, m1, tu, ma
603 ; RV32-NEXT: vmerge.vvm v8, v8, v9, v0
604 ; RV32-NEXT: addi sp, sp, 16
607 ; RV64-LABEL: vpmerge_vx_v2i64:
609 ; RV64-NEXT: vsetvli zero, a1, e64, m1, tu, ma
610 ; RV64-NEXT: vmerge.vxm v8, v8, a0, v0
613 ; RV32ZVFHMIN-LABEL: vpmerge_vx_v2i64:
614 ; RV32ZVFHMIN: # %bb.0:
615 ; RV32ZVFHMIN-NEXT: addi sp, sp, -16
616 ; RV32ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
617 ; RV32ZVFHMIN-NEXT: sw a1, 12(sp)
618 ; RV32ZVFHMIN-NEXT: sw a0, 8(sp)
619 ; RV32ZVFHMIN-NEXT: addi a0, sp, 8
620 ; RV32ZVFHMIN-NEXT: vsetivli zero, 2, e64, m1, ta, ma
621 ; RV32ZVFHMIN-NEXT: vlse64.v v9, (a0), zero
622 ; RV32ZVFHMIN-NEXT: vsetvli zero, a2, e64, m1, tu, ma
623 ; RV32ZVFHMIN-NEXT: vmerge.vvm v8, v8, v9, v0
624 ; RV32ZVFHMIN-NEXT: addi sp, sp, 16
625 ; RV32ZVFHMIN-NEXT: ret
627 ; RV64ZVFHMIN-LABEL: vpmerge_vx_v2i64:
628 ; RV64ZVFHMIN: # %bb.0:
629 ; RV64ZVFHMIN-NEXT: vsetvli zero, a1, e64, m1, tu, ma
630 ; RV64ZVFHMIN-NEXT: vmerge.vxm v8, v8, a0, v0
631 ; RV64ZVFHMIN-NEXT: ret
632 %elt.head = insertelement <2 x i64> poison, i64 %a, i32 0
633 %va = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
634 %v = call <2 x i64> @llvm.vp.merge.v2i64(<2 x i1> %m, <2 x i64> %va, <2 x i64> %vb, i32 %evl)
638 define <2 x i64> @vpmerge_vi_v2i64(<2 x i64> %vb, <2 x i1> %m, i32 zeroext %evl) {
639 ; CHECK-LABEL: vpmerge_vi_v2i64:
641 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, tu, ma
642 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
644 %elt.head = insertelement <2 x i64> poison, i64 2, i32 0
645 %va = shufflevector <2 x i64> %elt.head, <2 x i64> poison, <2 x i32> zeroinitializer
646 %v = call <2 x i64> @llvm.vp.merge.v2i64(<2 x i1> %m, <2 x i64> %va, <2 x i64> %vb, i32 %evl)
650 declare <4 x i64> @llvm.vp.merge.v4i64(<4 x i1>, <4 x i64>, <4 x i64>, i32)
652 define <4 x i64> @vpmerge_vv_v4i64(<4 x i64> %va, <4 x i64> %vb, <4 x i1> %m, i32 zeroext %evl) {
653 ; CHECK-LABEL: vpmerge_vv_v4i64:
655 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, tu, ma
656 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
657 ; CHECK-NEXT: vmv2r.v v8, v10
659 %v = call <4 x i64> @llvm.vp.merge.v4i64(<4 x i1> %m, <4 x i64> %va, <4 x i64> %vb, i32 %evl)
663 define <4 x i64> @vpmerge_vx_v4i64(i64 %a, <4 x i64> %vb, <4 x i1> %m, i32 zeroext %evl) {
664 ; RV32-LABEL: vpmerge_vx_v4i64:
666 ; RV32-NEXT: addi sp, sp, -16
667 ; RV32-NEXT: .cfi_def_cfa_offset 16
668 ; RV32-NEXT: sw a1, 12(sp)
669 ; RV32-NEXT: sw a0, 8(sp)
670 ; RV32-NEXT: addi a0, sp, 8
671 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
672 ; RV32-NEXT: vlse64.v v10, (a0), zero
673 ; RV32-NEXT: vsetvli zero, a2, e64, m2, tu, ma
674 ; RV32-NEXT: vmerge.vvm v8, v8, v10, v0
675 ; RV32-NEXT: addi sp, sp, 16
678 ; RV64-LABEL: vpmerge_vx_v4i64:
680 ; RV64-NEXT: vsetvli zero, a1, e64, m2, tu, ma
681 ; RV64-NEXT: vmerge.vxm v8, v8, a0, v0
684 ; RV32ZVFHMIN-LABEL: vpmerge_vx_v4i64:
685 ; RV32ZVFHMIN: # %bb.0:
686 ; RV32ZVFHMIN-NEXT: addi sp, sp, -16
687 ; RV32ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
688 ; RV32ZVFHMIN-NEXT: sw a1, 12(sp)
689 ; RV32ZVFHMIN-NEXT: sw a0, 8(sp)
690 ; RV32ZVFHMIN-NEXT: addi a0, sp, 8
691 ; RV32ZVFHMIN-NEXT: vsetivli zero, 4, e64, m2, ta, ma
692 ; RV32ZVFHMIN-NEXT: vlse64.v v10, (a0), zero
693 ; RV32ZVFHMIN-NEXT: vsetvli zero, a2, e64, m2, tu, ma
694 ; RV32ZVFHMIN-NEXT: vmerge.vvm v8, v8, v10, v0
695 ; RV32ZVFHMIN-NEXT: addi sp, sp, 16
696 ; RV32ZVFHMIN-NEXT: ret
698 ; RV64ZVFHMIN-LABEL: vpmerge_vx_v4i64:
699 ; RV64ZVFHMIN: # %bb.0:
700 ; RV64ZVFHMIN-NEXT: vsetvli zero, a1, e64, m2, tu, ma
701 ; RV64ZVFHMIN-NEXT: vmerge.vxm v8, v8, a0, v0
702 ; RV64ZVFHMIN-NEXT: ret
703 %elt.head = insertelement <4 x i64> poison, i64 %a, i32 0
704 %va = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
705 %v = call <4 x i64> @llvm.vp.merge.v4i64(<4 x i1> %m, <4 x i64> %va, <4 x i64> %vb, i32 %evl)
709 define <4 x i64> @vpmerge_vi_v4i64(<4 x i64> %vb, <4 x i1> %m, i32 zeroext %evl) {
710 ; CHECK-LABEL: vpmerge_vi_v4i64:
712 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, tu, ma
713 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
715 %elt.head = insertelement <4 x i64> poison, i64 2, i32 0
716 %va = shufflevector <4 x i64> %elt.head, <4 x i64> poison, <4 x i32> zeroinitializer
717 %v = call <4 x i64> @llvm.vp.merge.v4i64(<4 x i1> %m, <4 x i64> %va, <4 x i64> %vb, i32 %evl)
721 declare <8 x i64> @llvm.vp.merge.v8i64(<8 x i1>, <8 x i64>, <8 x i64>, i32)
723 define <8 x i64> @vpmerge_vv_v8i64(<8 x i64> %va, <8 x i64> %vb, <8 x i1> %m, i32 zeroext %evl) {
724 ; CHECK-LABEL: vpmerge_vv_v8i64:
726 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, tu, ma
727 ; CHECK-NEXT: vmerge.vvm v12, v12, v8, v0
728 ; CHECK-NEXT: vmv4r.v v8, v12
730 %v = call <8 x i64> @llvm.vp.merge.v8i64(<8 x i1> %m, <8 x i64> %va, <8 x i64> %vb, i32 %evl)
734 define <8 x i64> @vpmerge_vx_v8i64(i64 %a, <8 x i64> %vb, <8 x i1> %m, i32 zeroext %evl) {
735 ; RV32-LABEL: vpmerge_vx_v8i64:
737 ; RV32-NEXT: addi sp, sp, -16
738 ; RV32-NEXT: .cfi_def_cfa_offset 16
739 ; RV32-NEXT: sw a1, 12(sp)
740 ; RV32-NEXT: sw a0, 8(sp)
741 ; RV32-NEXT: addi a0, sp, 8
742 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
743 ; RV32-NEXT: vlse64.v v12, (a0), zero
744 ; RV32-NEXT: vsetvli zero, a2, e64, m4, tu, ma
745 ; RV32-NEXT: vmerge.vvm v8, v8, v12, v0
746 ; RV32-NEXT: addi sp, sp, 16
749 ; RV64-LABEL: vpmerge_vx_v8i64:
751 ; RV64-NEXT: vsetvli zero, a1, e64, m4, tu, ma
752 ; RV64-NEXT: vmerge.vxm v8, v8, a0, v0
755 ; RV32ZVFHMIN-LABEL: vpmerge_vx_v8i64:
756 ; RV32ZVFHMIN: # %bb.0:
757 ; RV32ZVFHMIN-NEXT: addi sp, sp, -16
758 ; RV32ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
759 ; RV32ZVFHMIN-NEXT: sw a1, 12(sp)
760 ; RV32ZVFHMIN-NEXT: sw a0, 8(sp)
761 ; RV32ZVFHMIN-NEXT: addi a0, sp, 8
762 ; RV32ZVFHMIN-NEXT: vsetivli zero, 8, e64, m4, ta, ma
763 ; RV32ZVFHMIN-NEXT: vlse64.v v12, (a0), zero
764 ; RV32ZVFHMIN-NEXT: vsetvli zero, a2, e64, m4, tu, ma
765 ; RV32ZVFHMIN-NEXT: vmerge.vvm v8, v8, v12, v0
766 ; RV32ZVFHMIN-NEXT: addi sp, sp, 16
767 ; RV32ZVFHMIN-NEXT: ret
769 ; RV64ZVFHMIN-LABEL: vpmerge_vx_v8i64:
770 ; RV64ZVFHMIN: # %bb.0:
771 ; RV64ZVFHMIN-NEXT: vsetvli zero, a1, e64, m4, tu, ma
772 ; RV64ZVFHMIN-NEXT: vmerge.vxm v8, v8, a0, v0
773 ; RV64ZVFHMIN-NEXT: ret
774 %elt.head = insertelement <8 x i64> poison, i64 %a, i32 0
775 %va = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
776 %v = call <8 x i64> @llvm.vp.merge.v8i64(<8 x i1> %m, <8 x i64> %va, <8 x i64> %vb, i32 %evl)
780 define <8 x i64> @vpmerge_vi_v8i64(<8 x i64> %vb, <8 x i1> %m, i32 zeroext %evl) {
781 ; CHECK-LABEL: vpmerge_vi_v8i64:
783 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, tu, ma
784 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
786 %elt.head = insertelement <8 x i64> poison, i64 2, i32 0
787 %va = shufflevector <8 x i64> %elt.head, <8 x i64> poison, <8 x i32> zeroinitializer
788 %v = call <8 x i64> @llvm.vp.merge.v8i64(<8 x i1> %m, <8 x i64> %va, <8 x i64> %vb, i32 %evl)
792 declare <16 x i64> @llvm.vp.merge.v16i64(<16 x i1>, <16 x i64>, <16 x i64>, i32)
794 define <16 x i64> @vpmerge_vv_v16i64(<16 x i64> %va, <16 x i64> %vb, <16 x i1> %m, i32 zeroext %evl) {
795 ; CHECK-LABEL: vpmerge_vv_v16i64:
797 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, tu, ma
798 ; CHECK-NEXT: vmerge.vvm v16, v16, v8, v0
799 ; CHECK-NEXT: vmv8r.v v8, v16
801 %v = call <16 x i64> @llvm.vp.merge.v16i64(<16 x i1> %m, <16 x i64> %va, <16 x i64> %vb, i32 %evl)
805 define <16 x i64> @vpmerge_vx_v16i64(i64 %a, <16 x i64> %vb, <16 x i1> %m, i32 zeroext %evl) {
806 ; RV32-LABEL: vpmerge_vx_v16i64:
808 ; RV32-NEXT: addi sp, sp, -16
809 ; RV32-NEXT: .cfi_def_cfa_offset 16
810 ; RV32-NEXT: sw a1, 12(sp)
811 ; RV32-NEXT: sw a0, 8(sp)
812 ; RV32-NEXT: addi a0, sp, 8
813 ; RV32-NEXT: vsetivli zero, 16, e64, m8, ta, ma
814 ; RV32-NEXT: vlse64.v v16, (a0), zero
815 ; RV32-NEXT: vsetvli zero, a2, e64, m8, tu, ma
816 ; RV32-NEXT: vmerge.vvm v8, v8, v16, v0
817 ; RV32-NEXT: addi sp, sp, 16
820 ; RV64-LABEL: vpmerge_vx_v16i64:
822 ; RV64-NEXT: vsetvli zero, a1, e64, m8, tu, ma
823 ; RV64-NEXT: vmerge.vxm v8, v8, a0, v0
826 ; RV32ZVFHMIN-LABEL: vpmerge_vx_v16i64:
827 ; RV32ZVFHMIN: # %bb.0:
828 ; RV32ZVFHMIN-NEXT: addi sp, sp, -16
829 ; RV32ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
830 ; RV32ZVFHMIN-NEXT: sw a1, 12(sp)
831 ; RV32ZVFHMIN-NEXT: sw a0, 8(sp)
832 ; RV32ZVFHMIN-NEXT: addi a0, sp, 8
833 ; RV32ZVFHMIN-NEXT: vsetivli zero, 16, e64, m8, ta, ma
834 ; RV32ZVFHMIN-NEXT: vlse64.v v16, (a0), zero
835 ; RV32ZVFHMIN-NEXT: vsetvli zero, a2, e64, m8, tu, ma
836 ; RV32ZVFHMIN-NEXT: vmerge.vvm v8, v8, v16, v0
837 ; RV32ZVFHMIN-NEXT: addi sp, sp, 16
838 ; RV32ZVFHMIN-NEXT: ret
840 ; RV64ZVFHMIN-LABEL: vpmerge_vx_v16i64:
841 ; RV64ZVFHMIN: # %bb.0:
842 ; RV64ZVFHMIN-NEXT: vsetvli zero, a1, e64, m8, tu, ma
843 ; RV64ZVFHMIN-NEXT: vmerge.vxm v8, v8, a0, v0
844 ; RV64ZVFHMIN-NEXT: ret
845 %elt.head = insertelement <16 x i64> poison, i64 %a, i32 0
846 %va = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
847 %v = call <16 x i64> @llvm.vp.merge.v16i64(<16 x i1> %m, <16 x i64> %va, <16 x i64> %vb, i32 %evl)
851 define <16 x i64> @vpmerge_vi_v16i64(<16 x i64> %vb, <16 x i1> %m, i32 zeroext %evl) {
852 ; CHECK-LABEL: vpmerge_vi_v16i64:
854 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, tu, ma
855 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
857 %elt.head = insertelement <16 x i64> poison, i64 2, i32 0
858 %va = shufflevector <16 x i64> %elt.head, <16 x i64> poison, <16 x i32> zeroinitializer
859 %v = call <16 x i64> @llvm.vp.merge.v16i64(<16 x i1> %m, <16 x i64> %va, <16 x i64> %vb, i32 %evl)
863 declare <2 x half> @llvm.vp.merge.v2f16(<2 x i1>, <2 x half>, <2 x half>, i32)
865 define <2 x half> @vpmerge_vv_v2f16(<2 x half> %va, <2 x half> %vb, <2 x i1> %m, i32 zeroext %evl) {
866 ; CHECK-LABEL: vpmerge_vv_v2f16:
868 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, tu, ma
869 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
870 ; CHECK-NEXT: vmv1r.v v8, v9
872 %v = call <2 x half> @llvm.vp.merge.v2f16(<2 x i1> %m, <2 x half> %va, <2 x half> %vb, i32 %evl)
876 define <2 x half> @vpmerge_vf_v2f16(half %a, <2 x half> %vb, <2 x i1> %m, i32 zeroext %evl) {
877 ; ZVFH-LABEL: vpmerge_vf_v2f16:
879 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, tu, ma
880 ; ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
883 ; ZVFHMIN-LABEL: vpmerge_vf_v2f16:
885 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
886 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
887 ; ZVFHMIN-NEXT: vfmv.v.f v9, fa5
888 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf4, tu, mu
889 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9, v0.t
891 %elt.head = insertelement <2 x half> poison, half %a, i32 0
892 %va = shufflevector <2 x half> %elt.head, <2 x half> poison, <2 x i32> zeroinitializer
893 %v = call <2 x half> @llvm.vp.merge.v2f16(<2 x i1> %m, <2 x half> %va, <2 x half> %vb, i32 %evl)
897 declare <4 x half> @llvm.vp.merge.v4f16(<4 x i1>, <4 x half>, <4 x half>, i32)
899 define <4 x half> @vpmerge_vv_v4f16(<4 x half> %va, <4 x half> %vb, <4 x i1> %m, i32 zeroext %evl) {
900 ; CHECK-LABEL: vpmerge_vv_v4f16:
902 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, tu, ma
903 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
904 ; CHECK-NEXT: vmv1r.v v8, v9
906 %v = call <4 x half> @llvm.vp.merge.v4f16(<4 x i1> %m, <4 x half> %va, <4 x half> %vb, i32 %evl)
910 define <4 x half> @vpmerge_vf_v4f16(half %a, <4 x half> %vb, <4 x i1> %m, i32 zeroext %evl) {
911 ; ZVFH-LABEL: vpmerge_vf_v4f16:
913 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, tu, ma
914 ; ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
917 ; ZVFHMIN-LABEL: vpmerge_vf_v4f16:
919 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
920 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m1, ta, ma
921 ; ZVFHMIN-NEXT: vfmv.v.f v9, fa5
922 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf2, tu, mu
923 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9, v0.t
925 %elt.head = insertelement <4 x half> poison, half %a, i32 0
926 %va = shufflevector <4 x half> %elt.head, <4 x half> poison, <4 x i32> zeroinitializer
927 %v = call <4 x half> @llvm.vp.merge.v4f16(<4 x i1> %m, <4 x half> %va, <4 x half> %vb, i32 %evl)
931 declare <8 x half> @llvm.vp.merge.v8f16(<8 x i1>, <8 x half>, <8 x half>, i32)
933 define <8 x half> @vpmerge_vv_v8f16(<8 x half> %va, <8 x half> %vb, <8 x i1> %m, i32 zeroext %evl) {
934 ; CHECK-LABEL: vpmerge_vv_v8f16:
936 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, tu, ma
937 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
938 ; CHECK-NEXT: vmv1r.v v8, v9
940 %v = call <8 x half> @llvm.vp.merge.v8f16(<8 x i1> %m, <8 x half> %va, <8 x half> %vb, i32 %evl)
944 define <8 x half> @vpmerge_vf_v8f16(half %a, <8 x half> %vb, <8 x i1> %m, i32 zeroext %evl) {
945 ; ZVFH-LABEL: vpmerge_vf_v8f16:
947 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, tu, ma
948 ; ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
951 ; ZVFHMIN-LABEL: vpmerge_vf_v8f16:
953 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
954 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m2, ta, ma
955 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
956 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, m1, tu, mu
957 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10, v0.t
959 %elt.head = insertelement <8 x half> poison, half %a, i32 0
960 %va = shufflevector <8 x half> %elt.head, <8 x half> poison, <8 x i32> zeroinitializer
961 %v = call <8 x half> @llvm.vp.merge.v8f16(<8 x i1> %m, <8 x half> %va, <8 x half> %vb, i32 %evl)
965 declare <16 x half> @llvm.vp.merge.v16f16(<16 x i1>, <16 x half>, <16 x half>, i32)
967 define <16 x half> @vpmerge_vv_v16f16(<16 x half> %va, <16 x half> %vb, <16 x i1> %m, i32 zeroext %evl) {
968 ; CHECK-LABEL: vpmerge_vv_v16f16:
970 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, tu, ma
971 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
972 ; CHECK-NEXT: vmv2r.v v8, v10
974 %v = call <16 x half> @llvm.vp.merge.v16f16(<16 x i1> %m, <16 x half> %va, <16 x half> %vb, i32 %evl)
978 define <16 x half> @vpmerge_vf_v16f16(half %a, <16 x half> %vb, <16 x i1> %m, i32 zeroext %evl) {
979 ; ZVFH-LABEL: vpmerge_vf_v16f16:
981 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, tu, ma
982 ; ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
985 ; ZVFHMIN-LABEL: vpmerge_vf_v16f16:
987 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
988 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m4, ta, ma
989 ; ZVFHMIN-NEXT: vfmv.v.f v12, fa5
990 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, m2, tu, mu
991 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12, v0.t
993 %elt.head = insertelement <16 x half> poison, half %a, i32 0
994 %va = shufflevector <16 x half> %elt.head, <16 x half> poison, <16 x i32> zeroinitializer
995 %v = call <16 x half> @llvm.vp.merge.v16f16(<16 x i1> %m, <16 x half> %va, <16 x half> %vb, i32 %evl)
999 declare <2 x float> @llvm.vp.merge.v2f32(<2 x i1>, <2 x float>, <2 x float>, i32)
1001 define <2 x float> @vpmerge_vv_v2f32(<2 x float> %va, <2 x float> %vb, <2 x i1> %m, i32 zeroext %evl) {
1002 ; CHECK-LABEL: vpmerge_vv_v2f32:
1004 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, tu, ma
1005 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
1006 ; CHECK-NEXT: vmv1r.v v8, v9
1008 %v = call <2 x float> @llvm.vp.merge.v2f32(<2 x i1> %m, <2 x float> %va, <2 x float> %vb, i32 %evl)
1012 define <2 x float> @vpmerge_vf_v2f32(float %a, <2 x float> %vb, <2 x i1> %m, i32 zeroext %evl) {
1013 ; CHECK-LABEL: vpmerge_vf_v2f32:
1015 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, tu, ma
1016 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1018 %elt.head = insertelement <2 x float> poison, float %a, i32 0
1019 %va = shufflevector <2 x float> %elt.head, <2 x float> poison, <2 x i32> zeroinitializer
1020 %v = call <2 x float> @llvm.vp.merge.v2f32(<2 x i1> %m, <2 x float> %va, <2 x float> %vb, i32 %evl)
1024 declare <4 x float> @llvm.vp.merge.v4f32(<4 x i1>, <4 x float>, <4 x float>, i32)
1026 define <4 x float> @vpmerge_vv_v4f32(<4 x float> %va, <4 x float> %vb, <4 x i1> %m, i32 zeroext %evl) {
1027 ; CHECK-LABEL: vpmerge_vv_v4f32:
1029 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, ma
1030 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
1031 ; CHECK-NEXT: vmv1r.v v8, v9
1033 %v = call <4 x float> @llvm.vp.merge.v4f32(<4 x i1> %m, <4 x float> %va, <4 x float> %vb, i32 %evl)
1037 define <4 x float> @vpmerge_vf_v4f32(float %a, <4 x float> %vb, <4 x i1> %m, i32 zeroext %evl) {
1038 ; CHECK-LABEL: vpmerge_vf_v4f32:
1040 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, ma
1041 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1043 %elt.head = insertelement <4 x float> poison, float %a, i32 0
1044 %va = shufflevector <4 x float> %elt.head, <4 x float> poison, <4 x i32> zeroinitializer
1045 %v = call <4 x float> @llvm.vp.merge.v4f32(<4 x i1> %m, <4 x float> %va, <4 x float> %vb, i32 %evl)
1049 declare <8 x float> @llvm.vp.merge.v8f32(<8 x i1>, <8 x float>, <8 x float>, i32)
1051 define <8 x float> @vpmerge_vv_v8f32(<8 x float> %va, <8 x float> %vb, <8 x i1> %m, i32 zeroext %evl) {
1052 ; CHECK-LABEL: vpmerge_vv_v8f32:
1054 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, tu, ma
1055 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
1056 ; CHECK-NEXT: vmv2r.v v8, v10
1058 %v = call <8 x float> @llvm.vp.merge.v8f32(<8 x i1> %m, <8 x float> %va, <8 x float> %vb, i32 %evl)
1062 define <8 x float> @vpmerge_vf_v8f32(float %a, <8 x float> %vb, <8 x i1> %m, i32 zeroext %evl) {
1063 ; CHECK-LABEL: vpmerge_vf_v8f32:
1065 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, tu, ma
1066 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1068 %elt.head = insertelement <8 x float> poison, float %a, i32 0
1069 %va = shufflevector <8 x float> %elt.head, <8 x float> poison, <8 x i32> zeroinitializer
1070 %v = call <8 x float> @llvm.vp.merge.v8f32(<8 x i1> %m, <8 x float> %va, <8 x float> %vb, i32 %evl)
1074 declare <16 x float> @llvm.vp.merge.v16f32(<16 x i1>, <16 x float>, <16 x float>, i32)
1076 define <16 x float> @vpmerge_vv_v16f32(<16 x float> %va, <16 x float> %vb, <16 x i1> %m, i32 zeroext %evl) {
1077 ; CHECK-LABEL: vpmerge_vv_v16f32:
1079 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, tu, ma
1080 ; CHECK-NEXT: vmerge.vvm v12, v12, v8, v0
1081 ; CHECK-NEXT: vmv4r.v v8, v12
1083 %v = call <16 x float> @llvm.vp.merge.v16f32(<16 x i1> %m, <16 x float> %va, <16 x float> %vb, i32 %evl)
1087 define <16 x float> @vpmerge_vf_v16f32(float %a, <16 x float> %vb, <16 x i1> %m, i32 zeroext %evl) {
1088 ; CHECK-LABEL: vpmerge_vf_v16f32:
1090 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, tu, ma
1091 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1093 %elt.head = insertelement <16 x float> poison, float %a, i32 0
1094 %va = shufflevector <16 x float> %elt.head, <16 x float> poison, <16 x i32> zeroinitializer
1095 %v = call <16 x float> @llvm.vp.merge.v16f32(<16 x i1> %m, <16 x float> %va, <16 x float> %vb, i32 %evl)
1099 declare <2 x double> @llvm.vp.merge.v2f64(<2 x i1>, <2 x double>, <2 x double>, i32)
1101 define <2 x double> @vpmerge_vv_v2f64(<2 x double> %va, <2 x double> %vb, <2 x i1> %m, i32 zeroext %evl) {
1102 ; CHECK-LABEL: vpmerge_vv_v2f64:
1104 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, tu, ma
1105 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
1106 ; CHECK-NEXT: vmv1r.v v8, v9
1108 %v = call <2 x double> @llvm.vp.merge.v2f64(<2 x i1> %m, <2 x double> %va, <2 x double> %vb, i32 %evl)
1112 define <2 x double> @vpmerge_vf_v2f64(double %a, <2 x double> %vb, <2 x i1> %m, i32 zeroext %evl) {
1113 ; CHECK-LABEL: vpmerge_vf_v2f64:
1115 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, tu, ma
1116 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1118 %elt.head = insertelement <2 x double> poison, double %a, i32 0
1119 %va = shufflevector <2 x double> %elt.head, <2 x double> poison, <2 x i32> zeroinitializer
1120 %v = call <2 x double> @llvm.vp.merge.v2f64(<2 x i1> %m, <2 x double> %va, <2 x double> %vb, i32 %evl)
1124 declare <4 x double> @llvm.vp.merge.v4f64(<4 x i1>, <4 x double>, <4 x double>, i32)
1126 define <4 x double> @vpmerge_vv_v4f64(<4 x double> %va, <4 x double> %vb, <4 x i1> %m, i32 zeroext %evl) {
1127 ; CHECK-LABEL: vpmerge_vv_v4f64:
1129 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, tu, ma
1130 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
1131 ; CHECK-NEXT: vmv2r.v v8, v10
1133 %v = call <4 x double> @llvm.vp.merge.v4f64(<4 x i1> %m, <4 x double> %va, <4 x double> %vb, i32 %evl)
1137 define <4 x double> @vpmerge_vf_v4f64(double %a, <4 x double> %vb, <4 x i1> %m, i32 zeroext %evl) {
1138 ; CHECK-LABEL: vpmerge_vf_v4f64:
1140 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, tu, ma
1141 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1143 %elt.head = insertelement <4 x double> poison, double %a, i32 0
1144 %va = shufflevector <4 x double> %elt.head, <4 x double> poison, <4 x i32> zeroinitializer
1145 %v = call <4 x double> @llvm.vp.merge.v4f64(<4 x i1> %m, <4 x double> %va, <4 x double> %vb, i32 %evl)
1149 declare <8 x double> @llvm.vp.merge.v8f64(<8 x i1>, <8 x double>, <8 x double>, i32)
1151 define <8 x double> @vpmerge_vv_v8f64(<8 x double> %va, <8 x double> %vb, <8 x i1> %m, i32 zeroext %evl) {
1152 ; CHECK-LABEL: vpmerge_vv_v8f64:
1154 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, tu, ma
1155 ; CHECK-NEXT: vmerge.vvm v12, v12, v8, v0
1156 ; CHECK-NEXT: vmv4r.v v8, v12
1158 %v = call <8 x double> @llvm.vp.merge.v8f64(<8 x i1> %m, <8 x double> %va, <8 x double> %vb, i32 %evl)
1162 define <8 x double> @vpmerge_vf_v8f64(double %a, <8 x double> %vb, <8 x i1> %m, i32 zeroext %evl) {
1163 ; CHECK-LABEL: vpmerge_vf_v8f64:
1165 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, tu, ma
1166 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1168 %elt.head = insertelement <8 x double> poison, double %a, i32 0
1169 %va = shufflevector <8 x double> %elt.head, <8 x double> poison, <8 x i32> zeroinitializer
1170 %v = call <8 x double> @llvm.vp.merge.v8f64(<8 x i1> %m, <8 x double> %va, <8 x double> %vb, i32 %evl)
1174 declare <16 x double> @llvm.vp.merge.v16f64(<16 x i1>, <16 x double>, <16 x double>, i32)
1176 define <16 x double> @vpmerge_vv_v16f64(<16 x double> %va, <16 x double> %vb, <16 x i1> %m, i32 zeroext %evl) {
1177 ; CHECK-LABEL: vpmerge_vv_v16f64:
1179 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, tu, ma
1180 ; CHECK-NEXT: vmerge.vvm v16, v16, v8, v0
1181 ; CHECK-NEXT: vmv8r.v v8, v16
1183 %v = call <16 x double> @llvm.vp.merge.v16f64(<16 x i1> %m, <16 x double> %va, <16 x double> %vb, i32 %evl)
1184 ret <16 x double> %v
1187 define <16 x double> @vpmerge_vf_v16f64(double %a, <16 x double> %vb, <16 x i1> %m, i32 zeroext %evl) {
1188 ; CHECK-LABEL: vpmerge_vf_v16f64:
1190 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, tu, ma
1191 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1193 %elt.head = insertelement <16 x double> poison, double %a, i32 0
1194 %va = shufflevector <16 x double> %elt.head, <16 x double> poison, <16 x i32> zeroinitializer
1195 %v = call <16 x double> @llvm.vp.merge.v16f64(<16 x i1> %m, <16 x double> %va, <16 x double> %vb, i32 %evl)
1196 ret <16 x double> %v
1199 declare <32 x double> @llvm.vp.merge.v32f64(<32 x i1>, <32 x double>, <32 x double>, i32)
1201 define <32 x double> @vpmerge_vv_v32f64(<32 x double> %va, <32 x double> %vb, <32 x i1> %m, i32 zeroext %evl) {
1202 ; CHECK-LABEL: vpmerge_vv_v32f64:
1204 ; CHECK-NEXT: addi sp, sp, -16
1205 ; CHECK-NEXT: .cfi_def_cfa_offset 16
1206 ; CHECK-NEXT: csrr a1, vlenb
1207 ; CHECK-NEXT: slli a1, a1, 4
1208 ; CHECK-NEXT: sub sp, sp, a1
1209 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x10, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 16 * vlenb
1210 ; CHECK-NEXT: addi a1, a0, 128
1211 ; CHECK-NEXT: vsetivli zero, 16, e64, m8, ta, ma
1212 ; CHECK-NEXT: vle64.v v24, (a1)
1213 ; CHECK-NEXT: csrr a1, vlenb
1214 ; CHECK-NEXT: slli a1, a1, 3
1215 ; CHECK-NEXT: add a1, sp, a1
1216 ; CHECK-NEXT: addi a1, a1, 16
1217 ; CHECK-NEXT: vs8r.v v24, (a1) # Unknown-size Folded Spill
1218 ; CHECK-NEXT: vle64.v v24, (a0)
1219 ; CHECK-NEXT: li a1, 16
1220 ; CHECK-NEXT: addi a0, sp, 16
1221 ; CHECK-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
1222 ; CHECK-NEXT: mv a0, a2
1223 ; CHECK-NEXT: bltu a2, a1, .LBB79_2
1224 ; CHECK-NEXT: # %bb.1:
1225 ; CHECK-NEXT: li a0, 16
1226 ; CHECK-NEXT: .LBB79_2:
1227 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, tu, ma
1228 ; CHECK-NEXT: vmerge.vvm v24, v24, v8, v0
1229 ; CHECK-NEXT: addi a0, a2, -16
1230 ; CHECK-NEXT: sltu a1, a2, a0
1231 ; CHECK-NEXT: addi a1, a1, -1
1232 ; CHECK-NEXT: and a0, a1, a0
1233 ; CHECK-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
1234 ; CHECK-NEXT: vslidedown.vi v0, v0, 2
1235 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, tu, ma
1236 ; CHECK-NEXT: csrr a0, vlenb
1237 ; CHECK-NEXT: slli a0, a0, 3
1238 ; CHECK-NEXT: add a0, sp, a0
1239 ; CHECK-NEXT: addi a0, a0, 16
1240 ; CHECK-NEXT: vl8r.v v16, (a0) # Unknown-size Folded Reload
1241 ; CHECK-NEXT: addi a0, sp, 16
1242 ; CHECK-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
1243 ; CHECK-NEXT: vmerge.vvm v16, v16, v8, v0
1244 ; CHECK-NEXT: vmv8r.v v8, v24
1245 ; CHECK-NEXT: csrr a0, vlenb
1246 ; CHECK-NEXT: slli a0, a0, 4
1247 ; CHECK-NEXT: add sp, sp, a0
1248 ; CHECK-NEXT: addi sp, sp, 16
1250 %v = call <32 x double> @llvm.vp.merge.v32f64(<32 x i1> %m, <32 x double> %va, <32 x double> %vb, i32 %evl)
1251 ret <32 x double> %v
1254 define <32 x double> @vpmerge_vf_v32f64(double %a, <32 x double> %vb, <32 x i1> %m, i32 zeroext %evl) {
1255 ; CHECK-LABEL: vpmerge_vf_v32f64:
1257 ; CHECK-NEXT: li a2, 16
1258 ; CHECK-NEXT: mv a1, a0
1259 ; CHECK-NEXT: bltu a0, a2, .LBB80_2
1260 ; CHECK-NEXT: # %bb.1:
1261 ; CHECK-NEXT: li a1, 16
1262 ; CHECK-NEXT: .LBB80_2:
1263 ; CHECK-NEXT: vsetvli zero, a1, e64, m8, tu, ma
1264 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1265 ; CHECK-NEXT: addi a1, a0, -16
1266 ; CHECK-NEXT: sltu a0, a0, a1
1267 ; CHECK-NEXT: addi a0, a0, -1
1268 ; CHECK-NEXT: and a0, a0, a1
1269 ; CHECK-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
1270 ; CHECK-NEXT: vslidedown.vi v0, v0, 2
1271 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, tu, ma
1272 ; CHECK-NEXT: vfmerge.vfm v16, v16, fa0, v0
1274 %elt.head = insertelement <32 x double> poison, double %a, i32 0
1275 %va = shufflevector <32 x double> %elt.head, <32 x double> poison, <32 x i32> zeroinitializer
1276 %v = call <32 x double> @llvm.vp.merge.v32f64(<32 x i1> %m, <32 x double> %va, <32 x double> %vb, i32 %evl)
1277 ret <32 x double> %v