1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mtriple=riscv32 -mattr=+v,+zfh,+zvfh -verify-machineinstrs < %s | FileCheck -check-prefixes=CHECK,RV32 %s
3 ; RUN: llc -mtriple=riscv64 -mattr=+v,+zfh,+zvfh -verify-machineinstrs < %s | FileCheck -check-prefixes=CHECK,RV64 %s
5 define <5 x i8> @load_v5i8(ptr %p) {
6 ; CHECK-LABEL: load_v5i8:
8 ; CHECK-NEXT: vsetivli zero, 5, e8, mf2, ta, ma
9 ; CHECK-NEXT: vle8.v v8, (a0)
11 %x = load <5 x i8>, ptr %p
15 define <5 x i8> @load_v5i8_align1(ptr %p) {
16 ; CHECK-LABEL: load_v5i8_align1:
18 ; CHECK-NEXT: vsetivli zero, 5, e8, mf2, ta, ma
19 ; CHECK-NEXT: vle8.v v8, (a0)
21 %x = load <5 x i8>, ptr %p, align 1
25 define <6 x i8> @load_v6i8(ptr %p) {
26 ; CHECK-LABEL: load_v6i8:
28 ; CHECK-NEXT: vsetivli zero, 6, e8, mf2, ta, ma
29 ; CHECK-NEXT: vle8.v v8, (a0)
31 %x = load <6 x i8>, ptr %p
35 define <12 x i8> @load_v12i8(ptr %p) {
36 ; CHECK-LABEL: load_v12i8:
38 ; CHECK-NEXT: vsetivli zero, 12, e8, m1, ta, ma
39 ; CHECK-NEXT: vle8.v v8, (a0)
41 %x = load <12 x i8>, ptr %p
45 define <6 x i16> @load_v6i16(ptr %p) {
46 ; CHECK-LABEL: load_v6i16:
48 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
49 ; CHECK-NEXT: vle16.v v8, (a0)
51 %x = load <6 x i16>, ptr %p
55 define <6 x half> @load_v6f16(ptr %p) {
56 ; CHECK-LABEL: load_v6f16:
58 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
59 ; CHECK-NEXT: vle16.v v8, (a0)
61 %x = load <6 x half>, ptr %p
65 define <6 x float> @load_v6f32(ptr %p) {
66 ; CHECK-LABEL: load_v6f32:
68 ; CHECK-NEXT: vsetivli zero, 6, e32, m2, ta, ma
69 ; CHECK-NEXT: vle32.v v8, (a0)
71 %x = load <6 x float>, ptr %p
75 define <6 x double> @load_v6f64(ptr %p) {
76 ; CHECK-LABEL: load_v6f64:
78 ; CHECK-NEXT: vsetivli zero, 6, e64, m4, ta, ma
79 ; CHECK-NEXT: vle64.v v8, (a0)
81 %x = load <6 x double>, ptr %p
85 define <6 x i1> @load_v6i1(ptr %p) {
86 ; RV32-LABEL: load_v6i1:
88 ; RV32-NEXT: lbu a0, 0(a0)
89 ; RV32-NEXT: srli a1, a0, 5
90 ; RV32-NEXT: slli a2, a0, 27
91 ; RV32-NEXT: srli a2, a2, 31
92 ; RV32-NEXT: slli a3, a0, 28
93 ; RV32-NEXT: srli a3, a3, 31
94 ; RV32-NEXT: slli a4, a0, 29
95 ; RV32-NEXT: srli a4, a4, 31
96 ; RV32-NEXT: slli a5, a0, 30
97 ; RV32-NEXT: srli a5, a5, 31
98 ; RV32-NEXT: andi a0, a0, 1
99 ; RV32-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
100 ; RV32-NEXT: vmv.v.x v8, a0
101 ; RV32-NEXT: vslide1down.vx v8, v8, a5
102 ; RV32-NEXT: vslide1down.vx v8, v8, a4
103 ; RV32-NEXT: vslide1down.vx v8, v8, a3
104 ; RV32-NEXT: vslide1down.vx v8, v8, a2
105 ; RV32-NEXT: vslide1down.vx v8, v8, a1
106 ; RV32-NEXT: vslidedown.vi v8, v8, 2
107 ; RV32-NEXT: vand.vi v8, v8, 1
108 ; RV32-NEXT: vmsne.vi v0, v8, 0
111 ; RV64-LABEL: load_v6i1:
113 ; RV64-NEXT: lbu a0, 0(a0)
114 ; RV64-NEXT: srli a1, a0, 5
115 ; RV64-NEXT: slli a2, a0, 59
116 ; RV64-NEXT: srli a2, a2, 63
117 ; RV64-NEXT: slli a3, a0, 60
118 ; RV64-NEXT: srli a3, a3, 63
119 ; RV64-NEXT: slli a4, a0, 61
120 ; RV64-NEXT: srli a4, a4, 63
121 ; RV64-NEXT: slli a5, a0, 62
122 ; RV64-NEXT: srli a5, a5, 63
123 ; RV64-NEXT: andi a0, a0, 1
124 ; RV64-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
125 ; RV64-NEXT: vmv.v.x v8, a0
126 ; RV64-NEXT: vslide1down.vx v8, v8, a5
127 ; RV64-NEXT: vslide1down.vx v8, v8, a4
128 ; RV64-NEXT: vslide1down.vx v8, v8, a3
129 ; RV64-NEXT: vslide1down.vx v8, v8, a2
130 ; RV64-NEXT: vslide1down.vx v8, v8, a1
131 ; RV64-NEXT: vslidedown.vi v8, v8, 2
132 ; RV64-NEXT: vand.vi v8, v8, 1
133 ; RV64-NEXT: vmsne.vi v0, v8, 0
135 %x = load <6 x i1>, ptr %p
140 define <4 x i32> @exact_vlen_i32_m1(ptr %p) vscale_range(2,2) {
141 ; CHECK-LABEL: exact_vlen_i32_m1:
143 ; CHECK-NEXT: vl1re32.v v8, (a0)
145 %v = load <4 x i32>, ptr %p
149 define <16 x i8> @exact_vlen_i8_m1(ptr %p) vscale_range(2,2) {
150 ; CHECK-LABEL: exact_vlen_i8_m1:
152 ; CHECK-NEXT: vl1r.v v8, (a0)
154 %v = load <16 x i8>, ptr %p
158 define <32 x i8> @exact_vlen_i8_m2(ptr %p) vscale_range(2,2) {
159 ; CHECK-LABEL: exact_vlen_i8_m2:
161 ; CHECK-NEXT: vl2r.v v8, (a0)
163 %v = load <32 x i8>, ptr %p
167 define <128 x i8> @exact_vlen_i8_m8(ptr %p) vscale_range(2,2) {
168 ; CHECK-LABEL: exact_vlen_i8_m8:
170 ; CHECK-NEXT: vl8r.v v8, (a0)
172 %v = load <128 x i8>, ptr %p
176 define <16 x i64> @exact_vlen_i64_m8(ptr %p) vscale_range(2,2) {
177 ; CHECK-LABEL: exact_vlen_i64_m8:
179 ; CHECK-NEXT: vl8re64.v v8, (a0)
181 %v = load <16 x i64>, ptr %p