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,RV32,RV32ZVFH
4 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfh,+v,+m -target-abi=lp64d \
5 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV64,RV64ZVFH
6 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfhmin,+v,+m -target-abi=ilp32d \
7 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV32,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,RV64,RV64ZVFHMIN
10 declare <vscale x 1 x i1> @llvm.vp.merge.nxv1i1(<vscale x 1 x i1>, <vscale x 1 x i1>, <vscale x 1 x i1>, i32)
12 define <vscale x 1 x i1> @vpmerge_nxv1i1(<vscale x 1 x i1> %va, <vscale x 1 x i1> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
13 ; RV32-LABEL: vpmerge_nxv1i1:
15 ; RV32-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
16 ; RV32-NEXT: vid.v v10
17 ; RV32-NEXT: vmsltu.vx v10, v10, a0
18 ; RV32-NEXT: vmand.mm v9, v9, v10
19 ; RV32-NEXT: vmandn.mm v8, v8, v9
20 ; RV32-NEXT: vmand.mm v9, v0, v9
21 ; RV32-NEXT: vmor.mm v0, v9, v8
24 ; RV64-LABEL: vpmerge_nxv1i1:
26 ; RV64-NEXT: vsetvli a1, zero, e64, m1, ta, ma
27 ; RV64-NEXT: vid.v v10
28 ; RV64-NEXT: vmsltu.vx v10, v10, a0
29 ; RV64-NEXT: vmand.mm v9, v9, v10
30 ; RV64-NEXT: vmandn.mm v8, v8, v9
31 ; RV64-NEXT: vmand.mm v9, v0, v9
32 ; RV64-NEXT: vmor.mm v0, v9, v8
34 %v = call <vscale x 1 x i1> @llvm.vp.merge.nxv1i1(<vscale x 1 x i1> %m, <vscale x 1 x i1> %va, <vscale x 1 x i1> %vb, i32 %evl)
35 ret <vscale x 1 x i1> %v
38 declare <vscale x 1 x i8> @llvm.vp.merge.nxv1i8(<vscale x 1 x i1>, <vscale x 1 x i8>, <vscale x 1 x i8>, i32)
40 define <vscale x 1 x i8> @vpmerge_vv_nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
41 ; CHECK-LABEL: vpmerge_vv_nxv1i8:
43 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, tu, ma
44 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
45 ; CHECK-NEXT: vmv1r.v v8, v9
47 %v = call <vscale x 1 x i8> @llvm.vp.merge.nxv1i8(<vscale x 1 x i1> %m, <vscale x 1 x i8> %va, <vscale x 1 x i8> %vb, i32 %evl)
48 ret <vscale x 1 x i8> %v
51 define <vscale x 1 x i8> @vpmerge_vx_nxv1i8(i8 %a, <vscale x 1 x i8> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
52 ; CHECK-LABEL: vpmerge_vx_nxv1i8:
54 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, tu, ma
55 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
57 %elt.head = insertelement <vscale x 1 x i8> poison, i8 %a, i32 0
58 %va = shufflevector <vscale x 1 x i8> %elt.head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
59 %v = call <vscale x 1 x i8> @llvm.vp.merge.nxv1i8(<vscale x 1 x i1> %m, <vscale x 1 x i8> %va, <vscale x 1 x i8> %vb, i32 %evl)
60 ret <vscale x 1 x i8> %v
63 define <vscale x 1 x i8> @vpmerge_vi_nxv1i8(<vscale x 1 x i8> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
64 ; CHECK-LABEL: vpmerge_vi_nxv1i8:
66 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, tu, ma
67 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
69 %v = call <vscale x 1 x i8> @llvm.vp.merge.nxv1i8(<vscale x 1 x i1> %m, <vscale x 1 x i8> splat (i8 2), <vscale x 1 x i8> %vb, i32 %evl)
70 ret <vscale x 1 x i8> %v
73 declare <vscale x 2 x i8> @llvm.vp.merge.nxv2i8(<vscale x 2 x i1>, <vscale x 2 x i8>, <vscale x 2 x i8>, i32)
75 define <vscale x 2 x i8> @vpmerge_vv_nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
76 ; CHECK-LABEL: vpmerge_vv_nxv2i8:
78 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, tu, ma
79 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
80 ; CHECK-NEXT: vmv1r.v v8, v9
82 %v = call <vscale x 2 x i8> @llvm.vp.merge.nxv2i8(<vscale x 2 x i1> %m, <vscale x 2 x i8> %va, <vscale x 2 x i8> %vb, i32 %evl)
83 ret <vscale x 2 x i8> %v
86 define <vscale x 2 x i8> @vpmerge_vx_nxv2i8(i8 %a, <vscale x 2 x i8> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
87 ; CHECK-LABEL: vpmerge_vx_nxv2i8:
89 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, tu, ma
90 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
92 %elt.head = insertelement <vscale x 2 x i8> poison, i8 %a, i32 0
93 %va = shufflevector <vscale x 2 x i8> %elt.head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
94 %v = call <vscale x 2 x i8> @llvm.vp.merge.nxv2i8(<vscale x 2 x i1> %m, <vscale x 2 x i8> %va, <vscale x 2 x i8> %vb, i32 %evl)
95 ret <vscale x 2 x i8> %v
98 define <vscale x 2 x i8> @vpmerge_vi_nxv2i8(<vscale x 2 x i8> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
99 ; CHECK-LABEL: vpmerge_vi_nxv2i8:
101 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, tu, ma
102 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
104 %v = call <vscale x 2 x i8> @llvm.vp.merge.nxv2i8(<vscale x 2 x i1> %m, <vscale x 2 x i8> splat (i8 2), <vscale x 2 x i8> %vb, i32 %evl)
105 ret <vscale x 2 x i8> %v
108 declare <vscale x 3 x i8> @llvm.vp.merge.nxv3i8(<vscale x 3 x i1>, <vscale x 3 x i8>, <vscale x 3 x i8>, i32)
110 define <vscale x 3 x i8> @vpmerge_vv_nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %vb, <vscale x 3 x i1> %m, i32 zeroext %evl) {
111 ; CHECK-LABEL: vpmerge_vv_nxv3i8:
113 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, tu, ma
114 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
115 ; CHECK-NEXT: vmv1r.v v8, v9
117 %v = call <vscale x 3 x i8> @llvm.vp.merge.nxv3i8(<vscale x 3 x i1> %m, <vscale x 3 x i8> %va, <vscale x 3 x i8> %vb, i32 %evl)
118 ret <vscale x 3 x i8> %v
121 define <vscale x 3 x i8> @vpmerge_vx_nxv3i8(i8 %a, <vscale x 3 x i8> %vb, <vscale x 3 x i1> %m, i32 zeroext %evl) {
122 ; CHECK-LABEL: vpmerge_vx_nxv3i8:
124 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, tu, ma
125 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
127 %elt.head = insertelement <vscale x 3 x i8> poison, i8 %a, i32 0
128 %va = shufflevector <vscale x 3 x i8> %elt.head, <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer
129 %v = call <vscale x 3 x i8> @llvm.vp.merge.nxv3i8(<vscale x 3 x i1> %m, <vscale x 3 x i8> %va, <vscale x 3 x i8> %vb, i32 %evl)
130 ret <vscale x 3 x i8> %v
133 define <vscale x 3 x i8> @vpmerge_vi_nxv3i8(<vscale x 3 x i8> %vb, <vscale x 3 x i1> %m, i32 zeroext %evl) {
134 ; CHECK-LABEL: vpmerge_vi_nxv3i8:
136 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, tu, ma
137 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
139 %v = call <vscale x 3 x i8> @llvm.vp.merge.nxv3i8(<vscale x 3 x i1> %m, <vscale x 3 x i8> splat (i8 2), <vscale x 3 x i8> %vb, i32 %evl)
140 ret <vscale x 3 x i8> %v
143 declare <vscale x 4 x i8> @llvm.vp.merge.nxv4i8(<vscale x 4 x i1>, <vscale x 4 x i8>, <vscale x 4 x i8>, i32)
145 define <vscale x 4 x i8> @vpmerge_vv_nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
146 ; CHECK-LABEL: vpmerge_vv_nxv4i8:
148 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, tu, ma
149 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
150 ; CHECK-NEXT: vmv1r.v v8, v9
152 %v = call <vscale x 4 x i8> @llvm.vp.merge.nxv4i8(<vscale x 4 x i1> %m, <vscale x 4 x i8> %va, <vscale x 4 x i8> %vb, i32 %evl)
153 ret <vscale x 4 x i8> %v
156 define <vscale x 4 x i8> @vpmerge_vx_nxv4i8(i8 %a, <vscale x 4 x i8> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
157 ; CHECK-LABEL: vpmerge_vx_nxv4i8:
159 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, tu, ma
160 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
162 %elt.head = insertelement <vscale x 4 x i8> poison, i8 %a, i32 0
163 %va = shufflevector <vscale x 4 x i8> %elt.head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
164 %v = call <vscale x 4 x i8> @llvm.vp.merge.nxv4i8(<vscale x 4 x i1> %m, <vscale x 4 x i8> %va, <vscale x 4 x i8> %vb, i32 %evl)
165 ret <vscale x 4 x i8> %v
168 define <vscale x 4 x i8> @vpmerge_vi_nxv4i8(<vscale x 4 x i8> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
169 ; CHECK-LABEL: vpmerge_vi_nxv4i8:
171 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, tu, ma
172 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
174 %v = call <vscale x 4 x i8> @llvm.vp.merge.nxv4i8(<vscale x 4 x i1> %m, <vscale x 4 x i8> splat (i8 2), <vscale x 4 x i8> %vb, i32 %evl)
175 ret <vscale x 4 x i8> %v
178 declare <vscale x 8 x i7> @llvm.vp.merge.nxv8i7(<vscale x 8 x i1>, <vscale x 8 x i7>, <vscale x 8 x i7>, i32)
180 define <vscale x 8 x i7> @vpmerge_vv_nxv8i7(<vscale x 8 x i7> %va, <vscale x 8 x i7> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
181 ; CHECK-LABEL: vpmerge_vv_nxv8i7:
183 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, tu, ma
184 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
185 ; CHECK-NEXT: vmv1r.v v8, v9
187 %v = call <vscale x 8 x i7> @llvm.vp.merge.nxv8i7(<vscale x 8 x i1> %m, <vscale x 8 x i7> %va, <vscale x 8 x i7> %vb, i32 %evl)
188 ret <vscale x 8 x i7> %v
191 define <vscale x 8 x i7> @vpmerge_vx_nxv8i7(i7 %a, <vscale x 8 x i7> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
192 ; CHECK-LABEL: vpmerge_vx_nxv8i7:
194 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, tu, ma
195 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
197 %elt.head = insertelement <vscale x 8 x i7> poison, i7 %a, i32 0
198 %va = shufflevector <vscale x 8 x i7> %elt.head, <vscale x 8 x i7> poison, <vscale x 8 x i32> zeroinitializer
199 %v = call <vscale x 8 x i7> @llvm.vp.merge.nxv8i7(<vscale x 8 x i1> %m, <vscale x 8 x i7> %va, <vscale x 8 x i7> %vb, i32 %evl)
200 ret <vscale x 8 x i7> %v
203 define <vscale x 8 x i7> @vpmerge_vi_nxv8i7(<vscale x 8 x i7> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
204 ; CHECK-LABEL: vpmerge_vi_nxv8i7:
206 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, tu, ma
207 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
209 %v = call <vscale x 8 x i7> @llvm.vp.merge.nxv8i7(<vscale x 8 x i1> %m, <vscale x 8 x i7> splat (i7 2), <vscale x 8 x i7> %vb, i32 %evl)
210 ret <vscale x 8 x i7> %v
213 declare <vscale x 8 x i8> @llvm.vp.merge.nxv8i8(<vscale x 8 x i1>, <vscale x 8 x i8>, <vscale x 8 x i8>, i32)
215 define <vscale x 8 x i8> @vpmerge_vv_nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
216 ; CHECK-LABEL: vpmerge_vv_nxv8i8:
218 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, tu, ma
219 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
220 ; CHECK-NEXT: vmv1r.v v8, v9
222 %v = call <vscale x 8 x i8> @llvm.vp.merge.nxv8i8(<vscale x 8 x i1> %m, <vscale x 8 x i8> %va, <vscale x 8 x i8> %vb, i32 %evl)
223 ret <vscale x 8 x i8> %v
226 define <vscale x 8 x i8> @vpmerge_vx_nxv8i8(i8 %a, <vscale x 8 x i8> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
227 ; CHECK-LABEL: vpmerge_vx_nxv8i8:
229 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, tu, ma
230 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
232 %elt.head = insertelement <vscale x 8 x i8> poison, i8 %a, i32 0
233 %va = shufflevector <vscale x 8 x i8> %elt.head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
234 %v = call <vscale x 8 x i8> @llvm.vp.merge.nxv8i8(<vscale x 8 x i1> %m, <vscale x 8 x i8> %va, <vscale x 8 x i8> %vb, i32 %evl)
235 ret <vscale x 8 x i8> %v
238 define <vscale x 8 x i8> @vpmerge_vi_nxv8i8(<vscale x 8 x i8> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
239 ; CHECK-LABEL: vpmerge_vi_nxv8i8:
241 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, tu, ma
242 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
244 %v = call <vscale x 8 x i8> @llvm.vp.merge.nxv8i8(<vscale x 8 x i1> %m, <vscale x 8 x i8> splat (i8 2), <vscale x 8 x i8> %vb, i32 %evl)
245 ret <vscale x 8 x i8> %v
248 declare <vscale x 16 x i8> @llvm.vp.merge.nxv16i8(<vscale x 16 x i1>, <vscale x 16 x i8>, <vscale x 16 x i8>, i32)
250 define <vscale x 16 x i8> @vpmerge_vv_nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb, <vscale x 16 x i1> %m, i32 zeroext %evl) {
251 ; CHECK-LABEL: vpmerge_vv_nxv16i8:
253 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, tu, ma
254 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
255 ; CHECK-NEXT: vmv2r.v v8, v10
257 %v = call <vscale x 16 x i8> @llvm.vp.merge.nxv16i8(<vscale x 16 x i1> %m, <vscale x 16 x i8> %va, <vscale x 16 x i8> %vb, i32 %evl)
258 ret <vscale x 16 x i8> %v
261 define <vscale x 16 x i8> @vpmerge_vx_nxv16i8(i8 %a, <vscale x 16 x i8> %vb, <vscale x 16 x i1> %m, i32 zeroext %evl) {
262 ; CHECK-LABEL: vpmerge_vx_nxv16i8:
264 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, tu, ma
265 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
267 %elt.head = insertelement <vscale x 16 x i8> poison, i8 %a, i32 0
268 %va = shufflevector <vscale x 16 x i8> %elt.head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
269 %v = call <vscale x 16 x i8> @llvm.vp.merge.nxv16i8(<vscale x 16 x i1> %m, <vscale x 16 x i8> %va, <vscale x 16 x i8> %vb, i32 %evl)
270 ret <vscale x 16 x i8> %v
273 define <vscale x 16 x i8> @vpmerge_vi_nxv16i8(<vscale x 16 x i8> %vb, <vscale x 16 x i1> %m, i32 zeroext %evl) {
274 ; CHECK-LABEL: vpmerge_vi_nxv16i8:
276 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, tu, ma
277 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
279 %v = call <vscale x 16 x i8> @llvm.vp.merge.nxv16i8(<vscale x 16 x i1> %m, <vscale x 16 x i8> splat (i8 2), <vscale x 16 x i8> %vb, i32 %evl)
280 ret <vscale x 16 x i8> %v
283 declare <vscale x 32 x i8> @llvm.vp.merge.nxv32i8(<vscale x 32 x i1>, <vscale x 32 x i8>, <vscale x 32 x i8>, i32)
285 define <vscale x 32 x i8> @vpmerge_vv_nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb, <vscale x 32 x i1> %m, i32 zeroext %evl) {
286 ; CHECK-LABEL: vpmerge_vv_nxv32i8:
288 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, tu, ma
289 ; CHECK-NEXT: vmerge.vvm v12, v12, v8, v0
290 ; CHECK-NEXT: vmv4r.v v8, v12
292 %v = call <vscale x 32 x i8> @llvm.vp.merge.nxv32i8(<vscale x 32 x i1> %m, <vscale x 32 x i8> %va, <vscale x 32 x i8> %vb, i32 %evl)
293 ret <vscale x 32 x i8> %v
296 define <vscale x 32 x i8> @vpmerge_vx_nxv32i8(i8 %a, <vscale x 32 x i8> %vb, <vscale x 32 x i1> %m, i32 zeroext %evl) {
297 ; CHECK-LABEL: vpmerge_vx_nxv32i8:
299 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, tu, ma
300 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
302 %elt.head = insertelement <vscale x 32 x i8> poison, i8 %a, i32 0
303 %va = shufflevector <vscale x 32 x i8> %elt.head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
304 %v = call <vscale x 32 x i8> @llvm.vp.merge.nxv32i8(<vscale x 32 x i1> %m, <vscale x 32 x i8> %va, <vscale x 32 x i8> %vb, i32 %evl)
305 ret <vscale x 32 x i8> %v
308 define <vscale x 32 x i8> @vpmerge_vi_nxv32i8(<vscale x 32 x i8> %vb, <vscale x 32 x i1> %m, i32 zeroext %evl) {
309 ; CHECK-LABEL: vpmerge_vi_nxv32i8:
311 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, tu, ma
312 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
314 %v = call <vscale x 32 x i8> @llvm.vp.merge.nxv32i8(<vscale x 32 x i1> %m, <vscale x 32 x i8> splat (i8 2), <vscale x 32 x i8> %vb, i32 %evl)
315 ret <vscale x 32 x i8> %v
318 declare <vscale x 64 x i8> @llvm.vp.merge.nxv64i8(<vscale x 64 x i1>, <vscale x 64 x i8>, <vscale x 64 x i8>, i32)
320 define <vscale x 64 x i8> @vpmerge_vv_nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb, <vscale x 64 x i1> %m, i32 zeroext %evl) {
321 ; CHECK-LABEL: vpmerge_vv_nxv64i8:
323 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, tu, ma
324 ; CHECK-NEXT: vmerge.vvm v16, v16, v8, v0
325 ; CHECK-NEXT: vmv8r.v v8, v16
327 %v = call <vscale x 64 x i8> @llvm.vp.merge.nxv64i8(<vscale x 64 x i1> %m, <vscale x 64 x i8> %va, <vscale x 64 x i8> %vb, i32 %evl)
328 ret <vscale x 64 x i8> %v
331 define <vscale x 64 x i8> @vpmerge_vx_nxv64i8(i8 %a, <vscale x 64 x i8> %vb, <vscale x 64 x i1> %m, i32 zeroext %evl) {
332 ; CHECK-LABEL: vpmerge_vx_nxv64i8:
334 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, tu, ma
335 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
337 %elt.head = insertelement <vscale x 64 x i8> poison, i8 %a, i32 0
338 %va = shufflevector <vscale x 64 x i8> %elt.head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
339 %v = call <vscale x 64 x i8> @llvm.vp.merge.nxv64i8(<vscale x 64 x i1> %m, <vscale x 64 x i8> %va, <vscale x 64 x i8> %vb, i32 %evl)
340 ret <vscale x 64 x i8> %v
343 define <vscale x 64 x i8> @vpmerge_vi_nxv64i8(<vscale x 64 x i8> %vb, <vscale x 64 x i1> %m, i32 zeroext %evl) {
344 ; CHECK-LABEL: vpmerge_vi_nxv64i8:
346 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, tu, ma
347 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
349 %v = call <vscale x 64 x i8> @llvm.vp.merge.nxv64i8(<vscale x 64 x i1> %m, <vscale x 64 x i8> splat (i8 2), <vscale x 64 x i8> %vb, i32 %evl)
350 ret <vscale x 64 x i8> %v
353 declare <vscale x 128 x i8> @llvm.vp.merge.nxv128i8(<vscale x 128 x i1>, <vscale x 128 x i8>, <vscale x 128 x i8>, i32)
355 define <vscale x 128 x i8> @vpmerge_vv_nxv128i8(<vscale x 128 x i8> %va, <vscale x 128 x i8> %vb, <vscale x 128 x i1> %m, i32 zeroext %evl) {
356 ; CHECK-LABEL: vpmerge_vv_nxv128i8:
358 ; CHECK-NEXT: addi sp, sp, -16
359 ; CHECK-NEXT: .cfi_def_cfa_offset 16
360 ; CHECK-NEXT: csrr a1, vlenb
361 ; CHECK-NEXT: slli a1, a1, 3
362 ; CHECK-NEXT: sub sp, sp, a1
363 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x08, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 8 * vlenb
364 ; CHECK-NEXT: vmv1r.v v7, v0
365 ; CHECK-NEXT: vmv8r.v v24, v16
366 ; CHECK-NEXT: addi a1, sp, 16
367 ; CHECK-NEXT: vs8r.v v8, (a1) # Unknown-size Folded Spill
368 ; CHECK-NEXT: csrr a1, vlenb
369 ; CHECK-NEXT: slli a1, a1, 3
370 ; CHECK-NEXT: add a4, a0, a1
371 ; CHECK-NEXT: vl8r.v v16, (a4)
372 ; CHECK-NEXT: vsetvli a4, zero, e8, m8, ta, ma
373 ; CHECK-NEXT: vlm.v v0, (a2)
374 ; CHECK-NEXT: sub a2, a3, a1
375 ; CHECK-NEXT: sltu a4, a3, a2
376 ; CHECK-NEXT: vl8r.v v8, (a0)
377 ; CHECK-NEXT: addi a4, a4, -1
378 ; CHECK-NEXT: and a2, a4, a2
379 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, tu, ma
380 ; CHECK-NEXT: vmerge.vvm v16, v16, v24, v0
381 ; CHECK-NEXT: bltu a3, a1, .LBB28_2
382 ; CHECK-NEXT: # %bb.1:
383 ; CHECK-NEXT: mv a3, a1
384 ; CHECK-NEXT: .LBB28_2:
385 ; CHECK-NEXT: vmv1r.v v0, v7
386 ; CHECK-NEXT: addi a0, sp, 16
387 ; CHECK-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
388 ; CHECK-NEXT: vsetvli zero, a3, e8, m8, tu, ma
389 ; CHECK-NEXT: vmerge.vvm v8, v8, v24, v0
390 ; CHECK-NEXT: csrr a0, vlenb
391 ; CHECK-NEXT: slli a0, a0, 3
392 ; CHECK-NEXT: add sp, sp, a0
393 ; CHECK-NEXT: addi sp, sp, 16
395 %v = call <vscale x 128 x i8> @llvm.vp.merge.nxv128i8(<vscale x 128 x i1> %m, <vscale x 128 x i8> %va, <vscale x 128 x i8> %vb, i32 %evl)
396 ret <vscale x 128 x i8> %v
399 define <vscale x 128 x i8> @vpmerge_vx_nxv128i8(i8 %a, <vscale x 128 x i8> %vb, <vscale x 128 x i1> %m, i32 zeroext %evl) {
400 ; CHECK-LABEL: vpmerge_vx_nxv128i8:
402 ; CHECK-NEXT: vmv1r.v v24, v0
403 ; CHECK-NEXT: vsetvli a3, zero, e8, m8, ta, ma
404 ; CHECK-NEXT: vlm.v v0, (a1)
405 ; CHECK-NEXT: csrr a1, vlenb
406 ; CHECK-NEXT: slli a1, a1, 3
407 ; CHECK-NEXT: sub a3, a2, a1
408 ; CHECK-NEXT: sltu a4, a2, a3
409 ; CHECK-NEXT: addi a4, a4, -1
410 ; CHECK-NEXT: and a3, a4, a3
411 ; CHECK-NEXT: vsetvli zero, a3, e8, m8, tu, ma
412 ; CHECK-NEXT: vmerge.vxm v16, v16, a0, v0
413 ; CHECK-NEXT: bltu a2, a1, .LBB29_2
414 ; CHECK-NEXT: # %bb.1:
415 ; CHECK-NEXT: mv a2, a1
416 ; CHECK-NEXT: .LBB29_2:
417 ; CHECK-NEXT: vmv1r.v v0, v24
418 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, tu, ma
419 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
421 %elt.head = insertelement <vscale x 128 x i8> poison, i8 %a, i32 0
422 %va = shufflevector <vscale x 128 x i8> %elt.head, <vscale x 128 x i8> poison, <vscale x 128 x i32> zeroinitializer
423 %v = call <vscale x 128 x i8> @llvm.vp.merge.nxv128i8(<vscale x 128 x i1> %m, <vscale x 128 x i8> %va, <vscale x 128 x i8> %vb, i32 %evl)
424 ret <vscale x 128 x i8> %v
427 define <vscale x 128 x i8> @vpmerge_vi_nxv128i8(<vscale x 128 x i8> %vb, <vscale x 128 x i1> %m, i32 zeroext %evl) {
428 ; CHECK-LABEL: vpmerge_vi_nxv128i8:
430 ; CHECK-NEXT: vmv1r.v v24, v0
431 ; CHECK-NEXT: vsetvli a2, zero, e8, m8, ta, ma
432 ; CHECK-NEXT: vlm.v v0, (a0)
433 ; CHECK-NEXT: csrr a0, vlenb
434 ; CHECK-NEXT: slli a0, a0, 3
435 ; CHECK-NEXT: sub a2, a1, a0
436 ; CHECK-NEXT: sltu a3, a1, a2
437 ; CHECK-NEXT: addi a3, a3, -1
438 ; CHECK-NEXT: and a2, a3, a2
439 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, tu, ma
440 ; CHECK-NEXT: vmerge.vim v16, v16, 2, v0
441 ; CHECK-NEXT: bltu a1, a0, .LBB30_2
442 ; CHECK-NEXT: # %bb.1:
443 ; CHECK-NEXT: mv a1, a0
444 ; CHECK-NEXT: .LBB30_2:
445 ; CHECK-NEXT: vmv1r.v v0, v24
446 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, tu, ma
447 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
449 %v = call <vscale x 128 x i8> @llvm.vp.merge.nxv128i8(<vscale x 128 x i1> %m, <vscale x 128 x i8> splat (i8 2), <vscale x 128 x i8> %vb, i32 %evl)
450 ret <vscale x 128 x i8> %v
453 declare <vscale x 1 x i16> @llvm.vp.merge.nxv1i16(<vscale x 1 x i1>, <vscale x 1 x i16>, <vscale x 1 x i16>, i32)
455 define <vscale x 1 x i16> @vpmerge_vv_nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
456 ; CHECK-LABEL: vpmerge_vv_nxv1i16:
458 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, tu, ma
459 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
460 ; CHECK-NEXT: vmv1r.v v8, v9
462 %v = call <vscale x 1 x i16> @llvm.vp.merge.nxv1i16(<vscale x 1 x i1> %m, <vscale x 1 x i16> %va, <vscale x 1 x i16> %vb, i32 %evl)
463 ret <vscale x 1 x i16> %v
466 define <vscale x 1 x i16> @vpmerge_vx_nxv1i16(i16 %a, <vscale x 1 x i16> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
467 ; CHECK-LABEL: vpmerge_vx_nxv1i16:
469 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, tu, ma
470 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
472 %elt.head = insertelement <vscale x 1 x i16> poison, i16 %a, i32 0
473 %va = shufflevector <vscale x 1 x i16> %elt.head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
474 %v = call <vscale x 1 x i16> @llvm.vp.merge.nxv1i16(<vscale x 1 x i1> %m, <vscale x 1 x i16> %va, <vscale x 1 x i16> %vb, i32 %evl)
475 ret <vscale x 1 x i16> %v
478 define <vscale x 1 x i16> @vpmerge_vi_nxv1i16(<vscale x 1 x i16> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
479 ; CHECK-LABEL: vpmerge_vi_nxv1i16:
481 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, tu, ma
482 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
484 %v = call <vscale x 1 x i16> @llvm.vp.merge.nxv1i16(<vscale x 1 x i1> %m, <vscale x 1 x i16> splat (i16 2), <vscale x 1 x i16> %vb, i32 %evl)
485 ret <vscale x 1 x i16> %v
488 declare <vscale x 2 x i16> @llvm.vp.merge.nxv2i16(<vscale x 2 x i1>, <vscale x 2 x i16>, <vscale x 2 x i16>, i32)
490 define <vscale x 2 x i16> @vpmerge_vv_nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
491 ; CHECK-LABEL: vpmerge_vv_nxv2i16:
493 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, tu, ma
494 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
495 ; CHECK-NEXT: vmv1r.v v8, v9
497 %v = call <vscale x 2 x i16> @llvm.vp.merge.nxv2i16(<vscale x 2 x i1> %m, <vscale x 2 x i16> %va, <vscale x 2 x i16> %vb, i32 %evl)
498 ret <vscale x 2 x i16> %v
501 define <vscale x 2 x i16> @vpmerge_vx_nxv2i16(i16 %a, <vscale x 2 x i16> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
502 ; CHECK-LABEL: vpmerge_vx_nxv2i16:
504 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, tu, ma
505 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
507 %elt.head = insertelement <vscale x 2 x i16> poison, i16 %a, i32 0
508 %va = shufflevector <vscale x 2 x i16> %elt.head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
509 %v = call <vscale x 2 x i16> @llvm.vp.merge.nxv2i16(<vscale x 2 x i1> %m, <vscale x 2 x i16> %va, <vscale x 2 x i16> %vb, i32 %evl)
510 ret <vscale x 2 x i16> %v
513 define <vscale x 2 x i16> @vpmerge_vi_nxv2i16(<vscale x 2 x i16> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
514 ; CHECK-LABEL: vpmerge_vi_nxv2i16:
516 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, tu, ma
517 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
519 %v = call <vscale x 2 x i16> @llvm.vp.merge.nxv2i16(<vscale x 2 x i1> %m, <vscale x 2 x i16> splat (i16 2), <vscale x 2 x i16> %vb, i32 %evl)
520 ret <vscale x 2 x i16> %v
523 declare <vscale x 4 x i16> @llvm.vp.merge.nxv4i16(<vscale x 4 x i1>, <vscale x 4 x i16>, <vscale x 4 x i16>, i32)
525 define <vscale x 4 x i16> @vpmerge_vv_nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
526 ; CHECK-LABEL: vpmerge_vv_nxv4i16:
528 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, tu, ma
529 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
530 ; CHECK-NEXT: vmv1r.v v8, v9
532 %v = call <vscale x 4 x i16> @llvm.vp.merge.nxv4i16(<vscale x 4 x i1> %m, <vscale x 4 x i16> %va, <vscale x 4 x i16> %vb, i32 %evl)
533 ret <vscale x 4 x i16> %v
536 define <vscale x 4 x i16> @vpmerge_vx_nxv4i16(i16 %a, <vscale x 4 x i16> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
537 ; CHECK-LABEL: vpmerge_vx_nxv4i16:
539 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, tu, ma
540 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
542 %elt.head = insertelement <vscale x 4 x i16> poison, i16 %a, i32 0
543 %va = shufflevector <vscale x 4 x i16> %elt.head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
544 %v = call <vscale x 4 x i16> @llvm.vp.merge.nxv4i16(<vscale x 4 x i1> %m, <vscale x 4 x i16> %va, <vscale x 4 x i16> %vb, i32 %evl)
545 ret <vscale x 4 x i16> %v
548 define <vscale x 4 x i16> @vpmerge_vi_nxv4i16(<vscale x 4 x i16> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
549 ; CHECK-LABEL: vpmerge_vi_nxv4i16:
551 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, tu, ma
552 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
554 %v = call <vscale x 4 x i16> @llvm.vp.merge.nxv4i16(<vscale x 4 x i1> %m, <vscale x 4 x i16> splat (i16 2), <vscale x 4 x i16> %vb, i32 %evl)
555 ret <vscale x 4 x i16> %v
558 declare <vscale x 8 x i16> @llvm.vp.merge.nxv8i16(<vscale x 8 x i1>, <vscale x 8 x i16>, <vscale x 8 x i16>, i32)
560 define <vscale x 8 x i16> @vpmerge_vv_nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
561 ; CHECK-LABEL: vpmerge_vv_nxv8i16:
563 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, tu, ma
564 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
565 ; CHECK-NEXT: vmv2r.v v8, v10
567 %v = call <vscale x 8 x i16> @llvm.vp.merge.nxv8i16(<vscale x 8 x i1> %m, <vscale x 8 x i16> %va, <vscale x 8 x i16> %vb, i32 %evl)
568 ret <vscale x 8 x i16> %v
571 define <vscale x 8 x i16> @vpmerge_vx_nxv8i16(i16 %a, <vscale x 8 x i16> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
572 ; CHECK-LABEL: vpmerge_vx_nxv8i16:
574 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, tu, ma
575 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
577 %elt.head = insertelement <vscale x 8 x i16> poison, i16 %a, i32 0
578 %va = shufflevector <vscale x 8 x i16> %elt.head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
579 %v = call <vscale x 8 x i16> @llvm.vp.merge.nxv8i16(<vscale x 8 x i1> %m, <vscale x 8 x i16> %va, <vscale x 8 x i16> %vb, i32 %evl)
580 ret <vscale x 8 x i16> %v
583 define <vscale x 8 x i16> @vpmerge_vi_nxv8i16(<vscale x 8 x i16> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
584 ; CHECK-LABEL: vpmerge_vi_nxv8i16:
586 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, tu, ma
587 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
589 %v = call <vscale x 8 x i16> @llvm.vp.merge.nxv8i16(<vscale x 8 x i1> %m, <vscale x 8 x i16> splat (i16 2), <vscale x 8 x i16> %vb, i32 %evl)
590 ret <vscale x 8 x i16> %v
593 declare <vscale x 16 x i16> @llvm.vp.merge.nxv16i16(<vscale x 16 x i1>, <vscale x 16 x i16>, <vscale x 16 x i16>, i32)
595 define <vscale x 16 x i16> @vpmerge_vv_nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb, <vscale x 16 x i1> %m, i32 zeroext %evl) {
596 ; CHECK-LABEL: vpmerge_vv_nxv16i16:
598 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, tu, ma
599 ; CHECK-NEXT: vmerge.vvm v12, v12, v8, v0
600 ; CHECK-NEXT: vmv4r.v v8, v12
602 %v = call <vscale x 16 x i16> @llvm.vp.merge.nxv16i16(<vscale x 16 x i1> %m, <vscale x 16 x i16> %va, <vscale x 16 x i16> %vb, i32 %evl)
603 ret <vscale x 16 x i16> %v
606 define <vscale x 16 x i16> @vpmerge_vx_nxv16i16(i16 %a, <vscale x 16 x i16> %vb, <vscale x 16 x i1> %m, i32 zeroext %evl) {
607 ; CHECK-LABEL: vpmerge_vx_nxv16i16:
609 ; CHECK-NEXT: vsetvli zero, a1, e16, m4, tu, ma
610 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
612 %elt.head = insertelement <vscale x 16 x i16> poison, i16 %a, i32 0
613 %va = shufflevector <vscale x 16 x i16> %elt.head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
614 %v = call <vscale x 16 x i16> @llvm.vp.merge.nxv16i16(<vscale x 16 x i1> %m, <vscale x 16 x i16> %va, <vscale x 16 x i16> %vb, i32 %evl)
615 ret <vscale x 16 x i16> %v
618 define <vscale x 16 x i16> @vpmerge_vi_nxv16i16(<vscale x 16 x i16> %vb, <vscale x 16 x i1> %m, i32 zeroext %evl) {
619 ; CHECK-LABEL: vpmerge_vi_nxv16i16:
621 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, tu, ma
622 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
624 %v = call <vscale x 16 x i16> @llvm.vp.merge.nxv16i16(<vscale x 16 x i1> %m, <vscale x 16 x i16> splat (i16 2), <vscale x 16 x i16> %vb, i32 %evl)
625 ret <vscale x 16 x i16> %v
628 declare <vscale x 32 x i16> @llvm.vp.merge.nxv32i16(<vscale x 32 x i1>, <vscale x 32 x i16>, <vscale x 32 x i16>, i32)
630 define <vscale x 32 x i16> @vpmerge_vv_nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb, <vscale x 32 x i1> %m, i32 zeroext %evl) {
631 ; CHECK-LABEL: vpmerge_vv_nxv32i16:
633 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, tu, ma
634 ; CHECK-NEXT: vmerge.vvm v16, v16, v8, v0
635 ; CHECK-NEXT: vmv8r.v v8, v16
637 %v = call <vscale x 32 x i16> @llvm.vp.merge.nxv32i16(<vscale x 32 x i1> %m, <vscale x 32 x i16> %va, <vscale x 32 x i16> %vb, i32 %evl)
638 ret <vscale x 32 x i16> %v
641 define <vscale x 32 x i16> @vpmerge_vx_nxv32i16(i16 %a, <vscale x 32 x i16> %vb, <vscale x 32 x i1> %m, i32 zeroext %evl) {
642 ; CHECK-LABEL: vpmerge_vx_nxv32i16:
644 ; CHECK-NEXT: vsetvli zero, a1, e16, m8, tu, ma
645 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
647 %elt.head = insertelement <vscale x 32 x i16> poison, i16 %a, i32 0
648 %va = shufflevector <vscale x 32 x i16> %elt.head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
649 %v = call <vscale x 32 x i16> @llvm.vp.merge.nxv32i16(<vscale x 32 x i1> %m, <vscale x 32 x i16> %va, <vscale x 32 x i16> %vb, i32 %evl)
650 ret <vscale x 32 x i16> %v
653 define <vscale x 32 x i16> @vpmerge_vi_nxv32i16(<vscale x 32 x i16> %vb, <vscale x 32 x i1> %m, i32 zeroext %evl) {
654 ; CHECK-LABEL: vpmerge_vi_nxv32i16:
656 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, tu, ma
657 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
659 %v = call <vscale x 32 x i16> @llvm.vp.merge.nxv32i16(<vscale x 32 x i1> %m, <vscale x 32 x i16> splat (i16 2), <vscale x 32 x i16> %vb, i32 %evl)
660 ret <vscale x 32 x i16> %v
663 declare <vscale x 1 x i32> @llvm.vp.merge.nxv1i32(<vscale x 1 x i1>, <vscale x 1 x i32>, <vscale x 1 x i32>, i32)
665 define <vscale x 1 x i32> @vpmerge_vv_nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
666 ; CHECK-LABEL: vpmerge_vv_nxv1i32:
668 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, tu, ma
669 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
670 ; CHECK-NEXT: vmv1r.v v8, v9
672 %v = call <vscale x 1 x i32> @llvm.vp.merge.nxv1i32(<vscale x 1 x i1> %m, <vscale x 1 x i32> %va, <vscale x 1 x i32> %vb, i32 %evl)
673 ret <vscale x 1 x i32> %v
676 define <vscale x 1 x i32> @vpmerge_vx_nxv1i32(i32 %a, <vscale x 1 x i32> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
677 ; CHECK-LABEL: vpmerge_vx_nxv1i32:
679 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, tu, ma
680 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
682 %elt.head = insertelement <vscale x 1 x i32> poison, i32 %a, i32 0
683 %va = shufflevector <vscale x 1 x i32> %elt.head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
684 %v = call <vscale x 1 x i32> @llvm.vp.merge.nxv1i32(<vscale x 1 x i1> %m, <vscale x 1 x i32> %va, <vscale x 1 x i32> %vb, i32 %evl)
685 ret <vscale x 1 x i32> %v
688 define <vscale x 1 x i32> @vpmerge_vi_nxv1i32(<vscale x 1 x i32> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
689 ; CHECK-LABEL: vpmerge_vi_nxv1i32:
691 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, tu, ma
692 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
694 %v = call <vscale x 1 x i32> @llvm.vp.merge.nxv1i32(<vscale x 1 x i1> %m, <vscale x 1 x i32> splat (i32 2), <vscale x 1 x i32> %vb, i32 %evl)
695 ret <vscale x 1 x i32> %v
698 declare <vscale x 2 x i32> @llvm.vp.merge.nxv2i32(<vscale x 2 x i1>, <vscale x 2 x i32>, <vscale x 2 x i32>, i32)
700 define <vscale x 2 x i32> @vpmerge_vv_nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
701 ; CHECK-LABEL: vpmerge_vv_nxv2i32:
703 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, ma
704 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
705 ; CHECK-NEXT: vmv1r.v v8, v9
707 %v = call <vscale x 2 x i32> @llvm.vp.merge.nxv2i32(<vscale x 2 x i1> %m, <vscale x 2 x i32> %va, <vscale x 2 x i32> %vb, i32 %evl)
708 ret <vscale x 2 x i32> %v
711 define <vscale x 2 x i32> @vpmerge_vx_nxv2i32(i32 %a, <vscale x 2 x i32> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
712 ; CHECK-LABEL: vpmerge_vx_nxv2i32:
714 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, tu, ma
715 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
717 %elt.head = insertelement <vscale x 2 x i32> poison, i32 %a, i32 0
718 %va = shufflevector <vscale x 2 x i32> %elt.head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
719 %v = call <vscale x 2 x i32> @llvm.vp.merge.nxv2i32(<vscale x 2 x i1> %m, <vscale x 2 x i32> %va, <vscale x 2 x i32> %vb, i32 %evl)
720 ret <vscale x 2 x i32> %v
723 define <vscale x 2 x i32> @vpmerge_vi_nxv2i32(<vscale x 2 x i32> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
724 ; CHECK-LABEL: vpmerge_vi_nxv2i32:
726 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, ma
727 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
729 %v = call <vscale x 2 x i32> @llvm.vp.merge.nxv2i32(<vscale x 2 x i1> %m, <vscale x 2 x i32> splat (i32 2), <vscale x 2 x i32> %vb, i32 %evl)
730 ret <vscale x 2 x i32> %v
733 declare <vscale x 4 x i32> @llvm.vp.merge.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>, <vscale x 4 x i32>, i32)
735 define <vscale x 4 x i32> @vpmerge_vv_nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
736 ; CHECK-LABEL: vpmerge_vv_nxv4i32:
738 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, tu, ma
739 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
740 ; CHECK-NEXT: vmv2r.v v8, v10
742 %v = call <vscale x 4 x i32> @llvm.vp.merge.nxv4i32(<vscale x 4 x i1> %m, <vscale x 4 x i32> %va, <vscale x 4 x i32> %vb, i32 %evl)
743 ret <vscale x 4 x i32> %v
746 define <vscale x 4 x i32> @vpmerge_vx_nxv4i32(i32 %a, <vscale x 4 x i32> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
747 ; CHECK-LABEL: vpmerge_vx_nxv4i32:
749 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, tu, ma
750 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
752 %elt.head = insertelement <vscale x 4 x i32> poison, i32 %a, i32 0
753 %va = shufflevector <vscale x 4 x i32> %elt.head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
754 %v = call <vscale x 4 x i32> @llvm.vp.merge.nxv4i32(<vscale x 4 x i1> %m, <vscale x 4 x i32> %va, <vscale x 4 x i32> %vb, i32 %evl)
755 ret <vscale x 4 x i32> %v
758 define <vscale x 4 x i32> @vpmerge_vi_nxv4i32(<vscale x 4 x i32> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
759 ; CHECK-LABEL: vpmerge_vi_nxv4i32:
761 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, tu, ma
762 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
764 %v = call <vscale x 4 x i32> @llvm.vp.merge.nxv4i32(<vscale x 4 x i1> %m, <vscale x 4 x i32> splat (i32 2), <vscale x 4 x i32> %vb, i32 %evl)
765 ret <vscale x 4 x i32> %v
768 declare <vscale x 8 x i32> @llvm.vp.merge.nxv8i32(<vscale x 8 x i1>, <vscale x 8 x i32>, <vscale x 8 x i32>, i32)
770 define <vscale x 8 x i32> @vpmerge_vv_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
771 ; CHECK-LABEL: vpmerge_vv_nxv8i32:
773 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, tu, ma
774 ; CHECK-NEXT: vmerge.vvm v12, v12, v8, v0
775 ; CHECK-NEXT: vmv4r.v v8, v12
777 %v = call <vscale x 8 x i32> @llvm.vp.merge.nxv8i32(<vscale x 8 x i1> %m, <vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, i32 %evl)
778 ret <vscale x 8 x i32> %v
781 define <vscale x 8 x i32> @vpmerge_vx_nxv8i32(i32 %a, <vscale x 8 x i32> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
782 ; CHECK-LABEL: vpmerge_vx_nxv8i32:
784 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, tu, ma
785 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
787 %elt.head = insertelement <vscale x 8 x i32> poison, i32 %a, i32 0
788 %va = shufflevector <vscale x 8 x i32> %elt.head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
789 %v = call <vscale x 8 x i32> @llvm.vp.merge.nxv8i32(<vscale x 8 x i1> %m, <vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, i32 %evl)
790 ret <vscale x 8 x i32> %v
793 define <vscale x 8 x i32> @vpmerge_vi_nxv8i32(<vscale x 8 x i32> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
794 ; CHECK-LABEL: vpmerge_vi_nxv8i32:
796 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, tu, ma
797 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
799 %v = call <vscale x 8 x i32> @llvm.vp.merge.nxv8i32(<vscale x 8 x i1> %m, <vscale x 8 x i32> splat (i32 2), <vscale x 8 x i32> %vb, i32 %evl)
800 ret <vscale x 8 x i32> %v
803 declare <vscale x 16 x i32> @llvm.vp.merge.nxv16i32(<vscale x 16 x i1>, <vscale x 16 x i32>, <vscale x 16 x i32>, i32)
805 define <vscale x 16 x i32> @vpmerge_vv_nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb, <vscale x 16 x i1> %m, i32 zeroext %evl) {
806 ; CHECK-LABEL: vpmerge_vv_nxv16i32:
808 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, tu, ma
809 ; CHECK-NEXT: vmerge.vvm v16, v16, v8, v0
810 ; CHECK-NEXT: vmv8r.v v8, v16
812 %v = call <vscale x 16 x i32> @llvm.vp.merge.nxv16i32(<vscale x 16 x i1> %m, <vscale x 16 x i32> %va, <vscale x 16 x i32> %vb, i32 %evl)
813 ret <vscale x 16 x i32> %v
816 define <vscale x 16 x i32> @vpmerge_vx_nxv16i32(i32 %a, <vscale x 16 x i32> %vb, <vscale x 16 x i1> %m, i32 zeroext %evl) {
817 ; CHECK-LABEL: vpmerge_vx_nxv16i32:
819 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, tu, ma
820 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
822 %elt.head = insertelement <vscale x 16 x i32> poison, i32 %a, i32 0
823 %va = shufflevector <vscale x 16 x i32> %elt.head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
824 %v = call <vscale x 16 x i32> @llvm.vp.merge.nxv16i32(<vscale x 16 x i1> %m, <vscale x 16 x i32> %va, <vscale x 16 x i32> %vb, i32 %evl)
825 ret <vscale x 16 x i32> %v
828 define <vscale x 16 x i32> @vpmerge_vi_nxv16i32(<vscale x 16 x i32> %vb, <vscale x 16 x i1> %m, i32 zeroext %evl) {
829 ; CHECK-LABEL: vpmerge_vi_nxv16i32:
831 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, tu, ma
832 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
834 %v = call <vscale x 16 x i32> @llvm.vp.merge.nxv16i32(<vscale x 16 x i1> %m, <vscale x 16 x i32> splat (i32 2), <vscale x 16 x i32> %vb, i32 %evl)
835 ret <vscale x 16 x i32> %v
838 declare <vscale x 1 x i64> @llvm.vp.merge.nxv1i64(<vscale x 1 x i1>, <vscale x 1 x i64>, <vscale x 1 x i64>, i32)
840 define <vscale x 1 x i64> @vpmerge_vv_nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
841 ; CHECK-LABEL: vpmerge_vv_nxv1i64:
843 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, tu, ma
844 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
845 ; CHECK-NEXT: vmv1r.v v8, v9
847 %v = call <vscale x 1 x i64> @llvm.vp.merge.nxv1i64(<vscale x 1 x i1> %m, <vscale x 1 x i64> %va, <vscale x 1 x i64> %vb, i32 %evl)
848 ret <vscale x 1 x i64> %v
851 define <vscale x 1 x i64> @vpmerge_vx_nxv1i64(i64 %a, <vscale x 1 x i64> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
852 ; RV32-LABEL: vpmerge_vx_nxv1i64:
854 ; RV32-NEXT: addi sp, sp, -16
855 ; RV32-NEXT: .cfi_def_cfa_offset 16
856 ; RV32-NEXT: sw a1, 12(sp)
857 ; RV32-NEXT: sw a0, 8(sp)
858 ; RV32-NEXT: addi a0, sp, 8
859 ; RV32-NEXT: vsetvli zero, a2, e64, m1, tu, mu
860 ; RV32-NEXT: vlse64.v v8, (a0), zero, v0.t
861 ; RV32-NEXT: addi sp, sp, 16
864 ; RV64-LABEL: vpmerge_vx_nxv1i64:
866 ; RV64-NEXT: vsetvli zero, a1, e64, m1, tu, ma
867 ; RV64-NEXT: vmerge.vxm v8, v8, a0, v0
869 %elt.head = insertelement <vscale x 1 x i64> poison, i64 %a, i32 0
870 %va = shufflevector <vscale x 1 x i64> %elt.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
871 %v = call <vscale x 1 x i64> @llvm.vp.merge.nxv1i64(<vscale x 1 x i1> %m, <vscale x 1 x i64> %va, <vscale x 1 x i64> %vb, i32 %evl)
872 ret <vscale x 1 x i64> %v
875 define <vscale x 1 x i64> @vpmerge_vi_nxv1i64(<vscale x 1 x i64> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
876 ; CHECK-LABEL: vpmerge_vi_nxv1i64:
878 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, tu, ma
879 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
881 %v = call <vscale x 1 x i64> @llvm.vp.merge.nxv1i64(<vscale x 1 x i1> %m, <vscale x 1 x i64> splat (i64 2), <vscale x 1 x i64> %vb, i32 %evl)
882 ret <vscale x 1 x i64> %v
885 declare <vscale x 2 x i64> @llvm.vp.merge.nxv2i64(<vscale x 2 x i1>, <vscale x 2 x i64>, <vscale x 2 x i64>, i32)
887 define <vscale x 2 x i64> @vpmerge_vv_nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
888 ; CHECK-LABEL: vpmerge_vv_nxv2i64:
890 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, tu, ma
891 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
892 ; CHECK-NEXT: vmv2r.v v8, v10
894 %v = call <vscale x 2 x i64> @llvm.vp.merge.nxv2i64(<vscale x 2 x i1> %m, <vscale x 2 x i64> %va, <vscale x 2 x i64> %vb, i32 %evl)
895 ret <vscale x 2 x i64> %v
898 define <vscale x 2 x i64> @vpmerge_vx_nxv2i64(i64 %a, <vscale x 2 x i64> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
899 ; RV32-LABEL: vpmerge_vx_nxv2i64:
901 ; RV32-NEXT: addi sp, sp, -16
902 ; RV32-NEXT: .cfi_def_cfa_offset 16
903 ; RV32-NEXT: sw a1, 12(sp)
904 ; RV32-NEXT: sw a0, 8(sp)
905 ; RV32-NEXT: addi a0, sp, 8
906 ; RV32-NEXT: vsetvli zero, a2, e64, m2, tu, mu
907 ; RV32-NEXT: vlse64.v v8, (a0), zero, v0.t
908 ; RV32-NEXT: addi sp, sp, 16
911 ; RV64-LABEL: vpmerge_vx_nxv2i64:
913 ; RV64-NEXT: vsetvli zero, a1, e64, m2, tu, ma
914 ; RV64-NEXT: vmerge.vxm v8, v8, a0, v0
916 %elt.head = insertelement <vscale x 2 x i64> poison, i64 %a, i32 0
917 %va = shufflevector <vscale x 2 x i64> %elt.head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
918 %v = call <vscale x 2 x i64> @llvm.vp.merge.nxv2i64(<vscale x 2 x i1> %m, <vscale x 2 x i64> %va, <vscale x 2 x i64> %vb, i32 %evl)
919 ret <vscale x 2 x i64> %v
922 define <vscale x 2 x i64> @vpmerge_vi_nxv2i64(<vscale x 2 x i64> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
923 ; CHECK-LABEL: vpmerge_vi_nxv2i64:
925 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, tu, ma
926 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
928 %v = call <vscale x 2 x i64> @llvm.vp.merge.nxv2i64(<vscale x 2 x i1> %m, <vscale x 2 x i64> splat (i64 2), <vscale x 2 x i64> %vb, i32 %evl)
929 ret <vscale x 2 x i64> %v
932 declare <vscale x 4 x i64> @llvm.vp.merge.nxv4i64(<vscale x 4 x i1>, <vscale x 4 x i64>, <vscale x 4 x i64>, i32)
934 define <vscale x 4 x i64> @vpmerge_vv_nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
935 ; CHECK-LABEL: vpmerge_vv_nxv4i64:
937 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, tu, ma
938 ; CHECK-NEXT: vmerge.vvm v12, v12, v8, v0
939 ; CHECK-NEXT: vmv4r.v v8, v12
941 %v = call <vscale x 4 x i64> @llvm.vp.merge.nxv4i64(<vscale x 4 x i1> %m, <vscale x 4 x i64> %va, <vscale x 4 x i64> %vb, i32 %evl)
942 ret <vscale x 4 x i64> %v
945 define <vscale x 4 x i64> @vpmerge_vx_nxv4i64(i64 %a, <vscale x 4 x i64> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
946 ; RV32-LABEL: vpmerge_vx_nxv4i64:
948 ; RV32-NEXT: addi sp, sp, -16
949 ; RV32-NEXT: .cfi_def_cfa_offset 16
950 ; RV32-NEXT: sw a1, 12(sp)
951 ; RV32-NEXT: sw a0, 8(sp)
952 ; RV32-NEXT: addi a0, sp, 8
953 ; RV32-NEXT: vsetvli zero, a2, e64, m4, tu, mu
954 ; RV32-NEXT: vlse64.v v8, (a0), zero, v0.t
955 ; RV32-NEXT: addi sp, sp, 16
958 ; RV64-LABEL: vpmerge_vx_nxv4i64:
960 ; RV64-NEXT: vsetvli zero, a1, e64, m4, tu, ma
961 ; RV64-NEXT: vmerge.vxm v8, v8, a0, v0
963 %elt.head = insertelement <vscale x 4 x i64> poison, i64 %a, i32 0
964 %va = shufflevector <vscale x 4 x i64> %elt.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
965 %v = call <vscale x 4 x i64> @llvm.vp.merge.nxv4i64(<vscale x 4 x i1> %m, <vscale x 4 x i64> %va, <vscale x 4 x i64> %vb, i32 %evl)
966 ret <vscale x 4 x i64> %v
969 define <vscale x 4 x i64> @vpmerge_vi_nxv4i64(<vscale x 4 x i64> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
970 ; CHECK-LABEL: vpmerge_vi_nxv4i64:
972 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, tu, ma
973 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
975 %v = call <vscale x 4 x i64> @llvm.vp.merge.nxv4i64(<vscale x 4 x i1> %m, <vscale x 4 x i64> splat (i64 2), <vscale x 4 x i64> %vb, i32 %evl)
976 ret <vscale x 4 x i64> %v
979 declare <vscale x 8 x i64> @llvm.vp.merge.nxv8i64(<vscale x 8 x i1>, <vscale x 8 x i64>, <vscale x 8 x i64>, i32)
981 define <vscale x 8 x i64> @vpmerge_vv_nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
982 ; CHECK-LABEL: vpmerge_vv_nxv8i64:
984 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, tu, ma
985 ; CHECK-NEXT: vmerge.vvm v16, v16, v8, v0
986 ; CHECK-NEXT: vmv8r.v v8, v16
988 %v = call <vscale x 8 x i64> @llvm.vp.merge.nxv8i64(<vscale x 8 x i1> %m, <vscale x 8 x i64> %va, <vscale x 8 x i64> %vb, i32 %evl)
989 ret <vscale x 8 x i64> %v
992 define <vscale x 8 x i64> @vpmerge_vx_nxv8i64(i64 %a, <vscale x 8 x i64> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
993 ; RV32-LABEL: vpmerge_vx_nxv8i64:
995 ; RV32-NEXT: addi sp, sp, -16
996 ; RV32-NEXT: .cfi_def_cfa_offset 16
997 ; RV32-NEXT: sw a1, 12(sp)
998 ; RV32-NEXT: sw a0, 8(sp)
999 ; RV32-NEXT: addi a0, sp, 8
1000 ; RV32-NEXT: vsetvli zero, a2, e64, m8, tu, mu
1001 ; RV32-NEXT: vlse64.v v8, (a0), zero, v0.t
1002 ; RV32-NEXT: addi sp, sp, 16
1005 ; RV64-LABEL: vpmerge_vx_nxv8i64:
1007 ; RV64-NEXT: vsetvli zero, a1, e64, m8, tu, ma
1008 ; RV64-NEXT: vmerge.vxm v8, v8, a0, v0
1010 %elt.head = insertelement <vscale x 8 x i64> poison, i64 %a, i32 0
1011 %va = shufflevector <vscale x 8 x i64> %elt.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
1012 %v = call <vscale x 8 x i64> @llvm.vp.merge.nxv8i64(<vscale x 8 x i1> %m, <vscale x 8 x i64> %va, <vscale x 8 x i64> %vb, i32 %evl)
1013 ret <vscale x 8 x i64> %v
1016 define <vscale x 8 x i64> @vpmerge_vi_nxv8i64(<vscale x 8 x i64> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1017 ; CHECK-LABEL: vpmerge_vi_nxv8i64:
1019 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, tu, ma
1020 ; CHECK-NEXT: vmerge.vim v8, v8, 2, v0
1022 %v = call <vscale x 8 x i64> @llvm.vp.merge.nxv8i64(<vscale x 8 x i1> %m, <vscale x 8 x i64> splat (i64 2), <vscale x 8 x i64> %vb, i32 %evl)
1023 ret <vscale x 8 x i64> %v
1026 declare <vscale x 1 x half> @llvm.vp.merge.nxv1f16(<vscale x 1 x i1>, <vscale x 1 x half>, <vscale x 1 x half>, i32)
1028 define <vscale x 1 x half> @vpmerge_vv_nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1029 ; CHECK-LABEL: vpmerge_vv_nxv1f16:
1031 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, tu, ma
1032 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
1033 ; CHECK-NEXT: vmv1r.v v8, v9
1035 %v = call <vscale x 1 x half> @llvm.vp.merge.nxv1f16(<vscale x 1 x i1> %m, <vscale x 1 x half> %va, <vscale x 1 x half> %vb, i32 %evl)
1036 ret <vscale x 1 x half> %v
1039 define <vscale x 1 x half> @vpmerge_vf_nxv1f16(half %a, <vscale x 1 x half> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1040 ; RV32ZVFH-LABEL: vpmerge_vf_nxv1f16:
1041 ; RV32ZVFH: # %bb.0:
1042 ; RV32ZVFH-NEXT: vsetvli zero, a0, e16, mf4, tu, ma
1043 ; RV32ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
1044 ; RV32ZVFH-NEXT: ret
1046 ; RV64ZVFH-LABEL: vpmerge_vf_nxv1f16:
1047 ; RV64ZVFH: # %bb.0:
1048 ; RV64ZVFH-NEXT: vsetvli zero, a0, e16, mf4, tu, ma
1049 ; RV64ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
1050 ; RV64ZVFH-NEXT: ret
1052 ; RV32ZVFHMIN-LABEL: vpmerge_vf_nxv1f16:
1053 ; RV32ZVFHMIN: # %bb.0:
1054 ; RV32ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
1055 ; RV32ZVFHMIN-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
1056 ; RV32ZVFHMIN-NEXT: vfmv.v.f v9, fa5
1057 ; RV32ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf4, tu, mu
1058 ; RV32ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9, v0.t
1059 ; RV32ZVFHMIN-NEXT: ret
1061 ; RV64ZVFHMIN-LABEL: vpmerge_vf_nxv1f16:
1062 ; RV64ZVFHMIN: # %bb.0:
1063 ; RV64ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
1064 ; RV64ZVFHMIN-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
1065 ; RV64ZVFHMIN-NEXT: vfmv.v.f v9, fa5
1066 ; RV64ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf4, tu, mu
1067 ; RV64ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9, v0.t
1068 ; RV64ZVFHMIN-NEXT: ret
1069 %elt.head = insertelement <vscale x 1 x half> poison, half %a, i32 0
1070 %va = shufflevector <vscale x 1 x half> %elt.head, <vscale x 1 x half> poison, <vscale x 1 x i32> zeroinitializer
1071 %v = call <vscale x 1 x half> @llvm.vp.merge.nxv1f16(<vscale x 1 x i1> %m, <vscale x 1 x half> %va, <vscale x 1 x half> %vb, i32 %evl)
1072 ret <vscale x 1 x half> %v
1075 declare <vscale x 2 x half> @llvm.vp.merge.nxv2f16(<vscale x 2 x i1>, <vscale x 2 x half>, <vscale x 2 x half>, i32)
1077 define <vscale x 2 x half> @vpmerge_vv_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1078 ; CHECK-LABEL: vpmerge_vv_nxv2f16:
1080 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, tu, ma
1081 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
1082 ; CHECK-NEXT: vmv1r.v v8, v9
1084 %v = call <vscale x 2 x half> @llvm.vp.merge.nxv2f16(<vscale x 2 x i1> %m, <vscale x 2 x half> %va, <vscale x 2 x half> %vb, i32 %evl)
1085 ret <vscale x 2 x half> %v
1088 define <vscale x 2 x half> @vpmerge_vf_nxv2f16(half %a, <vscale x 2 x half> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1089 ; RV32ZVFH-LABEL: vpmerge_vf_nxv2f16:
1090 ; RV32ZVFH: # %bb.0:
1091 ; RV32ZVFH-NEXT: vsetvli zero, a0, e16, mf2, tu, ma
1092 ; RV32ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
1093 ; RV32ZVFH-NEXT: ret
1095 ; RV64ZVFH-LABEL: vpmerge_vf_nxv2f16:
1096 ; RV64ZVFH: # %bb.0:
1097 ; RV64ZVFH-NEXT: vsetvli zero, a0, e16, mf2, tu, ma
1098 ; RV64ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
1099 ; RV64ZVFH-NEXT: ret
1101 ; RV32ZVFHMIN-LABEL: vpmerge_vf_nxv2f16:
1102 ; RV32ZVFHMIN: # %bb.0:
1103 ; RV32ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
1104 ; RV32ZVFHMIN-NEXT: vsetvli a1, zero, e32, m1, ta, ma
1105 ; RV32ZVFHMIN-NEXT: vfmv.v.f v9, fa5
1106 ; RV32ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf2, tu, mu
1107 ; RV32ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9, v0.t
1108 ; RV32ZVFHMIN-NEXT: ret
1110 ; RV64ZVFHMIN-LABEL: vpmerge_vf_nxv2f16:
1111 ; RV64ZVFHMIN: # %bb.0:
1112 ; RV64ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
1113 ; RV64ZVFHMIN-NEXT: vsetvli a1, zero, e32, m1, ta, ma
1114 ; RV64ZVFHMIN-NEXT: vfmv.v.f v9, fa5
1115 ; RV64ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf2, tu, mu
1116 ; RV64ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9, v0.t
1117 ; RV64ZVFHMIN-NEXT: ret
1118 %elt.head = insertelement <vscale x 2 x half> poison, half %a, i32 0
1119 %va = shufflevector <vscale x 2 x half> %elt.head, <vscale x 2 x half> poison, <vscale x 2 x i32> zeroinitializer
1120 %v = call <vscale x 2 x half> @llvm.vp.merge.nxv2f16(<vscale x 2 x i1> %m, <vscale x 2 x half> %va, <vscale x 2 x half> %vb, i32 %evl)
1121 ret <vscale x 2 x half> %v
1124 declare <vscale x 4 x half> @llvm.vp.merge.nxv4f16(<vscale x 4 x i1>, <vscale x 4 x half>, <vscale x 4 x half>, i32)
1126 define <vscale x 4 x half> @vpmerge_vv_nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1127 ; CHECK-LABEL: vpmerge_vv_nxv4f16:
1129 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, tu, ma
1130 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
1131 ; CHECK-NEXT: vmv1r.v v8, v9
1133 %v = call <vscale x 4 x half> @llvm.vp.merge.nxv4f16(<vscale x 4 x i1> %m, <vscale x 4 x half> %va, <vscale x 4 x half> %vb, i32 %evl)
1134 ret <vscale x 4 x half> %v
1137 define <vscale x 4 x half> @vpmerge_vf_nxv4f16(half %a, <vscale x 4 x half> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1138 ; RV32ZVFH-LABEL: vpmerge_vf_nxv4f16:
1139 ; RV32ZVFH: # %bb.0:
1140 ; RV32ZVFH-NEXT: vsetvli zero, a0, e16, m1, tu, ma
1141 ; RV32ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
1142 ; RV32ZVFH-NEXT: ret
1144 ; RV64ZVFH-LABEL: vpmerge_vf_nxv4f16:
1145 ; RV64ZVFH: # %bb.0:
1146 ; RV64ZVFH-NEXT: vsetvli zero, a0, e16, m1, tu, ma
1147 ; RV64ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
1148 ; RV64ZVFH-NEXT: ret
1150 ; RV32ZVFHMIN-LABEL: vpmerge_vf_nxv4f16:
1151 ; RV32ZVFHMIN: # %bb.0:
1152 ; RV32ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
1153 ; RV32ZVFHMIN-NEXT: vsetvli a1, zero, e32, m2, ta, ma
1154 ; RV32ZVFHMIN-NEXT: vfmv.v.f v10, fa5
1155 ; RV32ZVFHMIN-NEXT: vsetvli zero, a0, e16, m1, tu, mu
1156 ; RV32ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10, v0.t
1157 ; RV32ZVFHMIN-NEXT: ret
1159 ; RV64ZVFHMIN-LABEL: vpmerge_vf_nxv4f16:
1160 ; RV64ZVFHMIN: # %bb.0:
1161 ; RV64ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
1162 ; RV64ZVFHMIN-NEXT: vsetvli a1, zero, e32, m2, ta, ma
1163 ; RV64ZVFHMIN-NEXT: vfmv.v.f v10, fa5
1164 ; RV64ZVFHMIN-NEXT: vsetvli zero, a0, e16, m1, tu, mu
1165 ; RV64ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10, v0.t
1166 ; RV64ZVFHMIN-NEXT: ret
1167 %elt.head = insertelement <vscale x 4 x half> poison, half %a, i32 0
1168 %va = shufflevector <vscale x 4 x half> %elt.head, <vscale x 4 x half> poison, <vscale x 4 x i32> zeroinitializer
1169 %v = call <vscale x 4 x half> @llvm.vp.merge.nxv4f16(<vscale x 4 x i1> %m, <vscale x 4 x half> %va, <vscale x 4 x half> %vb, i32 %evl)
1170 ret <vscale x 4 x half> %v
1173 declare <vscale x 8 x half> @llvm.vp.merge.nxv8f16(<vscale x 8 x i1>, <vscale x 8 x half>, <vscale x 8 x half>, i32)
1175 define <vscale x 8 x half> @vpmerge_vv_nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1176 ; CHECK-LABEL: vpmerge_vv_nxv8f16:
1178 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, tu, ma
1179 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
1180 ; CHECK-NEXT: vmv2r.v v8, v10
1182 %v = call <vscale x 8 x half> @llvm.vp.merge.nxv8f16(<vscale x 8 x i1> %m, <vscale x 8 x half> %va, <vscale x 8 x half> %vb, i32 %evl)
1183 ret <vscale x 8 x half> %v
1186 define <vscale x 8 x half> @vpmerge_vf_nxv8f16(half %a, <vscale x 8 x half> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1187 ; RV32ZVFH-LABEL: vpmerge_vf_nxv8f16:
1188 ; RV32ZVFH: # %bb.0:
1189 ; RV32ZVFH-NEXT: vsetvli zero, a0, e16, m2, tu, ma
1190 ; RV32ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
1191 ; RV32ZVFH-NEXT: ret
1193 ; RV64ZVFH-LABEL: vpmerge_vf_nxv8f16:
1194 ; RV64ZVFH: # %bb.0:
1195 ; RV64ZVFH-NEXT: vsetvli zero, a0, e16, m2, tu, ma
1196 ; RV64ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
1197 ; RV64ZVFH-NEXT: ret
1199 ; RV32ZVFHMIN-LABEL: vpmerge_vf_nxv8f16:
1200 ; RV32ZVFHMIN: # %bb.0:
1201 ; RV32ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
1202 ; RV32ZVFHMIN-NEXT: vsetvli a1, zero, e32, m4, ta, ma
1203 ; RV32ZVFHMIN-NEXT: vfmv.v.f v12, fa5
1204 ; RV32ZVFHMIN-NEXT: vsetvli zero, a0, e16, m2, tu, mu
1205 ; RV32ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12, v0.t
1206 ; RV32ZVFHMIN-NEXT: ret
1208 ; RV64ZVFHMIN-LABEL: vpmerge_vf_nxv8f16:
1209 ; RV64ZVFHMIN: # %bb.0:
1210 ; RV64ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
1211 ; RV64ZVFHMIN-NEXT: vsetvli a1, zero, e32, m4, ta, ma
1212 ; RV64ZVFHMIN-NEXT: vfmv.v.f v12, fa5
1213 ; RV64ZVFHMIN-NEXT: vsetvli zero, a0, e16, m2, tu, mu
1214 ; RV64ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12, v0.t
1215 ; RV64ZVFHMIN-NEXT: ret
1216 %elt.head = insertelement <vscale x 8 x half> poison, half %a, i32 0
1217 %va = shufflevector <vscale x 8 x half> %elt.head, <vscale x 8 x half> poison, <vscale x 8 x i32> zeroinitializer
1218 %v = call <vscale x 8 x half> @llvm.vp.merge.nxv8f16(<vscale x 8 x i1> %m, <vscale x 8 x half> %va, <vscale x 8 x half> %vb, i32 %evl)
1219 ret <vscale x 8 x half> %v
1222 declare <vscale x 16 x half> @llvm.vp.merge.nxv16f16(<vscale x 16 x i1>, <vscale x 16 x half>, <vscale x 16 x half>, i32)
1224 define <vscale x 16 x half> @vpmerge_vv_nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %vb, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1225 ; CHECK-LABEL: vpmerge_vv_nxv16f16:
1227 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, tu, ma
1228 ; CHECK-NEXT: vmerge.vvm v12, v12, v8, v0
1229 ; CHECK-NEXT: vmv4r.v v8, v12
1231 %v = call <vscale x 16 x half> @llvm.vp.merge.nxv16f16(<vscale x 16 x i1> %m, <vscale x 16 x half> %va, <vscale x 16 x half> %vb, i32 %evl)
1232 ret <vscale x 16 x half> %v
1235 define <vscale x 16 x half> @vpmerge_vf_nxv16f16(half %a, <vscale x 16 x half> %vb, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1236 ; RV32ZVFH-LABEL: vpmerge_vf_nxv16f16:
1237 ; RV32ZVFH: # %bb.0:
1238 ; RV32ZVFH-NEXT: vsetvli zero, a0, e16, m4, tu, ma
1239 ; RV32ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
1240 ; RV32ZVFH-NEXT: ret
1242 ; RV64ZVFH-LABEL: vpmerge_vf_nxv16f16:
1243 ; RV64ZVFH: # %bb.0:
1244 ; RV64ZVFH-NEXT: vsetvli zero, a0, e16, m4, tu, ma
1245 ; RV64ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
1246 ; RV64ZVFH-NEXT: ret
1248 ; RV32ZVFHMIN-LABEL: vpmerge_vf_nxv16f16:
1249 ; RV32ZVFHMIN: # %bb.0:
1250 ; RV32ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
1251 ; RV32ZVFHMIN-NEXT: vsetvli a1, zero, e32, m8, ta, ma
1252 ; RV32ZVFHMIN-NEXT: vfmv.v.f v16, fa5
1253 ; RV32ZVFHMIN-NEXT: vsetvli zero, a0, e16, m4, tu, mu
1254 ; RV32ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16, v0.t
1255 ; RV32ZVFHMIN-NEXT: ret
1257 ; RV64ZVFHMIN-LABEL: vpmerge_vf_nxv16f16:
1258 ; RV64ZVFHMIN: # %bb.0:
1259 ; RV64ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
1260 ; RV64ZVFHMIN-NEXT: vsetvli a1, zero, e32, m8, ta, ma
1261 ; RV64ZVFHMIN-NEXT: vfmv.v.f v16, fa5
1262 ; RV64ZVFHMIN-NEXT: vsetvli zero, a0, e16, m4, tu, mu
1263 ; RV64ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16, v0.t
1264 ; RV64ZVFHMIN-NEXT: ret
1265 %elt.head = insertelement <vscale x 16 x half> poison, half %a, i32 0
1266 %va = shufflevector <vscale x 16 x half> %elt.head, <vscale x 16 x half> poison, <vscale x 16 x i32> zeroinitializer
1267 %v = call <vscale x 16 x half> @llvm.vp.merge.nxv16f16(<vscale x 16 x i1> %m, <vscale x 16 x half> %va, <vscale x 16 x half> %vb, i32 %evl)
1268 ret <vscale x 16 x half> %v
1271 declare <vscale x 32 x half> @llvm.vp.merge.nxv32f16(<vscale x 32 x i1>, <vscale x 32 x half>, <vscale x 32 x half>, i32)
1273 define <vscale x 32 x half> @vpmerge_vv_nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %vb, <vscale x 32 x i1> %m, i32 zeroext %evl) {
1274 ; CHECK-LABEL: vpmerge_vv_nxv32f16:
1276 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, tu, ma
1277 ; CHECK-NEXT: vmerge.vvm v16, v16, v8, v0
1278 ; CHECK-NEXT: vmv8r.v v8, v16
1280 %v = call <vscale x 32 x half> @llvm.vp.merge.nxv32f16(<vscale x 32 x i1> %m, <vscale x 32 x half> %va, <vscale x 32 x half> %vb, i32 %evl)
1281 ret <vscale x 32 x half> %v
1284 define <vscale x 32 x half> @vpmerge_vf_nxv32f16(half %a, <vscale x 32 x half> %vb, <vscale x 32 x i1> %m, i32 zeroext %evl) {
1285 ; RV32ZVFH-LABEL: vpmerge_vf_nxv32f16:
1286 ; RV32ZVFH: # %bb.0:
1287 ; RV32ZVFH-NEXT: vsetvli zero, a0, e16, m8, tu, ma
1288 ; RV32ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
1289 ; RV32ZVFH-NEXT: ret
1291 ; RV64ZVFH-LABEL: vpmerge_vf_nxv32f16:
1292 ; RV64ZVFH: # %bb.0:
1293 ; RV64ZVFH-NEXT: vsetvli zero, a0, e16, m8, tu, ma
1294 ; RV64ZVFH-NEXT: vfmerge.vfm v8, v8, fa0, v0
1295 ; RV64ZVFH-NEXT: ret
1297 ; RV32ZVFHMIN-LABEL: vpmerge_vf_nxv32f16:
1298 ; RV32ZVFHMIN: # %bb.0:
1299 ; RV32ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
1300 ; RV32ZVFHMIN-NEXT: vsetvli a1, zero, e32, m8, ta, ma
1301 ; RV32ZVFHMIN-NEXT: vfmv.v.f v24, fa5
1302 ; RV32ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
1303 ; RV32ZVFHMIN-NEXT: vfncvt.f.f.w v16, v24
1304 ; RV32ZVFHMIN-NEXT: vmv.v.v v20, v16
1305 ; RV32ZVFHMIN-NEXT: vsetvli zero, a0, e16, m8, tu, ma
1306 ; RV32ZVFHMIN-NEXT: vmerge.vvm v8, v8, v16, v0
1307 ; RV32ZVFHMIN-NEXT: ret
1309 ; RV64ZVFHMIN-LABEL: vpmerge_vf_nxv32f16:
1310 ; RV64ZVFHMIN: # %bb.0:
1311 ; RV64ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
1312 ; RV64ZVFHMIN-NEXT: vsetvli a1, zero, e32, m8, ta, ma
1313 ; RV64ZVFHMIN-NEXT: vfmv.v.f v24, fa5
1314 ; RV64ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
1315 ; RV64ZVFHMIN-NEXT: vfncvt.f.f.w v16, v24
1316 ; RV64ZVFHMIN-NEXT: vmv.v.v v20, v16
1317 ; RV64ZVFHMIN-NEXT: vsetvli zero, a0, e16, m8, tu, ma
1318 ; RV64ZVFHMIN-NEXT: vmerge.vvm v8, v8, v16, v0
1319 ; RV64ZVFHMIN-NEXT: ret
1320 %elt.head = insertelement <vscale x 32 x half> poison, half %a, i32 0
1321 %va = shufflevector <vscale x 32 x half> %elt.head, <vscale x 32 x half> poison, <vscale x 32 x i32> zeroinitializer
1322 %v = call <vscale x 32 x half> @llvm.vp.merge.nxv32f16(<vscale x 32 x i1> %m, <vscale x 32 x half> %va, <vscale x 32 x half> %vb, i32 %evl)
1323 ret <vscale x 32 x half> %v
1326 declare <vscale x 1 x float> @llvm.vp.merge.nxv1f32(<vscale x 1 x i1>, <vscale x 1 x float>, <vscale x 1 x float>, i32)
1328 define <vscale x 1 x float> @vpmerge_vv_nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1329 ; CHECK-LABEL: vpmerge_vv_nxv1f32:
1331 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, tu, ma
1332 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
1333 ; CHECK-NEXT: vmv1r.v v8, v9
1335 %v = call <vscale x 1 x float> @llvm.vp.merge.nxv1f32(<vscale x 1 x i1> %m, <vscale x 1 x float> %va, <vscale x 1 x float> %vb, i32 %evl)
1336 ret <vscale x 1 x float> %v
1339 define <vscale x 1 x float> @vpmerge_vf_nxv1f32(float %a, <vscale x 1 x float> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1340 ; CHECK-LABEL: vpmerge_vf_nxv1f32:
1342 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, tu, ma
1343 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1345 %elt.head = insertelement <vscale x 1 x float> poison, float %a, i32 0
1346 %va = shufflevector <vscale x 1 x float> %elt.head, <vscale x 1 x float> poison, <vscale x 1 x i32> zeroinitializer
1347 %v = call <vscale x 1 x float> @llvm.vp.merge.nxv1f32(<vscale x 1 x i1> %m, <vscale x 1 x float> %va, <vscale x 1 x float> %vb, i32 %evl)
1348 ret <vscale x 1 x float> %v
1351 declare <vscale x 2 x float> @llvm.vp.merge.nxv2f32(<vscale x 2 x i1>, <vscale x 2 x float>, <vscale x 2 x float>, i32)
1353 define <vscale x 2 x float> @vpmerge_vv_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1354 ; CHECK-LABEL: vpmerge_vv_nxv2f32:
1356 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, ma
1357 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
1358 ; CHECK-NEXT: vmv1r.v v8, v9
1360 %v = call <vscale x 2 x float> @llvm.vp.merge.nxv2f32(<vscale x 2 x i1> %m, <vscale x 2 x float> %va, <vscale x 2 x float> %vb, i32 %evl)
1361 ret <vscale x 2 x float> %v
1364 define <vscale x 2 x float> @vpmerge_vf_nxv2f32(float %a, <vscale x 2 x float> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1365 ; CHECK-LABEL: vpmerge_vf_nxv2f32:
1367 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, ma
1368 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1370 %elt.head = insertelement <vscale x 2 x float> poison, float %a, i32 0
1371 %va = shufflevector <vscale x 2 x float> %elt.head, <vscale x 2 x float> poison, <vscale x 2 x i32> zeroinitializer
1372 %v = call <vscale x 2 x float> @llvm.vp.merge.nxv2f32(<vscale x 2 x i1> %m, <vscale x 2 x float> %va, <vscale x 2 x float> %vb, i32 %evl)
1373 ret <vscale x 2 x float> %v
1376 declare <vscale x 4 x float> @llvm.vp.merge.nxv4f32(<vscale x 4 x i1>, <vscale x 4 x float>, <vscale x 4 x float>, i32)
1378 define <vscale x 4 x float> @vpmerge_vv_nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1379 ; CHECK-LABEL: vpmerge_vv_nxv4f32:
1381 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, tu, ma
1382 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
1383 ; CHECK-NEXT: vmv2r.v v8, v10
1385 %v = call <vscale x 4 x float> @llvm.vp.merge.nxv4f32(<vscale x 4 x i1> %m, <vscale x 4 x float> %va, <vscale x 4 x float> %vb, i32 %evl)
1386 ret <vscale x 4 x float> %v
1389 define <vscale x 4 x float> @vpmerge_vf_nxv4f32(float %a, <vscale x 4 x float> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1390 ; CHECK-LABEL: vpmerge_vf_nxv4f32:
1392 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, tu, ma
1393 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1395 %elt.head = insertelement <vscale x 4 x float> poison, float %a, i32 0
1396 %va = shufflevector <vscale x 4 x float> %elt.head, <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer
1397 %v = call <vscale x 4 x float> @llvm.vp.merge.nxv4f32(<vscale x 4 x i1> %m, <vscale x 4 x float> %va, <vscale x 4 x float> %vb, i32 %evl)
1398 ret <vscale x 4 x float> %v
1401 declare <vscale x 8 x float> @llvm.vp.merge.nxv8f32(<vscale x 8 x i1>, <vscale x 8 x float>, <vscale x 8 x float>, i32)
1403 define <vscale x 8 x float> @vpmerge_vv_nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1404 ; CHECK-LABEL: vpmerge_vv_nxv8f32:
1406 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, tu, ma
1407 ; CHECK-NEXT: vmerge.vvm v12, v12, v8, v0
1408 ; CHECK-NEXT: vmv4r.v v8, v12
1410 %v = call <vscale x 8 x float> @llvm.vp.merge.nxv8f32(<vscale x 8 x i1> %m, <vscale x 8 x float> %va, <vscale x 8 x float> %vb, i32 %evl)
1411 ret <vscale x 8 x float> %v
1414 define <vscale x 8 x float> @vpmerge_vf_nxv8f32(float %a, <vscale x 8 x float> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1415 ; CHECK-LABEL: vpmerge_vf_nxv8f32:
1417 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, tu, ma
1418 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1420 %elt.head = insertelement <vscale x 8 x float> poison, float %a, i32 0
1421 %va = shufflevector <vscale x 8 x float> %elt.head, <vscale x 8 x float> poison, <vscale x 8 x i32> zeroinitializer
1422 %v = call <vscale x 8 x float> @llvm.vp.merge.nxv8f32(<vscale x 8 x i1> %m, <vscale x 8 x float> %va, <vscale x 8 x float> %vb, i32 %evl)
1423 ret <vscale x 8 x float> %v
1426 declare <vscale x 16 x float> @llvm.vp.merge.nxv16f32(<vscale x 16 x i1>, <vscale x 16 x float>, <vscale x 16 x float>, i32)
1428 define <vscale x 16 x float> @vpmerge_vv_nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %vb, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1429 ; CHECK-LABEL: vpmerge_vv_nxv16f32:
1431 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, tu, ma
1432 ; CHECK-NEXT: vmerge.vvm v16, v16, v8, v0
1433 ; CHECK-NEXT: vmv8r.v v8, v16
1435 %v = call <vscale x 16 x float> @llvm.vp.merge.nxv16f32(<vscale x 16 x i1> %m, <vscale x 16 x float> %va, <vscale x 16 x float> %vb, i32 %evl)
1436 ret <vscale x 16 x float> %v
1439 define <vscale x 16 x float> @vpmerge_vf_nxv16f32(float %a, <vscale x 16 x float> %vb, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1440 ; CHECK-LABEL: vpmerge_vf_nxv16f32:
1442 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, tu, ma
1443 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1445 %elt.head = insertelement <vscale x 16 x float> poison, float %a, i32 0
1446 %va = shufflevector <vscale x 16 x float> %elt.head, <vscale x 16 x float> poison, <vscale x 16 x i32> zeroinitializer
1447 %v = call <vscale x 16 x float> @llvm.vp.merge.nxv16f32(<vscale x 16 x i1> %m, <vscale x 16 x float> %va, <vscale x 16 x float> %vb, i32 %evl)
1448 ret <vscale x 16 x float> %v
1451 declare <vscale x 1 x double> @llvm.vp.merge.nxv1f64(<vscale x 1 x i1>, <vscale x 1 x double>, <vscale x 1 x double>, i32)
1453 define <vscale x 1 x double> @vpmerge_vv_nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1454 ; CHECK-LABEL: vpmerge_vv_nxv1f64:
1456 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, tu, ma
1457 ; CHECK-NEXT: vmerge.vvm v9, v9, v8, v0
1458 ; CHECK-NEXT: vmv1r.v v8, v9
1460 %v = call <vscale x 1 x double> @llvm.vp.merge.nxv1f64(<vscale x 1 x i1> %m, <vscale x 1 x double> %va, <vscale x 1 x double> %vb, i32 %evl)
1461 ret <vscale x 1 x double> %v
1464 define <vscale x 1 x double> @vpmerge_vf_nxv1f64(double %a, <vscale x 1 x double> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1465 ; CHECK-LABEL: vpmerge_vf_nxv1f64:
1467 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, tu, ma
1468 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1470 %elt.head = insertelement <vscale x 1 x double> poison, double %a, i32 0
1471 %va = shufflevector <vscale x 1 x double> %elt.head, <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer
1472 %v = call <vscale x 1 x double> @llvm.vp.merge.nxv1f64(<vscale x 1 x i1> %m, <vscale x 1 x double> %va, <vscale x 1 x double> %vb, i32 %evl)
1473 ret <vscale x 1 x double> %v
1476 declare <vscale x 2 x double> @llvm.vp.merge.nxv2f64(<vscale x 2 x i1>, <vscale x 2 x double>, <vscale x 2 x double>, i32)
1478 define <vscale x 2 x double> @vpmerge_vv_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1479 ; CHECK-LABEL: vpmerge_vv_nxv2f64:
1481 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, tu, ma
1482 ; CHECK-NEXT: vmerge.vvm v10, v10, v8, v0
1483 ; CHECK-NEXT: vmv2r.v v8, v10
1485 %v = call <vscale x 2 x double> @llvm.vp.merge.nxv2f64(<vscale x 2 x i1> %m, <vscale x 2 x double> %va, <vscale x 2 x double> %vb, i32 %evl)
1486 ret <vscale x 2 x double> %v
1489 define <vscale x 2 x double> @vpmerge_vf_nxv2f64(double %a, <vscale x 2 x double> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1490 ; CHECK-LABEL: vpmerge_vf_nxv2f64:
1492 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, tu, ma
1493 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1495 %elt.head = insertelement <vscale x 2 x double> poison, double %a, i32 0
1496 %va = shufflevector <vscale x 2 x double> %elt.head, <vscale x 2 x double> poison, <vscale x 2 x i32> zeroinitializer
1497 %v = call <vscale x 2 x double> @llvm.vp.merge.nxv2f64(<vscale x 2 x i1> %m, <vscale x 2 x double> %va, <vscale x 2 x double> %vb, i32 %evl)
1498 ret <vscale x 2 x double> %v
1501 declare <vscale x 4 x double> @llvm.vp.merge.nxv4f64(<vscale x 4 x i1>, <vscale x 4 x double>, <vscale x 4 x double>, i32)
1503 define <vscale x 4 x double> @vpmerge_vv_nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1504 ; CHECK-LABEL: vpmerge_vv_nxv4f64:
1506 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, tu, ma
1507 ; CHECK-NEXT: vmerge.vvm v12, v12, v8, v0
1508 ; CHECK-NEXT: vmv4r.v v8, v12
1510 %v = call <vscale x 4 x double> @llvm.vp.merge.nxv4f64(<vscale x 4 x i1> %m, <vscale x 4 x double> %va, <vscale x 4 x double> %vb, i32 %evl)
1511 ret <vscale x 4 x double> %v
1514 define <vscale x 4 x double> @vpmerge_vf_nxv4f64(double %a, <vscale x 4 x double> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1515 ; CHECK-LABEL: vpmerge_vf_nxv4f64:
1517 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, tu, ma
1518 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1520 %elt.head = insertelement <vscale x 4 x double> poison, double %a, i32 0
1521 %va = shufflevector <vscale x 4 x double> %elt.head, <vscale x 4 x double> poison, <vscale x 4 x i32> zeroinitializer
1522 %v = call <vscale x 4 x double> @llvm.vp.merge.nxv4f64(<vscale x 4 x i1> %m, <vscale x 4 x double> %va, <vscale x 4 x double> %vb, i32 %evl)
1523 ret <vscale x 4 x double> %v
1526 declare <vscale x 8 x double> @llvm.vp.merge.nxv8f64(<vscale x 8 x i1>, <vscale x 8 x double>, <vscale x 8 x double>, i32)
1528 define <vscale x 8 x double> @vpmerge_vv_nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1529 ; CHECK-LABEL: vpmerge_vv_nxv8f64:
1531 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, tu, ma
1532 ; CHECK-NEXT: vmerge.vvm v16, v16, v8, v0
1533 ; CHECK-NEXT: vmv8r.v v8, v16
1535 %v = call <vscale x 8 x double> @llvm.vp.merge.nxv8f64(<vscale x 8 x i1> %m, <vscale x 8 x double> %va, <vscale x 8 x double> %vb, i32 %evl)
1536 ret <vscale x 8 x double> %v
1539 define <vscale x 8 x double> @vpmerge_vf_nxv8f64(double %a, <vscale x 8 x double> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1540 ; CHECK-LABEL: vpmerge_vf_nxv8f64:
1542 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, tu, ma
1543 ; CHECK-NEXT: vfmerge.vfm v8, v8, fa0, v0
1545 %elt.head = insertelement <vscale x 8 x double> poison, double %a, i32 0
1546 %va = shufflevector <vscale x 8 x double> %elt.head, <vscale x 8 x double> poison, <vscale x 8 x i32> zeroinitializer
1547 %v = call <vscale x 8 x double> @llvm.vp.merge.nxv8f64(<vscale x 8 x i1> %m, <vscale x 8 x double> %va, <vscale x 8 x double> %vb, i32 %evl)
1548 ret <vscale x 8 x double> %v