Skip to content

Commit 2c219ce

Browse files
authored
Rollup merge of #125266 - workingjubilee:stream-plastic-love, r=RalfJung,nikic
compiler: add simd_ctpop intrinsic Fairly straightforward addition. cc `@rust-lang/opsem` new (extremely boring) intrinsic
2 parents 14134c1 + 7a53ba2 commit 2c219ce

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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)