Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplification of BigNum::bit_length #92747

Merged
merged 2 commits into from
Jan 15, 2022

Commits on Jan 10, 2022

  1. Simplification of BigNum::bit_length

    As indicated in the comment, the BigNum::bit_length function could be
    optimized by using CLZ, which is often a single instruction instead a
    loop.
    
    I think the code is also simpler now without the loop.
    
    I added some additional tests for Big8x3 and Big32x40 to ensure that
    there were no regressions.
    swenson committed Jan 10, 2022
    Configuration menu
    Copy the full SHA
    424f38f View commit details
    Browse the repository at this point in the history
  2. Simplify BigNum::bit_length() with log2()

    Thank you to @scottmcm for suggesting the handy `log2()` function.
    swenson committed Jan 10, 2022
    Configuration menu
    Copy the full SHA
    0589cac View commit details
    Browse the repository at this point in the history