1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v \
3 ; RUN: -verify-machineinstrs | FileCheck %s
4 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v \
5 ; RUN: -verify-machineinstrs | FileCheck %s
7 declare iXLen @llvm.riscv.vcpop.iXLen.nxv1i1(
11 define iXLen @intrinsic_vcpop_m_nxv1i1(<vscale x 1 x i1> %0, iXLen %1) nounwind {
12 ; CHECK-LABEL: intrinsic_vcpop_m_nxv1i1:
13 ; CHECK: # %bb.0: # %entry
14 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
15 ; CHECK-NEXT: vcpop.m a0, v0
18 %a = call iXLen @llvm.riscv.vcpop.iXLen.nxv1i1(
25 define iXLen @intrinsic_vcpop_m_nxv1i1_zero(<vscale x 1 x i1> %0) nounwind {
26 ; CHECK-LABEL: intrinsic_vcpop_m_nxv1i1_zero:
27 ; CHECK: # %bb.0: # %entry
28 ; CHECK-NEXT: li a0, 0
31 %a = call iXLen @llvm.riscv.vcpop.iXLen.nxv1i1(
38 declare iXLen @llvm.riscv.vcpop.mask.iXLen.nxv1i1(
43 define iXLen @intrinsic_vcpop_mask_m_nxv1i1(<vscale x 1 x i1> %0, <vscale x 1 x i1> %1, iXLen %2) nounwind {
44 ; CHECK-LABEL: intrinsic_vcpop_mask_m_nxv1i1:
45 ; CHECK: # %bb.0: # %entry
46 ; CHECK-NEXT: vmv1r.v v9, v0
47 ; CHECK-NEXT: vmv1r.v v0, v8
48 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
49 ; CHECK-NEXT: vcpop.m a0, v9, v0.t
52 %a = call iXLen @llvm.riscv.vcpop.mask.iXLen.nxv1i1(
60 define iXLen @intrinsic_vcpop_mask_m_nxv1i1_zero(<vscale x 1 x i1> %0, <vscale x 1 x i1> %1) nounwind {
61 ; CHECK-LABEL: intrinsic_vcpop_mask_m_nxv1i1_zero:
62 ; CHECK: # %bb.0: # %entry
63 ; CHECK-NEXT: li a0, 0
66 %a = call iXLen @llvm.riscv.vcpop.mask.iXLen.nxv1i1(
74 declare iXLen @llvm.riscv.vcpop.iXLen.nxv2i1(
78 define iXLen @intrinsic_vcpop_m_nxv2i1(<vscale x 2 x i1> %0, iXLen %1) nounwind {
79 ; CHECK-LABEL: intrinsic_vcpop_m_nxv2i1:
80 ; CHECK: # %bb.0: # %entry
81 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
82 ; CHECK-NEXT: vcpop.m a0, v0
85 %a = call iXLen @llvm.riscv.vcpop.iXLen.nxv2i1(
92 declare iXLen @llvm.riscv.vcpop.mask.iXLen.nxv2i1(
97 define iXLen @intrinsic_vcpop_mask_m_nxv2i1(<vscale x 2 x i1> %0, <vscale x 2 x i1> %1, iXLen %2) nounwind {
98 ; CHECK-LABEL: intrinsic_vcpop_mask_m_nxv2i1:
99 ; CHECK: # %bb.0: # %entry
100 ; CHECK-NEXT: vmv1r.v v9, v0
101 ; CHECK-NEXT: vmv1r.v v0, v8
102 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
103 ; CHECK-NEXT: vcpop.m a0, v9, v0.t
106 %a = call iXLen @llvm.riscv.vcpop.mask.iXLen.nxv2i1(
107 <vscale x 2 x i1> %0,
108 <vscale x 2 x i1> %1,
114 declare iXLen @llvm.riscv.vcpop.iXLen.nxv4i1(
118 define iXLen @intrinsic_vcpop_m_nxv4i1(<vscale x 4 x i1> %0, iXLen %1) nounwind {
119 ; CHECK-LABEL: intrinsic_vcpop_m_nxv4i1:
120 ; CHECK: # %bb.0: # %entry
121 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
122 ; CHECK-NEXT: vcpop.m a0, v0
125 %a = call iXLen @llvm.riscv.vcpop.iXLen.nxv4i1(
126 <vscale x 4 x i1> %0,
132 declare iXLen @llvm.riscv.vcpop.mask.iXLen.nxv4i1(
137 define iXLen @intrinsic_vcpop_mask_m_nxv4i1(<vscale x 4 x i1> %0, <vscale x 4 x i1> %1, iXLen %2) nounwind {
138 ; CHECK-LABEL: intrinsic_vcpop_mask_m_nxv4i1:
139 ; CHECK: # %bb.0: # %entry
140 ; CHECK-NEXT: vmv1r.v v9, v0
141 ; CHECK-NEXT: vmv1r.v v0, v8
142 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
143 ; CHECK-NEXT: vcpop.m a0, v9, v0.t
146 %a = call iXLen @llvm.riscv.vcpop.mask.iXLen.nxv4i1(
147 <vscale x 4 x i1> %0,
148 <vscale x 4 x i1> %1,
154 declare iXLen @llvm.riscv.vcpop.iXLen.nxv8i1(
158 define iXLen @intrinsic_vcpop_m_nxv8i1(<vscale x 8 x i1> %0, iXLen %1) nounwind {
159 ; CHECK-LABEL: intrinsic_vcpop_m_nxv8i1:
160 ; CHECK: # %bb.0: # %entry
161 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
162 ; CHECK-NEXT: vcpop.m a0, v0
165 %a = call iXLen @llvm.riscv.vcpop.iXLen.nxv8i1(
166 <vscale x 8 x i1> %0,
172 declare iXLen @llvm.riscv.vcpop.mask.iXLen.nxv8i1(
177 define iXLen @intrinsic_vcpop_mask_m_nxv8i1(<vscale x 8 x i1> %0, <vscale x 8 x i1> %1, iXLen %2) nounwind {
178 ; CHECK-LABEL: intrinsic_vcpop_mask_m_nxv8i1:
179 ; CHECK: # %bb.0: # %entry
180 ; CHECK-NEXT: vmv1r.v v9, v0
181 ; CHECK-NEXT: vmv1r.v v0, v8
182 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
183 ; CHECK-NEXT: vcpop.m a0, v9, v0.t
186 %a = call iXLen @llvm.riscv.vcpop.mask.iXLen.nxv8i1(
187 <vscale x 8 x i1> %0,
188 <vscale x 8 x i1> %1,
194 declare iXLen @llvm.riscv.vcpop.iXLen.nxv16i1(
198 define iXLen @intrinsic_vcpop_m_nxv16i1(<vscale x 16 x i1> %0, iXLen %1) nounwind {
199 ; CHECK-LABEL: intrinsic_vcpop_m_nxv16i1:
200 ; CHECK: # %bb.0: # %entry
201 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
202 ; CHECK-NEXT: vcpop.m a0, v0
205 %a = call iXLen @llvm.riscv.vcpop.iXLen.nxv16i1(
206 <vscale x 16 x i1> %0,
212 declare iXLen @llvm.riscv.vcpop.mask.iXLen.nxv16i1(
217 define iXLen @intrinsic_vcpop_mask_m_nxv16i1(<vscale x 16 x i1> %0, <vscale x 16 x i1> %1, iXLen %2) nounwind {
218 ; CHECK-LABEL: intrinsic_vcpop_mask_m_nxv16i1:
219 ; CHECK: # %bb.0: # %entry
220 ; CHECK-NEXT: vmv1r.v v9, v0
221 ; CHECK-NEXT: vmv1r.v v0, v8
222 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
223 ; CHECK-NEXT: vcpop.m a0, v9, v0.t
226 %a = call iXLen @llvm.riscv.vcpop.mask.iXLen.nxv16i1(
227 <vscale x 16 x i1> %0,
228 <vscale x 16 x i1> %1,
234 declare iXLen @llvm.riscv.vcpop.iXLen.nxv32i1(
238 define iXLen @intrinsic_vcpop_m_nxv32i1(<vscale x 32 x i1> %0, iXLen %1) nounwind {
239 ; CHECK-LABEL: intrinsic_vcpop_m_nxv32i1:
240 ; CHECK: # %bb.0: # %entry
241 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
242 ; CHECK-NEXT: vcpop.m a0, v0
245 %a = call iXLen @llvm.riscv.vcpop.iXLen.nxv32i1(
246 <vscale x 32 x i1> %0,
252 declare iXLen @llvm.riscv.vcpop.mask.iXLen.nxv32i1(
257 define iXLen @intrinsic_vcpop_mask_m_nxv32i1(<vscale x 32 x i1> %0, <vscale x 32 x i1> %1, iXLen %2) nounwind {
258 ; CHECK-LABEL: intrinsic_vcpop_mask_m_nxv32i1:
259 ; CHECK: # %bb.0: # %entry
260 ; CHECK-NEXT: vmv1r.v v9, v0
261 ; CHECK-NEXT: vmv1r.v v0, v8
262 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
263 ; CHECK-NEXT: vcpop.m a0, v9, v0.t
266 %a = call iXLen @llvm.riscv.vcpop.mask.iXLen.nxv32i1(
267 <vscale x 32 x i1> %0,
268 <vscale x 32 x i1> %1,
274 declare iXLen @llvm.riscv.vcpop.iXLen.nxv64i1(
278 define iXLen @intrinsic_vcpop_m_nxv64i1(<vscale x 64 x i1> %0, iXLen %1) nounwind {
279 ; CHECK-LABEL: intrinsic_vcpop_m_nxv64i1:
280 ; CHECK: # %bb.0: # %entry
281 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
282 ; CHECK-NEXT: vcpop.m a0, v0
285 %a = call iXLen @llvm.riscv.vcpop.iXLen.nxv64i1(
286 <vscale x 64 x i1> %0,
292 declare iXLen @llvm.riscv.vcpop.mask.iXLen.nxv64i1(
297 define iXLen @intrinsic_vcpop_mask_m_nxv64i1(<vscale x 64 x i1> %0, <vscale x 64 x i1> %1, iXLen %2) nounwind {
298 ; CHECK-LABEL: intrinsic_vcpop_mask_m_nxv64i1:
299 ; CHECK: # %bb.0: # %entry
300 ; CHECK-NEXT: vmv1r.v v9, v0
301 ; CHECK-NEXT: vmv1r.v v0, v8
302 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
303 ; CHECK-NEXT: vcpop.m a0, v9, v0.t
306 %a = call iXLen @llvm.riscv.vcpop.mask.iXLen.nxv64i1(
307 <vscale x 64 x i1> %0,
308 <vscale x 64 x i1> %1,