1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < %s \
3 ; RUN: | FileCheck %s --check-prefixes=CHECK,RV32
4 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s \
5 ; RUN: | FileCheck %s --check-prefixes=CHECK,RV64
7 define <vscale x 1 x i8> @vmerge_vv_nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb, <vscale x 1 x i1> %cond) {
8 ; CHECK-LABEL: vmerge_vv_nxv1i8:
10 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
11 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
13 %vc = select <vscale x 1 x i1> %cond, <vscale x 1 x i8> %va, <vscale x 1 x i8> %vb
14 ret <vscale x 1 x i8> %vc
17 define <vscale x 1 x i8> @vmerge_xv_nxv1i8(<vscale x 1 x i8> %va, i8 signext %b, <vscale x 1 x i1> %cond) {
18 ; CHECK-LABEL: vmerge_xv_nxv1i8:
20 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
21 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
23 %head = insertelement <vscale x 1 x i8> poison, i8 %b, i32 0
24 %splat = shufflevector <vscale x 1 x i8> %head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
25 %vc = select <vscale x 1 x i1> %cond, <vscale x 1 x i8> %splat, <vscale x 1 x i8> %va
26 ret <vscale x 1 x i8> %vc
29 define <vscale x 1 x i8> @vmerge_iv_nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i1> %cond) {
30 ; CHECK-LABEL: vmerge_iv_nxv1i8:
32 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
33 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
35 %head = insertelement <vscale x 1 x i8> poison, i8 3, i32 0
36 %splat = shufflevector <vscale x 1 x i8> %head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
37 %vc = select <vscale x 1 x i1> %cond, <vscale x 1 x i8> %splat, <vscale x 1 x i8> %va
38 ret <vscale x 1 x i8> %vc
41 define <vscale x 2 x i8> @vmerge_vv_nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb, <vscale x 2 x i1> %cond) {
42 ; CHECK-LABEL: vmerge_vv_nxv2i8:
44 ; CHECK-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
45 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
47 %vc = select <vscale x 2 x i1> %cond, <vscale x 2 x i8> %va, <vscale x 2 x i8> %vb
48 ret <vscale x 2 x i8> %vc
51 define <vscale x 2 x i8> @vmerge_xv_nxv2i8(<vscale x 2 x i8> %va, i8 signext %b, <vscale x 2 x i1> %cond) {
52 ; CHECK-LABEL: vmerge_xv_nxv2i8:
54 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
55 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
57 %head = insertelement <vscale x 2 x i8> poison, i8 %b, i32 0
58 %splat = shufflevector <vscale x 2 x i8> %head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
59 %vc = select <vscale x 2 x i1> %cond, <vscale x 2 x i8> %splat, <vscale x 2 x i8> %va
60 ret <vscale x 2 x i8> %vc
63 define <vscale x 2 x i8> @vmerge_iv_nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i1> %cond) {
64 ; CHECK-LABEL: vmerge_iv_nxv2i8:
66 ; CHECK-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
67 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
69 %head = insertelement <vscale x 2 x i8> poison, i8 3, i32 0
70 %splat = shufflevector <vscale x 2 x i8> %head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
71 %vc = select <vscale x 2 x i1> %cond, <vscale x 2 x i8> %splat, <vscale x 2 x i8> %va
72 ret <vscale x 2 x i8> %vc
75 define <vscale x 3 x i8> @vmerge_vv_nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %vb, <vscale x 3 x i1> %cond) {
76 ; CHECK-LABEL: vmerge_vv_nxv3i8:
78 ; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
79 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
81 %vc = select <vscale x 3 x i1> %cond, <vscale x 3 x i8> %va, <vscale x 3 x i8> %vb
82 ret <vscale x 3 x i8> %vc
85 define <vscale x 3 x i8> @vmerge_xv_nxv3i8(<vscale x 3 x i8> %va, i8 signext %b, <vscale x 3 x i1> %cond) {
86 ; CHECK-LABEL: vmerge_xv_nxv3i8:
88 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
89 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
91 %head = insertelement <vscale x 3 x i8> poison, i8 %b, i32 0
92 %splat = shufflevector <vscale x 3 x i8> %head, <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer
93 %vc = select <vscale x 3 x i1> %cond, <vscale x 3 x i8> %splat, <vscale x 3 x i8> %va
94 ret <vscale x 3 x i8> %vc
97 define <vscale x 3 x i8> @vmerge_iv_nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i1> %cond) {
98 ; CHECK-LABEL: vmerge_iv_nxv3i8:
100 ; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
101 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
103 %head = insertelement <vscale x 3 x i8> poison, i8 3, i32 0
104 %splat = shufflevector <vscale x 3 x i8> %head, <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer
105 %vc = select <vscale x 3 x i1> %cond, <vscale x 3 x i8> %splat, <vscale x 3 x i8> %va
106 ret <vscale x 3 x i8> %vc
109 define <vscale x 4 x i8> @vmerge_vv_nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb, <vscale x 4 x i1> %cond) {
110 ; CHECK-LABEL: vmerge_vv_nxv4i8:
112 ; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
113 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
115 %vc = select <vscale x 4 x i1> %cond, <vscale x 4 x i8> %va, <vscale x 4 x i8> %vb
116 ret <vscale x 4 x i8> %vc
119 define <vscale x 4 x i8> @vmerge_xv_nxv4i8(<vscale x 4 x i8> %va, i8 signext %b, <vscale x 4 x i1> %cond) {
120 ; CHECK-LABEL: vmerge_xv_nxv4i8:
122 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
123 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
125 %head = insertelement <vscale x 4 x i8> poison, i8 %b, i32 0
126 %splat = shufflevector <vscale x 4 x i8> %head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
127 %vc = select <vscale x 4 x i1> %cond, <vscale x 4 x i8> %splat, <vscale x 4 x i8> %va
128 ret <vscale x 4 x i8> %vc
131 define <vscale x 4 x i8> @vmerge_iv_nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i1> %cond) {
132 ; CHECK-LABEL: vmerge_iv_nxv4i8:
134 ; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
135 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
137 %head = insertelement <vscale x 4 x i8> poison, i8 3, i32 0
138 %splat = shufflevector <vscale x 4 x i8> %head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
139 %vc = select <vscale x 4 x i1> %cond, <vscale x 4 x i8> %splat, <vscale x 4 x i8> %va
140 ret <vscale x 4 x i8> %vc
143 define <vscale x 8 x i8> @vmerge_vv_nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb, <vscale x 8 x i1> %cond) {
144 ; CHECK-LABEL: vmerge_vv_nxv8i8:
146 ; CHECK-NEXT: vsetvli a0, zero, e8, m1, ta, ma
147 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
149 %vc = select <vscale x 8 x i1> %cond, <vscale x 8 x i8> %va, <vscale x 8 x i8> %vb
150 ret <vscale x 8 x i8> %vc
153 define <vscale x 8 x i8> @vmerge_xv_nxv8i8(<vscale x 8 x i8> %va, i8 signext %b, <vscale x 8 x i1> %cond) {
154 ; CHECK-LABEL: vmerge_xv_nxv8i8:
156 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
157 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
159 %head = insertelement <vscale x 8 x i8> poison, i8 %b, i32 0
160 %splat = shufflevector <vscale x 8 x i8> %head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
161 %vc = select <vscale x 8 x i1> %cond, <vscale x 8 x i8> %splat, <vscale x 8 x i8> %va
162 ret <vscale x 8 x i8> %vc
165 define <vscale x 8 x i8> @vmerge_iv_nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i1> %cond) {
166 ; CHECK-LABEL: vmerge_iv_nxv8i8:
168 ; CHECK-NEXT: vsetvli a0, zero, e8, m1, ta, ma
169 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
171 %head = insertelement <vscale x 8 x i8> poison, i8 3, i32 0
172 %splat = shufflevector <vscale x 8 x i8> %head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
173 %vc = select <vscale x 8 x i1> %cond, <vscale x 8 x i8> %splat, <vscale x 8 x i8> %va
174 ret <vscale x 8 x i8> %vc
177 define <vscale x 16 x i8> @vmerge_vv_nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb, <vscale x 16 x i1> %cond) {
178 ; CHECK-LABEL: vmerge_vv_nxv16i8:
180 ; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma
181 ; CHECK-NEXT: vmerge.vvm v8, v10, v8, v0
183 %vc = select <vscale x 16 x i1> %cond, <vscale x 16 x i8> %va, <vscale x 16 x i8> %vb
184 ret <vscale x 16 x i8> %vc
187 define <vscale x 16 x i8> @vmerge_xv_nxv16i8(<vscale x 16 x i8> %va, i8 signext %b, <vscale x 16 x i1> %cond) {
188 ; CHECK-LABEL: vmerge_xv_nxv16i8:
190 ; CHECK-NEXT: vsetvli a1, zero, e8, m2, ta, ma
191 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
193 %head = insertelement <vscale x 16 x i8> poison, i8 %b, i32 0
194 %splat = shufflevector <vscale x 16 x i8> %head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
195 %vc = select <vscale x 16 x i1> %cond, <vscale x 16 x i8> %splat, <vscale x 16 x i8> %va
196 ret <vscale x 16 x i8> %vc
199 define <vscale x 16 x i8> @vmerge_iv_nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i1> %cond) {
200 ; CHECK-LABEL: vmerge_iv_nxv16i8:
202 ; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma
203 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
205 %head = insertelement <vscale x 16 x i8> poison, i8 3, i32 0
206 %splat = shufflevector <vscale x 16 x i8> %head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
207 %vc = select <vscale x 16 x i1> %cond, <vscale x 16 x i8> %splat, <vscale x 16 x i8> %va
208 ret <vscale x 16 x i8> %vc
211 define <vscale x 32 x i8> @vmerge_vv_nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb, <vscale x 32 x i1> %cond) {
212 ; CHECK-LABEL: vmerge_vv_nxv32i8:
214 ; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma
215 ; CHECK-NEXT: vmerge.vvm v8, v12, v8, v0
217 %vc = select <vscale x 32 x i1> %cond, <vscale x 32 x i8> %va, <vscale x 32 x i8> %vb
218 ret <vscale x 32 x i8> %vc
221 define <vscale x 32 x i8> @vmerge_xv_nxv32i8(<vscale x 32 x i8> %va, i8 signext %b, <vscale x 32 x i1> %cond) {
222 ; CHECK-LABEL: vmerge_xv_nxv32i8:
224 ; CHECK-NEXT: vsetvli a1, zero, e8, m4, ta, ma
225 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
227 %head = insertelement <vscale x 32 x i8> poison, i8 %b, i32 0
228 %splat = shufflevector <vscale x 32 x i8> %head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
229 %vc = select <vscale x 32 x i1> %cond, <vscale x 32 x i8> %splat, <vscale x 32 x i8> %va
230 ret <vscale x 32 x i8> %vc
233 define <vscale x 32 x i8> @vmerge_iv_nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i1> %cond) {
234 ; CHECK-LABEL: vmerge_iv_nxv32i8:
236 ; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma
237 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
239 %head = insertelement <vscale x 32 x i8> poison, i8 3, i32 0
240 %splat = shufflevector <vscale x 32 x i8> %head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
241 %vc = select <vscale x 32 x i1> %cond, <vscale x 32 x i8> %splat, <vscale x 32 x i8> %va
242 ret <vscale x 32 x i8> %vc
245 define <vscale x 64 x i8> @vmerge_vv_nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb, <vscale x 64 x i1> %cond) {
246 ; CHECK-LABEL: vmerge_vv_nxv64i8:
248 ; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma
249 ; CHECK-NEXT: vmerge.vvm v8, v16, v8, v0
251 %vc = select <vscale x 64 x i1> %cond, <vscale x 64 x i8> %va, <vscale x 64 x i8> %vb
252 ret <vscale x 64 x i8> %vc
255 define <vscale x 64 x i8> @vmerge_xv_nxv64i8(<vscale x 64 x i8> %va, i8 signext %b, <vscale x 64 x i1> %cond) {
256 ; CHECK-LABEL: vmerge_xv_nxv64i8:
258 ; CHECK-NEXT: vsetvli a1, zero, e8, m8, ta, ma
259 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
261 %head = insertelement <vscale x 64 x i8> poison, i8 %b, i32 0
262 %splat = shufflevector <vscale x 64 x i8> %head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
263 %vc = select <vscale x 64 x i1> %cond, <vscale x 64 x i8> %splat, <vscale x 64 x i8> %va
264 ret <vscale x 64 x i8> %vc
267 define <vscale x 64 x i8> @vmerge_iv_nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i1> %cond) {
268 ; CHECK-LABEL: vmerge_iv_nxv64i8:
270 ; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma
271 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
273 %head = insertelement <vscale x 64 x i8> poison, i8 3, i32 0
274 %splat = shufflevector <vscale x 64 x i8> %head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
275 %vc = select <vscale x 64 x i1> %cond, <vscale x 64 x i8> %splat, <vscale x 64 x i8> %va
276 ret <vscale x 64 x i8> %vc
279 define <vscale x 1 x i16> @vmerge_vv_nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb, <vscale x 1 x i1> %cond) {
280 ; CHECK-LABEL: vmerge_vv_nxv1i16:
282 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
283 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
285 %vc = select <vscale x 1 x i1> %cond, <vscale x 1 x i16> %va, <vscale x 1 x i16> %vb
286 ret <vscale x 1 x i16> %vc
289 define <vscale x 1 x i16> @vmerge_xv_nxv1i16(<vscale x 1 x i16> %va, i16 signext %b, <vscale x 1 x i1> %cond) {
290 ; CHECK-LABEL: vmerge_xv_nxv1i16:
292 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
293 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
295 %head = insertelement <vscale x 1 x i16> poison, i16 %b, i32 0
296 %splat = shufflevector <vscale x 1 x i16> %head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
297 %vc = select <vscale x 1 x i1> %cond, <vscale x 1 x i16> %splat, <vscale x 1 x i16> %va
298 ret <vscale x 1 x i16> %vc
301 define <vscale x 1 x i16> @vmerge_iv_nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i1> %cond) {
302 ; CHECK-LABEL: vmerge_iv_nxv1i16:
304 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
305 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
307 %head = insertelement <vscale x 1 x i16> poison, i16 3, i32 0
308 %splat = shufflevector <vscale x 1 x i16> %head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
309 %vc = select <vscale x 1 x i1> %cond, <vscale x 1 x i16> %splat, <vscale x 1 x i16> %va
310 ret <vscale x 1 x i16> %vc
313 define <vscale x 2 x i16> @vmerge_vv_nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb, <vscale x 2 x i1> %cond) {
314 ; CHECK-LABEL: vmerge_vv_nxv2i16:
316 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
317 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
319 %vc = select <vscale x 2 x i1> %cond, <vscale x 2 x i16> %va, <vscale x 2 x i16> %vb
320 ret <vscale x 2 x i16> %vc
323 define <vscale x 2 x i16> @vmerge_xv_nxv2i16(<vscale x 2 x i16> %va, i16 signext %b, <vscale x 2 x i1> %cond) {
324 ; CHECK-LABEL: vmerge_xv_nxv2i16:
326 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
327 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
329 %head = insertelement <vscale x 2 x i16> poison, i16 %b, i32 0
330 %splat = shufflevector <vscale x 2 x i16> %head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
331 %vc = select <vscale x 2 x i1> %cond, <vscale x 2 x i16> %splat, <vscale x 2 x i16> %va
332 ret <vscale x 2 x i16> %vc
335 define <vscale x 2 x i16> @vmerge_iv_nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i1> %cond) {
336 ; CHECK-LABEL: vmerge_iv_nxv2i16:
338 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
339 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
341 %head = insertelement <vscale x 2 x i16> poison, i16 3, i32 0
342 %splat = shufflevector <vscale x 2 x i16> %head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
343 %vc = select <vscale x 2 x i1> %cond, <vscale x 2 x i16> %splat, <vscale x 2 x i16> %va
344 ret <vscale x 2 x i16> %vc
347 define <vscale x 4 x i16> @vmerge_vv_nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb, <vscale x 4 x i1> %cond) {
348 ; CHECK-LABEL: vmerge_vv_nxv4i16:
350 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
351 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
353 %vc = select <vscale x 4 x i1> %cond, <vscale x 4 x i16> %va, <vscale x 4 x i16> %vb
354 ret <vscale x 4 x i16> %vc
357 define <vscale x 4 x i16> @vmerge_xv_nxv4i16(<vscale x 4 x i16> %va, i16 signext %b, <vscale x 4 x i1> %cond) {
358 ; CHECK-LABEL: vmerge_xv_nxv4i16:
360 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
361 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
363 %head = insertelement <vscale x 4 x i16> poison, i16 %b, i32 0
364 %splat = shufflevector <vscale x 4 x i16> %head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
365 %vc = select <vscale x 4 x i1> %cond, <vscale x 4 x i16> %splat, <vscale x 4 x i16> %va
366 ret <vscale x 4 x i16> %vc
369 define <vscale x 4 x i16> @vmerge_iv_nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i1> %cond) {
370 ; CHECK-LABEL: vmerge_iv_nxv4i16:
372 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
373 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
375 %head = insertelement <vscale x 4 x i16> poison, i16 3, i32 0
376 %splat = shufflevector <vscale x 4 x i16> %head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
377 %vc = select <vscale x 4 x i1> %cond, <vscale x 4 x i16> %splat, <vscale x 4 x i16> %va
378 ret <vscale x 4 x i16> %vc
381 define <vscale x 8 x i16> @vmerge_vv_nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb, <vscale x 8 x i1> %cond) {
382 ; CHECK-LABEL: vmerge_vv_nxv8i16:
384 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
385 ; CHECK-NEXT: vmerge.vvm v8, v10, v8, v0
387 %vc = select <vscale x 8 x i1> %cond, <vscale x 8 x i16> %va, <vscale x 8 x i16> %vb
388 ret <vscale x 8 x i16> %vc
391 define <vscale x 8 x i16> @vmerge_xv_nxv8i16(<vscale x 8 x i16> %va, i16 signext %b, <vscale x 8 x i1> %cond) {
392 ; CHECK-LABEL: vmerge_xv_nxv8i16:
394 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
395 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
397 %head = insertelement <vscale x 8 x i16> poison, i16 %b, i32 0
398 %splat = shufflevector <vscale x 8 x i16> %head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
399 %vc = select <vscale x 8 x i1> %cond, <vscale x 8 x i16> %splat, <vscale x 8 x i16> %va
400 ret <vscale x 8 x i16> %vc
403 define <vscale x 8 x i16> @vmerge_iv_nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i1> %cond) {
404 ; CHECK-LABEL: vmerge_iv_nxv8i16:
406 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
407 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
409 %head = insertelement <vscale x 8 x i16> poison, i16 3, i32 0
410 %splat = shufflevector <vscale x 8 x i16> %head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
411 %vc = select <vscale x 8 x i1> %cond, <vscale x 8 x i16> %splat, <vscale x 8 x i16> %va
412 ret <vscale x 8 x i16> %vc
415 define <vscale x 16 x i16> @vmerge_vv_nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb, <vscale x 16 x i1> %cond) {
416 ; CHECK-LABEL: vmerge_vv_nxv16i16:
418 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
419 ; CHECK-NEXT: vmerge.vvm v8, v12, v8, v0
421 %vc = select <vscale x 16 x i1> %cond, <vscale x 16 x i16> %va, <vscale x 16 x i16> %vb
422 ret <vscale x 16 x i16> %vc
425 define <vscale x 16 x i16> @vmerge_xv_nxv16i16(<vscale x 16 x i16> %va, i16 signext %b, <vscale x 16 x i1> %cond) {
426 ; CHECK-LABEL: vmerge_xv_nxv16i16:
428 ; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, ma
429 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
431 %head = insertelement <vscale x 16 x i16> poison, i16 %b, i32 0
432 %splat = shufflevector <vscale x 16 x i16> %head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
433 %vc = select <vscale x 16 x i1> %cond, <vscale x 16 x i16> %splat, <vscale x 16 x i16> %va
434 ret <vscale x 16 x i16> %vc
437 define <vscale x 16 x i16> @vmerge_iv_nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i1> %cond) {
438 ; CHECK-LABEL: vmerge_iv_nxv16i16:
440 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
441 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
443 %head = insertelement <vscale x 16 x i16> poison, i16 3, i32 0
444 %splat = shufflevector <vscale x 16 x i16> %head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
445 %vc = select <vscale x 16 x i1> %cond, <vscale x 16 x i16> %splat, <vscale x 16 x i16> %va
446 ret <vscale x 16 x i16> %vc
449 define <vscale x 32 x i16> @vmerge_vv_nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb, <vscale x 32 x i1> %cond) {
450 ; CHECK-LABEL: vmerge_vv_nxv32i16:
452 ; CHECK-NEXT: vsetvli a0, zero, e16, m8, ta, ma
453 ; CHECK-NEXT: vmerge.vvm v8, v16, v8, v0
455 %vc = select <vscale x 32 x i1> %cond, <vscale x 32 x i16> %va, <vscale x 32 x i16> %vb
456 ret <vscale x 32 x i16> %vc
459 define <vscale x 32 x i16> @vmerge_xv_nxv32i16(<vscale x 32 x i16> %va, i16 signext %b, <vscale x 32 x i1> %cond) {
460 ; CHECK-LABEL: vmerge_xv_nxv32i16:
462 ; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, ma
463 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
465 %head = insertelement <vscale x 32 x i16> poison, i16 %b, i32 0
466 %splat = shufflevector <vscale x 32 x i16> %head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
467 %vc = select <vscale x 32 x i1> %cond, <vscale x 32 x i16> %splat, <vscale x 32 x i16> %va
468 ret <vscale x 32 x i16> %vc
471 define <vscale x 32 x i16> @vmerge_iv_nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i1> %cond) {
472 ; CHECK-LABEL: vmerge_iv_nxv32i16:
474 ; CHECK-NEXT: vsetvli a0, zero, e16, m8, ta, ma
475 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
477 %head = insertelement <vscale x 32 x i16> poison, i16 3, i32 0
478 %splat = shufflevector <vscale x 32 x i16> %head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
479 %vc = select <vscale x 32 x i1> %cond, <vscale x 32 x i16> %splat, <vscale x 32 x i16> %va
480 ret <vscale x 32 x i16> %vc
483 define <vscale x 1 x i32> @vmerge_vv_nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb, <vscale x 1 x i1> %cond) {
484 ; CHECK-LABEL: vmerge_vv_nxv1i32:
486 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
487 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
489 %vc = select <vscale x 1 x i1> %cond, <vscale x 1 x i32> %va, <vscale x 1 x i32> %vb
490 ret <vscale x 1 x i32> %vc
493 define <vscale x 1 x i32> @vmerge_xv_nxv1i32(<vscale x 1 x i32> %va, i32 signext %b, <vscale x 1 x i1> %cond) {
494 ; CHECK-LABEL: vmerge_xv_nxv1i32:
496 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
497 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
499 %head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
500 %splat = shufflevector <vscale x 1 x i32> %head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
501 %vc = select <vscale x 1 x i1> %cond, <vscale x 1 x i32> %splat, <vscale x 1 x i32> %va
502 ret <vscale x 1 x i32> %vc
505 define <vscale x 1 x i32> @vmerge_iv_nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i1> %cond) {
506 ; CHECK-LABEL: vmerge_iv_nxv1i32:
508 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
509 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
511 %head = insertelement <vscale x 1 x i32> poison, i32 3, i32 0
512 %splat = shufflevector <vscale x 1 x i32> %head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
513 %vc = select <vscale x 1 x i1> %cond, <vscale x 1 x i32> %splat, <vscale x 1 x i32> %va
514 ret <vscale x 1 x i32> %vc
517 define <vscale x 2 x i32> @vmerge_vv_nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb, <vscale x 2 x i1> %cond) {
518 ; CHECK-LABEL: vmerge_vv_nxv2i32:
520 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
521 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
523 %vc = select <vscale x 2 x i1> %cond, <vscale x 2 x i32> %va, <vscale x 2 x i32> %vb
524 ret <vscale x 2 x i32> %vc
527 define <vscale x 2 x i32> @vmerge_xv_nxv2i32(<vscale x 2 x i32> %va, i32 signext %b, <vscale x 2 x i1> %cond) {
528 ; CHECK-LABEL: vmerge_xv_nxv2i32:
530 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
531 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
533 %head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
534 %splat = shufflevector <vscale x 2 x i32> %head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
535 %vc = select <vscale x 2 x i1> %cond, <vscale x 2 x i32> %splat, <vscale x 2 x i32> %va
536 ret <vscale x 2 x i32> %vc
539 define <vscale x 2 x i32> @vmerge_iv_nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i1> %cond) {
540 ; CHECK-LABEL: vmerge_iv_nxv2i32:
542 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
543 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
545 %head = insertelement <vscale x 2 x i32> poison, i32 3, i32 0
546 %splat = shufflevector <vscale x 2 x i32> %head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
547 %vc = select <vscale x 2 x i1> %cond, <vscale x 2 x i32> %splat, <vscale x 2 x i32> %va
548 ret <vscale x 2 x i32> %vc
551 define <vscale x 4 x i32> @vmerge_vv_nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb, <vscale x 4 x i1> %cond) {
552 ; CHECK-LABEL: vmerge_vv_nxv4i32:
554 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
555 ; CHECK-NEXT: vmerge.vvm v8, v10, v8, v0
557 %vc = select <vscale x 4 x i1> %cond, <vscale x 4 x i32> %va, <vscale x 4 x i32> %vb
558 ret <vscale x 4 x i32> %vc
561 define <vscale x 4 x i32> @vmerge_xv_nxv4i32(<vscale x 4 x i32> %va, i32 signext %b, <vscale x 4 x i1> %cond) {
562 ; CHECK-LABEL: vmerge_xv_nxv4i32:
564 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
565 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
567 %head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
568 %splat = shufflevector <vscale x 4 x i32> %head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
569 %vc = select <vscale x 4 x i1> %cond, <vscale x 4 x i32> %splat, <vscale x 4 x i32> %va
570 ret <vscale x 4 x i32> %vc
573 define <vscale x 4 x i32> @vmerge_iv_nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i1> %cond) {
574 ; CHECK-LABEL: vmerge_iv_nxv4i32:
576 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
577 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
579 %head = insertelement <vscale x 4 x i32> poison, i32 3, i32 0
580 %splat = shufflevector <vscale x 4 x i32> %head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
581 %vc = select <vscale x 4 x i1> %cond, <vscale x 4 x i32> %splat, <vscale x 4 x i32> %va
582 ret <vscale x 4 x i32> %vc
585 define <vscale x 8 x i32> @vmerge_vv_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, <vscale x 8 x i1> %cond) {
586 ; CHECK-LABEL: vmerge_vv_nxv8i32:
588 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
589 ; CHECK-NEXT: vmerge.vvm v8, v12, v8, v0
591 %vc = select <vscale x 8 x i1> %cond, <vscale x 8 x i32> %va, <vscale x 8 x i32> %vb
592 ret <vscale x 8 x i32> %vc
595 define <vscale x 8 x i32> @vmerge_xv_nxv8i32(<vscale x 8 x i32> %va, i32 signext %b, <vscale x 8 x i1> %cond) {
596 ; CHECK-LABEL: vmerge_xv_nxv8i32:
598 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
599 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
601 %head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
602 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
603 %vc = select <vscale x 8 x i1> %cond, <vscale x 8 x i32> %splat, <vscale x 8 x i32> %va
604 ret <vscale x 8 x i32> %vc
607 define <vscale x 8 x i32> @vmerge_iv_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i1> %cond) {
608 ; CHECK-LABEL: vmerge_iv_nxv8i32:
610 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
611 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
613 %head = insertelement <vscale x 8 x i32> poison, i32 3, i32 0
614 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
615 %vc = select <vscale x 8 x i1> %cond, <vscale x 8 x i32> %splat, <vscale x 8 x i32> %va
616 ret <vscale x 8 x i32> %vc
619 define <vscale x 16 x i32> @vmerge_vv_nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb, <vscale x 16 x i1> %cond) {
620 ; CHECK-LABEL: vmerge_vv_nxv16i32:
622 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
623 ; CHECK-NEXT: vmerge.vvm v8, v16, v8, v0
625 %vc = select <vscale x 16 x i1> %cond, <vscale x 16 x i32> %va, <vscale x 16 x i32> %vb
626 ret <vscale x 16 x i32> %vc
629 define <vscale x 16 x i32> @vmerge_xv_nxv16i32(<vscale x 16 x i32> %va, i32 signext %b, <vscale x 16 x i1> %cond) {
630 ; CHECK-LABEL: vmerge_xv_nxv16i32:
632 ; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, ma
633 ; CHECK-NEXT: vmerge.vxm v8, v8, a0, v0
635 %head = insertelement <vscale x 16 x i32> poison, i32 %b, i32 0
636 %splat = shufflevector <vscale x 16 x i32> %head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
637 %vc = select <vscale x 16 x i1> %cond, <vscale x 16 x i32> %splat, <vscale x 16 x i32> %va
638 ret <vscale x 16 x i32> %vc
641 define <vscale x 16 x i32> @vmerge_iv_nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i1> %cond) {
642 ; CHECK-LABEL: vmerge_iv_nxv16i32:
644 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
645 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
647 %head = insertelement <vscale x 16 x i32> poison, i32 3, i32 0
648 %splat = shufflevector <vscale x 16 x i32> %head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
649 %vc = select <vscale x 16 x i1> %cond, <vscale x 16 x i32> %splat, <vscale x 16 x i32> %va
650 ret <vscale x 16 x i32> %vc
653 define <vscale x 1 x i64> @vmerge_vv_nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb, <vscale x 1 x i1> %cond) {
654 ; CHECK-LABEL: vmerge_vv_nxv1i64:
656 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
657 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
659 %vc = select <vscale x 1 x i1> %cond, <vscale x 1 x i64> %va, <vscale x 1 x i64> %vb
660 ret <vscale x 1 x i64> %vc
663 define <vscale x 1 x i64> @vmerge_xv_nxv1i64(<vscale x 1 x i64> %va, i64 %b, <vscale x 1 x i1> %cond) {
664 ; RV32-LABEL: vmerge_xv_nxv1i64:
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: vsetvli a1, zero, e64, m1, ta, mu
672 ; RV32-NEXT: vlse64.v v8, (a0), zero, v0.t
673 ; RV32-NEXT: addi sp, sp, 16
676 ; RV64-LABEL: vmerge_xv_nxv1i64:
678 ; RV64-NEXT: vsetvli a1, zero, e64, m1, ta, ma
679 ; RV64-NEXT: vmerge.vxm v8, v8, a0, v0
681 %head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
682 %splat = shufflevector <vscale x 1 x i64> %head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
683 %vc = select <vscale x 1 x i1> %cond, <vscale x 1 x i64> %splat, <vscale x 1 x i64> %va
684 ret <vscale x 1 x i64> %vc
687 define <vscale x 1 x i64> @vmerge_iv_nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i1> %cond) {
688 ; CHECK-LABEL: vmerge_iv_nxv1i64:
690 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
691 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
693 %head = insertelement <vscale x 1 x i64> poison, i64 3, i32 0
694 %splat = shufflevector <vscale x 1 x i64> %head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
695 %vc = select <vscale x 1 x i1> %cond, <vscale x 1 x i64> %splat, <vscale x 1 x i64> %va
696 ret <vscale x 1 x i64> %vc
699 define <vscale x 2 x i64> @vmerge_vv_nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb, <vscale x 2 x i1> %cond) {
700 ; CHECK-LABEL: vmerge_vv_nxv2i64:
702 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
703 ; CHECK-NEXT: vmerge.vvm v8, v10, v8, v0
705 %vc = select <vscale x 2 x i1> %cond, <vscale x 2 x i64> %va, <vscale x 2 x i64> %vb
706 ret <vscale x 2 x i64> %vc
709 define <vscale x 2 x i64> @vmerge_xv_nxv2i64(<vscale x 2 x i64> %va, i64 %b, <vscale x 2 x i1> %cond) {
710 ; RV32-LABEL: vmerge_xv_nxv2i64:
712 ; RV32-NEXT: addi sp, sp, -16
713 ; RV32-NEXT: .cfi_def_cfa_offset 16
714 ; RV32-NEXT: sw a1, 12(sp)
715 ; RV32-NEXT: sw a0, 8(sp)
716 ; RV32-NEXT: addi a0, sp, 8
717 ; RV32-NEXT: vsetvli a1, zero, e64, m2, ta, mu
718 ; RV32-NEXT: vlse64.v v8, (a0), zero, v0.t
719 ; RV32-NEXT: addi sp, sp, 16
722 ; RV64-LABEL: vmerge_xv_nxv2i64:
724 ; RV64-NEXT: vsetvli a1, zero, e64, m2, ta, ma
725 ; RV64-NEXT: vmerge.vxm v8, v8, a0, v0
727 %head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
728 %splat = shufflevector <vscale x 2 x i64> %head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
729 %vc = select <vscale x 2 x i1> %cond, <vscale x 2 x i64> %splat, <vscale x 2 x i64> %va
730 ret <vscale x 2 x i64> %vc
733 define <vscale x 2 x i64> @vmerge_iv_nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i1> %cond) {
734 ; CHECK-LABEL: vmerge_iv_nxv2i64:
736 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
737 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
739 %head = insertelement <vscale x 2 x i64> poison, i64 3, i32 0
740 %splat = shufflevector <vscale x 2 x i64> %head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
741 %vc = select <vscale x 2 x i1> %cond, <vscale x 2 x i64> %splat, <vscale x 2 x i64> %va
742 ret <vscale x 2 x i64> %vc
745 define <vscale x 4 x i64> @vmerge_vv_nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb, <vscale x 4 x i1> %cond) {
746 ; CHECK-LABEL: vmerge_vv_nxv4i64:
748 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
749 ; CHECK-NEXT: vmerge.vvm v8, v12, v8, v0
751 %vc = select <vscale x 4 x i1> %cond, <vscale x 4 x i64> %va, <vscale x 4 x i64> %vb
752 ret <vscale x 4 x i64> %vc
755 define <vscale x 4 x i64> @vmerge_xv_nxv4i64(<vscale x 4 x i64> %va, i64 %b, <vscale x 4 x i1> %cond) {
756 ; RV32-LABEL: vmerge_xv_nxv4i64:
758 ; RV32-NEXT: addi sp, sp, -16
759 ; RV32-NEXT: .cfi_def_cfa_offset 16
760 ; RV32-NEXT: sw a1, 12(sp)
761 ; RV32-NEXT: sw a0, 8(sp)
762 ; RV32-NEXT: addi a0, sp, 8
763 ; RV32-NEXT: vsetvli a1, zero, e64, m4, ta, mu
764 ; RV32-NEXT: vlse64.v v8, (a0), zero, v0.t
765 ; RV32-NEXT: addi sp, sp, 16
768 ; RV64-LABEL: vmerge_xv_nxv4i64:
770 ; RV64-NEXT: vsetvli a1, zero, e64, m4, ta, ma
771 ; RV64-NEXT: vmerge.vxm v8, v8, a0, v0
773 %head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
774 %splat = shufflevector <vscale x 4 x i64> %head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
775 %vc = select <vscale x 4 x i1> %cond, <vscale x 4 x i64> %splat, <vscale x 4 x i64> %va
776 ret <vscale x 4 x i64> %vc
779 define <vscale x 4 x i64> @vmerge_iv_nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i1> %cond) {
780 ; CHECK-LABEL: vmerge_iv_nxv4i64:
782 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
783 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
785 %head = insertelement <vscale x 4 x i64> poison, i64 3, i32 0
786 %splat = shufflevector <vscale x 4 x i64> %head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
787 %vc = select <vscale x 4 x i1> %cond, <vscale x 4 x i64> %splat, <vscale x 4 x i64> %va
788 ret <vscale x 4 x i64> %vc
791 define <vscale x 8 x i64> @vmerge_vv_nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb, <vscale x 8 x i1> %cond) {
792 ; CHECK-LABEL: vmerge_vv_nxv8i64:
794 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
795 ; CHECK-NEXT: vmerge.vvm v8, v16, v8, v0
797 %vc = select <vscale x 8 x i1> %cond, <vscale x 8 x i64> %va, <vscale x 8 x i64> %vb
798 ret <vscale x 8 x i64> %vc
801 define <vscale x 8 x i64> @vmerge_xv_nxv8i64(<vscale x 8 x i64> %va, i64 %b, <vscale x 8 x i1> %cond) {
802 ; RV32-LABEL: vmerge_xv_nxv8i64:
804 ; RV32-NEXT: addi sp, sp, -16
805 ; RV32-NEXT: .cfi_def_cfa_offset 16
806 ; RV32-NEXT: sw a1, 12(sp)
807 ; RV32-NEXT: sw a0, 8(sp)
808 ; RV32-NEXT: addi a0, sp, 8
809 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, mu
810 ; RV32-NEXT: vlse64.v v8, (a0), zero, v0.t
811 ; RV32-NEXT: addi sp, sp, 16
814 ; RV64-LABEL: vmerge_xv_nxv8i64:
816 ; RV64-NEXT: vsetvli a1, zero, e64, m8, ta, ma
817 ; RV64-NEXT: vmerge.vxm v8, v8, a0, v0
819 %head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
820 %splat = shufflevector <vscale x 8 x i64> %head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
821 %vc = select <vscale x 8 x i1> %cond, <vscale x 8 x i64> %splat, <vscale x 8 x i64> %va
822 ret <vscale x 8 x i64> %vc
825 define <vscale x 8 x i64> @vmerge_iv_nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i1> %cond) {
826 ; CHECK-LABEL: vmerge_iv_nxv8i64:
828 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
829 ; CHECK-NEXT: vmerge.vim v8, v8, 3, v0
831 %head = insertelement <vscale x 8 x i64> poison, i64 3, i32 0
832 %splat = shufflevector <vscale x 8 x i64> %head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
833 %vc = select <vscale x 8 x i1> %cond, <vscale x 8 x i64> %splat, <vscale x 8 x i64> %va
834 ret <vscale x 8 x i64> %vc
837 define <vscale x 8 x i64> @vmerge_truelhs_nxv8i64_0(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb) {
838 ; CHECK-LABEL: vmerge_truelhs_nxv8i64_0:
841 %mhead = insertelement <vscale x 8 x i1> poison, i1 1, i32 0
842 %mtrue = shufflevector <vscale x 8 x i1> %mhead, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
843 %vc = select <vscale x 8 x i1> %mtrue, <vscale x 8 x i64> %va, <vscale x 8 x i64> %vb
844 ret <vscale x 8 x i64> %vc
847 define <vscale x 8 x i64> @vmerge_falselhs_nxv8i64_0(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb) {
848 ; CHECK-LABEL: vmerge_falselhs_nxv8i64_0:
850 ; CHECK-NEXT: vmv8r.v v8, v16
852 %vc = select <vscale x 8 x i1> zeroinitializer, <vscale x 8 x i64> %va, <vscale x 8 x i64> %vb
853 ret <vscale x 8 x i64> %vc