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)
Sep 18 2024, 3:22 AM
Unknown Object (File)
Sep 17 2024, 2:23 PM
Unknown Object (File)
Sep 11 2024, 9:06 AM
Unknown Object (File)
Sep 8 2024, 8:10 PM
Unknown Object (File)
Sep 8 2024, 4:09 PM
Unknown Object (File)
Sep 8 2024, 6:20 AM
Unknown Object (File)
Sep 8 2024, 5:50 AM
Unknown Object (File)
Sep 1 2024, 6:56 AM
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

Lint
Lint Skipped
Unit
Tests Skipped