Skip to content

Commit 9557b90

Browse files
cg_clif: support simd_ctpop
1 parent 1185a64 commit 9557b90

File tree

1 file changed

+2
-0
lines changed
  • compiler/rustc_codegen_cranelift/src/intrinsics

1 file changed

+2
-0
lines changed

compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs

+2
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
348348
| sym::simd_bswap
349349
| sym::simd_bitreverse
350350
| sym::simd_ctlz
351+
| sym::simd_ctpop
351352
| sym::simd_cttz => {
352353
intrinsic_args!(fx, args => (a); intrinsic);
353354

@@ -367,6 +368,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
367368
(ty::Uint(_) | ty::Int(_), sym::simd_bswap) => fx.bcx.ins().bswap(lane),
368369
(ty::Uint(_) | ty::Int(_), sym::simd_bitreverse) => fx.bcx.ins().bitrev(lane),
369370
(ty::Uint(_) | ty::Int(_), sym::simd_ctlz) => fx.bcx.ins().clz(lane),
371+
(ty::Uint(_) | ty::Int(_), sym::simd_ctpop) => fx.bcx.ins().popcnt(lane),
370372
(ty::Uint(_) | ty::Int(_), sym::simd_cttz) => fx.bcx.ins().ctz(lane),
371373

372374
_ => unreachable!(),

0 commit comments

Comments
 (0)