1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,CHECK-RV32
3 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,CHECK-RV64
4 ; RUN: llc -mtriple=riscv32 -mattr=+v,+zvkb -verify-machineinstrs < %s | FileCheck %s --check-prefix=CHECK-ZVKB
5 ; RUN: llc -mtriple=riscv64 -mattr=+v,+zvkb -verify-machineinstrs < %s | FileCheck %s --check-prefix=CHECK-ZVKB
7 declare <vscale x 1 x i8> @llvm.fshl.nxv1i8(<vscale x 1 x i8>, <vscale x 1 x i8>, <vscale x 1 x i8>)
9 define <vscale x 1 x i8> @vrol_vv_nxv1i8(<vscale x 1 x i8> %a, <vscale x 1 x i8> %b) {
10 ; CHECK-LABEL: vrol_vv_nxv1i8:
12 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
13 ; CHECK-NEXT: vand.vi v10, v9, 7
14 ; CHECK-NEXT: vsll.vv v10, v8, v10
15 ; CHECK-NEXT: vrsub.vi v9, v9, 0
16 ; CHECK-NEXT: vand.vi v9, v9, 7
17 ; CHECK-NEXT: vsrl.vv v8, v8, v9
18 ; CHECK-NEXT: vor.vv v8, v10, v8
21 ; CHECK-ZVKB-LABEL: vrol_vv_nxv1i8:
22 ; CHECK-ZVKB: # %bb.0:
23 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
24 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v9
25 ; CHECK-ZVKB-NEXT: ret
26 %x = call <vscale x 1 x i8> @llvm.fshl.nxv1i8(<vscale x 1 x i8> %a, <vscale x 1 x i8> %a, <vscale x 1 x i8> %b)
27 ret <vscale x 1 x i8> %x
30 define <vscale x 1 x i8> @vrol_vx_nxv1i8(<vscale x 1 x i8> %a, i8 %b) {
31 ; CHECK-LABEL: vrol_vx_nxv1i8:
33 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
34 ; CHECK-NEXT: vmv.v.x v9, a0
35 ; CHECK-NEXT: vand.vi v10, v9, 7
36 ; CHECK-NEXT: vsll.vv v10, v8, v10
37 ; CHECK-NEXT: vrsub.vi v9, v9, 0
38 ; CHECK-NEXT: vand.vi v9, v9, 7
39 ; CHECK-NEXT: vsrl.vv v8, v8, v9
40 ; CHECK-NEXT: vor.vv v8, v10, v8
43 ; CHECK-ZVKB-LABEL: vrol_vx_nxv1i8:
44 ; CHECK-ZVKB: # %bb.0:
45 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
46 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
47 ; CHECK-ZVKB-NEXT: ret
48 %b.head = insertelement <vscale x 1 x i8> poison, i8 %b, i32 0
49 %b.splat = shufflevector <vscale x 1 x i8> %b.head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
50 %x = call <vscale x 1 x i8> @llvm.fshl.nxv1i8(<vscale x 1 x i8> %a, <vscale x 1 x i8> %a, <vscale x 1 x i8> %b.splat)
51 ret <vscale x 1 x i8> %x
54 declare <vscale x 2 x i8> @llvm.fshl.nxv2i8(<vscale x 2 x i8>, <vscale x 2 x i8>, <vscale x 2 x i8>)
56 define <vscale x 2 x i8> @vrol_vv_nxv2i8(<vscale x 2 x i8> %a, <vscale x 2 x i8> %b) {
57 ; CHECK-LABEL: vrol_vv_nxv2i8:
59 ; CHECK-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
60 ; CHECK-NEXT: vand.vi v10, v9, 7
61 ; CHECK-NEXT: vsll.vv v10, v8, v10
62 ; CHECK-NEXT: vrsub.vi v9, v9, 0
63 ; CHECK-NEXT: vand.vi v9, v9, 7
64 ; CHECK-NEXT: vsrl.vv v8, v8, v9
65 ; CHECK-NEXT: vor.vv v8, v10, v8
68 ; CHECK-ZVKB-LABEL: vrol_vv_nxv2i8:
69 ; CHECK-ZVKB: # %bb.0:
70 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
71 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v9
72 ; CHECK-ZVKB-NEXT: ret
73 %x = call <vscale x 2 x i8> @llvm.fshl.nxv2i8(<vscale x 2 x i8> %a, <vscale x 2 x i8> %a, <vscale x 2 x i8> %b)
74 ret <vscale x 2 x i8> %x
77 define <vscale x 2 x i8> @vrol_vx_nxv2i8(<vscale x 2 x i8> %a, i8 %b) {
78 ; CHECK-LABEL: vrol_vx_nxv2i8:
80 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
81 ; CHECK-NEXT: vmv.v.x v9, a0
82 ; CHECK-NEXT: vand.vi v10, v9, 7
83 ; CHECK-NEXT: vsll.vv v10, v8, v10
84 ; CHECK-NEXT: vrsub.vi v9, v9, 0
85 ; CHECK-NEXT: vand.vi v9, v9, 7
86 ; CHECK-NEXT: vsrl.vv v8, v8, v9
87 ; CHECK-NEXT: vor.vv v8, v10, v8
90 ; CHECK-ZVKB-LABEL: vrol_vx_nxv2i8:
91 ; CHECK-ZVKB: # %bb.0:
92 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
93 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
94 ; CHECK-ZVKB-NEXT: ret
95 %b.head = insertelement <vscale x 2 x i8> poison, i8 %b, i32 0
96 %b.splat = shufflevector <vscale x 2 x i8> %b.head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
97 %x = call <vscale x 2 x i8> @llvm.fshl.nxv2i8(<vscale x 2 x i8> %a, <vscale x 2 x i8> %a, <vscale x 2 x i8> %b.splat)
98 ret <vscale x 2 x i8> %x
101 declare <vscale x 4 x i8> @llvm.fshl.nxv4i8(<vscale x 4 x i8>, <vscale x 4 x i8>, <vscale x 4 x i8>)
103 define <vscale x 4 x i8> @vrol_vv_nxv4i8(<vscale x 4 x i8> %a, <vscale x 4 x i8> %b) {
104 ; CHECK-LABEL: vrol_vv_nxv4i8:
106 ; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
107 ; CHECK-NEXT: vand.vi v10, v9, 7
108 ; CHECK-NEXT: vsll.vv v10, v8, v10
109 ; CHECK-NEXT: vrsub.vi v9, v9, 0
110 ; CHECK-NEXT: vand.vi v9, v9, 7
111 ; CHECK-NEXT: vsrl.vv v8, v8, v9
112 ; CHECK-NEXT: vor.vv v8, v10, v8
115 ; CHECK-ZVKB-LABEL: vrol_vv_nxv4i8:
116 ; CHECK-ZVKB: # %bb.0:
117 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
118 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v9
119 ; CHECK-ZVKB-NEXT: ret
120 %x = call <vscale x 4 x i8> @llvm.fshl.nxv4i8(<vscale x 4 x i8> %a, <vscale x 4 x i8> %a, <vscale x 4 x i8> %b)
121 ret <vscale x 4 x i8> %x
124 define <vscale x 4 x i8> @vrol_vx_nxv4i8(<vscale x 4 x i8> %a, i8 %b) {
125 ; CHECK-LABEL: vrol_vx_nxv4i8:
127 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
128 ; CHECK-NEXT: vmv.v.x v9, a0
129 ; CHECK-NEXT: vand.vi v10, v9, 7
130 ; CHECK-NEXT: vsll.vv v10, v8, v10
131 ; CHECK-NEXT: vrsub.vi v9, v9, 0
132 ; CHECK-NEXT: vand.vi v9, v9, 7
133 ; CHECK-NEXT: vsrl.vv v8, v8, v9
134 ; CHECK-NEXT: vor.vv v8, v10, v8
137 ; CHECK-ZVKB-LABEL: vrol_vx_nxv4i8:
138 ; CHECK-ZVKB: # %bb.0:
139 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
140 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
141 ; CHECK-ZVKB-NEXT: ret
142 %b.head = insertelement <vscale x 4 x i8> poison, i8 %b, i32 0
143 %b.splat = shufflevector <vscale x 4 x i8> %b.head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
144 %x = call <vscale x 4 x i8> @llvm.fshl.nxv4i8(<vscale x 4 x i8> %a, <vscale x 4 x i8> %a, <vscale x 4 x i8> %b.splat)
145 ret <vscale x 4 x i8> %x
148 declare <vscale x 8 x i8> @llvm.fshl.nxv8i8(<vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>)
150 define <vscale x 8 x i8> @vrol_vv_nxv8i8(<vscale x 8 x i8> %a, <vscale x 8 x i8> %b) {
151 ; CHECK-LABEL: vrol_vv_nxv8i8:
153 ; CHECK-NEXT: vsetvli a0, zero, e8, m1, ta, ma
154 ; CHECK-NEXT: vand.vi v10, v9, 7
155 ; CHECK-NEXT: vsll.vv v10, v8, v10
156 ; CHECK-NEXT: vrsub.vi v9, v9, 0
157 ; CHECK-NEXT: vand.vi v9, v9, 7
158 ; CHECK-NEXT: vsrl.vv v8, v8, v9
159 ; CHECK-NEXT: vor.vv v8, v10, v8
162 ; CHECK-ZVKB-LABEL: vrol_vv_nxv8i8:
163 ; CHECK-ZVKB: # %bb.0:
164 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, m1, ta, ma
165 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v9
166 ; CHECK-ZVKB-NEXT: ret
167 %x = call <vscale x 8 x i8> @llvm.fshl.nxv8i8(<vscale x 8 x i8> %a, <vscale x 8 x i8> %a, <vscale x 8 x i8> %b)
168 ret <vscale x 8 x i8> %x
171 define <vscale x 8 x i8> @vrol_vx_nxv8i8(<vscale x 8 x i8> %a, i8 %b) {
172 ; CHECK-LABEL: vrol_vx_nxv8i8:
174 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
175 ; CHECK-NEXT: vmv.v.x v9, a0
176 ; CHECK-NEXT: vand.vi v10, v9, 7
177 ; CHECK-NEXT: vsll.vv v10, v8, v10
178 ; CHECK-NEXT: vrsub.vi v9, v9, 0
179 ; CHECK-NEXT: vand.vi v9, v9, 7
180 ; CHECK-NEXT: vsrl.vv v8, v8, v9
181 ; CHECK-NEXT: vor.vv v8, v10, v8
184 ; CHECK-ZVKB-LABEL: vrol_vx_nxv8i8:
185 ; CHECK-ZVKB: # %bb.0:
186 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, m1, ta, ma
187 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
188 ; CHECK-ZVKB-NEXT: ret
189 %b.head = insertelement <vscale x 8 x i8> poison, i8 %b, i32 0
190 %b.splat = shufflevector <vscale x 8 x i8> %b.head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
191 %x = call <vscale x 8 x i8> @llvm.fshl.nxv8i8(<vscale x 8 x i8> %a, <vscale x 8 x i8> %a, <vscale x 8 x i8> %b.splat)
192 ret <vscale x 8 x i8> %x
195 declare <vscale x 16 x i8> @llvm.fshl.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>)
197 define <vscale x 16 x i8> @vrol_vv_nxv16i8(<vscale x 16 x i8> %a, <vscale x 16 x i8> %b) {
198 ; CHECK-LABEL: vrol_vv_nxv16i8:
200 ; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma
201 ; CHECK-NEXT: vand.vi v12, v10, 7
202 ; CHECK-NEXT: vsll.vv v12, v8, v12
203 ; CHECK-NEXT: vrsub.vi v10, v10, 0
204 ; CHECK-NEXT: vand.vi v10, v10, 7
205 ; CHECK-NEXT: vsrl.vv v8, v8, v10
206 ; CHECK-NEXT: vor.vv v8, v12, v8
209 ; CHECK-ZVKB-LABEL: vrol_vv_nxv16i8:
210 ; CHECK-ZVKB: # %bb.0:
211 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, m2, ta, ma
212 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v10
213 ; CHECK-ZVKB-NEXT: ret
214 %x = call <vscale x 16 x i8> @llvm.fshl.nxv16i8(<vscale x 16 x i8> %a, <vscale x 16 x i8> %a, <vscale x 16 x i8> %b)
215 ret <vscale x 16 x i8> %x
218 define <vscale x 16 x i8> @vrol_vx_nxv16i8(<vscale x 16 x i8> %a, i8 %b) {
219 ; CHECK-LABEL: vrol_vx_nxv16i8:
221 ; CHECK-NEXT: vsetvli a1, zero, e8, m2, ta, ma
222 ; CHECK-NEXT: vmv.v.x v10, a0
223 ; CHECK-NEXT: vand.vi v12, v10, 7
224 ; CHECK-NEXT: vsll.vv v12, v8, v12
225 ; CHECK-NEXT: vrsub.vi v10, v10, 0
226 ; CHECK-NEXT: vand.vi v10, v10, 7
227 ; CHECK-NEXT: vsrl.vv v8, v8, v10
228 ; CHECK-NEXT: vor.vv v8, v12, v8
231 ; CHECK-ZVKB-LABEL: vrol_vx_nxv16i8:
232 ; CHECK-ZVKB: # %bb.0:
233 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, m2, ta, ma
234 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
235 ; CHECK-ZVKB-NEXT: ret
236 %b.head = insertelement <vscale x 16 x i8> poison, i8 %b, i32 0
237 %b.splat = shufflevector <vscale x 16 x i8> %b.head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
238 %x = call <vscale x 16 x i8> @llvm.fshl.nxv16i8(<vscale x 16 x i8> %a, <vscale x 16 x i8> %a, <vscale x 16 x i8> %b.splat)
239 ret <vscale x 16 x i8> %x
242 declare <vscale x 32 x i8> @llvm.fshl.nxv32i8(<vscale x 32 x i8>, <vscale x 32 x i8>, <vscale x 32 x i8>)
244 define <vscale x 32 x i8> @vrol_vv_nxv32i8(<vscale x 32 x i8> %a, <vscale x 32 x i8> %b) {
245 ; CHECK-LABEL: vrol_vv_nxv32i8:
247 ; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma
248 ; CHECK-NEXT: vand.vi v16, v12, 7
249 ; CHECK-NEXT: vsll.vv v16, v8, v16
250 ; CHECK-NEXT: vrsub.vi v12, v12, 0
251 ; CHECK-NEXT: vand.vi v12, v12, 7
252 ; CHECK-NEXT: vsrl.vv v8, v8, v12
253 ; CHECK-NEXT: vor.vv v8, v16, v8
256 ; CHECK-ZVKB-LABEL: vrol_vv_nxv32i8:
257 ; CHECK-ZVKB: # %bb.0:
258 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, m4, ta, ma
259 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v12
260 ; CHECK-ZVKB-NEXT: ret
261 %x = call <vscale x 32 x i8> @llvm.fshl.nxv32i8(<vscale x 32 x i8> %a, <vscale x 32 x i8> %a, <vscale x 32 x i8> %b)
262 ret <vscale x 32 x i8> %x
265 define <vscale x 32 x i8> @vrol_vx_nxv32i8(<vscale x 32 x i8> %a, i8 %b) {
266 ; CHECK-LABEL: vrol_vx_nxv32i8:
268 ; CHECK-NEXT: vsetvli a1, zero, e8, m4, ta, ma
269 ; CHECK-NEXT: vmv.v.x v12, a0
270 ; CHECK-NEXT: vand.vi v16, v12, 7
271 ; CHECK-NEXT: vsll.vv v16, v8, v16
272 ; CHECK-NEXT: vrsub.vi v12, v12, 0
273 ; CHECK-NEXT: vand.vi v12, v12, 7
274 ; CHECK-NEXT: vsrl.vv v8, v8, v12
275 ; CHECK-NEXT: vor.vv v8, v16, v8
278 ; CHECK-ZVKB-LABEL: vrol_vx_nxv32i8:
279 ; CHECK-ZVKB: # %bb.0:
280 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, m4, ta, ma
281 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
282 ; CHECK-ZVKB-NEXT: ret
283 %b.head = insertelement <vscale x 32 x i8> poison, i8 %b, i32 0
284 %b.splat = shufflevector <vscale x 32 x i8> %b.head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
285 %x = call <vscale x 32 x i8> @llvm.fshl.nxv32i8(<vscale x 32 x i8> %a, <vscale x 32 x i8> %a, <vscale x 32 x i8> %b.splat)
286 ret <vscale x 32 x i8> %x
289 declare <vscale x 64 x i8> @llvm.fshl.nxv64i8(<vscale x 64 x i8>, <vscale x 64 x i8>, <vscale x 64 x i8>)
291 define <vscale x 64 x i8> @vrol_vv_nxv64i8(<vscale x 64 x i8> %a, <vscale x 64 x i8> %b) {
292 ; CHECK-LABEL: vrol_vv_nxv64i8:
294 ; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma
295 ; CHECK-NEXT: vand.vi v24, v16, 7
296 ; CHECK-NEXT: vsll.vv v24, v8, v24
297 ; CHECK-NEXT: vrsub.vi v16, v16, 0
298 ; CHECK-NEXT: vand.vi v16, v16, 7
299 ; CHECK-NEXT: vsrl.vv v8, v8, v16
300 ; CHECK-NEXT: vor.vv v8, v24, v8
303 ; CHECK-ZVKB-LABEL: vrol_vv_nxv64i8:
304 ; CHECK-ZVKB: # %bb.0:
305 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e8, m8, ta, ma
306 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v16
307 ; CHECK-ZVKB-NEXT: ret
308 %x = call <vscale x 64 x i8> @llvm.fshl.nxv64i8(<vscale x 64 x i8> %a, <vscale x 64 x i8> %a, <vscale x 64 x i8> %b)
309 ret <vscale x 64 x i8> %x
312 define <vscale x 64 x i8> @vrol_vx_nxv64i8(<vscale x 64 x i8> %a, i8 %b) {
313 ; CHECK-LABEL: vrol_vx_nxv64i8:
315 ; CHECK-NEXT: vsetvli a1, zero, e8, m8, ta, ma
316 ; CHECK-NEXT: vmv.v.x v16, a0
317 ; CHECK-NEXT: vand.vi v24, v16, 7
318 ; CHECK-NEXT: vsll.vv v24, v8, v24
319 ; CHECK-NEXT: vrsub.vi v16, v16, 0
320 ; CHECK-NEXT: vand.vi v16, v16, 7
321 ; CHECK-NEXT: vsrl.vv v8, v8, v16
322 ; CHECK-NEXT: vor.vv v8, v24, v8
325 ; CHECK-ZVKB-LABEL: vrol_vx_nxv64i8:
326 ; CHECK-ZVKB: # %bb.0:
327 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e8, m8, ta, ma
328 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
329 ; CHECK-ZVKB-NEXT: ret
330 %b.head = insertelement <vscale x 64 x i8> poison, i8 %b, i32 0
331 %b.splat = shufflevector <vscale x 64 x i8> %b.head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
332 %x = call <vscale x 64 x i8> @llvm.fshl.nxv64i8(<vscale x 64 x i8> %a, <vscale x 64 x i8> %a, <vscale x 64 x i8> %b.splat)
333 ret <vscale x 64 x i8> %x
336 declare <vscale x 1 x i16> @llvm.fshl.nxv1i16(<vscale x 1 x i16>, <vscale x 1 x i16>, <vscale x 1 x i16>)
338 define <vscale x 1 x i16> @vrol_vv_nxv1i16(<vscale x 1 x i16> %a, <vscale x 1 x i16> %b) {
339 ; CHECK-LABEL: vrol_vv_nxv1i16:
341 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
342 ; CHECK-NEXT: vand.vi v10, v9, 15
343 ; CHECK-NEXT: vsll.vv v10, v8, v10
344 ; CHECK-NEXT: vrsub.vi v9, v9, 0
345 ; CHECK-NEXT: vand.vi v9, v9, 15
346 ; CHECK-NEXT: vsrl.vv v8, v8, v9
347 ; CHECK-NEXT: vor.vv v8, v10, v8
350 ; CHECK-ZVKB-LABEL: vrol_vv_nxv1i16:
351 ; CHECK-ZVKB: # %bb.0:
352 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
353 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v9
354 ; CHECK-ZVKB-NEXT: ret
355 %x = call <vscale x 1 x i16> @llvm.fshl.nxv1i16(<vscale x 1 x i16> %a, <vscale x 1 x i16> %a, <vscale x 1 x i16> %b)
356 ret <vscale x 1 x i16> %x
359 define <vscale x 1 x i16> @vrol_vx_nxv1i16(<vscale x 1 x i16> %a, i16 %b) {
360 ; CHECK-LABEL: vrol_vx_nxv1i16:
362 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
363 ; CHECK-NEXT: vmv.v.x v9, a0
364 ; CHECK-NEXT: vand.vi v10, v9, 15
365 ; CHECK-NEXT: vsll.vv v10, v8, v10
366 ; CHECK-NEXT: vrsub.vi v9, v9, 0
367 ; CHECK-NEXT: vand.vi v9, v9, 15
368 ; CHECK-NEXT: vsrl.vv v8, v8, v9
369 ; CHECK-NEXT: vor.vv v8, v10, v8
372 ; CHECK-ZVKB-LABEL: vrol_vx_nxv1i16:
373 ; CHECK-ZVKB: # %bb.0:
374 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
375 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
376 ; CHECK-ZVKB-NEXT: ret
377 %b.head = insertelement <vscale x 1 x i16> poison, i16 %b, i32 0
378 %b.splat = shufflevector <vscale x 1 x i16> %b.head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
379 %x = call <vscale x 1 x i16> @llvm.fshl.nxv1i16(<vscale x 1 x i16> %a, <vscale x 1 x i16> %a, <vscale x 1 x i16> %b.splat)
380 ret <vscale x 1 x i16> %x
383 declare <vscale x 2 x i16> @llvm.fshl.nxv2i16(<vscale x 2 x i16>, <vscale x 2 x i16>, <vscale x 2 x i16>)
385 define <vscale x 2 x i16> @vrol_vv_nxv2i16(<vscale x 2 x i16> %a, <vscale x 2 x i16> %b) {
386 ; CHECK-LABEL: vrol_vv_nxv2i16:
388 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
389 ; CHECK-NEXT: vand.vi v10, v9, 15
390 ; CHECK-NEXT: vsll.vv v10, v8, v10
391 ; CHECK-NEXT: vrsub.vi v9, v9, 0
392 ; CHECK-NEXT: vand.vi v9, v9, 15
393 ; CHECK-NEXT: vsrl.vv v8, v8, v9
394 ; CHECK-NEXT: vor.vv v8, v10, v8
397 ; CHECK-ZVKB-LABEL: vrol_vv_nxv2i16:
398 ; CHECK-ZVKB: # %bb.0:
399 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
400 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v9
401 ; CHECK-ZVKB-NEXT: ret
402 %x = call <vscale x 2 x i16> @llvm.fshl.nxv2i16(<vscale x 2 x i16> %a, <vscale x 2 x i16> %a, <vscale x 2 x i16> %b)
403 ret <vscale x 2 x i16> %x
406 define <vscale x 2 x i16> @vrol_vx_nxv2i16(<vscale x 2 x i16> %a, i16 %b) {
407 ; CHECK-LABEL: vrol_vx_nxv2i16:
409 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
410 ; CHECK-NEXT: vmv.v.x v9, a0
411 ; CHECK-NEXT: vand.vi v10, v9, 15
412 ; CHECK-NEXT: vsll.vv v10, v8, v10
413 ; CHECK-NEXT: vrsub.vi v9, v9, 0
414 ; CHECK-NEXT: vand.vi v9, v9, 15
415 ; CHECK-NEXT: vsrl.vv v8, v8, v9
416 ; CHECK-NEXT: vor.vv v8, v10, v8
419 ; CHECK-ZVKB-LABEL: vrol_vx_nxv2i16:
420 ; CHECK-ZVKB: # %bb.0:
421 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
422 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
423 ; CHECK-ZVKB-NEXT: ret
424 %b.head = insertelement <vscale x 2 x i16> poison, i16 %b, i32 0
425 %b.splat = shufflevector <vscale x 2 x i16> %b.head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
426 %x = call <vscale x 2 x i16> @llvm.fshl.nxv2i16(<vscale x 2 x i16> %a, <vscale x 2 x i16> %a, <vscale x 2 x i16> %b.splat)
427 ret <vscale x 2 x i16> %x
430 declare <vscale x 4 x i16> @llvm.fshl.nxv4i16(<vscale x 4 x i16>, <vscale x 4 x i16>, <vscale x 4 x i16>)
432 define <vscale x 4 x i16> @vrol_vv_nxv4i16(<vscale x 4 x i16> %a, <vscale x 4 x i16> %b) {
433 ; CHECK-LABEL: vrol_vv_nxv4i16:
435 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
436 ; CHECK-NEXT: vand.vi v10, v9, 15
437 ; CHECK-NEXT: vsll.vv v10, v8, v10
438 ; CHECK-NEXT: vrsub.vi v9, v9, 0
439 ; CHECK-NEXT: vand.vi v9, v9, 15
440 ; CHECK-NEXT: vsrl.vv v8, v8, v9
441 ; CHECK-NEXT: vor.vv v8, v10, v8
444 ; CHECK-ZVKB-LABEL: vrol_vv_nxv4i16:
445 ; CHECK-ZVKB: # %bb.0:
446 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e16, m1, ta, ma
447 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v9
448 ; CHECK-ZVKB-NEXT: ret
449 %x = call <vscale x 4 x i16> @llvm.fshl.nxv4i16(<vscale x 4 x i16> %a, <vscale x 4 x i16> %a, <vscale x 4 x i16> %b)
450 ret <vscale x 4 x i16> %x
453 define <vscale x 4 x i16> @vrol_vx_nxv4i16(<vscale x 4 x i16> %a, i16 %b) {
454 ; CHECK-LABEL: vrol_vx_nxv4i16:
456 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
457 ; CHECK-NEXT: vmv.v.x v9, a0
458 ; CHECK-NEXT: vand.vi v10, v9, 15
459 ; CHECK-NEXT: vsll.vv v10, v8, v10
460 ; CHECK-NEXT: vrsub.vi v9, v9, 0
461 ; CHECK-NEXT: vand.vi v9, v9, 15
462 ; CHECK-NEXT: vsrl.vv v8, v8, v9
463 ; CHECK-NEXT: vor.vv v8, v10, v8
466 ; CHECK-ZVKB-LABEL: vrol_vx_nxv4i16:
467 ; CHECK-ZVKB: # %bb.0:
468 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e16, m1, ta, ma
469 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
470 ; CHECK-ZVKB-NEXT: ret
471 %b.head = insertelement <vscale x 4 x i16> poison, i16 %b, i32 0
472 %b.splat = shufflevector <vscale x 4 x i16> %b.head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
473 %x = call <vscale x 4 x i16> @llvm.fshl.nxv4i16(<vscale x 4 x i16> %a, <vscale x 4 x i16> %a, <vscale x 4 x i16> %b.splat)
474 ret <vscale x 4 x i16> %x
477 declare <vscale x 8 x i16> @llvm.fshl.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>)
479 define <vscale x 8 x i16> @vrol_vv_nxv8i16(<vscale x 8 x i16> %a, <vscale x 8 x i16> %b) {
480 ; CHECK-LABEL: vrol_vv_nxv8i16:
482 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
483 ; CHECK-NEXT: vand.vi v12, v10, 15
484 ; CHECK-NEXT: vsll.vv v12, v8, v12
485 ; CHECK-NEXT: vrsub.vi v10, v10, 0
486 ; CHECK-NEXT: vand.vi v10, v10, 15
487 ; CHECK-NEXT: vsrl.vv v8, v8, v10
488 ; CHECK-NEXT: vor.vv v8, v12, v8
491 ; CHECK-ZVKB-LABEL: vrol_vv_nxv8i16:
492 ; CHECK-ZVKB: # %bb.0:
493 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e16, m2, ta, ma
494 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v10
495 ; CHECK-ZVKB-NEXT: ret
496 %x = call <vscale x 8 x i16> @llvm.fshl.nxv8i16(<vscale x 8 x i16> %a, <vscale x 8 x i16> %a, <vscale x 8 x i16> %b)
497 ret <vscale x 8 x i16> %x
500 define <vscale x 8 x i16> @vrol_vx_nxv8i16(<vscale x 8 x i16> %a, i16 %b) {
501 ; CHECK-LABEL: vrol_vx_nxv8i16:
503 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
504 ; CHECK-NEXT: vmv.v.x v10, a0
505 ; CHECK-NEXT: vand.vi v12, v10, 15
506 ; CHECK-NEXT: vsll.vv v12, v8, v12
507 ; CHECK-NEXT: vrsub.vi v10, v10, 0
508 ; CHECK-NEXT: vand.vi v10, v10, 15
509 ; CHECK-NEXT: vsrl.vv v8, v8, v10
510 ; CHECK-NEXT: vor.vv v8, v12, v8
513 ; CHECK-ZVKB-LABEL: vrol_vx_nxv8i16:
514 ; CHECK-ZVKB: # %bb.0:
515 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e16, m2, ta, ma
516 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
517 ; CHECK-ZVKB-NEXT: ret
518 %b.head = insertelement <vscale x 8 x i16> poison, i16 %b, i32 0
519 %b.splat = shufflevector <vscale x 8 x i16> %b.head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
520 %x = call <vscale x 8 x i16> @llvm.fshl.nxv8i16(<vscale x 8 x i16> %a, <vscale x 8 x i16> %a, <vscale x 8 x i16> %b.splat)
521 ret <vscale x 8 x i16> %x
524 declare <vscale x 16 x i16> @llvm.fshl.nxv16i16(<vscale x 16 x i16>, <vscale x 16 x i16>, <vscale x 16 x i16>)
526 define <vscale x 16 x i16> @vrol_vv_nxv16i16(<vscale x 16 x i16> %a, <vscale x 16 x i16> %b) {
527 ; CHECK-LABEL: vrol_vv_nxv16i16:
529 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
530 ; CHECK-NEXT: vand.vi v16, v12, 15
531 ; CHECK-NEXT: vsll.vv v16, v8, v16
532 ; CHECK-NEXT: vrsub.vi v12, v12, 0
533 ; CHECK-NEXT: vand.vi v12, v12, 15
534 ; CHECK-NEXT: vsrl.vv v8, v8, v12
535 ; CHECK-NEXT: vor.vv v8, v16, v8
538 ; CHECK-ZVKB-LABEL: vrol_vv_nxv16i16:
539 ; CHECK-ZVKB: # %bb.0:
540 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e16, m4, ta, ma
541 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v12
542 ; CHECK-ZVKB-NEXT: ret
543 %x = call <vscale x 16 x i16> @llvm.fshl.nxv16i16(<vscale x 16 x i16> %a, <vscale x 16 x i16> %a, <vscale x 16 x i16> %b)
544 ret <vscale x 16 x i16> %x
547 define <vscale x 16 x i16> @vrol_vx_nxv16i16(<vscale x 16 x i16> %a, i16 %b) {
548 ; CHECK-LABEL: vrol_vx_nxv16i16:
550 ; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, ma
551 ; CHECK-NEXT: vmv.v.x v12, a0
552 ; CHECK-NEXT: vand.vi v16, v12, 15
553 ; CHECK-NEXT: vsll.vv v16, v8, v16
554 ; CHECK-NEXT: vrsub.vi v12, v12, 0
555 ; CHECK-NEXT: vand.vi v12, v12, 15
556 ; CHECK-NEXT: vsrl.vv v8, v8, v12
557 ; CHECK-NEXT: vor.vv v8, v16, v8
560 ; CHECK-ZVKB-LABEL: vrol_vx_nxv16i16:
561 ; CHECK-ZVKB: # %bb.0:
562 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e16, m4, ta, ma
563 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
564 ; CHECK-ZVKB-NEXT: ret
565 %b.head = insertelement <vscale x 16 x i16> poison, i16 %b, i32 0
566 %b.splat = shufflevector <vscale x 16 x i16> %b.head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
567 %x = call <vscale x 16 x i16> @llvm.fshl.nxv16i16(<vscale x 16 x i16> %a, <vscale x 16 x i16> %a, <vscale x 16 x i16> %b.splat)
568 ret <vscale x 16 x i16> %x
571 declare <vscale x 32 x i16> @llvm.fshl.nxv32i16(<vscale x 32 x i16>, <vscale x 32 x i16>, <vscale x 32 x i16>)
573 define <vscale x 32 x i16> @vrol_vv_nxv32i16(<vscale x 32 x i16> %a, <vscale x 32 x i16> %b) {
574 ; CHECK-LABEL: vrol_vv_nxv32i16:
576 ; CHECK-NEXT: vsetvli a0, zero, e16, m8, ta, ma
577 ; CHECK-NEXT: vand.vi v24, v16, 15
578 ; CHECK-NEXT: vsll.vv v24, v8, v24
579 ; CHECK-NEXT: vrsub.vi v16, v16, 0
580 ; CHECK-NEXT: vand.vi v16, v16, 15
581 ; CHECK-NEXT: vsrl.vv v8, v8, v16
582 ; CHECK-NEXT: vor.vv v8, v24, v8
585 ; CHECK-ZVKB-LABEL: vrol_vv_nxv32i16:
586 ; CHECK-ZVKB: # %bb.0:
587 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e16, m8, ta, ma
588 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v16
589 ; CHECK-ZVKB-NEXT: ret
590 %x = call <vscale x 32 x i16> @llvm.fshl.nxv32i16(<vscale x 32 x i16> %a, <vscale x 32 x i16> %a, <vscale x 32 x i16> %b)
591 ret <vscale x 32 x i16> %x
594 define <vscale x 32 x i16> @vrol_vx_nxv32i16(<vscale x 32 x i16> %a, i16 %b) {
595 ; CHECK-LABEL: vrol_vx_nxv32i16:
597 ; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, ma
598 ; CHECK-NEXT: vmv.v.x v16, a0
599 ; CHECK-NEXT: vand.vi v24, v16, 15
600 ; CHECK-NEXT: vsll.vv v24, v8, v24
601 ; CHECK-NEXT: vrsub.vi v16, v16, 0
602 ; CHECK-NEXT: vand.vi v16, v16, 15
603 ; CHECK-NEXT: vsrl.vv v8, v8, v16
604 ; CHECK-NEXT: vor.vv v8, v24, v8
607 ; CHECK-ZVKB-LABEL: vrol_vx_nxv32i16:
608 ; CHECK-ZVKB: # %bb.0:
609 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e16, m8, ta, ma
610 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
611 ; CHECK-ZVKB-NEXT: ret
612 %b.head = insertelement <vscale x 32 x i16> poison, i16 %b, i32 0
613 %b.splat = shufflevector <vscale x 32 x i16> %b.head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
614 %x = call <vscale x 32 x i16> @llvm.fshl.nxv32i16(<vscale x 32 x i16> %a, <vscale x 32 x i16> %a, <vscale x 32 x i16> %b.splat)
615 ret <vscale x 32 x i16> %x
618 declare <vscale x 1 x i32> @llvm.fshl.nxv1i32(<vscale x 1 x i32>, <vscale x 1 x i32>, <vscale x 1 x i32>)
620 define <vscale x 1 x i32> @vrol_vv_nxv1i32(<vscale x 1 x i32> %a, <vscale x 1 x i32> %b) {
621 ; CHECK-LABEL: vrol_vv_nxv1i32:
623 ; CHECK-NEXT: li a0, 31
624 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
625 ; CHECK-NEXT: vand.vx v10, v9, a0
626 ; CHECK-NEXT: vsll.vv v10, v8, v10
627 ; CHECK-NEXT: vrsub.vi v9, v9, 0
628 ; CHECK-NEXT: vand.vx v9, v9, a0
629 ; CHECK-NEXT: vsrl.vv v8, v8, v9
630 ; CHECK-NEXT: vor.vv v8, v10, v8
633 ; CHECK-ZVKB-LABEL: vrol_vv_nxv1i32:
634 ; CHECK-ZVKB: # %bb.0:
635 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
636 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v9
637 ; CHECK-ZVKB-NEXT: ret
638 %x = call <vscale x 1 x i32> @llvm.fshl.nxv1i32(<vscale x 1 x i32> %a, <vscale x 1 x i32> %a, <vscale x 1 x i32> %b)
639 ret <vscale x 1 x i32> %x
642 define <vscale x 1 x i32> @vrol_vx_nxv1i32(<vscale x 1 x i32> %a, i32 %b) {
643 ; CHECK-RV32-LABEL: vrol_vx_nxv1i32:
644 ; CHECK-RV32: # %bb.0:
645 ; CHECK-RV32-NEXT: andi a1, a0, 31
646 ; CHECK-RV32-NEXT: vsetvli a2, zero, e32, mf2, ta, ma
647 ; CHECK-RV32-NEXT: vsll.vx v9, v8, a1
648 ; CHECK-RV32-NEXT: neg a0, a0
649 ; CHECK-RV32-NEXT: andi a0, a0, 31
650 ; CHECK-RV32-NEXT: vsrl.vx v8, v8, a0
651 ; CHECK-RV32-NEXT: vor.vv v8, v9, v8
652 ; CHECK-RV32-NEXT: ret
654 ; CHECK-RV64-LABEL: vrol_vx_nxv1i32:
655 ; CHECK-RV64: # %bb.0:
656 ; CHECK-RV64-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
657 ; CHECK-RV64-NEXT: vmv.v.x v9, a0
658 ; CHECK-RV64-NEXT: li a0, 31
659 ; CHECK-RV64-NEXT: vand.vx v10, v9, a0
660 ; CHECK-RV64-NEXT: vsll.vv v10, v8, v10
661 ; CHECK-RV64-NEXT: vrsub.vi v9, v9, 0
662 ; CHECK-RV64-NEXT: vand.vx v9, v9, a0
663 ; CHECK-RV64-NEXT: vsrl.vv v8, v8, v9
664 ; CHECK-RV64-NEXT: vor.vv v8, v10, v8
665 ; CHECK-RV64-NEXT: ret
667 ; CHECK-ZVKB-LABEL: vrol_vx_nxv1i32:
668 ; CHECK-ZVKB: # %bb.0:
669 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
670 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
671 ; CHECK-ZVKB-NEXT: ret
672 %b.head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
673 %b.splat = shufflevector <vscale x 1 x i32> %b.head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
674 %x = call <vscale x 1 x i32> @llvm.fshl.nxv1i32(<vscale x 1 x i32> %a, <vscale x 1 x i32> %a, <vscale x 1 x i32> %b.splat)
675 ret <vscale x 1 x i32> %x
678 declare <vscale x 2 x i32> @llvm.fshl.nxv2i32(<vscale x 2 x i32>, <vscale x 2 x i32>, <vscale x 2 x i32>)
680 define <vscale x 2 x i32> @vrol_vv_nxv2i32(<vscale x 2 x i32> %a, <vscale x 2 x i32> %b) {
681 ; CHECK-LABEL: vrol_vv_nxv2i32:
683 ; CHECK-NEXT: li a0, 31
684 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
685 ; CHECK-NEXT: vand.vx v10, v9, a0
686 ; CHECK-NEXT: vsll.vv v10, v8, v10
687 ; CHECK-NEXT: vrsub.vi v9, v9, 0
688 ; CHECK-NEXT: vand.vx v9, v9, a0
689 ; CHECK-NEXT: vsrl.vv v8, v8, v9
690 ; CHECK-NEXT: vor.vv v8, v10, v8
693 ; CHECK-ZVKB-LABEL: vrol_vv_nxv2i32:
694 ; CHECK-ZVKB: # %bb.0:
695 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e32, m1, ta, ma
696 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v9
697 ; CHECK-ZVKB-NEXT: ret
698 %x = call <vscale x 2 x i32> @llvm.fshl.nxv2i32(<vscale x 2 x i32> %a, <vscale x 2 x i32> %a, <vscale x 2 x i32> %b)
699 ret <vscale x 2 x i32> %x
702 define <vscale x 2 x i32> @vrol_vx_nxv2i32(<vscale x 2 x i32> %a, i32 %b) {
703 ; CHECK-RV32-LABEL: vrol_vx_nxv2i32:
704 ; CHECK-RV32: # %bb.0:
705 ; CHECK-RV32-NEXT: andi a1, a0, 31
706 ; CHECK-RV32-NEXT: vsetvli a2, zero, e32, m1, ta, ma
707 ; CHECK-RV32-NEXT: vsll.vx v9, v8, a1
708 ; CHECK-RV32-NEXT: neg a0, a0
709 ; CHECK-RV32-NEXT: andi a0, a0, 31
710 ; CHECK-RV32-NEXT: vsrl.vx v8, v8, a0
711 ; CHECK-RV32-NEXT: vor.vv v8, v9, v8
712 ; CHECK-RV32-NEXT: ret
714 ; CHECK-RV64-LABEL: vrol_vx_nxv2i32:
715 ; CHECK-RV64: # %bb.0:
716 ; CHECK-RV64-NEXT: vsetvli a1, zero, e32, m1, ta, ma
717 ; CHECK-RV64-NEXT: vmv.v.x v9, a0
718 ; CHECK-RV64-NEXT: li a0, 31
719 ; CHECK-RV64-NEXT: vand.vx v10, v9, a0
720 ; CHECK-RV64-NEXT: vsll.vv v10, v8, v10
721 ; CHECK-RV64-NEXT: vrsub.vi v9, v9, 0
722 ; CHECK-RV64-NEXT: vand.vx v9, v9, a0
723 ; CHECK-RV64-NEXT: vsrl.vv v8, v8, v9
724 ; CHECK-RV64-NEXT: vor.vv v8, v10, v8
725 ; CHECK-RV64-NEXT: ret
727 ; CHECK-ZVKB-LABEL: vrol_vx_nxv2i32:
728 ; CHECK-ZVKB: # %bb.0:
729 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e32, m1, ta, ma
730 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
731 ; CHECK-ZVKB-NEXT: ret
732 %b.head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
733 %b.splat = shufflevector <vscale x 2 x i32> %b.head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
734 %x = call <vscale x 2 x i32> @llvm.fshl.nxv2i32(<vscale x 2 x i32> %a, <vscale x 2 x i32> %a, <vscale x 2 x i32> %b.splat)
735 ret <vscale x 2 x i32> %x
738 declare <vscale x 4 x i32> @llvm.fshl.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>)
740 define <vscale x 4 x i32> @vrol_vv_nxv4i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
741 ; CHECK-LABEL: vrol_vv_nxv4i32:
743 ; CHECK-NEXT: li a0, 31
744 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
745 ; CHECK-NEXT: vand.vx v12, v10, a0
746 ; CHECK-NEXT: vsll.vv v12, v8, v12
747 ; CHECK-NEXT: vrsub.vi v10, v10, 0
748 ; CHECK-NEXT: vand.vx v10, v10, a0
749 ; CHECK-NEXT: vsrl.vv v8, v8, v10
750 ; CHECK-NEXT: vor.vv v8, v12, v8
753 ; CHECK-ZVKB-LABEL: vrol_vv_nxv4i32:
754 ; CHECK-ZVKB: # %bb.0:
755 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e32, m2, ta, ma
756 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v10
757 ; CHECK-ZVKB-NEXT: ret
758 %x = call <vscale x 4 x i32> @llvm.fshl.nxv4i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
759 ret <vscale x 4 x i32> %x
762 define <vscale x 4 x i32> @vrol_vx_nxv4i32(<vscale x 4 x i32> %a, i32 %b) {
763 ; CHECK-RV32-LABEL: vrol_vx_nxv4i32:
764 ; CHECK-RV32: # %bb.0:
765 ; CHECK-RV32-NEXT: andi a1, a0, 31
766 ; CHECK-RV32-NEXT: vsetvli a2, zero, e32, m2, ta, ma
767 ; CHECK-RV32-NEXT: vsll.vx v10, v8, a1
768 ; CHECK-RV32-NEXT: neg a0, a0
769 ; CHECK-RV32-NEXT: andi a0, a0, 31
770 ; CHECK-RV32-NEXT: vsrl.vx v8, v8, a0
771 ; CHECK-RV32-NEXT: vor.vv v8, v10, v8
772 ; CHECK-RV32-NEXT: ret
774 ; CHECK-RV64-LABEL: vrol_vx_nxv4i32:
775 ; CHECK-RV64: # %bb.0:
776 ; CHECK-RV64-NEXT: vsetvli a1, zero, e32, m2, ta, ma
777 ; CHECK-RV64-NEXT: vmv.v.x v10, a0
778 ; CHECK-RV64-NEXT: li a0, 31
779 ; CHECK-RV64-NEXT: vand.vx v12, v10, a0
780 ; CHECK-RV64-NEXT: vsll.vv v12, v8, v12
781 ; CHECK-RV64-NEXT: vrsub.vi v10, v10, 0
782 ; CHECK-RV64-NEXT: vand.vx v10, v10, a0
783 ; CHECK-RV64-NEXT: vsrl.vv v8, v8, v10
784 ; CHECK-RV64-NEXT: vor.vv v8, v12, v8
785 ; CHECK-RV64-NEXT: ret
787 ; CHECK-ZVKB-LABEL: vrol_vx_nxv4i32:
788 ; CHECK-ZVKB: # %bb.0:
789 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e32, m2, ta, ma
790 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
791 ; CHECK-ZVKB-NEXT: ret
792 %b.head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
793 %b.splat = shufflevector <vscale x 4 x i32> %b.head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
794 %x = call <vscale x 4 x i32> @llvm.fshl.nxv4i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b.splat)
795 ret <vscale x 4 x i32> %x
798 declare <vscale x 8 x i32> @llvm.fshl.nxv8i32(<vscale x 8 x i32>, <vscale x 8 x i32>, <vscale x 8 x i32>)
800 define <vscale x 8 x i32> @vrol_vv_nxv8i32(<vscale x 8 x i32> %a, <vscale x 8 x i32> %b) {
801 ; CHECK-LABEL: vrol_vv_nxv8i32:
803 ; CHECK-NEXT: li a0, 31
804 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
805 ; CHECK-NEXT: vand.vx v16, v12, a0
806 ; CHECK-NEXT: vsll.vv v16, v8, v16
807 ; CHECK-NEXT: vrsub.vi v12, v12, 0
808 ; CHECK-NEXT: vand.vx v12, v12, a0
809 ; CHECK-NEXT: vsrl.vv v8, v8, v12
810 ; CHECK-NEXT: vor.vv v8, v16, v8
813 ; CHECK-ZVKB-LABEL: vrol_vv_nxv8i32:
814 ; CHECK-ZVKB: # %bb.0:
815 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e32, m4, ta, ma
816 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v12
817 ; CHECK-ZVKB-NEXT: ret
818 %x = call <vscale x 8 x i32> @llvm.fshl.nxv8i32(<vscale x 8 x i32> %a, <vscale x 8 x i32> %a, <vscale x 8 x i32> %b)
819 ret <vscale x 8 x i32> %x
822 define <vscale x 8 x i32> @vrol_vx_nxv8i32(<vscale x 8 x i32> %a, i32 %b) {
823 ; CHECK-RV32-LABEL: vrol_vx_nxv8i32:
824 ; CHECK-RV32: # %bb.0:
825 ; CHECK-RV32-NEXT: andi a1, a0, 31
826 ; CHECK-RV32-NEXT: vsetvli a2, zero, e32, m4, ta, ma
827 ; CHECK-RV32-NEXT: vsll.vx v12, v8, a1
828 ; CHECK-RV32-NEXT: neg a0, a0
829 ; CHECK-RV32-NEXT: andi a0, a0, 31
830 ; CHECK-RV32-NEXT: vsrl.vx v8, v8, a0
831 ; CHECK-RV32-NEXT: vor.vv v8, v12, v8
832 ; CHECK-RV32-NEXT: ret
834 ; CHECK-RV64-LABEL: vrol_vx_nxv8i32:
835 ; CHECK-RV64: # %bb.0:
836 ; CHECK-RV64-NEXT: vsetvli a1, zero, e32, m4, ta, ma
837 ; CHECK-RV64-NEXT: vmv.v.x v12, a0
838 ; CHECK-RV64-NEXT: li a0, 31
839 ; CHECK-RV64-NEXT: vand.vx v16, v12, a0
840 ; CHECK-RV64-NEXT: vsll.vv v16, v8, v16
841 ; CHECK-RV64-NEXT: vrsub.vi v12, v12, 0
842 ; CHECK-RV64-NEXT: vand.vx v12, v12, a0
843 ; CHECK-RV64-NEXT: vsrl.vv v8, v8, v12
844 ; CHECK-RV64-NEXT: vor.vv v8, v16, v8
845 ; CHECK-RV64-NEXT: ret
847 ; CHECK-ZVKB-LABEL: vrol_vx_nxv8i32:
848 ; CHECK-ZVKB: # %bb.0:
849 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e32, m4, ta, ma
850 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
851 ; CHECK-ZVKB-NEXT: ret
852 %b.head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
853 %b.splat = shufflevector <vscale x 8 x i32> %b.head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
854 %x = call <vscale x 8 x i32> @llvm.fshl.nxv8i32(<vscale x 8 x i32> %a, <vscale x 8 x i32> %a, <vscale x 8 x i32> %b.splat)
855 ret <vscale x 8 x i32> %x
858 declare <vscale x 16 x i32> @llvm.fshl.nxv16i32(<vscale x 16 x i32>, <vscale x 16 x i32>, <vscale x 16 x i32>)
860 define <vscale x 16 x i32> @vrol_vv_nxv16i32(<vscale x 16 x i32> %a, <vscale x 16 x i32> %b) {
861 ; CHECK-LABEL: vrol_vv_nxv16i32:
863 ; CHECK-NEXT: li a0, 31
864 ; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, ma
865 ; CHECK-NEXT: vand.vx v24, v16, a0
866 ; CHECK-NEXT: vsll.vv v24, v8, v24
867 ; CHECK-NEXT: vrsub.vi v16, v16, 0
868 ; CHECK-NEXT: vand.vx v16, v16, a0
869 ; CHECK-NEXT: vsrl.vv v8, v8, v16
870 ; CHECK-NEXT: vor.vv v8, v24, v8
873 ; CHECK-ZVKB-LABEL: vrol_vv_nxv16i32:
874 ; CHECK-ZVKB: # %bb.0:
875 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e32, m8, ta, ma
876 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v16
877 ; CHECK-ZVKB-NEXT: ret
878 %x = call <vscale x 16 x i32> @llvm.fshl.nxv16i32(<vscale x 16 x i32> %a, <vscale x 16 x i32> %a, <vscale x 16 x i32> %b)
879 ret <vscale x 16 x i32> %x
882 define <vscale x 16 x i32> @vrol_vx_nxv16i32(<vscale x 16 x i32> %a, i32 %b) {
883 ; CHECK-RV32-LABEL: vrol_vx_nxv16i32:
884 ; CHECK-RV32: # %bb.0:
885 ; CHECK-RV32-NEXT: andi a1, a0, 31
886 ; CHECK-RV32-NEXT: vsetvli a2, zero, e32, m8, ta, ma
887 ; CHECK-RV32-NEXT: vsll.vx v16, v8, a1
888 ; CHECK-RV32-NEXT: neg a0, a0
889 ; CHECK-RV32-NEXT: andi a0, a0, 31
890 ; CHECK-RV32-NEXT: vsrl.vx v8, v8, a0
891 ; CHECK-RV32-NEXT: vor.vv v8, v16, v8
892 ; CHECK-RV32-NEXT: ret
894 ; CHECK-RV64-LABEL: vrol_vx_nxv16i32:
895 ; CHECK-RV64: # %bb.0:
896 ; CHECK-RV64-NEXT: vsetvli a1, zero, e32, m8, ta, ma
897 ; CHECK-RV64-NEXT: vmv.v.x v16, a0
898 ; CHECK-RV64-NEXT: li a0, 31
899 ; CHECK-RV64-NEXT: vand.vx v24, v16, a0
900 ; CHECK-RV64-NEXT: vsll.vv v24, v8, v24
901 ; CHECK-RV64-NEXT: vrsub.vi v16, v16, 0
902 ; CHECK-RV64-NEXT: vand.vx v16, v16, a0
903 ; CHECK-RV64-NEXT: vsrl.vv v8, v8, v16
904 ; CHECK-RV64-NEXT: vor.vv v8, v24, v8
905 ; CHECK-RV64-NEXT: ret
907 ; CHECK-ZVKB-LABEL: vrol_vx_nxv16i32:
908 ; CHECK-ZVKB: # %bb.0:
909 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e32, m8, ta, ma
910 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
911 ; CHECK-ZVKB-NEXT: ret
912 %b.head = insertelement <vscale x 16 x i32> poison, i32 %b, i32 0
913 %b.splat = shufflevector <vscale x 16 x i32> %b.head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
914 %x = call <vscale x 16 x i32> @llvm.fshl.nxv16i32(<vscale x 16 x i32> %a, <vscale x 16 x i32> %a, <vscale x 16 x i32> %b.splat)
915 ret <vscale x 16 x i32> %x
918 declare <vscale x 1 x i64> @llvm.fshl.nxv1i64(<vscale x 1 x i64>, <vscale x 1 x i64>, <vscale x 1 x i64>)
920 define <vscale x 1 x i64> @vrol_vv_nxv1i64(<vscale x 1 x i64> %a, <vscale x 1 x i64> %b) {
921 ; CHECK-LABEL: vrol_vv_nxv1i64:
923 ; CHECK-NEXT: li a0, 63
924 ; CHECK-NEXT: vsetvli a1, zero, e64, m1, ta, ma
925 ; CHECK-NEXT: vand.vx v10, v9, a0
926 ; CHECK-NEXT: vsll.vv v10, v8, v10
927 ; CHECK-NEXT: vrsub.vi v9, v9, 0
928 ; CHECK-NEXT: vand.vx v9, v9, a0
929 ; CHECK-NEXT: vsrl.vv v8, v8, v9
930 ; CHECK-NEXT: vor.vv v8, v10, v8
933 ; CHECK-ZVKB-LABEL: vrol_vv_nxv1i64:
934 ; CHECK-ZVKB: # %bb.0:
935 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e64, m1, ta, ma
936 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v9
937 ; CHECK-ZVKB-NEXT: ret
938 %x = call <vscale x 1 x i64> @llvm.fshl.nxv1i64(<vscale x 1 x i64> %a, <vscale x 1 x i64> %a, <vscale x 1 x i64> %b)
939 ret <vscale x 1 x i64> %x
942 define <vscale x 1 x i64> @vrol_vx_nxv1i64(<vscale x 1 x i64> %a, i64 %b) {
943 ; CHECK-RV32-LABEL: vrol_vx_nxv1i64:
944 ; CHECK-RV32: # %bb.0:
945 ; CHECK-RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
946 ; CHECK-RV32-NEXT: vmv.v.x v9, a0
947 ; CHECK-RV32-NEXT: li a0, 63
948 ; CHECK-RV32-NEXT: vand.vx v10, v9, a0
949 ; CHECK-RV32-NEXT: vsll.vv v10, v8, v10
950 ; CHECK-RV32-NEXT: vrsub.vi v9, v9, 0
951 ; CHECK-RV32-NEXT: vand.vx v9, v9, a0
952 ; CHECK-RV32-NEXT: vsrl.vv v8, v8, v9
953 ; CHECK-RV32-NEXT: vor.vv v8, v10, v8
954 ; CHECK-RV32-NEXT: ret
956 ; CHECK-RV64-LABEL: vrol_vx_nxv1i64:
957 ; CHECK-RV64: # %bb.0:
958 ; CHECK-RV64-NEXT: andi a1, a0, 63
959 ; CHECK-RV64-NEXT: vsetvli a2, zero, e64, m1, ta, ma
960 ; CHECK-RV64-NEXT: vsll.vx v9, v8, a1
961 ; CHECK-RV64-NEXT: negw a0, a0
962 ; CHECK-RV64-NEXT: andi a0, a0, 63
963 ; CHECK-RV64-NEXT: vsrl.vx v8, v8, a0
964 ; CHECK-RV64-NEXT: vor.vv v8, v9, v8
965 ; CHECK-RV64-NEXT: ret
967 ; CHECK-ZVKB-LABEL: vrol_vx_nxv1i64:
968 ; CHECK-ZVKB: # %bb.0:
969 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e64, m1, ta, ma
970 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
971 ; CHECK-ZVKB-NEXT: ret
972 %b.head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
973 %b.splat = shufflevector <vscale x 1 x i64> %b.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
974 %x = call <vscale x 1 x i64> @llvm.fshl.nxv1i64(<vscale x 1 x i64> %a, <vscale x 1 x i64> %a, <vscale x 1 x i64> %b.splat)
975 ret <vscale x 1 x i64> %x
978 declare <vscale x 2 x i64> @llvm.fshl.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>)
980 define <vscale x 2 x i64> @vrol_vv_nxv2i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %b) {
981 ; CHECK-LABEL: vrol_vv_nxv2i64:
983 ; CHECK-NEXT: li a0, 63
984 ; CHECK-NEXT: vsetvli a1, zero, e64, m2, ta, ma
985 ; CHECK-NEXT: vand.vx v12, v10, a0
986 ; CHECK-NEXT: vsll.vv v12, v8, v12
987 ; CHECK-NEXT: vrsub.vi v10, v10, 0
988 ; CHECK-NEXT: vand.vx v10, v10, a0
989 ; CHECK-NEXT: vsrl.vv v8, v8, v10
990 ; CHECK-NEXT: vor.vv v8, v12, v8
993 ; CHECK-ZVKB-LABEL: vrol_vv_nxv2i64:
994 ; CHECK-ZVKB: # %bb.0:
995 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e64, m2, ta, ma
996 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v10
997 ; CHECK-ZVKB-NEXT: ret
998 %x = call <vscale x 2 x i64> @llvm.fshl.nxv2i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %a, <vscale x 2 x i64> %b)
999 ret <vscale x 2 x i64> %x
1002 define <vscale x 2 x i64> @vrol_vx_nxv2i64(<vscale x 2 x i64> %a, i64 %b) {
1003 ; CHECK-RV32-LABEL: vrol_vx_nxv2i64:
1004 ; CHECK-RV32: # %bb.0:
1005 ; CHECK-RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1006 ; CHECK-RV32-NEXT: vmv.v.x v10, a0
1007 ; CHECK-RV32-NEXT: li a0, 63
1008 ; CHECK-RV32-NEXT: vand.vx v12, v10, a0
1009 ; CHECK-RV32-NEXT: vsll.vv v12, v8, v12
1010 ; CHECK-RV32-NEXT: vrsub.vi v10, v10, 0
1011 ; CHECK-RV32-NEXT: vand.vx v10, v10, a0
1012 ; CHECK-RV32-NEXT: vsrl.vv v8, v8, v10
1013 ; CHECK-RV32-NEXT: vor.vv v8, v12, v8
1014 ; CHECK-RV32-NEXT: ret
1016 ; CHECK-RV64-LABEL: vrol_vx_nxv2i64:
1017 ; CHECK-RV64: # %bb.0:
1018 ; CHECK-RV64-NEXT: andi a1, a0, 63
1019 ; CHECK-RV64-NEXT: vsetvli a2, zero, e64, m2, ta, ma
1020 ; CHECK-RV64-NEXT: vsll.vx v10, v8, a1
1021 ; CHECK-RV64-NEXT: negw a0, a0
1022 ; CHECK-RV64-NEXT: andi a0, a0, 63
1023 ; CHECK-RV64-NEXT: vsrl.vx v8, v8, a0
1024 ; CHECK-RV64-NEXT: vor.vv v8, v10, v8
1025 ; CHECK-RV64-NEXT: ret
1027 ; CHECK-ZVKB-LABEL: vrol_vx_nxv2i64:
1028 ; CHECK-ZVKB: # %bb.0:
1029 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1030 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
1031 ; CHECK-ZVKB-NEXT: ret
1032 %b.head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
1033 %b.splat = shufflevector <vscale x 2 x i64> %b.head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
1034 %x = call <vscale x 2 x i64> @llvm.fshl.nxv2i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %a, <vscale x 2 x i64> %b.splat)
1035 ret <vscale x 2 x i64> %x
1038 declare <vscale x 4 x i64> @llvm.fshl.nxv4i64(<vscale x 4 x i64>, <vscale x 4 x i64>, <vscale x 4 x i64>)
1040 define <vscale x 4 x i64> @vrol_vv_nxv4i64(<vscale x 4 x i64> %a, <vscale x 4 x i64> %b) {
1041 ; CHECK-LABEL: vrol_vv_nxv4i64:
1043 ; CHECK-NEXT: li a0, 63
1044 ; CHECK-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1045 ; CHECK-NEXT: vand.vx v16, v12, a0
1046 ; CHECK-NEXT: vsll.vv v16, v8, v16
1047 ; CHECK-NEXT: vrsub.vi v12, v12, 0
1048 ; CHECK-NEXT: vand.vx v12, v12, a0
1049 ; CHECK-NEXT: vsrl.vv v8, v8, v12
1050 ; CHECK-NEXT: vor.vv v8, v16, v8
1053 ; CHECK-ZVKB-LABEL: vrol_vv_nxv4i64:
1054 ; CHECK-ZVKB: # %bb.0:
1055 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1056 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v12
1057 ; CHECK-ZVKB-NEXT: ret
1058 %x = call <vscale x 4 x i64> @llvm.fshl.nxv4i64(<vscale x 4 x i64> %a, <vscale x 4 x i64> %a, <vscale x 4 x i64> %b)
1059 ret <vscale x 4 x i64> %x
1062 define <vscale x 4 x i64> @vrol_vx_nxv4i64(<vscale x 4 x i64> %a, i64 %b) {
1063 ; CHECK-RV32-LABEL: vrol_vx_nxv4i64:
1064 ; CHECK-RV32: # %bb.0:
1065 ; CHECK-RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1066 ; CHECK-RV32-NEXT: vmv.v.x v12, a0
1067 ; CHECK-RV32-NEXT: li a0, 63
1068 ; CHECK-RV32-NEXT: vand.vx v16, v12, a0
1069 ; CHECK-RV32-NEXT: vsll.vv v16, v8, v16
1070 ; CHECK-RV32-NEXT: vrsub.vi v12, v12, 0
1071 ; CHECK-RV32-NEXT: vand.vx v12, v12, a0
1072 ; CHECK-RV32-NEXT: vsrl.vv v8, v8, v12
1073 ; CHECK-RV32-NEXT: vor.vv v8, v16, v8
1074 ; CHECK-RV32-NEXT: ret
1076 ; CHECK-RV64-LABEL: vrol_vx_nxv4i64:
1077 ; CHECK-RV64: # %bb.0:
1078 ; CHECK-RV64-NEXT: andi a1, a0, 63
1079 ; CHECK-RV64-NEXT: vsetvli a2, zero, e64, m4, ta, ma
1080 ; CHECK-RV64-NEXT: vsll.vx v12, v8, a1
1081 ; CHECK-RV64-NEXT: negw a0, a0
1082 ; CHECK-RV64-NEXT: andi a0, a0, 63
1083 ; CHECK-RV64-NEXT: vsrl.vx v8, v8, a0
1084 ; CHECK-RV64-NEXT: vor.vv v8, v12, v8
1085 ; CHECK-RV64-NEXT: ret
1087 ; CHECK-ZVKB-LABEL: vrol_vx_nxv4i64:
1088 ; CHECK-ZVKB: # %bb.0:
1089 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1090 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
1091 ; CHECK-ZVKB-NEXT: ret
1092 %b.head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
1093 %b.splat = shufflevector <vscale x 4 x i64> %b.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
1094 %x = call <vscale x 4 x i64> @llvm.fshl.nxv4i64(<vscale x 4 x i64> %a, <vscale x 4 x i64> %a, <vscale x 4 x i64> %b.splat)
1095 ret <vscale x 4 x i64> %x
1098 declare <vscale x 8 x i64> @llvm.fshl.nxv8i64(<vscale x 8 x i64>, <vscale x 8 x i64>, <vscale x 8 x i64>)
1100 define <vscale x 8 x i64> @vrol_vv_nxv8i64(<vscale x 8 x i64> %a, <vscale x 8 x i64> %b) {
1101 ; CHECK-LABEL: vrol_vv_nxv8i64:
1103 ; CHECK-NEXT: li a0, 63
1104 ; CHECK-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1105 ; CHECK-NEXT: vand.vx v24, v16, a0
1106 ; CHECK-NEXT: vsll.vv v24, v8, v24
1107 ; CHECK-NEXT: vrsub.vi v16, v16, 0
1108 ; CHECK-NEXT: vand.vx v16, v16, a0
1109 ; CHECK-NEXT: vsrl.vv v8, v8, v16
1110 ; CHECK-NEXT: vor.vv v8, v24, v8
1113 ; CHECK-ZVKB-LABEL: vrol_vv_nxv8i64:
1114 ; CHECK-ZVKB: # %bb.0:
1115 ; CHECK-ZVKB-NEXT: vsetvli a0, zero, e64, m8, ta, ma
1116 ; CHECK-ZVKB-NEXT: vrol.vv v8, v8, v16
1117 ; CHECK-ZVKB-NEXT: ret
1118 %x = call <vscale x 8 x i64> @llvm.fshl.nxv8i64(<vscale x 8 x i64> %a, <vscale x 8 x i64> %a, <vscale x 8 x i64> %b)
1119 ret <vscale x 8 x i64> %x
1122 define <vscale x 8 x i64> @vrol_vx_nxv8i64(<vscale x 8 x i64> %a, i64 %b) {
1123 ; CHECK-RV32-LABEL: vrol_vx_nxv8i64:
1124 ; CHECK-RV32: # %bb.0:
1125 ; CHECK-RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1126 ; CHECK-RV32-NEXT: vmv.v.x v16, a0
1127 ; CHECK-RV32-NEXT: li a0, 63
1128 ; CHECK-RV32-NEXT: vand.vx v24, v16, a0
1129 ; CHECK-RV32-NEXT: vsll.vv v24, v8, v24
1130 ; CHECK-RV32-NEXT: vrsub.vi v16, v16, 0
1131 ; CHECK-RV32-NEXT: vand.vx v16, v16, a0
1132 ; CHECK-RV32-NEXT: vsrl.vv v8, v8, v16
1133 ; CHECK-RV32-NEXT: vor.vv v8, v24, v8
1134 ; CHECK-RV32-NEXT: ret
1136 ; CHECK-RV64-LABEL: vrol_vx_nxv8i64:
1137 ; CHECK-RV64: # %bb.0:
1138 ; CHECK-RV64-NEXT: andi a1, a0, 63
1139 ; CHECK-RV64-NEXT: vsetvli a2, zero, e64, m8, ta, ma
1140 ; CHECK-RV64-NEXT: vsll.vx v16, v8, a1
1141 ; CHECK-RV64-NEXT: negw a0, a0
1142 ; CHECK-RV64-NEXT: andi a0, a0, 63
1143 ; CHECK-RV64-NEXT: vsrl.vx v8, v8, a0
1144 ; CHECK-RV64-NEXT: vor.vv v8, v16, v8
1145 ; CHECK-RV64-NEXT: ret
1147 ; CHECK-ZVKB-LABEL: vrol_vx_nxv8i64:
1148 ; CHECK-ZVKB: # %bb.0:
1149 ; CHECK-ZVKB-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1150 ; CHECK-ZVKB-NEXT: vrol.vx v8, v8, a0
1151 ; CHECK-ZVKB-NEXT: ret
1152 %b.head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
1153 %b.splat = shufflevector <vscale x 8 x i64> %b.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
1154 %x = call <vscale x 8 x i64> @llvm.fshl.nxv8i64(<vscale x 8 x i64> %a, <vscale x 8 x i64> %a, <vscale x 8 x i64> %b.splat)
1155 ret <vscale x 8 x i64> %x