[libc-commits] [libc] [llvm] [libc] Remove UB specializations of type traits for `BigInt` (PR #84035)
Guillaume Chatelet via libc-commits
libc-commits at lists.llvm.org
Wed Mar 6 01:58:16 PST 2024
================
@@ -579,19 +586,33 @@ struct BigInt {
return *this;
}
- LIBC_INLINE constexpr uint64_t clz() {
- uint64_t leading_zeroes = 0;
- for (size_t i = WORD_COUNT; i > 0; --i) {
- if (val[i - 1] == 0) {
- leading_zeroes += WORD_SIZE;
- } else {
- leading_zeroes += countl_zero(val[i - 1]);
+ // TODO: remove and use cpp::countl_zero below.
----------------
gchatelet wrote:
It's mostly about having a single way to do something.
Right now we have `big_int.clz()` and `cpp::countl_zero(big_int)`.
https://github.com/llvm/llvm-project/pull/84035
More information about the libc-commits
mailing list