[libc-commits] [libc] [llvm] [libc][NFC] Refactor FPBits and remove LongDoubleBits specialization (PR #78192)

via libc-commits libc-commits at lists.llvm.org
Mon Jan 15 09:05:01 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 39b2104b4a4e0990eddc763eab99b28e8deab953 e9b580c29719c71d7ed21b621d96460892ec8675 -- libc/src/__support/FPUtil/FPBits.h libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h libc/test/src/__support/FPUtil/fpbits_test.cpp libc/test/utils/FPUtil/x86_long_double_test.cpp
``````````

</details>

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

``````````diff
diff --git a/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h b/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h
index b6e56b4599..03e2633723 100644
--- a/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h
+++ b/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h
@@ -61,7 +61,8 @@ LIBC_INLINE long double nextafter(long double from, long double to) {
         from_bits.set_biased_exponent(from_bits.get_biased_exponent() + 1);
         if (from_bits.is_inf())
           raise_except_if_required(FE_OVERFLOW | FE_INEXACT);
-        return from_bits.get_val();;
+        return from_bits.get_val();
+        ;
       } else {
         ++int_val;
       }
@@ -75,7 +76,8 @@ LIBC_INLINE long double nextafter(long double from, long double to) {
         // from == 0 is handled separately so decrementing the exponent will not
         // lead to underflow.
         from_bits.set_biased_exponent(from_bits.get_biased_exponent() - 1);
-        return from_bits.get_val();;
+        return from_bits.get_val();
+        ;
       } else {
         --int_val;
       }
@@ -94,7 +96,8 @@ LIBC_INLINE long double nextafter(long double from, long double to) {
         // from == 0 is handled separately so decrementing the exponent will not
         // lead to underflow.
         from_bits.set_biased_exponent(from_bits.get_biased_exponent() - 1);
-        return from_bits.get_val();;
+        return from_bits.get_val();
+        ;
       } else {
         --int_val;
       }
@@ -109,7 +112,8 @@ LIBC_INLINE long double nextafter(long double from, long double to) {
         from_bits.set_biased_exponent(from_bits.get_biased_exponent() + 1);
         if (from_bits.is_inf())
           raise_except_if_required(FE_OVERFLOW | FE_INEXACT);
-        return from_bits.get_val();;
+        return from_bits.get_val();
+        ;
       } else {
         ++int_val;
       }

``````````

</details>


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


More information about the libc-commits mailing list