]> git.lizzy.rs Git - rust.git/commit - src/tools/rust-analyzer
Rollup merge of #92747 - swenson:bignum-bit-length-optimization, r=scottmcm
authorMatthias Krüger <matthias.krueger@famsik.de>
Sat, 15 Jan 2022 10:28:22 +0000 (11:28 +0100)
committerGitHub <noreply@github.com>
Sat, 15 Jan 2022 10:28:22 +0000 (11:28 +0100)
commitf511360fd29e426c4a24ebde038f5bfbfcf93f88
treebdb41b553f0998d6a77ff21c7877a7546477b74b
parent38c22af0153cf8f920c01ef04493e8878401fd18
parent0589cace8c943d40a60b7356d8c772baf2879cee
Rollup merge of #92747 - swenson:bignum-bit-length-optimization, r=scottmcm

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.