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
F132083890: D45330.id139371.diff
Mon, Oct 13, 12:45 PM
Unknown Object (File)
Thu, Oct 9, 5:48 PM
Unknown Object (File)
Mon, Oct 6, 3:09 AM
Unknown Object (File)
Wed, Oct 1, 11:21 PM
Unknown Object (File)
Wed, Oct 1, 5:35 PM
Unknown Object (File)
Fri, Sep 26, 11:56 AM
Unknown Object (File)
Wed, Sep 24, 9:05 AM
Unknown Object (File)
Mon, Sep 22, 5:09 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