Page MenuHomeFreeBSD

Use fls to avoid a loop in isqrt
ClosedPublic

Authored by dougm on Apr 30 2019, 6:12 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 14, 12:11 AM
Unknown Object (File)
Sep 17 2025, 12:26 PM
Unknown Object (File)
Sep 16 2025, 5:23 AM
Unknown Object (File)
Sep 14 2025, 1:23 AM
Unknown Object (File)
Sep 4 2025, 8:03 AM
Unknown Object (File)
Sep 4 2025, 7:54 AM
Unknown Object (File)
Aug 30 2025, 12:12 AM
Unknown Object (File)
Aug 14 2025, 4:33 PM
Subscribers

Details

Summary

fls() should find the most significant bit of an int faster than a linear search can, so use it to avoid a linear search in isqrt.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable