1
Fork 0

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
This commit is contained in:
Matthias Krüger 2024-05-21 12:47:06 +02:00 committed by GitHub
commit fd975f75fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 95 additions and 40 deletions

View file

@ -348,6 +348,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
| sym::simd_bswap
| sym::simd_bitreverse
| sym::simd_ctlz
| sym::simd_ctpop
| sym::simd_cttz => {
intrinsic_args!(fx, args => (a); intrinsic);
@ -367,6 +368,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
(ty::Uint(_) | ty::Int(_), sym::simd_bswap) => fx.bcx.ins().bswap(lane),
(ty::Uint(_) | ty::Int(_), sym::simd_bitreverse) => fx.bcx.ins().bitrev(lane),
(ty::Uint(_) | ty::Int(_), sym::simd_ctlz) => fx.bcx.ins().clz(lane),
(ty::Uint(_) | ty::Int(_), sym::simd_ctpop) => fx.bcx.ins().popcnt(lane),
(ty::Uint(_) | ty::Int(_), sym::simd_cttz) => fx.bcx.ins().ctz(lane),
_ => unreachable!(),