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> @vsrl_vx_nxv1i8(<vscale x 1 x i8> %va, i8 signext %b) {
6 ; CHECK-LABEL: vsrl_vx_nxv1i8:
8 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
9 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 1 x i8> %va, %splat
14 ret <vscale x 1 x i8> %vc
17 define <vscale x 1 x i8> @vsrl_vx_nxv1i8_0(<vscale x 1 x i8> %va) {
18 ; CHECK-LABEL: vsrl_vx_nxv1i8_0:
20 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
21 ; CHECK-NEXT: vsrl.vi v8, v8, 6
23 %vc = lshr <vscale x 1 x i8> %va, splat (i8 6)
24 ret <vscale x 1 x i8> %vc
27 define <vscale x 2 x i8> @vsrl_vx_nxv2i8(<vscale x 2 x i8> %va, i8 signext %b) {
28 ; CHECK-LABEL: vsrl_vx_nxv2i8:
30 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
31 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 2 x i8> %va, %splat
36 ret <vscale x 2 x i8> %vc
39 define <vscale x 2 x i8> @vsrl_vx_nxv2i8_0(<vscale x 2 x i8> %va) {
40 ; CHECK-LABEL: vsrl_vx_nxv2i8_0:
42 ; CHECK-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
43 ; CHECK-NEXT: vsrl.vi v8, v8, 6
45 %vc = lshr <vscale x 2 x i8> %va, splat (i8 6)
46 ret <vscale x 2 x i8> %vc
49 define <vscale x 4 x i8> @vsrl_vx_nxv4i8(<vscale x 4 x i8> %va, i8 signext %b) {
50 ; CHECK-LABEL: vsrl_vx_nxv4i8:
52 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
53 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 4 x i8> %va, %splat
58 ret <vscale x 4 x i8> %vc
61 define <vscale x 4 x i8> @vsrl_vx_nxv4i8_0(<vscale x 4 x i8> %va) {
62 ; CHECK-LABEL: vsrl_vx_nxv4i8_0:
64 ; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
65 ; CHECK-NEXT: vsrl.vi v8, v8, 6
67 %vc = lshr <vscale x 4 x i8> %va, splat (i8 6)
68 ret <vscale x 4 x i8> %vc
71 define <vscale x 8 x i8> @vsrl_vx_nxv8i8(<vscale x 8 x i8> %va, i8 signext %b) {
72 ; CHECK-LABEL: vsrl_vx_nxv8i8:
74 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
75 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 8 x i8> %va, %splat
80 ret <vscale x 8 x i8> %vc
83 define <vscale x 8 x i8> @vsrl_vx_nxv8i8_0(<vscale x 8 x i8> %va) {
84 ; CHECK-LABEL: vsrl_vx_nxv8i8_0:
86 ; CHECK-NEXT: vsetvli a0, zero, e8, m1, ta, ma
87 ; CHECK-NEXT: vsrl.vi v8, v8, 6
89 %vc = lshr <vscale x 8 x i8> %va, splat (i8 6)
90 ret <vscale x 8 x i8> %vc
93 define <vscale x 16 x i8> @vsrl_vx_nxv16i8(<vscale x 16 x i8> %va, i8 signext %b) {
94 ; CHECK-LABEL: vsrl_vx_nxv16i8:
96 ; CHECK-NEXT: vsetvli a1, zero, e8, m2, ta, ma
97 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 16 x i8> %va, %splat
102 ret <vscale x 16 x i8> %vc
105 define <vscale x 16 x i8> @vsrl_vx_nxv16i8_0(<vscale x 16 x i8> %va) {
106 ; CHECK-LABEL: vsrl_vx_nxv16i8_0:
108 ; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma
109 ; CHECK-NEXT: vsrl.vi v8, v8, 6
111 %vc = lshr <vscale x 16 x i8> %va, splat (i8 6)
112 ret <vscale x 16 x i8> %vc
115 define <vscale x 32 x i8> @vsrl_vx_nxv32i8(<vscale x 32 x i8> %va, i8 signext %b) {
116 ; CHECK-LABEL: vsrl_vx_nxv32i8:
118 ; CHECK-NEXT: vsetvli a1, zero, e8, m4, ta, ma
119 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 32 x i8> %va, %splat
124 ret <vscale x 32 x i8> %vc
127 define <vscale x 32 x i8> @vsrl_vx_nxv32i8_0(<vscale x 32 x i8> %va) {
128 ; CHECK-LABEL: vsrl_vx_nxv32i8_0:
130 ; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma
131 ; CHECK-NEXT: vsrl.vi v8, v8, 6
133 %vc = lshr <vscale x 32 x i8> %va, splat (i8 6)
134 ret <vscale x 32 x i8> %vc
137 define <vscale x 64 x i8> @vsrl_vx_nxv64i8(<vscale x 64 x i8> %va, i8 signext %b) {
138 ; CHECK-LABEL: vsrl_vx_nxv64i8:
140 ; CHECK-NEXT: vsetvli a1, zero, e8, m8, ta, ma
141 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 64 x i8> %va, %splat
146 ret <vscale x 64 x i8> %vc
149 define <vscale x 64 x i8> @vsrl_vx_nxv64i8_0(<vscale x 64 x i8> %va) {
150 ; CHECK-LABEL: vsrl_vx_nxv64i8_0:
152 ; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma
153 ; CHECK-NEXT: vsrl.vi v8, v8, 6
155 %vc = lshr <vscale x 64 x i8> %va, splat (i8 6)
156 ret <vscale x 64 x i8> %vc
159 define <vscale x 1 x i16> @vsrl_vx_nxv1i16(<vscale x 1 x i16> %va, i16 signext %b) {
160 ; CHECK-LABEL: vsrl_vx_nxv1i16:
162 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
163 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 1 x i16> %va, %splat
168 ret <vscale x 1 x i16> %vc
171 define <vscale x 1 x i16> @vsrl_vx_nxv1i16_0(<vscale x 1 x i16> %va) {
172 ; CHECK-LABEL: vsrl_vx_nxv1i16_0:
174 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
175 ; CHECK-NEXT: vsrl.vi v8, v8, 6
177 %vc = lshr <vscale x 1 x i16> %va, splat (i16 6)
178 ret <vscale x 1 x i16> %vc
181 define <vscale x 2 x i16> @vsrl_vx_nxv2i16(<vscale x 2 x i16> %va, i16 signext %b) {
182 ; CHECK-LABEL: vsrl_vx_nxv2i16:
184 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
185 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 2 x i16> %va, %splat
190 ret <vscale x 2 x i16> %vc
193 define <vscale x 2 x i16> @vsrl_vx_nxv2i16_0(<vscale x 2 x i16> %va) {
194 ; CHECK-LABEL: vsrl_vx_nxv2i16_0:
196 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
197 ; CHECK-NEXT: vsrl.vi v8, v8, 6
199 %vc = lshr <vscale x 2 x i16> %va, splat (i16 6)
200 ret <vscale x 2 x i16> %vc
203 define <vscale x 4 x i16> @vsrl_vx_nxv4i16(<vscale x 4 x i16> %va, i16 signext %b) {
204 ; CHECK-LABEL: vsrl_vx_nxv4i16:
206 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
207 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 4 x i16> %va, %splat
212 ret <vscale x 4 x i16> %vc
215 define <vscale x 4 x i16> @vsrl_vx_nxv4i16_0(<vscale x 4 x i16> %va) {
216 ; CHECK-LABEL: vsrl_vx_nxv4i16_0:
218 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
219 ; CHECK-NEXT: vsrl.vi v8, v8, 6
221 %vc = lshr <vscale x 4 x i16> %va, splat (i16 6)
222 ret <vscale x 4 x i16> %vc
225 define <vscale x 8 x i16> @vsrl_vx_nxv8i16(<vscale x 8 x i16> %va, i16 signext %b) {
226 ; CHECK-LABEL: vsrl_vx_nxv8i16:
228 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
229 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 8 x i16> %va, %splat
234 ret <vscale x 8 x i16> %vc
237 define <vscale x 8 x i16> @vsrl_vx_nxv8i16_0(<vscale x 8 x i16> %va) {
238 ; CHECK-LABEL: vsrl_vx_nxv8i16_0:
240 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
241 ; CHECK-NEXT: vsrl.vi v8, v8, 6
243 %vc = lshr <vscale x 8 x i16> %va, splat (i16 6)
244 ret <vscale x 8 x i16> %vc
247 define <vscale x 16 x i16> @vsrl_vx_nxv16i16(<vscale x 16 x i16> %va, i16 signext %b) {
248 ; CHECK-LABEL: vsrl_vx_nxv16i16:
250 ; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, ma
251 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 16 x i16> %va, %splat
256 ret <vscale x 16 x i16> %vc
259 define <vscale x 16 x i16> @vsrl_vx_nxv16i16_0(<vscale x 16 x i16> %va) {
260 ; CHECK-LABEL: vsrl_vx_nxv16i16_0:
262 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
263 ; CHECK-NEXT: vsrl.vi v8, v8, 6
265 %vc = lshr <vscale x 16 x i16> %va, splat (i16 6)
266 ret <vscale x 16 x i16> %vc
269 define <vscale x 32 x i16> @vsrl_vx_nxv32i16(<vscale x 32 x i16> %va, i16 signext %b) {
270 ; CHECK-LABEL: vsrl_vx_nxv32i16:
272 ; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, ma
273 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 32 x i16> %va, %splat
278 ret <vscale x 32 x i16> %vc
281 define <vscale x 32 x i16> @vsrl_vx_nxv32i16_0(<vscale x 32 x i16> %va) {
282 ; CHECK-LABEL: vsrl_vx_nxv32i16_0:
284 ; CHECK-NEXT: vsetvli a0, zero, e16, m8, ta, ma
285 ; CHECK-NEXT: vsrl.vi v8, v8, 6
287 %vc = lshr <vscale x 32 x i16> %va, splat (i16 6)
288 ret <vscale x 32 x i16> %vc
291 define <vscale x 1 x i32> @vsrl_vx_nxv1i32(<vscale x 1 x i32> %va, i32 signext %b) {
292 ; CHECK-LABEL: vsrl_vx_nxv1i32:
294 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
295 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 1 x i32> %va, %splat
300 ret <vscale x 1 x i32> %vc
303 define <vscale x 1 x i32> @vsrl_vx_nxv1i32_0(<vscale x 1 x i32> %va) {
304 ; CHECK-LABEL: vsrl_vx_nxv1i32_0:
306 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
307 ; CHECK-NEXT: vsrl.vi v8, v8, 31
309 %vc = lshr <vscale x 1 x i32> %va, splat (i32 31)
310 ret <vscale x 1 x i32> %vc
313 define <vscale x 2 x i32> @vsrl_vx_nxv2i32(<vscale x 2 x i32> %va, i32 signext %b) {
314 ; CHECK-LABEL: vsrl_vx_nxv2i32:
316 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
317 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 2 x i32> %va, %splat
322 ret <vscale x 2 x i32> %vc
325 define <vscale x 2 x i32> @vsrl_vx_nxv2i32_0(<vscale x 2 x i32> %va) {
326 ; CHECK-LABEL: vsrl_vx_nxv2i32_0:
328 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
329 ; CHECK-NEXT: vsrl.vi v8, v8, 31
331 %vc = lshr <vscale x 2 x i32> %va, splat (i32 31)
332 ret <vscale x 2 x i32> %vc
335 define <vscale x 4 x i32> @vsrl_vx_nxv4i32(<vscale x 4 x i32> %va, i32 signext %b) {
336 ; CHECK-LABEL: vsrl_vx_nxv4i32:
338 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
339 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 4 x i32> %va, %splat
344 ret <vscale x 4 x i32> %vc
347 define <vscale x 4 x i32> @vsrl_vx_nxv4i32_0(<vscale x 4 x i32> %va) {
348 ; CHECK-LABEL: vsrl_vx_nxv4i32_0:
350 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
351 ; CHECK-NEXT: vsrl.vi v8, v8, 31
353 %vc = lshr <vscale x 4 x i32> %va, splat (i32 31)
354 ret <vscale x 4 x i32> %vc
357 define <vscale x 8 x i32> @vsrl_vx_nxv8i32(<vscale x 8 x i32> %va, i32 signext %b) {
358 ; CHECK-LABEL: vsrl_vx_nxv8i32:
360 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
361 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 8 x i32> %va, %splat
366 ret <vscale x 8 x i32> %vc
369 define <vscale x 8 x i32> @vsrl_vx_nxv8i32_0(<vscale x 8 x i32> %va) {
370 ; CHECK-LABEL: vsrl_vx_nxv8i32_0:
372 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
373 ; CHECK-NEXT: vsrl.vi v8, v8, 31
375 %vc = lshr <vscale x 8 x i32> %va, splat (i32 31)
376 ret <vscale x 8 x i32> %vc
379 define <vscale x 16 x i32> @vsrl_vx_nxv16i32(<vscale x 16 x i32> %va, i32 signext %b) {
380 ; CHECK-LABEL: vsrl_vx_nxv16i32:
382 ; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, ma
383 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 16 x i32> %va, %splat
388 ret <vscale x 16 x i32> %vc
391 define <vscale x 16 x i32> @vsrl_vx_nxv16i32_0(<vscale x 16 x i32> %va) {
392 ; CHECK-LABEL: vsrl_vx_nxv16i32_0:
394 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
395 ; CHECK-NEXT: vsrl.vi v8, v8, 31
397 %vc = lshr <vscale x 16 x i32> %va, splat (i32 31)
398 ret <vscale x 16 x i32> %vc
401 define <vscale x 1 x i64> @vsrl_vx_nxv1i64(<vscale x 1 x i64> %va, i64 %b) {
402 ; CHECK-LABEL: vsrl_vx_nxv1i64:
404 ; CHECK-NEXT: vsetvli a1, zero, e64, m1, ta, ma
405 ; CHECK-NEXT: vsrl.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 = lshr <vscale x 1 x i64> %va, %splat
410 ret <vscale x 1 x i64> %vc
413 define <vscale x 1 x i64> @vsrl_vx_nxv1i64_0(<vscale x 1 x i64> %va) {
414 ; CHECK-LABEL: vsrl_vx_nxv1i64_0:
416 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
417 ; CHECK-NEXT: vsrl.vi v8, v8, 31
419 %vc = lshr <vscale x 1 x i64> %va, splat (i64 31)
420 ret <vscale x 1 x i64> %vc
423 define <vscale x 1 x i64> @vsrl_vx_nxv1i64_1(<vscale x 1 x i64> %va) {
424 ; CHECK-LABEL: vsrl_vx_nxv1i64_1:
426 ; CHECK-NEXT: li a0, 32
427 ; CHECK-NEXT: vsetvli a1, zero, e64, m1, ta, ma
428 ; CHECK-NEXT: vsrl.vx v8, v8, a0
430 %vc = lshr <vscale x 1 x i64> %va, splat (i64 32)
431 ret <vscale x 1 x i64> %vc
434 define <vscale x 2 x i64> @vsrl_vx_nxv2i64(<vscale x 2 x i64> %va, i64 %b) {
435 ; CHECK-LABEL: vsrl_vx_nxv2i64:
437 ; CHECK-NEXT: vsetvli a1, zero, e64, m2, ta, ma
438 ; CHECK-NEXT: vsrl.vx v8, v8, a0
440 %head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
441 %splat = shufflevector <vscale x 2 x i64> %head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
442 %vc = lshr <vscale x 2 x i64> %va, %splat
443 ret <vscale x 2 x i64> %vc
446 define <vscale x 2 x i64> @vsrl_vx_nxv2i64_0(<vscale x 2 x i64> %va) {
447 ; CHECK-LABEL: vsrl_vx_nxv2i64_0:
449 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
450 ; CHECK-NEXT: vsrl.vi v8, v8, 31
452 %vc = lshr <vscale x 2 x i64> %va, splat (i64 31)
453 ret <vscale x 2 x i64> %vc
456 define <vscale x 2 x i64> @vsrl_vx_nxv2i64_1(<vscale x 2 x i64> %va) {
457 ; CHECK-LABEL: vsrl_vx_nxv2i64_1:
459 ; CHECK-NEXT: li a0, 32
460 ; CHECK-NEXT: vsetvli a1, zero, e64, m2, ta, ma
461 ; CHECK-NEXT: vsrl.vx v8, v8, a0
463 %vc = lshr <vscale x 2 x i64> %va, splat (i64 32)
464 ret <vscale x 2 x i64> %vc
467 define <vscale x 4 x i64> @vsrl_vx_nxv4i64(<vscale x 4 x i64> %va, i64 %b) {
468 ; CHECK-LABEL: vsrl_vx_nxv4i64:
470 ; CHECK-NEXT: vsetvli a1, zero, e64, m4, ta, ma
471 ; CHECK-NEXT: vsrl.vx v8, v8, a0
473 %head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
474 %splat = shufflevector <vscale x 4 x i64> %head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
475 %vc = lshr <vscale x 4 x i64> %va, %splat
476 ret <vscale x 4 x i64> %vc
479 define <vscale x 4 x i64> @vsrl_vx_nxv4i64_0(<vscale x 4 x i64> %va) {
480 ; CHECK-LABEL: vsrl_vx_nxv4i64_0:
482 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
483 ; CHECK-NEXT: vsrl.vi v8, v8, 31
485 %vc = lshr <vscale x 4 x i64> %va, splat (i64 31)
486 ret <vscale x 4 x i64> %vc
489 define <vscale x 4 x i64> @vsrl_vx_nxv4i64_1(<vscale x 4 x i64> %va) {
490 ; CHECK-LABEL: vsrl_vx_nxv4i64_1:
492 ; CHECK-NEXT: li a0, 32
493 ; CHECK-NEXT: vsetvli a1, zero, e64, m4, ta, ma
494 ; CHECK-NEXT: vsrl.vx v8, v8, a0
496 %vc = lshr <vscale x 4 x i64> %va, splat (i64 32)
497 ret <vscale x 4 x i64> %vc
500 define <vscale x 8 x i64> @vsrl_vx_nxv8i64(<vscale x 8 x i64> %va, i64 %b) {
501 ; CHECK-LABEL: vsrl_vx_nxv8i64:
503 ; CHECK-NEXT: vsetvli a1, zero, e64, m8, ta, ma
504 ; CHECK-NEXT: vsrl.vx v8, v8, a0
506 %head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
507 %splat = shufflevector <vscale x 8 x i64> %head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
508 %vc = lshr <vscale x 8 x i64> %va, %splat
509 ret <vscale x 8 x i64> %vc
512 define <vscale x 8 x i64> @vsrl_vx_nxv8i64_0(<vscale x 8 x i64> %va) {
513 ; CHECK-LABEL: vsrl_vx_nxv8i64_0:
515 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
516 ; CHECK-NEXT: vsrl.vi v8, v8, 31
518 %vc = lshr <vscale x 8 x i64> %va, splat (i64 31)
519 ret <vscale x 8 x i64> %vc
522 define <vscale x 8 x i64> @vsrl_vx_nxv8i64_1(<vscale x 8 x i64> %va) {
523 ; CHECK-LABEL: vsrl_vx_nxv8i64_1:
525 ; CHECK-NEXT: li a0, 32
526 ; CHECK-NEXT: vsetvli a1, zero, e64, m8, ta, ma
527 ; CHECK-NEXT: vsrl.vx v8, v8, a0
529 %vc = lshr <vscale x 8 x i64> %va, splat (i64 32)
530 ret <vscale x 8 x i64> %vc
533 define <vscale x 8 x i32> @vsrl_vv_mask_nxv4i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, <vscale x 8 x i1> %mask) {
534 ; CHECK-LABEL: vsrl_vv_mask_nxv4i32:
536 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, mu
537 ; CHECK-NEXT: vsrl.vv v8, v8, v12, v0.t
539 %vs = select <vscale x 8 x i1> %mask, <vscale x 8 x i32> %vb, <vscale x 8 x i32> zeroinitializer
540 %vc = lshr <vscale x 8 x i32> %va, %vs
541 ret <vscale x 8 x i32> %vc
544 define <vscale x 8 x i32> @vsrl_vx_mask_nxv8i32(<vscale x 8 x i32> %va, i32 signext %b, <vscale x 8 x i1> %mask) {
545 ; CHECK-LABEL: vsrl_vx_mask_nxv8i32:
547 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu
548 ; CHECK-NEXT: vsrl.vx v8, v8, a0, v0.t
550 %head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
551 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
552 %vs = select <vscale x 8 x i1> %mask, <vscale x 8 x i32> %splat, <vscale x 8 x i32> zeroinitializer
553 %vc = lshr <vscale x 8 x i32> %va, %vs
554 ret <vscale x 8 x i32> %vc
557 define <vscale x 8 x i32> @vsrl_vi_mask_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i1> %mask) {
558 ; CHECK-LABEL: vsrl_vi_mask_nxv8i32:
560 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, mu
561 ; CHECK-NEXT: vsrl.vi v8, v8, 31, v0.t
563 %vs = select <vscale x 8 x i1> %mask, <vscale x 8 x i32> splat (i32 31), <vscale x 8 x i32> zeroinitializer
564 %vc = lshr <vscale x 8 x i32> %va, %vs
565 ret <vscale x 8 x i32> %vc