Page MenuHomeFreeBSD

roundup_pow_of_two: don't take the log of it
ClosedPublic

Authored by dougm on Sep 28 2024, 12:02 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 22, 9:13 PM
Unknown Object (File)
Thu, May 21, 4:44 PM
Unknown Object (File)
Thu, May 21, 11:34 AM
Unknown Object (File)
Thu, May 21, 8:44 AM
Unknown Object (File)
Tue, May 19, 5:32 AM
Unknown Object (File)
Mon, May 11, 7:47 PM
Unknown Object (File)
Mon, May 11, 7:38 PM
Unknown Object (File)
May 4 2026, 4:34 PM
Subscribers

Details

Summary

Based on the definitions, ilog2(roundup_pow_of_two(x)) == order_base_2(x). Replace the former with the latter in a few places to save a few calculations.

Diff Detail

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

Event Timeline

dougm created this revision.
bz added a subscriber: kib.

Add @kib in the hope that he's maintaining the mlx* bits these days.

This revision is now accepted and ready to land.Sep 28 2024, 11:40 AM
This revision was automatically updated to reflect the committed changes.