Skip to content

Commit 4a4380b

Browse files
committed
Minor edits.
1 parent 1bbe409 commit 4a4380b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/s2/util/math/exactfloat/bignum.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ int bit_width(const Bignum& a) {
149149

150150
// Bit width is the bits in the least significant bigits + bit width of
151151
// the most significant word.
152-
const int msw_width =
153-
(Bignum::kBigitBits - absl::countl_zero(a.bigits_.back()));
152+
const int msw_width = absl::bit_width(a.bigits_.back());
154153
const int lsw_width = (a.bigits_.size() - 1) * Bignum::kBigitBits;
155154
return msw_width + lsw_width;
156155
}
@@ -291,7 +290,8 @@ inline Bigit AddBigit(Bigit a, Bigit b, Bigit* absl_nonnull carry) {
291290
// https://stackoverflow.com/questions/33690791
292291
//
293292
// Godbolt link for comparison:
294-
// https://godbolt.org/z/cGnnfMbMn
293+
// https://godbolt.org/z/cGnnfMbMn (no intrinsics)
294+
// https://godbolt.org/z/jnM1Y3Tjs (intrinsics)
295295
#ifdef __x86_64__
296296
static_assert(sizeof(Bigit) == sizeof(unsigned long long));
297297
Bigit out;

0 commit comments

Comments
 (0)