[libc-commits] [libc] [llvm] [libc] Remove UB specializations of type traits for `BigInt` (PR #84035)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Tue Mar 5 08:49:20 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.
----------------
nickdesaulniers wrote:

What was the issue encountered with using them?

https://github.com/llvm/llvm-project/pull/84035


More information about the libc-commits mailing list