[libc-commits] [libc] [libc][stdfix] Implement `countlsfx` functions (PR #114318)

via libc-commits libc-commits at lists.llvm.org
Wed Nov 6 11:16:03 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff efc6d33be9f4b4d0f0e8d3d5f198f2616b75792b 81148c241c9da38a6b9d586fe1addb486b5de04f --extensions h,cpp -- libc/src/stdfix/countlshk.cpp libc/src/stdfix/countlshk.h libc/src/stdfix/countlshr.cpp libc/src/stdfix/countlshr.h libc/src/stdfix/countlsk.cpp libc/src/stdfix/countlsk.h libc/src/stdfix/countlslk.cpp libc/src/stdfix/countlslk.h libc/src/stdfix/countlslr.cpp libc/src/stdfix/countlslr.h libc/src/stdfix/countlsr.cpp libc/src/stdfix/countlsr.h libc/src/stdfix/countlsuhk.cpp libc/src/stdfix/countlsuhk.h libc/src/stdfix/countlsuhr.cpp libc/src/stdfix/countlsuhr.h libc/src/stdfix/countlsuk.cpp libc/src/stdfix/countlsuk.h libc/src/stdfix/countlsulk.cpp libc/src/stdfix/countlsulk.h libc/src/stdfix/countlsulr.cpp libc/src/stdfix/countlsulr.h libc/src/stdfix/countlsur.cpp libc/src/stdfix/countlsur.h libc/test/src/stdfix/CountlsTest.h libc/test/src/stdfix/countlshk_test.cpp libc/test/src/stdfix/countlshr_test.cpp libc/test/src/stdfix/countlsk_test.cpp libc/test/src/stdfix/countlslk_test.cpp libc/test/src/stdfix/countlslr_test.cpp libc/test/src/stdfix/countlsr_test.cpp libc/test/src/stdfix/countlsuhk_test.cpp libc/test/src/stdfix/countlsuhr_test.cpp libc/test/src/stdfix/countlsuk_test.cpp libc/test/src/stdfix/countlsulk_test.cpp libc/test/src/stdfix/countlsulr_test.cpp libc/test/src/stdfix/countlsur_test.cpp libc/src/__support/fixed_point/fx_bits.h libc/src/__support/fixed_point/fx_rep.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/src/__support/fixed_point/fx_rep.h b/libc/src/__support/fixed_point/fx_rep.h
index 4ec6a78e0d..b037cebc7f 100644
--- a/libc/src/__support/fixed_point/fx_rep.h
+++ b/libc/src/__support/fixed_point/fx_rep.h
@@ -296,9 +296,8 @@ template <> struct FXRep<unsigned sat accum> : FXRep<unsigned accum> {};
 template <>
 struct FXRep<unsigned long sat accum> : FXRep<unsigned long accum> {};
 
-template<typename FXRep>
-LIBC_INLINE constexpr int get_value_len() {
-  return FXRep::INTEGRAL_LEN + FXRep::FRACTION_LEN; 
+template <typename FXRep> LIBC_INLINE constexpr int get_value_len() {
+  return FXRep::INTEGRAL_LEN + FXRep::FRACTION_LEN;
 }
 
 } // namespace fixed_point
diff --git a/libc/test/src/stdfix/CountlsTest.h b/libc/test/src/stdfix/CountlsTest.h
index 67252e7ad5..859d2d6ead 100644
--- a/libc/test/src/stdfix/CountlsTest.h
+++ b/libc/test/src/stdfix/CountlsTest.h
@@ -20,7 +20,8 @@ template <typename T> class CountlsTest : public LIBC_NAMESPACE::testing::Test {
   static constexpr T one_fourth = FXRep::ONE_FOURTH();
   static constexpr T eps = FXRep::EPS();
 
-  static constexpr auto value_len = LIBC_NAMESPACE::fixed_point::get_value_len<FXRep>();
+  static constexpr auto value_len =
+      LIBC_NAMESPACE::fixed_point::get_value_len<FXRep>();
 
 public:
   typedef int (*CountlsFunc)(T);
@@ -41,7 +42,7 @@ public:
     if (10 <= static_cast<int>(max)) {
       EXPECT_EQ(FXRep::INTEGRAL_LEN - 4, func(10));
     }
-    
+
     if (static_cast<int>(min) <= -10) {
       EXPECT_EQ(FXRep::INTEGRAL_LEN - 4, func(-10));
     }

``````````

</details>


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


More information about the libc-commits mailing list