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 --check-prefixes=CHECK
4 declare <vscale x 2 x i64> @llvm.bitreverse.nxv2i64(<vscale x 2 x i64>)
6 define i32 @splat_vector_split_i64() {
7 ; CHECK-LABEL: splat_vector_split_i64:
9 ; CHECK-NEXT: addi sp, sp, -16
10 ; CHECK-NEXT: .cfi_def_cfa_offset 16
11 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
12 ; CHECK-NEXT: vmv.v.i v10, 3
13 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
14 ; CHECK-NEXT: vmv.v.i v8, 0
15 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, tu, ma
16 ; CHECK-NEXT: vslideup.vi v8, v10, 3
17 ; CHECK-NEXT: sw zero, 12(sp)
18 ; CHECK-NEXT: lui a0, 1044480
19 ; CHECK-NEXT: sw a0, 8(sp)
20 ; CHECK-NEXT: li a0, 56
21 ; CHECK-NEXT: vsetvli a1, zero, e64, m2, ta, ma
22 ; CHECK-NEXT: vsrl.vx v10, v8, a0
23 ; CHECK-NEXT: li a1, 40
24 ; CHECK-NEXT: vsrl.vx v12, v8, a1
25 ; CHECK-NEXT: lui a2, 16
26 ; CHECK-NEXT: addi a2, a2, -256
27 ; CHECK-NEXT: vand.vx v12, v12, a2
28 ; CHECK-NEXT: vor.vv v10, v12, v10
29 ; CHECK-NEXT: vsrl.vi v12, v8, 24
30 ; CHECK-NEXT: addi a3, sp, 8
31 ; CHECK-NEXT: vlse64.v v14, (a3), zero
32 ; CHECK-NEXT: lui a3, 4080
33 ; CHECK-NEXT: vand.vx v12, v12, a3
34 ; CHECK-NEXT: vsrl.vi v16, v8, 8
35 ; CHECK-NEXT: vand.vv v16, v16, v14
36 ; CHECK-NEXT: vor.vv v12, v16, v12
37 ; CHECK-NEXT: vor.vv v10, v12, v10
38 ; CHECK-NEXT: vand.vv v12, v8, v14
39 ; CHECK-NEXT: vsll.vi v12, v12, 8
40 ; CHECK-NEXT: vand.vx v14, v8, a3
41 ; CHECK-NEXT: vsll.vi v14, v14, 24
42 ; CHECK-NEXT: vor.vv v12, v14, v12
43 ; CHECK-NEXT: vsll.vx v14, v8, a0
44 ; CHECK-NEXT: vand.vx v8, v8, a2
45 ; CHECK-NEXT: vsll.vx v8, v8, a1
46 ; CHECK-NEXT: vor.vv v8, v14, v8
47 ; CHECK-NEXT: vor.vv v8, v8, v12
48 ; CHECK-NEXT: vor.vv v8, v8, v10
49 ; CHECK-NEXT: vsrl.vi v10, v8, 4
50 ; CHECK-NEXT: lui a0, 61681
51 ; CHECK-NEXT: addi a0, a0, -241
52 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
53 ; CHECK-NEXT: vmv.v.x v12, a0
54 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
55 ; CHECK-NEXT: vand.vv v10, v10, v12
56 ; CHECK-NEXT: vand.vv v8, v8, v12
57 ; CHECK-NEXT: vsll.vi v8, v8, 4
58 ; CHECK-NEXT: vor.vv v8, v10, v8
59 ; CHECK-NEXT: vsrl.vi v10, v8, 2
60 ; CHECK-NEXT: lui a0, 209715
61 ; CHECK-NEXT: addi a0, a0, 819
62 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
63 ; CHECK-NEXT: vmv.v.x v12, a0
64 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
65 ; CHECK-NEXT: vand.vv v10, v10, v12
66 ; CHECK-NEXT: vand.vv v8, v8, v12
67 ; CHECK-NEXT: vsll.vi v8, v8, 2
68 ; CHECK-NEXT: vor.vv v8, v10, v8
69 ; CHECK-NEXT: vsrl.vi v10, v8, 1
70 ; CHECK-NEXT: lui a0, 349525
71 ; CHECK-NEXT: addi a0, a0, 1365
72 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
73 ; CHECK-NEXT: vmv.v.x v12, a0
74 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
75 ; CHECK-NEXT: vand.vv v10, v10, v12
76 ; CHECK-NEXT: vand.vv v8, v8, v12
77 ; CHECK-NEXT: vadd.vv v8, v8, v8
78 ; CHECK-NEXT: vor.vv v8, v10, v8
79 ; CHECK-NEXT: vslidedown.vi v8, v8, 3
80 ; CHECK-NEXT: vmv.x.s a0, v8
81 ; CHECK-NEXT: addi sp, sp, 16
83 %1 = insertelement <vscale x 2 x i64> zeroinitializer, i64 3, i64 3
84 %2 = tail call <vscale x 2 x i64> @llvm.bitreverse.nxv2i64(<vscale x 2 x i64> %1)
85 %3 = extractelement <vscale x 2 x i64> %2, i32 3
86 %4 = trunc i64 %3 to i32