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)
Sun, Apr 5, 8:51 AM
Unknown Object (File)
Mar 6 2026, 3:52 PM
Unknown Object (File)
Feb 24 2026, 2:45 PM
Unknown Object (File)
Feb 8 2026, 9:27 AM
Unknown Object (File)
Feb 7 2026, 10:35 PM
Unknown Object (File)
Jan 30 2026, 6:49 PM
Unknown Object (File)
Jan 7 2026, 11:48 PM
Unknown Object (File)
Dec 30 2025, 5:42 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.