[compiler-rt] [libc] [llvm] [compiler-rt][builtins] add libc-backed arithmetic builtins (PR #207092)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 4 13:09:12 PDT 2026


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 origin/main HEAD --extensions h,cpp -- compiler-rt/lib/builtins/adddf3.cpp compiler-rt/lib/builtins/divdf3.cpp compiler-rt/lib/builtins/divtf3.cpp compiler-rt/lib/builtins/muldf3.cpp compiler-rt/lib/builtins/multf3.cpp compiler-rt/lib/builtins/negdf2.cpp compiler-rt/lib/builtins/negsf2.cpp compiler-rt/lib/builtins/subdf3.cpp compiler-rt/lib/builtins/subtf3.cpp libc/shared/builtins/negdf2.h libc/shared/builtins/negsf2.h libc/src/__support/builtins/negdf2.h libc/src/__support/builtins/negsf2.h libc/shared/builtins.h libc/test/shared/shared_builtins_test.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/libc/src/__support/builtins/negdf2.h b/libc/src/__support/builtins/negdf2.h
index 5e9752509..9d290fc77 100644
--- a/libc/src/__support/builtins/negdf2.h
+++ b/libc/src/__support/builtins/negdf2.h
@@ -21,14 +21,14 @@
 namespace LIBC_NAMESPACE_DECL {
 namespace builtins {
 
-// Double-precision negation 
+// Double-precision negation
 // Mirrors compiler-rt's __negdf2.
 LIBC_INLINE double negdf2(double x) {
-    using FPBits = fputil::FPBits<double>;
+  using FPBits = fputil::FPBits<double>;
 
-    FPBits bits(x);
-    bits.set_sign(bits.sign().negate());
-    return bits.get_val();
+  FPBits bits(x);
+  bits.set_sign(bits.sign().negate());
+  return bits.get_val();
 }
 
 } // namespace builtins

``````````

</details>


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


More information about the llvm-commits mailing list