1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < %s | FileCheck %s
3 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s | FileCheck %s
5 define <vscale x 1 x i8> @vshl_vx_nxv1i8(<vscale x 1 x i8> %va, i8 signext %b) {
6 ; CHECK-LABEL: vshl_vx_nxv1i8:
8 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
9 ; CHECK-NEXT: vsll.vx v8, v8, a0
11 %head = insertelement <vscale x 1 x i8> poison, i8 %b, i32 0
12 %splat = shufflevector <vscale x 1 x i8> %head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
13 %vc = shl <vscale x 1 x i8> %va, %splat
14 ret <vscale x 1 x i8> %vc
17 define <vscale x 1 x i8> @vshl_vx_nxv1i8_0(<vscale x 1 x i8> %va) {
18 ; CHECK-LABEL: vshl_vx_nxv1i8_0:
20 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
21 ; CHECK-NEXT: vsll.vi v8, v8, 6
23 %vc = shl <vscale x 1 x i8> %va, splat (i8 6)
24 ret <vscale x 1 x i8> %vc
27 define <vscale x 2 x i8> @vshl_vx_nxv2i8(<vscale x 2 x i8> %va, i8 signext %b) {
28 ; CHECK-LABEL: vshl_vx_nxv2i8:
30 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
31 ; CHECK-NEXT: vsll.vx v8, v8, a0
33 %head = insertelement <vscale x 2 x i8> poison, i8 %b, i32 0
34 %splat = shufflevector <vscale x 2 x i8> %head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
35 %vc = shl <vscale x 2 x i8> %va, %splat
36 ret <vscale x 2 x i8> %vc
39 define <vscale x 2 x i8> @vshl_vx_nxv2i8_0(<vscale x 2 x i8> %va) {
40 ; CHECK-LABEL: vshl_vx_nxv2i8_0:
42 ; CHECK-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
43 ; CHECK-NEXT: vsll.vi v8, v8, 6
45 %vc = shl <vscale x 2 x i8> %va, splat (i8 6)
46 ret <vscale x 2 x i8> %vc
49 define <vscale x 4 x i8> @vshl_vx_nxv4i8(<vscale x 4 x i8> %va, i8 signext %b) {
50 ; CHECK-LABEL: vshl_vx_nxv4i8:
52 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
53 ; CHECK-NEXT: vsll.vx v8, v8, a0
55 %head = insertelement <vscale x 4 x i8> poison, i8 %b, i32 0
56 %splat = shufflevector <vscale x 4 x i8> %head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
57 %vc = shl <vscale x 4 x i8> %va, %splat
58 ret <vscale x 4 x i8> %vc
61 define <vscale x 4 x i8> @vshl_vx_nxv4i8_0(<vscale x 4 x i8> %va) {
62 ; CHECK-LABEL: vshl_vx_nxv4i8_0:
64 ; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
65 ; CHECK-NEXT: vsll.vi v8, v8, 6
67 %vc = shl <vscale x 4 x i8> %va, splat (i8 6)
68 ret <vscale x 4 x i8> %vc
71 define <vscale x 8 x i8> @vshl_vx_nxv8i8(<vscale x 8 x i8> %va, i8 signext %b) {
72 ; CHECK-LABEL: vshl_vx_nxv8i8:
74 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
75 ; CHECK-NEXT: vsll.vx v8, v8, a0
77 %head = insertelement <vscale x 8 x i8> poison, i8 %b, i32 0
78 %splat = shufflevector <vscale x 8 x i8> %head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
79 %vc = shl <vscale x 8 x i8> %va, %splat
80 ret <vscale x 8 x i8> %vc
83 define <vscale x 8 x i8> @vshl_vx_nxv8i8_0(<vscale x 8 x i8> %va) {
84 ; CHECK-LABEL: vshl_vx_nxv8i8_0:
86 ; CHECK-NEXT: vsetvli a0, zero, e8, m1, ta, ma
87 ; CHECK-NEXT: vsll.vi v8, v8, 6
89 %vc = shl <vscale x 8 x i8> %va, splat (i8 6)
90 ret <vscale x 8 x i8> %vc
93 define <vscale x 16 x i8> @vshl_vx_nxv16i8(<vscale x 16 x i8> %va, i8 signext %b) {
94 ; CHECK-LABEL: vshl_vx_nxv16i8:
96 ; CHECK-NEXT: vsetvli a1, zero, e8, m2, ta, ma
97 ; CHECK-NEXT: vsll.vx v8, v8, a0
99 %head = insertelement <vscale x 16 x i8> poison, i8 %b, i32 0
100 %splat = shufflevector <vscale x 16 x i8> %head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
101 %vc = shl <vscale x 16 x i8> %va, %splat
102 ret <vscale x 16 x i8> %vc
105 define <vscale x 16 x i8> @vshl_vx_nxv16i8_0(<vscale x 16 x i8> %va) {
106 ; CHECK-LABEL: vshl_vx_nxv16i8_0:
108 ; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma
109 ; CHECK-NEXT: vsll.vi v8, v8, 6
111 %vc = shl <vscale x 16 x i8> %va, splat (i8 6)
112 ret <vscale x 16 x i8> %vc
115 define <vscale x 32 x i8> @vshl_vx_nxv32i8(<vscale x 32 x i8> %va, i8 signext %b) {
116 ; CHECK-LABEL: vshl_vx_nxv32i8:
118 ; CHECK-NEXT: vsetvli a1, zero, e8, m4, ta, ma
119 ; CHECK-NEXT: vsll.vx v8, v8, a0
121 %head = insertelement <vscale x 32 x i8> poison, i8 %b, i32 0
122 %splat = shufflevector <vscale x 32 x i8> %head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
123 %vc = shl <vscale x 32 x i8> %va, %splat
124 ret <vscale x 32 x i8> %vc
127 define <vscale x 32 x i8> @vshl_vx_nxv32i8_0(<vscale x 32 x i8> %va) {
128 ; CHECK-LABEL: vshl_vx_nxv32i8_0:
130 ; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma
131 ; CHECK-NEXT: vsll.vi v8, v8, 6
133 %vc = shl <vscale x 32 x i8> %va, splat (i8 6)
134 ret <vscale x 32 x i8> %vc
137 define <vscale x 64 x i8> @vshl_vx_nxv64i8(<vscale x 64 x i8> %va, i8 signext %b) {
138 ; CHECK-LABEL: vshl_vx_nxv64i8:
140 ; CHECK-NEXT: vsetvli a1, zero, e8, m8, ta, ma
141 ; CHECK-NEXT: vsll.vx v8, v8, a0
143 %head = insertelement <vscale x 64 x i8> poison, i8 %b, i32 0
144 %splat = shufflevector <vscale x 64 x i8> %head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
145 %vc = shl <vscale x 64 x i8> %va, %splat
146 ret <vscale x 64 x i8> %vc
149 define <vscale x 64 x i8> @vshl_vx_nxv64i8_0(<vscale x 64 x i8> %va) {
150 ; CHECK-LABEL: vshl_vx_nxv64i8_0:
152 ; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma
153 ; CHECK-NEXT: vsll.vi v8, v8, 6
155 %vc = shl <vscale x 64 x i8> %va, splat (i8 6)
156 ret <vscale x 64 x i8> %vc
159 define <vscale x 1 x i16> @vshl_vx_nxv1i16(<vscale x 1 x i16> %va, i16 signext %b) {
160 ; CHECK-LABEL: vshl_vx_nxv1i16:
162 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
163 ; CHECK-NEXT: vsll.vx v8, v8, a0
165 %head = insertelement <vscale x 1 x i16> poison, i16 %b, i32 0
166 %splat = shufflevector <vscale x 1 x i16> %head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
167 %vc = shl <vscale x 1 x i16> %va, %splat
168 ret <vscale x 1 x i16> %vc
171 define <vscale x 1 x i16> @vshl_vx_nxv1i16_0(<vscale x 1 x i16> %va) {
172 ; CHECK-LABEL: vshl_vx_nxv1i16_0:
174 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
175 ; CHECK-NEXT: vsll.vi v8, v8, 6
177 %vc = shl <vscale x 1 x i16> %va, splat (i16 6)
178 ret <vscale x 1 x i16> %vc
181 define <vscale x 2 x i16> @vshl_vx_nxv2i16(<vscale x 2 x i16> %va, i16 signext %b) {
182 ; CHECK-LABEL: vshl_vx_nxv2i16:
184 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
185 ; CHECK-NEXT: vsll.vx v8, v8, a0
187 %head = insertelement <vscale x 2 x i16> poison, i16 %b, i32 0
188 %splat = shufflevector <vscale x 2 x i16> %head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
189 %vc = shl <vscale x 2 x i16> %va, %splat
190 ret <vscale x 2 x i16> %vc
193 define <vscale x 2 x i16> @vshl_vx_nxv2i16_0(<vscale x 2 x i16> %va) {
194 ; CHECK-LABEL: vshl_vx_nxv2i16_0:
196 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
197 ; CHECK-NEXT: vsll.vi v8, v8, 6
199 %vc = shl <vscale x 2 x i16> %va, splat (i16 6)
200 ret <vscale x 2 x i16> %vc
203 define <vscale x 4 x i16> @vshl_vx_nxv4i16(<vscale x 4 x i16> %va, i16 signext %b) {
204 ; CHECK-LABEL: vshl_vx_nxv4i16:
206 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
207 ; CHECK-NEXT: vsll.vx v8, v8, a0
209 %head = insertelement <vscale x 4 x i16> poison, i16 %b, i32 0
210 %splat = shufflevector <vscale x 4 x i16> %head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
211 %vc = shl <vscale x 4 x i16> %va, %splat
212 ret <vscale x 4 x i16> %vc
215 define <vscale x 4 x i16> @vshl_vx_nxv4i16_0(<vscale x 4 x i16> %va) {
216 ; CHECK-LABEL: vshl_vx_nxv4i16_0:
218 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
219 ; CHECK-NEXT: vsll.vi v8, v8, 6
221 %vc = shl <vscale x 4 x i16> %va, splat (i16 6)
222 ret <vscale x 4 x i16> %vc
225 define <vscale x 8 x i16> @vshl_vx_nxv8i16(<vscale x 8 x i16> %va, i16 signext %b) {
226 ; CHECK-LABEL: vshl_vx_nxv8i16:
228 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
229 ; CHECK-NEXT: vsll.vx v8, v8, a0
231 %head = insertelement <vscale x 8 x i16> poison, i16 %b, i32 0
232 %splat = shufflevector <vscale x 8 x i16> %head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
233 %vc = shl <vscale x 8 x i16> %va, %splat
234 ret <vscale x 8 x i16> %vc
237 define <vscale x 8 x i16> @vshl_vx_nxv8i16_0(<vscale x 8 x i16> %va) {
238 ; CHECK-LABEL: vshl_vx_nxv8i16_0:
240 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
241 ; CHECK-NEXT: vsll.vi v8, v8, 6
243 %vc = shl <vscale x 8 x i16> %va, splat (i16 6)
244 ret <vscale x 8 x i16> %vc
247 define <vscale x 16 x i16> @vshl_vx_nxv16i16(<vscale x 16 x i16> %va, i16 signext %b) {
248 ; CHECK-LABEL: vshl_vx_nxv16i16:
250 ; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, ma
251 ; CHECK-NEXT: vsll.vx v8, v8, a0
253 %head = insertelement <vscale x 16 x i16> poison, i16 %b, i32 0
254 %splat = shufflevector <vscale x 16 x i16> %head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
255 %vc = shl <vscale x 16 x i16> %va, %splat
256 ret <vscale x 16 x i16> %vc
259 define <vscale x 16 x i16> @vshl_vx_nxv16i16_0(<vscale x 16 x i16> %va) {
260 ; CHECK-LABEL: vshl_vx_nxv16i16_0:
262 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
263 ; CHECK-NEXT: vsll.vi v8, v8, 6
265 %vc = shl <vscale x 16 x i16> %va, splat (i16 6)
266 ret <vscale x 16 x i16> %vc
269 define <vscale x 32 x i16> @vshl_vx_nxv32i16(<vscale x 32 x i16> %va, i16 signext %b) {
270 ; CHECK-LABEL: vshl_vx_nxv32i16:
272 ; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, ma
273 ; CHECK-NEXT: vsll.vx v8, v8, a0
275 %head = insertelement <vscale x 32 x i16> poison, i16 %b, i32 0
276 %splat = shufflevector <vscale x 32 x i16> %head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
277 %vc = shl <vscale x 32 x i16> %va, %splat
278 ret <vscale x 32 x i16> %vc
281 define <vscale x 32 x i16> @vshl_vx_nxv32i16_0(<vscale x 32 x i16> %va) {
282 ; CHECK-LABEL: vshl_vx_nxv32i16_0:
284 ; CHECK-NEXT: vsetvli a0, zero, e16, m8, ta, ma
285 ; CHECK-NEXT: vsll.vi v8, v8, 6
287 %vc = shl <vscale x 32 x i16> %va, splat (i16 6)
288 ret <vscale x 32 x i16> %vc
291 define <vscale x 1 x i32> @vshl_vx_nxv1i32(<vscale x 1 x i32> %va, i32 signext %b) {
292 ; CHECK-LABEL: vshl_vx_nxv1i32:
294 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
295 ; CHECK-NEXT: vsll.vx v8, v8, a0
297 %head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
298 %splat = shufflevector <vscale x 1 x i32> %head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
299 %vc = shl <vscale x 1 x i32> %va, %splat
300 ret <vscale x 1 x i32> %vc
303 define <vscale x 1 x i32> @vshl_vx_nxv1i32_0(<vscale x 1 x i32> %va) {
304 ; CHECK-LABEL: vshl_vx_nxv1i32_0:
306 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
307 ; CHECK-NEXT: vsll.vi v8, v8, 31
309 %vc = shl <vscale x 1 x i32> %va, splat (i32 31)
310 ret <vscale x 1 x i32> %vc
313 define <vscale x 2 x i32> @vshl_vx_nxv2i32(<vscale x 2 x i32> %va, i32 signext %b) {
314 ; CHECK-LABEL: vshl_vx_nxv2i32:
316 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
317 ; CHECK-NEXT: vsll.vx v8, v8, a0
319 %head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
320 %splat = shufflevector <vscale x 2 x i32> %head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
321 %vc = shl <vscale x 2 x i32> %va, %splat
322 ret <vscale x 2 x i32> %vc
325 define <vscale x 2 x i32> @vshl_vx_nxv2i32_0(<vscale x 2 x i32> %va) {
326 ; CHECK-LABEL: vshl_vx_nxv2i32_0:
328 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
329 ; CHECK-NEXT: vsll.vi v8, v8, 31
331 %vc = shl <vscale x 2 x i32> %va, splat (i32 31)
332 ret <vscale x 2 x i32> %vc
335 define <vscale x 4 x i32> @vshl_vx_nxv4i32(<vscale x 4 x i32> %va, i32 signext %b) {
336 ; CHECK-LABEL: vshl_vx_nxv4i32:
338 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
339 ; CHECK-NEXT: vsll.vx v8, v8, a0
341 %head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
342 %splat = shufflevector <vscale x 4 x i32> %head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
343 %vc = shl <vscale x 4 x i32> %va, %splat
344 ret <vscale x 4 x i32> %vc
347 define <vscale x 4 x i32> @vshl_vx_nxv4i32_0(<vscale x 4 x i32> %va) {
348 ; CHECK-LABEL: vshl_vx_nxv4i32_0:
350 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
351 ; CHECK-NEXT: vsll.vi v8, v8, 31
353 %vc = shl <vscale x 4 x i32> %va, splat (i32 31)
354 ret <vscale x 4 x i32> %vc
357 define <vscale x 8 x i32> @vshl_vx_nxv8i32(<vscale x 8 x i32> %va, i32 signext %b) {
358 ; CHECK-LABEL: vshl_vx_nxv8i32:
360 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
361 ; CHECK-NEXT: vsll.vx v8, v8, a0
363 %head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
364 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
365 %vc = shl <vscale x 8 x i32> %va, %splat
366 ret <vscale x 8 x i32> %vc
369 define <vscale x 8 x i32> @vshl_vx_nxv8i32_0(<vscale x 8 x i32> %va) {
370 ; CHECK-LABEL: vshl_vx_nxv8i32_0:
372 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
373 ; CHECK-NEXT: vsll.vi v8, v8, 31
375 %vc = shl <vscale x 8 x i32> %va, splat (i32 31)
376 ret <vscale x 8 x i32> %vc
379 define <vscale x 16 x i32> @vshl_vx_nxv16i32(<vscale x 16 x i32> %va, i32 signext %b) {
380 ; CHECK-LABEL: vshl_vx_nxv16i32:
382 ; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, ma
383 ; CHECK-NEXT: vsll.vx v8, v8, a0
385 %head = insertelement <vscale x 16 x i32> poison, i32 %b, i32 0
386 %splat = shufflevector <vscale x 16 x i32> %head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
387 %vc = shl <vscale x 16 x i32> %va, %splat
388 ret <vscale x 16 x i32> %vc
391 define <vscale x 16 x i32> @vshl_vx_nxv16i32_0(<vscale x 16 x i32> %va) {
392 ; CHECK-LABEL: vshl_vx_nxv16i32_0:
394 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
395 ; CHECK-NEXT: vsll.vi v8, v8, 31
397 %vc = shl <vscale x 16 x i32> %va, splat (i32 31)
398 ret <vscale x 16 x i32> %vc
401 define <vscale x 1 x i64> @vshl_vx_nxv1i64(<vscale x 1 x i64> %va, i64 %b) {
402 ; CHECK-LABEL: vshl_vx_nxv1i64:
404 ; CHECK-NEXT: vsetvli a1, zero, e64, m1, ta, ma
405 ; CHECK-NEXT: vsll.vx v8, v8, a0
407 %head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
408 %splat = shufflevector <vscale x 1 x i64> %head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
409 %vc = shl <vscale x 1 x i64> %va, %splat
410 ret <vscale x 1 x i64> %vc
413 define <vscale x 1 x i64> @vshl_vx_nxv1i64_0(<vscale x 1 x i64> %va) {
414 ; CHECK-LABEL: vshl_vx_nxv1i64_0:
416 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
417 ; CHECK-NEXT: vsll.vi v8, v8, 31
419 %vc = shl <vscale x 1 x i64> %va, splat (i64 31)
420 ret <vscale x 1 x i64> %vc
423 define <vscale x 1 x i64> @vshl_vx_nxv1i64_1(<vscale x 1 x i64> %va) {
424 ; CHECK-LABEL: vshl_vx_nxv1i64_1:
426 ; CHECK-NEXT: li a0, 32
427 ; CHECK-NEXT: vsetvli a1, zero, e64, m1, ta, ma
428 ; CHECK-NEXT: vsll.vx v8, v8, a0
430 %vc = shl <vscale x 1 x i64> %va, splat (i64 32)
431 ret <vscale x 1 x i64> %vc
434 define <vscale x 1 x i64> @vshl_vx_nxv1i64_2(<vscale x 1 x i64> %va) {
435 ; CHECK-LABEL: vshl_vx_nxv1i64_2:
437 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
438 ; CHECK-NEXT: vadd.vv v8, v8, v8
440 %vc = shl <vscale x 1 x i64> %va, splat (i64 1)
441 ret <vscale x 1 x i64> %vc
444 define <vscale x 2 x i64> @vshl_vx_nxv2i64(<vscale x 2 x i64> %va, i64 %b) {
445 ; CHECK-LABEL: vshl_vx_nxv2i64:
447 ; CHECK-NEXT: vsetvli a1, zero, e64, m2, ta, ma
448 ; CHECK-NEXT: vsll.vx v8, v8, a0
450 %head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
451 %splat = shufflevector <vscale x 2 x i64> %head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
452 %vc = shl <vscale x 2 x i64> %va, %splat
453 ret <vscale x 2 x i64> %vc
456 define <vscale x 2 x i64> @vshl_vx_nxv2i64_0(<vscale x 2 x i64> %va) {
457 ; CHECK-LABEL: vshl_vx_nxv2i64_0:
459 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
460 ; CHECK-NEXT: vsll.vi v8, v8, 31
462 %vc = shl <vscale x 2 x i64> %va, splat (i64 31)
463 ret <vscale x 2 x i64> %vc
466 define <vscale x 2 x i64> @vshl_vx_nxv2i64_1(<vscale x 2 x i64> %va) {
467 ; CHECK-LABEL: vshl_vx_nxv2i64_1:
469 ; CHECK-NEXT: li a0, 32
470 ; CHECK-NEXT: vsetvli a1, zero, e64, m2, ta, ma
471 ; CHECK-NEXT: vsll.vx v8, v8, a0
473 %vc = shl <vscale x 2 x i64> %va, splat (i64 32)
474 ret <vscale x 2 x i64> %vc
477 define <vscale x 2 x i64> @vshl_vx_nxv2i64_2(<vscale x 2 x i64> %va) {
478 ; CHECK-LABEL: vshl_vx_nxv2i64_2:
480 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
481 ; CHECK-NEXT: vadd.vv v8, v8, v8
483 %vc = shl <vscale x 2 x i64> %va, splat (i64 1)
484 ret <vscale x 2 x i64> %vc
487 define <vscale x 4 x i64> @vshl_vx_nxv4i64(<vscale x 4 x i64> %va, i64 %b) {
488 ; CHECK-LABEL: vshl_vx_nxv4i64:
490 ; CHECK-NEXT: vsetvli a1, zero, e64, m4, ta, ma
491 ; CHECK-NEXT: vsll.vx v8, v8, a0
493 %head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
494 %splat = shufflevector <vscale x 4 x i64> %head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
495 %vc = shl <vscale x 4 x i64> %va, %splat
496 ret <vscale x 4 x i64> %vc
499 define <vscale x 4 x i64> @vshl_vx_nxv4i64_0(<vscale x 4 x i64> %va) {
500 ; CHECK-LABEL: vshl_vx_nxv4i64_0:
502 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
503 ; CHECK-NEXT: vsll.vi v8, v8, 31
505 %vc = shl <vscale x 4 x i64> %va, splat (i64 31)
506 ret <vscale x 4 x i64> %vc
509 define <vscale x 4 x i64> @vshl_vx_nxv4i64_1(<vscale x 4 x i64> %va) {
510 ; CHECK-LABEL: vshl_vx_nxv4i64_1:
512 ; CHECK-NEXT: li a0, 32
513 ; CHECK-NEXT: vsetvli a1, zero, e64, m4, ta, ma
514 ; CHECK-NEXT: vsll.vx v8, v8, a0
516 %vc = shl <vscale x 4 x i64> %va, splat (i64 32)
517 ret <vscale x 4 x i64> %vc
520 define <vscale x 4 x i64> @vshl_vx_nxv4i64_2(<vscale x 4 x i64> %va) {
521 ; CHECK-LABEL: vshl_vx_nxv4i64_2:
523 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
524 ; CHECK-NEXT: vadd.vv v8, v8, v8
526 %vc = shl <vscale x 4 x i64> %va, splat (i64 1)
527 ret <vscale x 4 x i64> %vc
530 define <vscale x 8 x i64> @vshl_vx_nxv8i64(<vscale x 8 x i64> %va, i64 %b) {
531 ; CHECK-LABEL: vshl_vx_nxv8i64:
533 ; CHECK-NEXT: vsetvli a1, zero, e64, m8, ta, ma
534 ; CHECK-NEXT: vsll.vx v8, v8, a0
536 %head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
537 %splat = shufflevector <vscale x 8 x i64> %head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
538 %vc = shl <vscale x 8 x i64> %va, %splat
539 ret <vscale x 8 x i64> %vc
542 define <vscale x 8 x i64> @vshl_vx_nxv8i64_0(<vscale x 8 x i64> %va) {
543 ; CHECK-LABEL: vshl_vx_nxv8i64_0:
545 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
546 ; CHECK-NEXT: vsll.vi v8, v8, 31
548 %vc = shl <vscale x 8 x i64> %va, splat (i64 31)
549 ret <vscale x 8 x i64> %vc
552 define <vscale x 8 x i64> @vshl_vx_nxv8i64_1(<vscale x 8 x i64> %va) {
553 ; CHECK-LABEL: vshl_vx_nxv8i64_1:
555 ; CHECK-NEXT: li a0, 32
556 ; CHECK-NEXT: vsetvli a1, zero, e64, m8, ta, ma
557 ; CHECK-NEXT: vsll.vx v8, v8, a0
559 %vc = shl <vscale x 8 x i64> %va, splat (i64 32)
560 ret <vscale x 8 x i64> %vc
563 define <vscale x 8 x i64> @vshl_vx_nxv8i64_2(<vscale x 8 x i64> %va) {
564 ; CHECK-LABEL: vshl_vx_nxv8i64_2:
566 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
567 ; CHECK-NEXT: vadd.vv v8, v8, v8
569 %vc = shl <vscale x 8 x i64> %va, splat (i64 1)
570 ret <vscale x 8 x i64> %vc
573 define <vscale x 8 x i32> @vshl_vv_mask_nxv4i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, <vscale x 8 x i1> %mask) {
574 ; CHECK-LABEL: vshl_vv_mask_nxv4i32:
576 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, mu
577 ; CHECK-NEXT: vsll.vv v8, v8, v12, v0.t
579 %vs = select <vscale x 8 x i1> %mask, <vscale x 8 x i32> %vb, <vscale x 8 x i32> zeroinitializer
580 %vc = shl <vscale x 8 x i32> %va, %vs
581 ret <vscale x 8 x i32> %vc
584 define <vscale x 8 x i32> @vshl_vx_mask_nxv8i32(<vscale x 8 x i32> %va, i32 signext %b, <vscale x 8 x i1> %mask) {
585 ; CHECK-LABEL: vshl_vx_mask_nxv8i32:
587 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu
588 ; CHECK-NEXT: vsll.vx v8, v8, a0, v0.t
590 %head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
591 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
592 %vs = select <vscale x 8 x i1> %mask, <vscale x 8 x i32> %splat, <vscale x 8 x i32> zeroinitializer
593 %vc = shl <vscale x 8 x i32> %va, %vs
594 ret <vscale x 8 x i32> %vc
597 define <vscale x 8 x i32> @vshl_vi_mask_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i1> %mask) {
598 ; CHECK-LABEL: vshl_vi_mask_nxv8i32:
600 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, mu
601 ; CHECK-NEXT: vsll.vi v8, v8, 31, v0.t
603 %vs = select <vscale x 8 x i1> %mask, <vscale x 8 x i32> splat (i32 31), <vscale x 8 x i32> zeroinitializer
604 %vc = shl <vscale x 8 x i32> %va, %vs
605 ret <vscale x 8 x i32> %vc