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
F110493541: D45330.id139023.diff
Wed, Feb 19, 5:01 AM
Unknown Object (File)
Sat, Feb 15, 7:23 PM
Unknown Object (File)
Sat, Feb 15, 4:04 PM
Unknown Object (File)
Thu, Feb 13, 11:07 AM
Unknown Object (File)
Fri, Feb 7, 2:37 AM
Unknown Object (File)
Dec 14 2024, 8:36 PM
Unknown Object (File)
Dec 4 2024, 11:35 PM
Unknown Object (File)
Nov 25 2024, 7:44 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