Page MenuHomeFreeBSD

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

Authored by dougm on May 24 2024, 7:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 5 2024, 7:59 AM
Unknown Object (File)
Oct 4 2024, 10:56 PM
Unknown Object (File)
Sep 30 2024, 10:56 PM
Unknown Object (File)
Sep 27 2024, 7:23 PM
Unknown Object (File)
Sep 27 2024, 5:12 PM
Unknown Object (File)
Sep 5 2024, 11:11 PM
Unknown Object (File)
Sep 5 2024, 11:11 PM
Unknown Object (File)
Sep 5 2024, 11:11 PM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dougm requested review of this revision.May 24 2024, 7:33 AM
dougm created this revision.
alc added a subscriber: markj.

Please coordinate this with @markj given his lazy init change.

This revision is now accepted and ready to land.Jun 4 2024, 5:01 PM
In D45331#1037497, @alc wrote:

Please coordinate this with @markj given his lazy init change.

Please go ahead. It'll be easy to rebase past this patch and I need to retest before pushing.

This revision was automatically updated to reflect the committed changes.