1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mtriple=riscv32 -mattr=+v,+zvfh -verify-machineinstrs < %s | FileCheck %s -check-prefixes=CHECK,RV32
3 ; RUN: llc -mtriple=riscv64 -mattr=+v,+zvfh -verify-machineinstrs < %s | FileCheck %s -check-prefixes=CHECK,RV64
4 ; RUN: llc -mtriple=riscv32 -mattr=+v,+zvfh,+zvkb -verify-machineinstrs < %s | FileCheck %s -check-prefixes=ZVKB-V
5 ; RUN: llc -mtriple=riscv64 -mattr=+v,+zvfh,+zvkb -verify-machineinstrs < %s | FileCheck %s -check-prefixes=ZVKB-V
6 ; RUN: llc -mtriple=riscv32 -mattr=+zve32x,+zvfh,+zvkb -verify-machineinstrs < %s | FileCheck %s -check-prefixes=ZVKB-ZVE32X
7 ; RUN: llc -mtriple=riscv64 -mattr=+zve32x,+zvfh,+zvkb -verify-machineinstrs < %s | FileCheck %s -check-prefixes=ZVKB-ZVE32X
9 define <8 x i1> @shuffle_v8i1_as_i8_1(<8 x i1> %v) {
10 ; CHECK-LABEL: shuffle_v8i1_as_i8_1:
12 ; CHECK-NEXT: vsetivli zero, 1, e8, mf8, ta, ma
13 ; CHECK-NEXT: vsrl.vi v8, v0, 1
14 ; CHECK-NEXT: vsll.vi v9, v0, 7
15 ; CHECK-NEXT: vor.vv v0, v9, v8
18 ; ZVKB-V-LABEL: shuffle_v8i1_as_i8_1:
20 ; ZVKB-V-NEXT: vsetivli zero, 1, e8, mf8, ta, ma
21 ; ZVKB-V-NEXT: vror.vi v0, v0, 1
24 ; ZVKB-ZVE32X-LABEL: shuffle_v8i1_as_i8_1:
25 ; ZVKB-ZVE32X: # %bb.0:
26 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 1, e8, mf4, ta, ma
27 ; ZVKB-ZVE32X-NEXT: vror.vi v0, v0, 1
28 ; ZVKB-ZVE32X-NEXT: ret
29 %shuffle = shufflevector <8 x i1> %v, <8 x i1> poison, <8 x i32> <i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0>
33 define <8 x i1> @shuffle_v8i1_as_i8_2(<8 x i1> %v) {
34 ; CHECK-LABEL: shuffle_v8i1_as_i8_2:
36 ; CHECK-NEXT: vsetivli zero, 1, e8, mf8, ta, ma
37 ; CHECK-NEXT: vsrl.vi v8, v0, 2
38 ; CHECK-NEXT: vsll.vi v9, v0, 6
39 ; CHECK-NEXT: vor.vv v0, v9, v8
42 ; ZVKB-V-LABEL: shuffle_v8i1_as_i8_2:
44 ; ZVKB-V-NEXT: vsetivli zero, 1, e8, mf8, ta, ma
45 ; ZVKB-V-NEXT: vror.vi v0, v0, 2
48 ; ZVKB-ZVE32X-LABEL: shuffle_v8i1_as_i8_2:
49 ; ZVKB-ZVE32X: # %bb.0:
50 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 1, e8, mf4, ta, ma
51 ; ZVKB-ZVE32X-NEXT: vror.vi v0, v0, 2
52 ; ZVKB-ZVE32X-NEXT: ret
53 %shuffle = shufflevector <8 x i1> %v, <8 x i1> poison, <8 x i32> <i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1>
57 define <8 x i1> @shuffle_v8i1_as_i8_3(<8 x i1> %v) {
58 ; CHECK-LABEL: shuffle_v8i1_as_i8_3:
60 ; CHECK-NEXT: vsetivli zero, 1, e8, mf8, ta, ma
61 ; CHECK-NEXT: vsrl.vi v8, v0, 3
62 ; CHECK-NEXT: vsll.vi v9, v0, 5
63 ; CHECK-NEXT: vor.vv v0, v9, v8
66 ; ZVKB-V-LABEL: shuffle_v8i1_as_i8_3:
68 ; ZVKB-V-NEXT: vsetivli zero, 1, e8, mf8, ta, ma
69 ; ZVKB-V-NEXT: vror.vi v0, v0, 3
72 ; ZVKB-ZVE32X-LABEL: shuffle_v8i1_as_i8_3:
73 ; ZVKB-ZVE32X: # %bb.0:
74 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 1, e8, mf4, ta, ma
75 ; ZVKB-ZVE32X-NEXT: vror.vi v0, v0, 3
76 ; ZVKB-ZVE32X-NEXT: ret
77 %shuffle = shufflevector <8 x i1> %v, <8 x i1> poison, <8 x i32> <i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2>
81 define <8 x i1> @shuffle_v8i1_as_i8_4(<8 x i1> %v) {
82 ; CHECK-LABEL: shuffle_v8i1_as_i8_4:
84 ; CHECK-NEXT: vsetivli zero, 1, e8, mf8, ta, ma
85 ; CHECK-NEXT: vsrl.vi v8, v0, 4
86 ; CHECK-NEXT: vsll.vi v9, v0, 4
87 ; CHECK-NEXT: vor.vv v0, v9, v8
90 ; ZVKB-V-LABEL: shuffle_v8i1_as_i8_4:
92 ; ZVKB-V-NEXT: vsetivli zero, 1, e8, mf8, ta, ma
93 ; ZVKB-V-NEXT: vror.vi v0, v0, 4
96 ; ZVKB-ZVE32X-LABEL: shuffle_v8i1_as_i8_4:
97 ; ZVKB-ZVE32X: # %bb.0:
98 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 1, e8, mf4, ta, ma
99 ; ZVKB-ZVE32X-NEXT: vror.vi v0, v0, 4
100 ; ZVKB-ZVE32X-NEXT: ret
101 %shuffle = shufflevector <8 x i1> %v, <8 x i1> poison, <8 x i32> <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3>
102 ret <8 x i1> %shuffle
105 define <8 x i1> @shuffle_v8i1_as_i8_5(<8 x i1> %v) {
106 ; CHECK-LABEL: shuffle_v8i1_as_i8_5:
108 ; CHECK-NEXT: vsetivli zero, 1, e8, mf8, ta, ma
109 ; CHECK-NEXT: vsrl.vi v8, v0, 5
110 ; CHECK-NEXT: vsll.vi v9, v0, 3
111 ; CHECK-NEXT: vor.vv v0, v9, v8
114 ; ZVKB-V-LABEL: shuffle_v8i1_as_i8_5:
116 ; ZVKB-V-NEXT: vsetivli zero, 1, e8, mf8, ta, ma
117 ; ZVKB-V-NEXT: vror.vi v0, v0, 5
120 ; ZVKB-ZVE32X-LABEL: shuffle_v8i1_as_i8_5:
121 ; ZVKB-ZVE32X: # %bb.0:
122 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 1, e8, mf4, ta, ma
123 ; ZVKB-ZVE32X-NEXT: vror.vi v0, v0, 5
124 ; ZVKB-ZVE32X-NEXT: ret
125 %shuffle = shufflevector <8 x i1> %v, <8 x i1> poison, <8 x i32> <i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4>
126 ret <8 x i1> %shuffle
129 define <8 x i1> @shuffle_v8i1_as_i8_6(<8 x i1> %v) {
130 ; CHECK-LABEL: shuffle_v8i1_as_i8_6:
132 ; CHECK-NEXT: vsetivli zero, 1, e8, mf8, ta, ma
133 ; CHECK-NEXT: vsrl.vi v8, v0, 6
134 ; CHECK-NEXT: vsll.vi v9, v0, 2
135 ; CHECK-NEXT: vor.vv v0, v9, v8
138 ; ZVKB-V-LABEL: shuffle_v8i1_as_i8_6:
140 ; ZVKB-V-NEXT: vsetivli zero, 1, e8, mf8, ta, ma
141 ; ZVKB-V-NEXT: vror.vi v0, v0, 6
144 ; ZVKB-ZVE32X-LABEL: shuffle_v8i1_as_i8_6:
145 ; ZVKB-ZVE32X: # %bb.0:
146 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 1, e8, mf4, ta, ma
147 ; ZVKB-ZVE32X-NEXT: vror.vi v0, v0, 6
148 ; ZVKB-ZVE32X-NEXT: ret
149 %shuffle = shufflevector <8 x i1> %v, <8 x i1> poison, <8 x i32> <i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5>
150 ret <8 x i1> %shuffle
153 define <8 x i1> @shuffle_v8i1_as_i8_7(<8 x i1> %v) {
154 ; CHECK-LABEL: shuffle_v8i1_as_i8_7:
156 ; CHECK-NEXT: vsetivli zero, 1, e8, mf8, ta, ma
157 ; CHECK-NEXT: vsrl.vi v8, v0, 7
158 ; CHECK-NEXT: vadd.vv v9, v0, v0
159 ; CHECK-NEXT: vor.vv v0, v9, v8
162 ; ZVKB-V-LABEL: shuffle_v8i1_as_i8_7:
164 ; ZVKB-V-NEXT: vsetivli zero, 1, e8, mf8, ta, ma
165 ; ZVKB-V-NEXT: vror.vi v0, v0, 7
168 ; ZVKB-ZVE32X-LABEL: shuffle_v8i1_as_i8_7:
169 ; ZVKB-ZVE32X: # %bb.0:
170 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 1, e8, mf4, ta, ma
171 ; ZVKB-ZVE32X-NEXT: vror.vi v0, v0, 7
172 ; ZVKB-ZVE32X-NEXT: ret
173 %shuffle = shufflevector <8 x i1> %v, <8 x i1> poison, <8 x i32> <i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6>
174 ret <8 x i1> %shuffle
177 define <8 x i8> @shuffle_v8i8_as_i16(<8 x i8> %v) {
178 ; CHECK-LABEL: shuffle_v8i8_as_i16:
180 ; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
181 ; CHECK-NEXT: vsrl.vi v9, v8, 8
182 ; CHECK-NEXT: vsll.vi v8, v8, 8
183 ; CHECK-NEXT: vor.vv v8, v8, v9
186 ; ZVKB-V-LABEL: shuffle_v8i8_as_i16:
188 ; ZVKB-V-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
189 ; ZVKB-V-NEXT: vrev8.v v8, v8
192 ; ZVKB-ZVE32X-LABEL: shuffle_v8i8_as_i16:
193 ; ZVKB-ZVE32X: # %bb.0:
194 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 4, e16, m2, ta, ma
195 ; ZVKB-ZVE32X-NEXT: vrev8.v v8, v8
196 ; ZVKB-ZVE32X-NEXT: ret
197 %shuffle = shufflevector <8 x i8> %v, <8 x i8> poison, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6>
198 ret <8 x i8> %shuffle
201 define <8 x i8> @shuffle_v8i8_as_i32_8(<8 x i8> %v) {
202 ; CHECK-LABEL: shuffle_v8i8_as_i32_8:
204 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
205 ; CHECK-NEXT: vsrl.vi v9, v8, 8
206 ; CHECK-NEXT: vsll.vi v8, v8, 24
207 ; CHECK-NEXT: vor.vv v8, v8, v9
210 ; ZVKB-V-LABEL: shuffle_v8i8_as_i32_8:
212 ; ZVKB-V-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
213 ; ZVKB-V-NEXT: vror.vi v8, v8, 8
216 ; ZVKB-ZVE32X-LABEL: shuffle_v8i8_as_i32_8:
217 ; ZVKB-ZVE32X: # %bb.0:
218 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 2, e32, m2, ta, ma
219 ; ZVKB-ZVE32X-NEXT: vror.vi v8, v8, 8
220 ; ZVKB-ZVE32X-NEXT: ret
221 %shuffle = shufflevector <8 x i8> %v, <8 x i8> poison, <8 x i32> <i32 1, i32 2, i32 3, i32 0, i32 5, i32 6, i32 7, i32 4>
222 ret <8 x i8> %shuffle
225 define <8 x i8> @shuffle_v8i8_as_i32_16(<8 x i8> %v) {
226 ; CHECK-LABEL: shuffle_v8i8_as_i32_16:
228 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
229 ; CHECK-NEXT: vsrl.vi v9, v8, 16
230 ; CHECK-NEXT: vsll.vi v8, v8, 16
231 ; CHECK-NEXT: vor.vv v8, v8, v9
234 ; ZVKB-V-LABEL: shuffle_v8i8_as_i32_16:
236 ; ZVKB-V-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
237 ; ZVKB-V-NEXT: vror.vi v8, v8, 16
240 ; ZVKB-ZVE32X-LABEL: shuffle_v8i8_as_i32_16:
241 ; ZVKB-ZVE32X: # %bb.0:
242 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 2, e32, m2, ta, ma
243 ; ZVKB-ZVE32X-NEXT: vror.vi v8, v8, 16
244 ; ZVKB-ZVE32X-NEXT: ret
245 %shuffle = shufflevector <8 x i8> %v, <8 x i8> poison, <8 x i32> <i32 2, i32 3, i32 0, i32 1, i32 6, i32 7, i32 4, i32 5>
246 ret <8 x i8> %shuffle
249 define <8 x i8> @shuffle_v8i8_as_i32_24(<8 x i8> %v) {
250 ; CHECK-LABEL: shuffle_v8i8_as_i32_24:
252 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
253 ; CHECK-NEXT: vsrl.vi v9, v8, 24
254 ; CHECK-NEXT: vsll.vi v8, v8, 8
255 ; CHECK-NEXT: vor.vv v8, v8, v9
258 ; ZVKB-V-LABEL: shuffle_v8i8_as_i32_24:
260 ; ZVKB-V-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
261 ; ZVKB-V-NEXT: vror.vi v8, v8, 24
264 ; ZVKB-ZVE32X-LABEL: shuffle_v8i8_as_i32_24:
265 ; ZVKB-ZVE32X: # %bb.0:
266 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 2, e32, m2, ta, ma
267 ; ZVKB-ZVE32X-NEXT: vror.vi v8, v8, 24
268 ; ZVKB-ZVE32X-NEXT: ret
269 %shuffle = shufflevector <8 x i8> %v, <8 x i8> poison, <8 x i32> <i32 3, i32 0, i32 1, i32 2, i32 7, i32 4, i32 5, i32 6>
270 ret <8 x i8> %shuffle
273 define <8 x i8> @shuffle_v8i8_as_i64_8(<8 x i8> %v) {
274 ; CHECK-LABEL: shuffle_v8i8_as_i64_8:
276 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
277 ; CHECK-NEXT: vslidedown.vi v9, v8, 1
278 ; CHECK-NEXT: vslideup.vi v9, v8, 7
279 ; CHECK-NEXT: vmv1r.v v8, v9
282 ; ZVKB-V-LABEL: shuffle_v8i8_as_i64_8:
284 ; ZVKB-V-NEXT: vsetivli zero, 1, e64, m1, ta, ma
285 ; ZVKB-V-NEXT: vror.vi v8, v8, 8
288 ; ZVKB-ZVE32X-LABEL: shuffle_v8i8_as_i64_8:
289 ; ZVKB-ZVE32X: # %bb.0:
290 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 8, e8, m2, ta, ma
291 ; ZVKB-ZVE32X-NEXT: vslidedown.vi v10, v8, 1
292 ; ZVKB-ZVE32X-NEXT: vslideup.vi v10, v8, 7
293 ; ZVKB-ZVE32X-NEXT: vmv.v.v v8, v10
294 ; ZVKB-ZVE32X-NEXT: ret
295 %shuffle = shufflevector <8 x i8> %v, <8 x i8> poison, <8 x i32> <i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0>
296 ret <8 x i8> %shuffle
299 define <8 x i8> @shuffle_v8i8_as_i64_16(<8 x i8> %v) {
300 ; CHECK-LABEL: shuffle_v8i8_as_i64_16:
302 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
303 ; CHECK-NEXT: vslidedown.vi v9, v8, 2
304 ; CHECK-NEXT: vslideup.vi v9, v8, 6
305 ; CHECK-NEXT: vmv1r.v v8, v9
308 ; ZVKB-V-LABEL: shuffle_v8i8_as_i64_16:
310 ; ZVKB-V-NEXT: vsetivli zero, 1, e64, m1, ta, ma
311 ; ZVKB-V-NEXT: vror.vi v8, v8, 16
314 ; ZVKB-ZVE32X-LABEL: shuffle_v8i8_as_i64_16:
315 ; ZVKB-ZVE32X: # %bb.0:
316 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 8, e8, m2, ta, ma
317 ; ZVKB-ZVE32X-NEXT: vslidedown.vi v10, v8, 2
318 ; ZVKB-ZVE32X-NEXT: vslideup.vi v10, v8, 6
319 ; ZVKB-ZVE32X-NEXT: vmv.v.v v8, v10
320 ; ZVKB-ZVE32X-NEXT: ret
321 %shuffle = shufflevector <8 x i8> %v, <8 x i8> poison, <8 x i32> <i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1>
322 ret <8 x i8> %shuffle
325 define <8 x i8> @shuffle_v8i8_as_i64_24(<8 x i8> %v) {
326 ; CHECK-LABEL: shuffle_v8i8_as_i64_24:
328 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
329 ; CHECK-NEXT: vslidedown.vi v9, v8, 3
330 ; CHECK-NEXT: vslideup.vi v9, v8, 5
331 ; CHECK-NEXT: vmv1r.v v8, v9
334 ; ZVKB-V-LABEL: shuffle_v8i8_as_i64_24:
336 ; ZVKB-V-NEXT: vsetivli zero, 1, e64, m1, ta, ma
337 ; ZVKB-V-NEXT: vror.vi v8, v8, 24
340 ; ZVKB-ZVE32X-LABEL: shuffle_v8i8_as_i64_24:
341 ; ZVKB-ZVE32X: # %bb.0:
342 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 8, e8, m2, ta, ma
343 ; ZVKB-ZVE32X-NEXT: vslidedown.vi v10, v8, 3
344 ; ZVKB-ZVE32X-NEXT: vslideup.vi v10, v8, 5
345 ; ZVKB-ZVE32X-NEXT: vmv.v.v v8, v10
346 ; ZVKB-ZVE32X-NEXT: ret
347 %shuffle = shufflevector <8 x i8> %v, <8 x i8> poison, <8 x i32> <i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2>
348 ret <8 x i8> %shuffle
351 define <8 x i8> @shuffle_v8i8_as_i64_32(<8 x i8> %v) {
352 ; CHECK-LABEL: shuffle_v8i8_as_i64_32:
354 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
355 ; CHECK-NEXT: vslidedown.vi v9, v8, 4
356 ; CHECK-NEXT: vslideup.vi v9, v8, 4
357 ; CHECK-NEXT: vmv1r.v v8, v9
360 ; ZVKB-V-LABEL: shuffle_v8i8_as_i64_32:
362 ; ZVKB-V-NEXT: vsetivli zero, 1, e64, m1, ta, ma
363 ; ZVKB-V-NEXT: vror.vi v8, v8, 32
366 ; ZVKB-ZVE32X-LABEL: shuffle_v8i8_as_i64_32:
367 ; ZVKB-ZVE32X: # %bb.0:
368 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 8, e8, m2, ta, ma
369 ; ZVKB-ZVE32X-NEXT: vslidedown.vi v10, v8, 4
370 ; ZVKB-ZVE32X-NEXT: vslideup.vi v10, v8, 4
371 ; ZVKB-ZVE32X-NEXT: vmv.v.v v8, v10
372 ; ZVKB-ZVE32X-NEXT: ret
373 %shuffle = shufflevector <8 x i8> %v, <8 x i8> poison, <8 x i32> <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3>
374 ret <8 x i8> %shuffle
377 define <8 x i8> @shuffle_v8i8_as_i64_40(<8 x i8> %v) {
378 ; CHECK-LABEL: shuffle_v8i8_as_i64_40:
380 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
381 ; CHECK-NEXT: vslidedown.vi v9, v8, 5
382 ; CHECK-NEXT: vslideup.vi v9, v8, 3
383 ; CHECK-NEXT: vmv1r.v v8, v9
386 ; ZVKB-V-LABEL: shuffle_v8i8_as_i64_40:
388 ; ZVKB-V-NEXT: vsetivli zero, 1, e64, m1, ta, ma
389 ; ZVKB-V-NEXT: vror.vi v8, v8, 40
392 ; ZVKB-ZVE32X-LABEL: shuffle_v8i8_as_i64_40:
393 ; ZVKB-ZVE32X: # %bb.0:
394 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 8, e8, m2, ta, ma
395 ; ZVKB-ZVE32X-NEXT: vslidedown.vi v10, v8, 5
396 ; ZVKB-ZVE32X-NEXT: vslideup.vi v10, v8, 3
397 ; ZVKB-ZVE32X-NEXT: vmv.v.v v8, v10
398 ; ZVKB-ZVE32X-NEXT: ret
399 %shuffle = shufflevector <8 x i8> %v, <8 x i8> poison, <8 x i32> <i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4>
400 ret <8 x i8> %shuffle
403 define <8 x i8> @shuffle_v8i8_as_i64_48(<8 x i8> %v) {
404 ; CHECK-LABEL: shuffle_v8i8_as_i64_48:
406 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
407 ; CHECK-NEXT: vslidedown.vi v9, v8, 6
408 ; CHECK-NEXT: vslideup.vi v9, v8, 2
409 ; CHECK-NEXT: vmv1r.v v8, v9
412 ; ZVKB-V-LABEL: shuffle_v8i8_as_i64_48:
414 ; ZVKB-V-NEXT: vsetivli zero, 1, e64, m1, ta, ma
415 ; ZVKB-V-NEXT: vror.vi v8, v8, 48
418 ; ZVKB-ZVE32X-LABEL: shuffle_v8i8_as_i64_48:
419 ; ZVKB-ZVE32X: # %bb.0:
420 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 8, e8, m2, ta, ma
421 ; ZVKB-ZVE32X-NEXT: vslidedown.vi v10, v8, 6
422 ; ZVKB-ZVE32X-NEXT: vslideup.vi v10, v8, 2
423 ; ZVKB-ZVE32X-NEXT: vmv.v.v v8, v10
424 ; ZVKB-ZVE32X-NEXT: ret
425 %shuffle = shufflevector <8 x i8> %v, <8 x i8> poison, <8 x i32> <i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5>
426 ret <8 x i8> %shuffle
429 define <8 x i8> @shuffle_v8i8_as_i64_56(<8 x i8> %v) {
430 ; CHECK-LABEL: shuffle_v8i8_as_i64_56:
432 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
433 ; CHECK-NEXT: vslidedown.vi v9, v8, 7
434 ; CHECK-NEXT: vslideup.vi v9, v8, 1
435 ; CHECK-NEXT: vmv1r.v v8, v9
438 ; ZVKB-V-LABEL: shuffle_v8i8_as_i64_56:
440 ; ZVKB-V-NEXT: vsetivli zero, 1, e64, m1, ta, ma
441 ; ZVKB-V-NEXT: vror.vi v8, v8, 56
444 ; ZVKB-ZVE32X-LABEL: shuffle_v8i8_as_i64_56:
445 ; ZVKB-ZVE32X: # %bb.0:
446 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 8, e8, m2, ta, ma
447 ; ZVKB-ZVE32X-NEXT: vslidedown.vi v10, v8, 7
448 ; ZVKB-ZVE32X-NEXT: vslideup.vi v10, v8, 1
449 ; ZVKB-ZVE32X-NEXT: vmv.v.v v8, v10
450 ; ZVKB-ZVE32X-NEXT: ret
451 %shuffle = shufflevector <8 x i8> %v, <8 x i8> poison, <8 x i32> <i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6>
452 ret <8 x i8> %shuffle
455 define <8 x i16> @shuffle_v8i16_as_i32(<8 x i16> %v) {
456 ; CHECK-LABEL: shuffle_v8i16_as_i32:
458 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
459 ; CHECK-NEXT: vsrl.vi v9, v8, 16
460 ; CHECK-NEXT: vsll.vi v8, v8, 16
461 ; CHECK-NEXT: vor.vv v8, v8, v9
464 ; ZVKB-V-LABEL: shuffle_v8i16_as_i32:
466 ; ZVKB-V-NEXT: vsetivli zero, 4, e32, m1, ta, ma
467 ; ZVKB-V-NEXT: vror.vi v8, v8, 16
470 ; ZVKB-ZVE32X-LABEL: shuffle_v8i16_as_i32:
471 ; ZVKB-ZVE32X: # %bb.0:
472 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 4, e32, m4, ta, ma
473 ; ZVKB-ZVE32X-NEXT: vror.vi v8, v8, 16
474 ; ZVKB-ZVE32X-NEXT: ret
475 %shuffle = shufflevector <8 x i16> %v, <8 x i16> poison, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6>
476 ret <8 x i16> %shuffle
479 define <8 x i16> @shuffle_v8i16_as_i64_16(<8 x i16> %v) {
480 ; RV32-LABEL: shuffle_v8i16_as_i64_16:
482 ; RV32-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
483 ; RV32-NEXT: vmv.v.i v9, 0
484 ; RV32-NEXT: li a0, 48
485 ; RV32-NEXT: vwsubu.vx v10, v9, a0
486 ; RV32-NEXT: li a1, 63
487 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, ma
488 ; RV32-NEXT: vand.vx v9, v10, a1
489 ; RV32-NEXT: vsrl.vv v9, v8, v9
490 ; RV32-NEXT: vmv.v.x v10, a0
491 ; RV32-NEXT: vand.vx v10, v10, a1
492 ; RV32-NEXT: vsll.vv v8, v8, v10
493 ; RV32-NEXT: vor.vv v8, v8, v9
496 ; RV64-LABEL: shuffle_v8i16_as_i64_16:
498 ; RV64-NEXT: li a0, 48
499 ; RV64-NEXT: vsetivli zero, 2, e64, m1, ta, ma
500 ; RV64-NEXT: vsll.vx v9, v8, a0
501 ; RV64-NEXT: vsrl.vi v8, v8, 16
502 ; RV64-NEXT: vor.vv v8, v9, v8
505 ; ZVKB-V-LABEL: shuffle_v8i16_as_i64_16:
507 ; ZVKB-V-NEXT: vsetivli zero, 2, e64, m1, ta, ma
508 ; ZVKB-V-NEXT: vror.vi v8, v8, 16
511 ; ZVKB-ZVE32X-LABEL: shuffle_v8i16_as_i64_16:
512 ; ZVKB-ZVE32X: # %bb.0:
513 ; ZVKB-ZVE32X-NEXT: lui a0, %hi(.LCPI19_0)
514 ; ZVKB-ZVE32X-NEXT: addi a0, a0, %lo(.LCPI19_0)
515 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 8, e16, m4, ta, ma
516 ; ZVKB-ZVE32X-NEXT: vle8.v v12, (a0)
517 ; ZVKB-ZVE32X-NEXT: vsext.vf2 v16, v12
518 ; ZVKB-ZVE32X-NEXT: vrgather.vv v12, v8, v16
519 ; ZVKB-ZVE32X-NEXT: vmv.v.v v8, v12
520 ; ZVKB-ZVE32X-NEXT: ret
521 %shuffle = shufflevector <8 x i16> %v, <8 x i16> poison, <8 x i32> <i32 1, i32 2, i32 3, i32 0, i32 5, i32 6, i32 7, i32 4>
522 ret <8 x i16> %shuffle
525 define <8 x i16> @shuffle_v8i16_as_i64_32(<8 x i16> %v) {
526 ; RV32-LABEL: shuffle_v8i16_as_i64_32:
528 ; RV32-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
529 ; RV32-NEXT: vmv.v.i v9, 0
530 ; RV32-NEXT: li a0, 32
531 ; RV32-NEXT: vwsubu.vx v10, v9, a0
532 ; RV32-NEXT: li a1, 63
533 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, ma
534 ; RV32-NEXT: vand.vx v9, v10, a1
535 ; RV32-NEXT: vsrl.vv v9, v8, v9
536 ; RV32-NEXT: vmv.v.x v10, a0
537 ; RV32-NEXT: vand.vx v10, v10, a1
538 ; RV32-NEXT: vsll.vv v8, v8, v10
539 ; RV32-NEXT: vor.vv v8, v8, v9
542 ; RV64-LABEL: shuffle_v8i16_as_i64_32:
544 ; RV64-NEXT: li a0, 32
545 ; RV64-NEXT: vsetivli zero, 2, e64, m1, ta, ma
546 ; RV64-NEXT: vsrl.vx v9, v8, a0
547 ; RV64-NEXT: vsll.vx v8, v8, a0
548 ; RV64-NEXT: vor.vv v8, v8, v9
551 ; ZVKB-V-LABEL: shuffle_v8i16_as_i64_32:
553 ; ZVKB-V-NEXT: vsetivli zero, 2, e64, m1, ta, ma
554 ; ZVKB-V-NEXT: vror.vi v8, v8, 32
557 ; ZVKB-ZVE32X-LABEL: shuffle_v8i16_as_i64_32:
558 ; ZVKB-ZVE32X: # %bb.0:
559 ; ZVKB-ZVE32X-NEXT: lui a0, %hi(.LCPI20_0)
560 ; ZVKB-ZVE32X-NEXT: addi a0, a0, %lo(.LCPI20_0)
561 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 8, e16, m4, ta, ma
562 ; ZVKB-ZVE32X-NEXT: vle8.v v12, (a0)
563 ; ZVKB-ZVE32X-NEXT: vsext.vf2 v16, v12
564 ; ZVKB-ZVE32X-NEXT: vrgather.vv v12, v8, v16
565 ; ZVKB-ZVE32X-NEXT: vmv.v.v v8, v12
566 ; ZVKB-ZVE32X-NEXT: ret
567 %shuffle = shufflevector <8 x i16> %v, <8 x i16> poison, <8 x i32> <i32 2, i32 3, i32 0, i32 1, i32 6, i32 7, i32 4, i32 5>
568 ret <8 x i16> %shuffle
571 define <8 x i16> @shuffle_v8i16_as_i64_48(<8 x i16> %v) {
572 ; RV32-LABEL: shuffle_v8i16_as_i64_48:
574 ; RV32-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
575 ; RV32-NEXT: vmv.v.i v9, 0
576 ; RV32-NEXT: li a0, 16
577 ; RV32-NEXT: vwsubu.vx v10, v9, a0
578 ; RV32-NEXT: li a1, 63
579 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, ma
580 ; RV32-NEXT: vand.vx v9, v10, a1
581 ; RV32-NEXT: vsrl.vv v9, v8, v9
582 ; RV32-NEXT: vmv.v.x v10, a0
583 ; RV32-NEXT: vand.vx v10, v10, a1
584 ; RV32-NEXT: vsll.vv v8, v8, v10
585 ; RV32-NEXT: vor.vv v8, v8, v9
588 ; RV64-LABEL: shuffle_v8i16_as_i64_48:
590 ; RV64-NEXT: li a0, 48
591 ; RV64-NEXT: vsetivli zero, 2, e64, m1, ta, ma
592 ; RV64-NEXT: vsrl.vx v9, v8, a0
593 ; RV64-NEXT: vsll.vi v8, v8, 16
594 ; RV64-NEXT: vor.vv v8, v8, v9
597 ; ZVKB-V-LABEL: shuffle_v8i16_as_i64_48:
599 ; ZVKB-V-NEXT: vsetivli zero, 2, e64, m1, ta, ma
600 ; ZVKB-V-NEXT: vror.vi v8, v8, 48
603 ; ZVKB-ZVE32X-LABEL: shuffle_v8i16_as_i64_48:
604 ; ZVKB-ZVE32X: # %bb.0:
605 ; ZVKB-ZVE32X-NEXT: lui a0, %hi(.LCPI21_0)
606 ; ZVKB-ZVE32X-NEXT: addi a0, a0, %lo(.LCPI21_0)
607 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 8, e16, m4, ta, ma
608 ; ZVKB-ZVE32X-NEXT: vle8.v v12, (a0)
609 ; ZVKB-ZVE32X-NEXT: vsext.vf2 v16, v12
610 ; ZVKB-ZVE32X-NEXT: vrgather.vv v12, v8, v16
611 ; ZVKB-ZVE32X-NEXT: vmv.v.v v8, v12
612 ; ZVKB-ZVE32X-NEXT: ret
613 %shuffle = shufflevector <8 x i16> %v, <8 x i16> poison, <8 x i32> <i32 3, i32 0, i32 1, i32 2, i32 7, i32 4, i32 5, i32 6>
614 ret <8 x i16> %shuffle
617 define <8 x i32> @shuffle_v8i32_as_i64(<8 x i32> %v) {
618 ; RV32-LABEL: shuffle_v8i32_as_i64:
620 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
621 ; RV32-NEXT: vmv.v.i v10, 0
622 ; RV32-NEXT: li a0, 32
623 ; RV32-NEXT: vwsubu.vx v12, v10, a0
624 ; RV32-NEXT: li a1, 63
625 ; RV32-NEXT: vsetvli zero, zero, e64, m2, ta, ma
626 ; RV32-NEXT: vand.vx v10, v12, a1
627 ; RV32-NEXT: vsrl.vv v10, v8, v10
628 ; RV32-NEXT: vmv.v.x v12, a0
629 ; RV32-NEXT: vand.vx v12, v12, a1
630 ; RV32-NEXT: vsll.vv v8, v8, v12
631 ; RV32-NEXT: vor.vv v8, v8, v10
634 ; RV64-LABEL: shuffle_v8i32_as_i64:
636 ; RV64-NEXT: li a0, 32
637 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
638 ; RV64-NEXT: vsrl.vx v10, v8, a0
639 ; RV64-NEXT: vsll.vx v8, v8, a0
640 ; RV64-NEXT: vor.vv v8, v8, v10
643 ; ZVKB-V-LABEL: shuffle_v8i32_as_i64:
645 ; ZVKB-V-NEXT: vsetivli zero, 4, e64, m2, ta, ma
646 ; ZVKB-V-NEXT: vror.vi v8, v8, 32
649 ; ZVKB-ZVE32X-LABEL: shuffle_v8i32_as_i64:
650 ; ZVKB-ZVE32X: # %bb.0:
651 ; ZVKB-ZVE32X-NEXT: lui a0, %hi(.LCPI22_0)
652 ; ZVKB-ZVE32X-NEXT: addi a0, a0, %lo(.LCPI22_0)
653 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 8, e16, m4, ta, ma
654 ; ZVKB-ZVE32X-NEXT: vle8.v v16, (a0)
655 ; ZVKB-ZVE32X-NEXT: vsext.vf2 v24, v16
656 ; ZVKB-ZVE32X-NEXT: vsetvli zero, zero, e32, m8, ta, ma
657 ; ZVKB-ZVE32X-NEXT: vrgatherei16.vv v16, v8, v24
658 ; ZVKB-ZVE32X-NEXT: vmv.v.v v8, v16
659 ; ZVKB-ZVE32X-NEXT: ret
660 %shuffle = shufflevector <8 x i32> %v, <8 x i32> poison, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6>
661 ret <8 x i32> %shuffle
664 define <8 x half> @shuffle_v8f16_as_i32(<8 x half> %v) {
665 ; CHECK-LABEL: shuffle_v8f16_as_i32:
667 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
668 ; CHECK-NEXT: vsrl.vi v9, v8, 16
669 ; CHECK-NEXT: vsll.vi v8, v8, 16
670 ; CHECK-NEXT: vor.vv v8, v8, v9
673 ; ZVKB-V-LABEL: shuffle_v8f16_as_i32:
675 ; ZVKB-V-NEXT: vsetivli zero, 4, e32, m1, ta, ma
676 ; ZVKB-V-NEXT: vror.vi v8, v8, 16
679 ; ZVKB-ZVE32X-LABEL: shuffle_v8f16_as_i32:
680 ; ZVKB-ZVE32X: # %bb.0:
681 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 4, e32, m4, ta, ma
682 ; ZVKB-ZVE32X-NEXT: vror.vi v8, v8, 16
683 ; ZVKB-ZVE32X-NEXT: ret
684 %shuffle = shufflevector <8 x half> %v, <8 x half> poison, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6>
685 ret <8 x half> %shuffle
688 define <8 x half> @shuffle_v8f16_as_i64_16(<8 x half> %v) {
689 ; RV32-LABEL: shuffle_v8f16_as_i64_16:
691 ; RV32-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
692 ; RV32-NEXT: vmv.v.i v9, 0
693 ; RV32-NEXT: li a0, 48
694 ; RV32-NEXT: vwsubu.vx v10, v9, a0
695 ; RV32-NEXT: li a1, 63
696 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, ma
697 ; RV32-NEXT: vand.vx v9, v10, a1
698 ; RV32-NEXT: vsrl.vv v9, v8, v9
699 ; RV32-NEXT: vmv.v.x v10, a0
700 ; RV32-NEXT: vand.vx v10, v10, a1
701 ; RV32-NEXT: vsll.vv v8, v8, v10
702 ; RV32-NEXT: vor.vv v8, v8, v9
705 ; RV64-LABEL: shuffle_v8f16_as_i64_16:
707 ; RV64-NEXT: li a0, 48
708 ; RV64-NEXT: vsetivli zero, 2, e64, m1, ta, ma
709 ; RV64-NEXT: vsll.vx v9, v8, a0
710 ; RV64-NEXT: vsrl.vi v8, v8, 16
711 ; RV64-NEXT: vor.vv v8, v9, v8
714 ; ZVKB-V-LABEL: shuffle_v8f16_as_i64_16:
716 ; ZVKB-V-NEXT: vsetivli zero, 2, e64, m1, ta, ma
717 ; ZVKB-V-NEXT: vror.vi v8, v8, 16
720 ; ZVKB-ZVE32X-LABEL: shuffle_v8f16_as_i64_16:
721 ; ZVKB-ZVE32X: # %bb.0:
722 ; ZVKB-ZVE32X-NEXT: lui a0, %hi(.LCPI24_0)
723 ; ZVKB-ZVE32X-NEXT: addi a0, a0, %lo(.LCPI24_0)
724 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 8, e16, m4, ta, ma
725 ; ZVKB-ZVE32X-NEXT: vle8.v v12, (a0)
726 ; ZVKB-ZVE32X-NEXT: vsext.vf2 v16, v12
727 ; ZVKB-ZVE32X-NEXT: vrgather.vv v12, v8, v16
728 ; ZVKB-ZVE32X-NEXT: vmv.v.v v8, v12
729 ; ZVKB-ZVE32X-NEXT: ret
730 %shuffle = shufflevector <8 x half> %v, <8 x half> poison, <8 x i32> <i32 1, i32 2, i32 3, i32 0, i32 5, i32 6, i32 7, i32 4>
731 ret <8 x half> %shuffle
734 define <8 x half> @shuffle_v8f16_as_i64_32(<8 x half> %v) {
735 ; RV32-LABEL: shuffle_v8f16_as_i64_32:
737 ; RV32-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
738 ; RV32-NEXT: vmv.v.i v9, 0
739 ; RV32-NEXT: li a0, 32
740 ; RV32-NEXT: vwsubu.vx v10, v9, a0
741 ; RV32-NEXT: li a1, 63
742 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, ma
743 ; RV32-NEXT: vand.vx v9, v10, a1
744 ; RV32-NEXT: vsrl.vv v9, v8, v9
745 ; RV32-NEXT: vmv.v.x v10, a0
746 ; RV32-NEXT: vand.vx v10, v10, a1
747 ; RV32-NEXT: vsll.vv v8, v8, v10
748 ; RV32-NEXT: vor.vv v8, v8, v9
751 ; RV64-LABEL: shuffle_v8f16_as_i64_32:
753 ; RV64-NEXT: li a0, 32
754 ; RV64-NEXT: vsetivli zero, 2, e64, m1, ta, ma
755 ; RV64-NEXT: vsrl.vx v9, v8, a0
756 ; RV64-NEXT: vsll.vx v8, v8, a0
757 ; RV64-NEXT: vor.vv v8, v8, v9
760 ; ZVKB-V-LABEL: shuffle_v8f16_as_i64_32:
762 ; ZVKB-V-NEXT: vsetivli zero, 2, e64, m1, ta, ma
763 ; ZVKB-V-NEXT: vror.vi v8, v8, 32
766 ; ZVKB-ZVE32X-LABEL: shuffle_v8f16_as_i64_32:
767 ; ZVKB-ZVE32X: # %bb.0:
768 ; ZVKB-ZVE32X-NEXT: lui a0, %hi(.LCPI25_0)
769 ; ZVKB-ZVE32X-NEXT: addi a0, a0, %lo(.LCPI25_0)
770 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 8, e16, m4, ta, ma
771 ; ZVKB-ZVE32X-NEXT: vle8.v v12, (a0)
772 ; ZVKB-ZVE32X-NEXT: vsext.vf2 v16, v12
773 ; ZVKB-ZVE32X-NEXT: vrgather.vv v12, v8, v16
774 ; ZVKB-ZVE32X-NEXT: vmv.v.v v8, v12
775 ; ZVKB-ZVE32X-NEXT: ret
776 %shuffle = shufflevector <8 x half> %v, <8 x half> poison, <8 x i32> <i32 2, i32 3, i32 0, i32 1, i32 6, i32 7, i32 4, i32 5>
777 ret <8 x half> %shuffle
780 define <8 x half> @shuffle_v8f16_as_i64_48(<8 x half> %v) {
781 ; RV32-LABEL: shuffle_v8f16_as_i64_48:
783 ; RV32-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
784 ; RV32-NEXT: vmv.v.i v9, 0
785 ; RV32-NEXT: li a0, 16
786 ; RV32-NEXT: vwsubu.vx v10, v9, a0
787 ; RV32-NEXT: li a1, 63
788 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, ma
789 ; RV32-NEXT: vand.vx v9, v10, a1
790 ; RV32-NEXT: vsrl.vv v9, v8, v9
791 ; RV32-NEXT: vmv.v.x v10, a0
792 ; RV32-NEXT: vand.vx v10, v10, a1
793 ; RV32-NEXT: vsll.vv v8, v8, v10
794 ; RV32-NEXT: vor.vv v8, v8, v9
797 ; RV64-LABEL: shuffle_v8f16_as_i64_48:
799 ; RV64-NEXT: li a0, 48
800 ; RV64-NEXT: vsetivli zero, 2, e64, m1, ta, ma
801 ; RV64-NEXT: vsrl.vx v9, v8, a0
802 ; RV64-NEXT: vsll.vi v8, v8, 16
803 ; RV64-NEXT: vor.vv v8, v8, v9
806 ; ZVKB-V-LABEL: shuffle_v8f16_as_i64_48:
808 ; ZVKB-V-NEXT: vsetivli zero, 2, e64, m1, ta, ma
809 ; ZVKB-V-NEXT: vror.vi v8, v8, 48
812 ; ZVKB-ZVE32X-LABEL: shuffle_v8f16_as_i64_48:
813 ; ZVKB-ZVE32X: # %bb.0:
814 ; ZVKB-ZVE32X-NEXT: lui a0, %hi(.LCPI26_0)
815 ; ZVKB-ZVE32X-NEXT: addi a0, a0, %lo(.LCPI26_0)
816 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 8, e16, m4, ta, ma
817 ; ZVKB-ZVE32X-NEXT: vle8.v v12, (a0)
818 ; ZVKB-ZVE32X-NEXT: vsext.vf2 v16, v12
819 ; ZVKB-ZVE32X-NEXT: vrgather.vv v12, v8, v16
820 ; ZVKB-ZVE32X-NEXT: vmv.v.v v8, v12
821 ; ZVKB-ZVE32X-NEXT: ret
822 %shuffle = shufflevector <8 x half> %v, <8 x half> poison, <8 x i32> <i32 3, i32 0, i32 1, i32 2, i32 7, i32 4, i32 5, i32 6>
823 ret <8 x half> %shuffle
826 define <8 x float> @shuffle_v8f32_as_i64(<8 x float> %v) {
827 ; RV32-LABEL: shuffle_v8f32_as_i64:
829 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
830 ; RV32-NEXT: vmv.v.i v10, 0
831 ; RV32-NEXT: li a0, 32
832 ; RV32-NEXT: vwsubu.vx v12, v10, a0
833 ; RV32-NEXT: li a1, 63
834 ; RV32-NEXT: vsetvli zero, zero, e64, m2, ta, ma
835 ; RV32-NEXT: vand.vx v10, v12, a1
836 ; RV32-NEXT: vsrl.vv v10, v8, v10
837 ; RV32-NEXT: vmv.v.x v12, a0
838 ; RV32-NEXT: vand.vx v12, v12, a1
839 ; RV32-NEXT: vsll.vv v8, v8, v12
840 ; RV32-NEXT: vor.vv v8, v8, v10
843 ; RV64-LABEL: shuffle_v8f32_as_i64:
845 ; RV64-NEXT: li a0, 32
846 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
847 ; RV64-NEXT: vsrl.vx v10, v8, a0
848 ; RV64-NEXT: vsll.vx v8, v8, a0
849 ; RV64-NEXT: vor.vv v8, v8, v10
852 ; ZVKB-V-LABEL: shuffle_v8f32_as_i64:
854 ; ZVKB-V-NEXT: vsetivli zero, 4, e64, m2, ta, ma
855 ; ZVKB-V-NEXT: vror.vi v8, v8, 32
858 ; ZVKB-ZVE32X-LABEL: shuffle_v8f32_as_i64:
859 ; ZVKB-ZVE32X: # %bb.0:
860 ; ZVKB-ZVE32X-NEXT: lui a0, %hi(.LCPI27_0)
861 ; ZVKB-ZVE32X-NEXT: addi a0, a0, %lo(.LCPI27_0)
862 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 8, e16, m4, ta, ma
863 ; ZVKB-ZVE32X-NEXT: vle8.v v16, (a0)
864 ; ZVKB-ZVE32X-NEXT: vsext.vf2 v24, v16
865 ; ZVKB-ZVE32X-NEXT: vsetvli zero, zero, e32, m8, ta, ma
866 ; ZVKB-ZVE32X-NEXT: vrgatherei16.vv v16, v8, v24
867 ; ZVKB-ZVE32X-NEXT: vmv.v.v v8, v16
868 ; ZVKB-ZVE32X-NEXT: ret
869 %shuffle = shufflevector <8 x float> %v, <8 x float> poison, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6>
870 ret <8 x float> %shuffle
873 define <8 x float> @shuffle_v8f32_as_i64_exact(<8 x float> %v) vscale_range(2,2) {
874 ; RV32-LABEL: shuffle_v8f32_as_i64_exact:
876 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
877 ; RV32-NEXT: vmv.v.i v10, 0
878 ; RV32-NEXT: li a0, 32
879 ; RV32-NEXT: vwsubu.vx v12, v10, a0
880 ; RV32-NEXT: li a1, 63
881 ; RV32-NEXT: vsetvli zero, zero, e64, m2, ta, ma
882 ; RV32-NEXT: vand.vx v10, v12, a1
883 ; RV32-NEXT: vsrl.vv v10, v8, v10
884 ; RV32-NEXT: vmv.v.x v12, a0
885 ; RV32-NEXT: vand.vx v12, v12, a1
886 ; RV32-NEXT: vsll.vv v8, v8, v12
887 ; RV32-NEXT: vor.vv v8, v8, v10
890 ; RV64-LABEL: shuffle_v8f32_as_i64_exact:
892 ; RV64-NEXT: li a0, 32
893 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
894 ; RV64-NEXT: vsrl.vx v10, v8, a0
895 ; RV64-NEXT: vsll.vx v8, v8, a0
896 ; RV64-NEXT: vor.vv v8, v8, v10
899 ; ZVKB-V-LABEL: shuffle_v8f32_as_i64_exact:
901 ; ZVKB-V-NEXT: vsetivli zero, 4, e64, m2, ta, ma
902 ; ZVKB-V-NEXT: vror.vi v8, v8, 32
905 ; ZVKB-ZVE32X-LABEL: shuffle_v8f32_as_i64_exact:
906 ; ZVKB-ZVE32X: # %bb.0:
907 ; ZVKB-ZVE32X-NEXT: lui a0, 8240
908 ; ZVKB-ZVE32X-NEXT: addi a0, a0, 1
909 ; ZVKB-ZVE32X-NEXT: vsetivli zero, 4, e32, m1, ta, ma
910 ; ZVKB-ZVE32X-NEXT: vmv.s.x v10, a0
911 ; ZVKB-ZVE32X-NEXT: vsext.vf4 v12, v10
912 ; ZVKB-ZVE32X-NEXT: vrgather.vv v11, v9, v12
913 ; ZVKB-ZVE32X-NEXT: vrgather.vv v10, v8, v12
914 ; ZVKB-ZVE32X-NEXT: vmv2r.v v8, v10
915 ; ZVKB-ZVE32X-NEXT: ret
916 %shuffle = shufflevector <8 x float> %v, <8 x float> poison, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6>
917 ret <8 x float> %shuffle