1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zvfh,+v \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s
4 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zvfh,+v \
5 ; RUN: -verify-machineinstrs < %s | FileCheck %s
7 declare void @llvm.vp.store.v2i8.p0(<2 x i8>, ptr, <2 x i1>, i32)
9 define void @vpstore_v2i8(<2 x i8> %val, ptr %ptr, <2 x i1> %m, i32 zeroext %evl) {
10 ; CHECK-LABEL: vpstore_v2i8:
12 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
13 ; CHECK-NEXT: vse8.v v8, (a0), v0.t
15 call void @llvm.vp.store.v2i8.p0(<2 x i8> %val, ptr %ptr, <2 x i1> %m, i32 %evl)
19 declare void @llvm.vp.store.v4i8.p0(<4 x i8>, ptr, <4 x i1>, i32)
21 define void @vpstore_v4i8(<4 x i8> %val, ptr %ptr, <4 x i1> %m, i32 zeroext %evl) {
22 ; CHECK-LABEL: vpstore_v4i8:
24 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
25 ; CHECK-NEXT: vse8.v v8, (a0), v0.t
27 call void @llvm.vp.store.v4i8.p0(<4 x i8> %val, ptr %ptr, <4 x i1> %m, i32 %evl)
31 declare void @llvm.vp.store.v8i7.v8i7.p0(<8 x i7>, ptr, <8 x i1>, i32)
33 define void @vpstore_v8i7(<8 x i7> %val, ptr %ptr, <8 x i1> %m, i32 zeroext %evl) {
34 ; CHECK-LABEL: vpstore_v8i7:
36 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
37 ; CHECK-NEXT: vse8.v v8, (a0), v0.t
39 call void @llvm.vp.store.v8i7.v8i7.p0(<8 x i7> %val, ptr %ptr, <8 x i1> %m, i32 %evl)
43 declare void @llvm.vp.store.v8i8.p0(<8 x i8>, ptr, <8 x i1>, i32)
45 define void @vpstore_v8i8(<8 x i8> %val, ptr %ptr, <8 x i1> %m, i32 zeroext %evl) {
46 ; CHECK-LABEL: vpstore_v8i8:
48 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
49 ; CHECK-NEXT: vse8.v v8, (a0), v0.t
51 call void @llvm.vp.store.v8i8.p0(<8 x i8> %val, ptr %ptr, <8 x i1> %m, i32 %evl)
55 declare void @llvm.vp.store.v2i16.p0(<2 x i16>, ptr, <2 x i1>, i32)
57 define void @vpstore_v2i16(<2 x i16> %val, ptr %ptr, <2 x i1> %m, i32 zeroext %evl) {
58 ; CHECK-LABEL: vpstore_v2i16:
60 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
61 ; CHECK-NEXT: vse16.v v8, (a0), v0.t
63 call void @llvm.vp.store.v2i16.p0(<2 x i16> %val, ptr %ptr, <2 x i1> %m, i32 %evl)
67 declare void @llvm.vp.store.v4i16.p0(<4 x i16>, ptr, <4 x i1>, i32)
69 define void @vpstore_v4i16(<4 x i16> %val, ptr %ptr, <4 x i1> %m, i32 zeroext %evl) {
70 ; CHECK-LABEL: vpstore_v4i16:
72 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
73 ; CHECK-NEXT: vse16.v v8, (a0), v0.t
75 call void @llvm.vp.store.v4i16.p0(<4 x i16> %val, ptr %ptr, <4 x i1> %m, i32 %evl)
79 declare void @llvm.vp.store.v8i16.p0(<8 x i16>, ptr, <8 x i1>, i32)
81 define void @vpstore_v8i16(<8 x i16> %val, ptr %ptr, <8 x i1> %m, i32 zeroext %evl) {
82 ; CHECK-LABEL: vpstore_v8i16:
84 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
85 ; CHECK-NEXT: vse16.v v8, (a0), v0.t
87 call void @llvm.vp.store.v8i16.p0(<8 x i16> %val, ptr %ptr, <8 x i1> %m, i32 %evl)
91 declare void @llvm.vp.store.v2i32.p0(<2 x i32>, ptr, <2 x i1>, i32)
93 define void @vpstore_v2i32(<2 x i32> %val, ptr %ptr, <2 x i1> %m, i32 zeroext %evl) {
94 ; CHECK-LABEL: vpstore_v2i32:
96 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
97 ; CHECK-NEXT: vse32.v v8, (a0), v0.t
99 call void @llvm.vp.store.v2i32.p0(<2 x i32> %val, ptr %ptr, <2 x i1> %m, i32 %evl)
103 declare void @llvm.vp.store.v4i32.p0(<4 x i32>, ptr, <4 x i1>, i32)
105 define void @vpstore_v4i32(<4 x i32> %val, ptr %ptr, <4 x i1> %m, i32 zeroext %evl) {
106 ; CHECK-LABEL: vpstore_v4i32:
108 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
109 ; CHECK-NEXT: vse32.v v8, (a0), v0.t
111 call void @llvm.vp.store.v4i32.p0(<4 x i32> %val, ptr %ptr, <4 x i1> %m, i32 %evl)
115 declare void @llvm.vp.store.v8i32.p0(<8 x i32>, ptr, <8 x i1>, i32)
117 define void @vpstore_v8i32(<8 x i32> %val, ptr %ptr, <8 x i1> %m, i32 zeroext %evl) {
118 ; CHECK-LABEL: vpstore_v8i32:
120 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
121 ; CHECK-NEXT: vse32.v v8, (a0), v0.t
123 call void @llvm.vp.store.v8i32.p0(<8 x i32> %val, ptr %ptr, <8 x i1> %m, i32 %evl)
127 declare void @llvm.vp.store.v2i64.p0(<2 x i64>, ptr, <2 x i1>, i32)
129 define void @vpstore_v2i64(<2 x i64> %val, ptr %ptr, <2 x i1> %m, i32 zeroext %evl) {
130 ; CHECK-LABEL: vpstore_v2i64:
132 ; CHECK-NEXT: vsetvli zero, a1, e64, m1, ta, ma
133 ; CHECK-NEXT: vse64.v v8, (a0), v0.t
135 call void @llvm.vp.store.v2i64.p0(<2 x i64> %val, ptr %ptr, <2 x i1> %m, i32 %evl)
139 declare void @llvm.vp.store.v4i64.p0(<4 x i64>, ptr, <4 x i1>, i32)
141 define void @vpstore_v4i64(<4 x i64> %val, ptr %ptr, <4 x i1> %m, i32 zeroext %evl) {
142 ; CHECK-LABEL: vpstore_v4i64:
144 ; CHECK-NEXT: vsetvli zero, a1, e64, m2, ta, ma
145 ; CHECK-NEXT: vse64.v v8, (a0), v0.t
147 call void @llvm.vp.store.v4i64.p0(<4 x i64> %val, ptr %ptr, <4 x i1> %m, i32 %evl)
151 declare void @llvm.vp.store.v8i64.p0(<8 x i64>, ptr, <8 x i1>, i32)
153 define void @vpstore_v8i64(<8 x i64> %val, ptr %ptr, <8 x i1> %m, i32 zeroext %evl) {
154 ; CHECK-LABEL: vpstore_v8i64:
156 ; CHECK-NEXT: vsetvli zero, a1, e64, m4, ta, ma
157 ; CHECK-NEXT: vse64.v v8, (a0), v0.t
159 call void @llvm.vp.store.v8i64.p0(<8 x i64> %val, ptr %ptr, <8 x i1> %m, i32 %evl)
163 declare void @llvm.vp.store.v2f16.p0(<2 x half>, ptr, <2 x i1>, i32)
165 define void @vpstore_v2f16(<2 x half> %val, ptr %ptr, <2 x i1> %m, i32 zeroext %evl) {
166 ; CHECK-LABEL: vpstore_v2f16:
168 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
169 ; CHECK-NEXT: vse16.v v8, (a0), v0.t
171 call void @llvm.vp.store.v2f16.p0(<2 x half> %val, ptr %ptr, <2 x i1> %m, i32 %evl)
175 declare void @llvm.vp.store.v4f16.p0(<4 x half>, ptr, <4 x i1>, i32)
177 define void @vpstore_v4f16(<4 x half> %val, ptr %ptr, <4 x i1> %m, i32 zeroext %evl) {
178 ; CHECK-LABEL: vpstore_v4f16:
180 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
181 ; CHECK-NEXT: vse16.v v8, (a0), v0.t
183 call void @llvm.vp.store.v4f16.p0(<4 x half> %val, ptr %ptr, <4 x i1> %m, i32 %evl)
187 declare void @llvm.vp.store.v8f16.p0(<8 x half>, ptr, <8 x i1>, i32)
189 define void @vpstore_v8f16(<8 x half> %val, ptr %ptr, <8 x i1> %m, i32 zeroext %evl) {
190 ; CHECK-LABEL: vpstore_v8f16:
192 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
193 ; CHECK-NEXT: vse16.v v8, (a0), v0.t
195 call void @llvm.vp.store.v8f16.p0(<8 x half> %val, ptr %ptr, <8 x i1> %m, i32 %evl)
199 declare void @llvm.vp.store.v2f32.p0(<2 x float>, ptr, <2 x i1>, i32)
201 define void @vpstore_v2f32(<2 x float> %val, ptr %ptr, <2 x i1> %m, i32 zeroext %evl) {
202 ; CHECK-LABEL: vpstore_v2f32:
204 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
205 ; CHECK-NEXT: vse32.v v8, (a0), v0.t
207 call void @llvm.vp.store.v2f32.p0(<2 x float> %val, ptr %ptr, <2 x i1> %m, i32 %evl)
211 declare void @llvm.vp.store.v4f32.p0(<4 x float>, ptr, <4 x i1>, i32)
213 define void @vpstore_v4f32(<4 x float> %val, ptr %ptr, <4 x i1> %m, i32 zeroext %evl) {
214 ; CHECK-LABEL: vpstore_v4f32:
216 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
217 ; CHECK-NEXT: vse32.v v8, (a0), v0.t
219 call void @llvm.vp.store.v4f32.p0(<4 x float> %val, ptr %ptr, <4 x i1> %m, i32 %evl)
223 declare void @llvm.vp.store.v6f32.p0(<6 x float>, ptr, <6 x i1>, i32)
225 define void @vpstore_v6f32(<6 x float> %val, ptr %ptr, <6 x i1> %m, i32 zeroext %evl) {
226 ; CHECK-LABEL: vpstore_v6f32:
228 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
229 ; CHECK-NEXT: vse32.v v8, (a0), v0.t
231 call void @llvm.vp.store.v6f32.p0(<6 x float> %val, ptr %ptr, <6 x i1> %m, i32 %evl)
235 declare void @llvm.vp.store.v8f32.p0(<8 x float>, ptr, <8 x i1>, i32)
237 define void @vpstore_v8f32(<8 x float> %val, ptr %ptr, <8 x i1> %m, i32 zeroext %evl) {
238 ; CHECK-LABEL: vpstore_v8f32:
240 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
241 ; CHECK-NEXT: vse32.v v8, (a0), v0.t
243 call void @llvm.vp.store.v8f32.p0(<8 x float> %val, ptr %ptr, <8 x i1> %m, i32 %evl)
247 declare void @llvm.vp.store.v2f64.p0(<2 x double>, ptr, <2 x i1>, i32)
249 define void @vpstore_v2f64(<2 x double> %val, ptr %ptr, <2 x i1> %m, i32 zeroext %evl) {
250 ; CHECK-LABEL: vpstore_v2f64:
252 ; CHECK-NEXT: vsetvli zero, a1, e64, m1, ta, ma
253 ; CHECK-NEXT: vse64.v v8, (a0), v0.t
255 call void @llvm.vp.store.v2f64.p0(<2 x double> %val, ptr %ptr, <2 x i1> %m, i32 %evl)
259 declare void @llvm.vp.store.v4f64.p0(<4 x double>, ptr, <4 x i1>, i32)
261 define void @vpstore_v4f64(<4 x double> %val, ptr %ptr, <4 x i1> %m, i32 zeroext %evl) {
262 ; CHECK-LABEL: vpstore_v4f64:
264 ; CHECK-NEXT: vsetvli zero, a1, e64, m2, ta, ma
265 ; CHECK-NEXT: vse64.v v8, (a0), v0.t
267 call void @llvm.vp.store.v4f64.p0(<4 x double> %val, ptr %ptr, <4 x i1> %m, i32 %evl)
271 declare void @llvm.vp.store.v8f64.p0(<8 x double>, ptr, <8 x i1>, i32)
273 define void @vpstore_v8f64(<8 x double> %val, ptr %ptr, <8 x i1> %m, i32 zeroext %evl) {
274 ; CHECK-LABEL: vpstore_v8f64:
276 ; CHECK-NEXT: vsetvli zero, a1, e64, m4, ta, ma
277 ; CHECK-NEXT: vse64.v v8, (a0), v0.t
279 call void @llvm.vp.store.v8f64.p0(<8 x double> %val, ptr %ptr, <8 x i1> %m, i32 %evl)
283 define void @vpstore_v2i8_allones_mask(<2 x i8> %val, ptr %ptr, i32 zeroext %evl) {
284 ; CHECK-LABEL: vpstore_v2i8_allones_mask:
286 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
287 ; CHECK-NEXT: vse8.v v8, (a0)
289 call void @llvm.vp.store.v2i8.p0(<2 x i8> %val, ptr %ptr, <2 x i1> splat (i1 true), i32 %evl)
293 declare void @llvm.vp.store.v32f64.p0(<32 x double>, ptr, <32 x i1>, i32)
295 define void @vpstore_v32f64(<32 x double> %val, ptr %ptr, <32 x i1> %m, i32 zeroext %evl) {
296 ; CHECK-LABEL: vpstore_v32f64:
298 ; CHECK-NEXT: li a3, 16
299 ; CHECK-NEXT: mv a2, a1
300 ; CHECK-NEXT: bltu a1, a3, .LBB24_2
301 ; CHECK-NEXT: # %bb.1:
302 ; CHECK-NEXT: li a2, 16
303 ; CHECK-NEXT: .LBB24_2:
304 ; CHECK-NEXT: vsetvli zero, a2, e64, m8, ta, ma
305 ; CHECK-NEXT: vse64.v v8, (a0), v0.t
306 ; CHECK-NEXT: addi a2, a1, -16
307 ; CHECK-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
308 ; CHECK-NEXT: vslidedown.vi v0, v0, 2
309 ; CHECK-NEXT: sltu a1, a1, a2
310 ; CHECK-NEXT: addi a1, a1, -1
311 ; CHECK-NEXT: and a1, a1, a2
312 ; CHECK-NEXT: addi a0, a0, 128
313 ; CHECK-NEXT: vsetvli zero, a1, e64, m8, ta, ma
314 ; CHECK-NEXT: vse64.v v16, (a0), v0.t
316 call void @llvm.vp.store.v32f64.p0(<32 x double> %val, ptr %ptr, <32 x i1> %m, i32 %evl)