Page MenuHomeFreeBSD

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

Authored by dougm on May 24 2024, 5:01 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Feb 18, 3:42 PM
Unknown Object (File)
Sat, Feb 14, 10:15 PM
Unknown Object (File)
Tue, Feb 10, 10:14 PM
Unknown Object (File)
Sat, Feb 7, 5:42 AM
Unknown Object (File)
Tue, Feb 3, 12:43 AM
Unknown Object (File)
Thu, Jan 29, 4:56 AM
Unknown Object (File)
Sat, Jan 24, 10:52 PM
Unknown Object (File)
Jan 20 2026, 6:04 PM
Subscribers

Details

Summary

In a GENERIC-NODEBUG kernel, each instance of using ilog2 in place of fls()-1 saves about 4 amd64 instructions, including a conditional, and 16 or so bytes.

Diff Detail

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