HomeFreeBSD

vm_phys: use ilog2(x) instead of fls(x)-1

Description

vm_phys: use ilog2(x) instead of fls(x)-1

One of these changes saves two instructions on an amd64
GENERIC-NODEBUG build. The rest are entirely cosmetic, because the
compiler can deduce that x is nonzero, and avoid the needless test.

Reviewed by: alc
Differential Revision: https://reviews.freebsd.org/D45331

Details

Provenance
dougmAuthored on Jun 4 2024, 6:07 PM
Reviewer
alc
Differential Revision
D45331: vm_phys: use ilog2(x) instead of fls(x)-1
Parents
rG9ff1462976fc: x86: simplify ceil(log2(x)) function
Branches
Unknown
Tags
Unknown