[libc-commits] [libc] bada922 - [libc][stdfix] Fix buildbot failure because of a typo. (#126291)

via libc-commits libc-commits at lists.llvm.org
Fri Feb 7 12:10:22 PST 2025


Author: Krishna Pandey
Date: 2025-02-07T14:10:18-06:00
New Revision: bada9220b87e73c0f4a498b82f883e17eda928d1

URL: https://github.com/llvm/llvm-project/commit/bada9220b87e73c0f4a498b82f883e17eda928d1
DIFF: https://github.com/llvm/llvm-project/commit/bada9220b87e73c0f4a498b82f883e17eda928d1.diff

LOG: [libc][stdfix] Fix buildbot failure because of a typo. (#126291)

Fix build-bot failure caused by #125356

Added: 
    

Modified: 
    libc/src/__support/fixed_point/fx_bits.h

Removed: 
    


################################################################################
diff  --git a/libc/src/__support/fixed_point/fx_bits.h b/libc/src/__support/fixed_point/fx_bits.h
index 21985e644253441..4b87a9018d67089 100644
--- a/libc/src/__support/fixed_point/fx_bits.h
+++ b/libc/src/__support/fixed_point/fx_bits.h
@@ -187,12 +187,11 @@ countls(T f) {
   constexpr int CONTAIN_LEN = cpp::numeric_limits<BitType>::digits;
   constexpr int PADDING_LEN = CONTAIN_LEN - FXRep::TOTAL_LEN;
 
-  if constexpr (FXRep::SIGN_LEN != 0) {
-    if (x < 0)
-      x = bit_not(x);
-  }
+  if constexpr (FXRep::SIGN_LEN != 0)
+    if (f < 0)
+      f = bit_not(f);
 
-  BitType value_bits = FXBits(x)::get_bits();
+  BitType value_bits = FXBits(f)::get_bits();
   return cpp::countl_zero(value_bits) - PADDING_LEN;
 }
 


        


More information about the libc-commits mailing list