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,RV32
3 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV64
5 declare <2 x i8> @llvm.experimental.stepvector.v2i8()
7 define <2 x i8> @stepvector_v2i8() {
8 ; CHECK-LABEL: stepvector_v2i8:
10 ; CHECK-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
11 ; CHECK-NEXT: vid.v v8
13 %v = call <2 x i8> @llvm.experimental.stepvector.v2i8()
17 declare <3 x i8> @llvm.experimental.stepvector.v3i8()
19 define <3 x i8> @stepvector_v3i8() {
20 ; CHECK-LABEL: stepvector_v3i8:
22 ; CHECK-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
23 ; CHECK-NEXT: vid.v v8
25 %v = call <3 x i8> @llvm.experimental.stepvector.v3i8()
29 declare <4 x i8> @llvm.experimental.stepvector.v4i8()
31 define <4 x i8> @stepvector_v4i8() {
32 ; CHECK-LABEL: stepvector_v4i8:
34 ; CHECK-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
35 ; CHECK-NEXT: vid.v v8
37 %v = call <4 x i8> @llvm.experimental.stepvector.v4i8()
41 declare <8 x i8> @llvm.experimental.stepvector.v8i8()
43 define <8 x i8> @stepvector_v8i8() {
44 ; CHECK-LABEL: stepvector_v8i8:
46 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
47 ; CHECK-NEXT: vid.v v8
49 %v = call <8 x i8> @llvm.experimental.stepvector.v8i8()
53 declare <16 x i8> @llvm.experimental.stepvector.v16i8()
55 define <16 x i8> @stepvector_v16i8() {
56 ; CHECK-LABEL: stepvector_v16i8:
58 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
59 ; CHECK-NEXT: vid.v v8
61 %v = call <16 x i8> @llvm.experimental.stepvector.v16i8()
65 declare <2 x i16> @llvm.experimental.stepvector.v2i16()
67 define <2 x i16> @stepvector_v2i16() {
68 ; CHECK-LABEL: stepvector_v2i16:
70 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
71 ; CHECK-NEXT: vid.v v8
73 %v = call <2 x i16> @llvm.experimental.stepvector.v2i16()
77 declare <4 x i16> @llvm.experimental.stepvector.v4i16()
79 define <4 x i16> @stepvector_v4i16() {
80 ; CHECK-LABEL: stepvector_v4i16:
82 ; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
83 ; CHECK-NEXT: vid.v v8
85 %v = call <4 x i16> @llvm.experimental.stepvector.v4i16()
89 declare <8 x i16> @llvm.experimental.stepvector.v8i16()
91 define <8 x i16> @stepvector_v8i16() {
92 ; CHECK-LABEL: stepvector_v8i16:
94 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
95 ; CHECK-NEXT: vid.v v8
97 %v = call <8 x i16> @llvm.experimental.stepvector.v8i16()
101 declare <16 x i16> @llvm.experimental.stepvector.v16i16()
103 define <16 x i16> @stepvector_v16i16() {
104 ; CHECK-LABEL: stepvector_v16i16:
106 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
107 ; CHECK-NEXT: vid.v v8
109 %v = call <16 x i16> @llvm.experimental.stepvector.v16i16()
113 declare <2 x i32> @llvm.experimental.stepvector.v2i32()
115 define <2 x i32> @stepvector_v2i32() {
116 ; CHECK-LABEL: stepvector_v2i32:
118 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
119 ; CHECK-NEXT: vid.v v8
121 %v = call <2 x i32> @llvm.experimental.stepvector.v2i32()
125 declare <4 x i32> @llvm.experimental.stepvector.v4i32()
127 define <4 x i32> @stepvector_v4i32() {
128 ; CHECK-LABEL: stepvector_v4i32:
130 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
131 ; CHECK-NEXT: vid.v v8
133 %v = call <4 x i32> @llvm.experimental.stepvector.v4i32()
137 declare <8 x i32> @llvm.experimental.stepvector.v8i32()
139 define <8 x i32> @stepvector_v8i32() {
140 ; CHECK-LABEL: stepvector_v8i32:
142 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
143 ; CHECK-NEXT: vid.v v8
145 %v = call <8 x i32> @llvm.experimental.stepvector.v8i32()
149 declare <16 x i32> @llvm.experimental.stepvector.v16i32()
151 define <16 x i32> @stepvector_v16i32() {
152 ; CHECK-LABEL: stepvector_v16i32:
154 ; CHECK-NEXT: vsetivli zero, 16, e32, m4, ta, ma
155 ; CHECK-NEXT: vid.v v8
157 %v = call <16 x i32> @llvm.experimental.stepvector.v16i32()
161 declare <2 x i64> @llvm.experimental.stepvector.v2i64()
163 define <2 x i64> @stepvector_v2i64() {
164 ; RV32-LABEL: stepvector_v2i64:
166 ; RV32-NEXT: lui a0, 16
167 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
168 ; RV32-NEXT: vmv.s.x v9, a0
169 ; RV32-NEXT: vsext.vf4 v8, v9
172 ; RV64-LABEL: stepvector_v2i64:
174 ; RV64-NEXT: vsetivli zero, 2, e64, m1, ta, ma
175 ; RV64-NEXT: vid.v v8
177 %v = call <2 x i64> @llvm.experimental.stepvector.v2i64()
181 declare <4 x i64> @llvm.experimental.stepvector.v4i64()
183 define <4 x i64> @stepvector_v4i64() {
184 ; RV32-LABEL: stepvector_v4i64:
186 ; RV32-NEXT: lui a0, %hi(.LCPI14_0)
187 ; RV32-NEXT: addi a0, a0, %lo(.LCPI14_0)
188 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
189 ; RV32-NEXT: vle8.v v10, (a0)
190 ; RV32-NEXT: vsext.vf4 v8, v10
193 ; RV64-LABEL: stepvector_v4i64:
195 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
196 ; RV64-NEXT: vid.v v8
198 %v = call <4 x i64> @llvm.experimental.stepvector.v4i64()
202 declare <8 x i64> @llvm.experimental.stepvector.v8i64()
204 define <8 x i64> @stepvector_v8i64() {
205 ; RV32-LABEL: stepvector_v8i64:
207 ; RV32-NEXT: lui a0, %hi(.LCPI15_0)
208 ; RV32-NEXT: addi a0, a0, %lo(.LCPI15_0)
209 ; RV32-NEXT: vsetivli zero, 16, e32, m4, ta, ma
210 ; RV32-NEXT: vle8.v v12, (a0)
211 ; RV32-NEXT: vsext.vf4 v8, v12
214 ; RV64-LABEL: stepvector_v8i64:
216 ; RV64-NEXT: vsetivli zero, 8, e64, m4, ta, ma
217 ; RV64-NEXT: vid.v v8
219 %v = call <8 x i64> @llvm.experimental.stepvector.v8i64()
223 declare <16 x i64> @llvm.experimental.stepvector.v16i64()
225 define <16 x i64> @stepvector_v16i64() {
226 ; RV32-LABEL: stepvector_v16i64:
228 ; RV32-NEXT: li a0, 32
229 ; RV32-NEXT: lui a1, %hi(.LCPI16_0)
230 ; RV32-NEXT: addi a1, a1, %lo(.LCPI16_0)
231 ; RV32-NEXT: vsetvli zero, a0, e32, m8, ta, ma
232 ; RV32-NEXT: vle8.v v16, (a1)
233 ; RV32-NEXT: vsext.vf4 v8, v16
236 ; RV64-LABEL: stepvector_v16i64:
238 ; RV64-NEXT: vsetivli zero, 16, e64, m8, ta, ma
239 ; RV64-NEXT: vid.v v8
241 %v = call <16 x i64> @llvm.experimental.stepvector.v16i64()