1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < %s | FileCheck %s
3 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s | FileCheck %s
5 define void @masked_store_v1i8(<1 x i8> %val, ptr %a, <1 x i1> %mask) {
6 ; CHECK-LABEL: masked_store_v1i8:
8 ; CHECK-NEXT: vsetivli zero, 1, e8, mf8, ta, ma
9 ; CHECK-NEXT: vse8.v v8, (a0), v0.t
11 call void @llvm.masked.store.v1i8.p0(<1 x i8> %val, ptr %a, i32 8, <1 x i1> %mask)
15 define void @masked_store_v1i16(<1 x i16> %val, ptr %a, <1 x i1> %mask) {
16 ; CHECK-LABEL: masked_store_v1i16:
18 ; CHECK-NEXT: vsetivli zero, 1, e16, mf4, ta, ma
19 ; CHECK-NEXT: vse16.v v8, (a0), v0.t
21 call void @llvm.masked.store.v1i16.p0(<1 x i16> %val, ptr %a, i32 8, <1 x i1> %mask)
25 define void @masked_store_v1i32(<1 x i32> %val, ptr %a, <1 x i1> %mask) {
26 ; CHECK-LABEL: masked_store_v1i32:
28 ; CHECK-NEXT: vsetivli zero, 1, e32, mf2, ta, ma
29 ; CHECK-NEXT: vse32.v v8, (a0), v0.t
31 call void @llvm.masked.store.v1i32.p0(<1 x i32> %val, ptr %a, i32 8, <1 x i1> %mask)
35 define void @masked_store_v1i64(<1 x i64> %val, ptr %a, <1 x i1> %mask) {
36 ; CHECK-LABEL: masked_store_v1i64:
38 ; CHECK-NEXT: vsetivli zero, 1, e64, m1, ta, ma
39 ; CHECK-NEXT: vse64.v v8, (a0), v0.t
41 call void @llvm.masked.store.v1i64.p0(<1 x i64> %val, ptr %a, i32 8, <1 x i1> %mask)
45 define void @masked_store_v2i8(<2 x i8> %val, ptr %a, <2 x i1> %mask) {
46 ; CHECK-LABEL: masked_store_v2i8:
48 ; CHECK-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
49 ; CHECK-NEXT: vse8.v v8, (a0), v0.t
51 call void @llvm.masked.store.v2i8.p0(<2 x i8> %val, ptr %a, i32 8, <2 x i1> %mask)
55 define void @masked_store_v2i16(<2 x i16> %val, ptr %a, <2 x i1> %mask) {
56 ; CHECK-LABEL: masked_store_v2i16:
58 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
59 ; CHECK-NEXT: vse16.v v8, (a0), v0.t
61 call void @llvm.masked.store.v2i16.p0(<2 x i16> %val, ptr %a, i32 8, <2 x i1> %mask)
65 define void @masked_store_v2i32(<2 x i32> %val, ptr %a, <2 x i1> %mask) {
66 ; CHECK-LABEL: masked_store_v2i32:
68 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
69 ; CHECK-NEXT: vse32.v v8, (a0), v0.t
71 call void @llvm.masked.store.v2i32.p0(<2 x i32> %val, ptr %a, i32 8, <2 x i1> %mask)
75 define void @masked_store_v2i64(<2 x i64> %val, ptr %a, <2 x i1> %mask) {
76 ; CHECK-LABEL: masked_store_v2i64:
78 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
79 ; CHECK-NEXT: vse64.v v8, (a0), v0.t
81 call void @llvm.masked.store.v2i64.p0(<2 x i64> %val, ptr %a, i32 8, <2 x i1> %mask)
85 define void @masked_store_v4i8(<4 x i8> %val, ptr %a, <4 x i1> %mask) {
86 ; CHECK-LABEL: masked_store_v4i8:
88 ; CHECK-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
89 ; CHECK-NEXT: vse8.v v8, (a0), v0.t
91 call void @llvm.masked.store.v4i8.p0(<4 x i8> %val, ptr %a, i32 8, <4 x i1> %mask)
95 define void @masked_store_v4i16(<4 x i16> %val, ptr %a, <4 x i1> %mask) {
96 ; CHECK-LABEL: masked_store_v4i16:
98 ; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
99 ; CHECK-NEXT: vse16.v v8, (a0), v0.t
101 call void @llvm.masked.store.v4i16.p0(<4 x i16> %val, ptr %a, i32 8, <4 x i1> %mask)
105 define void @masked_store_v4i32(<4 x i32> %val, ptr %a, <4 x i1> %mask) {
106 ; CHECK-LABEL: masked_store_v4i32:
108 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
109 ; CHECK-NEXT: vse32.v v8, (a0), v0.t
111 call void @llvm.masked.store.v4i32.p0(<4 x i32> %val, ptr %a, i32 8, <4 x i1> %mask)
115 define void @masked_store_v4i64(<4 x i64> %val, ptr %a, <4 x i1> %mask) {
116 ; CHECK-LABEL: masked_store_v4i64:
118 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
119 ; CHECK-NEXT: vse64.v v8, (a0), v0.t
121 call void @llvm.masked.store.v4i64.p0(<4 x i64> %val, ptr %a, i32 8, <4 x i1> %mask)
125 define void @masked_store_v8i8(<8 x i8> %val, ptr %a, <8 x i1> %mask) {
126 ; CHECK-LABEL: masked_store_v8i8:
128 ; CHECK-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
129 ; CHECK-NEXT: vse8.v v8, (a0), v0.t
131 call void @llvm.masked.store.v8i8.p0(<8 x i8> %val, ptr %a, i32 8, <8 x i1> %mask)
135 define void @masked_store_v8i16(<8 x i16> %val, ptr %a, <8 x i1> %mask) {
136 ; CHECK-LABEL: masked_store_v8i16:
138 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
139 ; CHECK-NEXT: vse16.v v8, (a0), v0.t
141 call void @llvm.masked.store.v8i16.p0(<8 x i16> %val, ptr %a, i32 8, <8 x i1> %mask)
145 define void @masked_store_v8i32(<8 x i32> %val, ptr %a, <8 x i1> %mask) {
146 ; CHECK-LABEL: masked_store_v8i32:
148 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
149 ; CHECK-NEXT: vse32.v v8, (a0), v0.t
151 call void @llvm.masked.store.v8i32.p0(<8 x i32> %val, ptr %a, i32 8, <8 x i1> %mask)
155 define void @masked_store_v8i64(<8 x i64> %val, ptr %a, <8 x i1> %mask) {
156 ; CHECK-LABEL: masked_store_v8i64:
158 ; CHECK-NEXT: vsetivli zero, 8, e64, m4, ta, ma
159 ; CHECK-NEXT: vse64.v v8, (a0), v0.t
161 call void @llvm.masked.store.v8i64.p0(<8 x i64> %val, ptr %a, i32 8, <8 x i1> %mask)
165 define void @masked_store_v16i8(<16 x i8> %val, ptr %a, <16 x i1> %mask) {
166 ; CHECK-LABEL: masked_store_v16i8:
168 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
169 ; CHECK-NEXT: vse8.v v8, (a0), v0.t
171 call void @llvm.masked.store.v16i8.p0(<16 x i8> %val, ptr %a, i32 8, <16 x i1> %mask)
175 define void @masked_store_v16i16(<16 x i16> %val, ptr %a, <16 x i1> %mask) {
176 ; CHECK-LABEL: masked_store_v16i16:
178 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
179 ; CHECK-NEXT: vse16.v v8, (a0), v0.t
181 call void @llvm.masked.store.v16i16.p0(<16 x i16> %val, ptr %a, i32 8, <16 x i1> %mask)
185 define void @masked_store_v16i32(<16 x i32> %val, ptr %a, <16 x i1> %mask) {
186 ; CHECK-LABEL: masked_store_v16i32:
188 ; CHECK-NEXT: vsetivli zero, 16, e32, m4, ta, ma
189 ; CHECK-NEXT: vse32.v v8, (a0), v0.t
191 call void @llvm.masked.store.v16i32.p0(<16 x i32> %val, ptr %a, i32 8, <16 x i1> %mask)
195 define void @masked_store_v16i64(<16 x i64> %val, ptr %a, <16 x i1> %mask) {
196 ; CHECK-LABEL: masked_store_v16i64:
198 ; CHECK-NEXT: vsetivli zero, 16, e64, m8, ta, ma
199 ; CHECK-NEXT: vse64.v v8, (a0), v0.t
201 call void @llvm.masked.store.v16i64.p0(<16 x i64> %val, ptr %a, i32 8, <16 x i1> %mask)
205 define void @masked_store_v32i8(<32 x i8> %val, ptr %a, <32 x i1> %mask) {
206 ; CHECK-LABEL: masked_store_v32i8:
208 ; CHECK-NEXT: li a1, 32
209 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
210 ; CHECK-NEXT: vse8.v v8, (a0), v0.t
212 call void @llvm.masked.store.v32i8.p0(<32 x i8> %val, ptr %a, i32 8, <32 x i1> %mask)
216 define void @masked_store_v32i16(<32 x i16> %val, ptr %a, <32 x i1> %mask) {
217 ; CHECK-LABEL: masked_store_v32i16:
219 ; CHECK-NEXT: li a1, 32
220 ; CHECK-NEXT: vsetvli zero, a1, e16, m4, ta, ma
221 ; CHECK-NEXT: vse16.v v8, (a0), v0.t
223 call void @llvm.masked.store.v32i16.p0(<32 x i16> %val, ptr %a, i32 8, <32 x i1> %mask)
227 define void @masked_store_v32i32(<32 x i32> %val, ptr %a, <32 x i1> %mask) {
228 ; CHECK-LABEL: masked_store_v32i32:
230 ; CHECK-NEXT: li a1, 32
231 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
232 ; CHECK-NEXT: vse32.v v8, (a0), v0.t
234 call void @llvm.masked.store.v32i32.p0(<32 x i32> %val, ptr %a, i32 8, <32 x i1> %mask)
238 define void @masked_store_v32i64(<32 x i64> %val, ptr %a, <32 x i1> %mask) {
239 ; CHECK-LABEL: masked_store_v32i64:
241 ; CHECK-NEXT: vsetivli zero, 16, e64, m8, ta, ma
242 ; CHECK-NEXT: vse64.v v8, (a0), v0.t
243 ; CHECK-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
244 ; CHECK-NEXT: vslidedown.vi v0, v0, 2
245 ; CHECK-NEXT: addi a0, a0, 128
246 ; CHECK-NEXT: vsetivli zero, 16, e64, m8, ta, ma
247 ; CHECK-NEXT: vse64.v v16, (a0), v0.t
249 call void @llvm.masked.store.v32i64.p0(<32 x i64> %val, ptr %a, i32 8, <32 x i1> %mask)
253 define void @masked_store_v64i8(<64 x i8> %val, ptr %a, <64 x i1> %mask) {
254 ; CHECK-LABEL: masked_store_v64i8:
256 ; CHECK-NEXT: li a1, 64
257 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
258 ; CHECK-NEXT: vse8.v v8, (a0), v0.t
260 call void @llvm.masked.store.v64i8.p0(<64 x i8> %val, ptr %a, i32 8, <64 x i1> %mask)
264 define void @masked_store_v64i16(<64 x i16> %val, ptr %a, <64 x i1> %mask) {
265 ; CHECK-LABEL: masked_store_v64i16:
267 ; CHECK-NEXT: li a1, 64
268 ; CHECK-NEXT: vsetvli zero, a1, e16, m8, ta, ma
269 ; CHECK-NEXT: vse16.v v8, (a0), v0.t
271 call void @llvm.masked.store.v64i16.p0(<64 x i16> %val, ptr %a, i32 8, <64 x i1> %mask)
275 define void @masked_store_v64i32(<64 x i32> %val, ptr %a, <64 x i1> %mask) {
276 ; CHECK-LABEL: masked_store_v64i32:
278 ; CHECK-NEXT: li a1, 32
279 ; CHECK-NEXT: vsetivli zero, 4, e8, mf2, ta, ma
280 ; CHECK-NEXT: vslidedown.vi v24, v0, 4
281 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
282 ; CHECK-NEXT: vse32.v v8, (a0), v0.t
283 ; CHECK-NEXT: addi a0, a0, 128
284 ; CHECK-NEXT: vmv1r.v v0, v24
285 ; CHECK-NEXT: vse32.v v16, (a0), v0.t
287 call void @llvm.masked.store.v64i32.p0(<64 x i32> %val, ptr %a, i32 8, <64 x i1> %mask)
291 define void @masked_store_v128i8(<128 x i8> %val, ptr %a, <128 x i1> %mask) {
292 ; CHECK-LABEL: masked_store_v128i8:
294 ; CHECK-NEXT: li a1, 128
295 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
296 ; CHECK-NEXT: vse8.v v8, (a0), v0.t
298 call void @llvm.masked.store.v128i8.p0(<128 x i8> %val, ptr %a, i32 8, <128 x i1> %mask)
302 define void @masked_store_v128i16(<128 x i16> %val, ptr %a, <128 x i1> %mask) {
303 ; CHECK-LABEL: masked_store_v128i16:
305 ; CHECK-NEXT: li a1, 64
306 ; CHECK-NEXT: vsetivli zero, 8, e8, m1, ta, ma
307 ; CHECK-NEXT: vslidedown.vi v24, v0, 8
308 ; CHECK-NEXT: vsetvli zero, a1, e16, m8, ta, ma
309 ; CHECK-NEXT: vse16.v v8, (a0), v0.t
310 ; CHECK-NEXT: addi a0, a0, 128
311 ; CHECK-NEXT: vmv1r.v v0, v24
312 ; CHECK-NEXT: vse16.v v16, (a0), v0.t
314 call void @llvm.masked.store.v128i16.p0(<128 x i16> %val, ptr %a, i32 8, <128 x i1> %mask)
318 define void @masked_store_v256i8(<256 x i8> %val, ptr %a, <256 x i1> %mask) {
319 ; CHECK-LABEL: masked_store_v256i8:
321 ; CHECK-NEXT: li a2, 128
322 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
323 ; CHECK-NEXT: vlm.v v24, (a1)
324 ; CHECK-NEXT: addi a1, a0, 128
325 ; CHECK-NEXT: vse8.v v8, (a0), v0.t
326 ; CHECK-NEXT: vmv1r.v v0, v24
327 ; CHECK-NEXT: vse8.v v16, (a1), v0.t
329 call void @llvm.masked.store.v256i8.p0(<256 x i8> %val, ptr %a, i32 8, <256 x i1> %mask)