[libc-commits] [libc] [libc][math]fadd implementation (PR #99694)

via libc-commits libc-commits at lists.llvm.org
Fri Jul 19 12:59:53 PDT 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 b1fd6f0996a9d6e6ebfa0cc3df0fe499c5ccdf65 ef487a5327f53054f59fe97247c32f4f83c65b53 --extensions h,cpp -- libc/src/math/fadd.h libc/src/math/generic/fadd.cpp libc/test/src/math/fadd_test.cpp libc/test/src/math/smoke/fadd_test.cpp
``````````

</details>

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

``````````diff
diff --git a/libc/src/math/fadd.h b/libc/src/math/fadd.h
index 701834cc2e..ec3ce18bb6 100644
--- a/libc/src/math/fadd.h
+++ b/libc/src/math/fadd.h
@@ -12,9 +12,9 @@
 #define LLVM_LIBC_SRC_MATH_FADD_H
 
 namespace LIBC_NAMESPACE_DECL {
-    
+
 float fadd(double x, double y);
 
-} // namesapce LIBC_NAMESPACE_DECL 
+} // namespace LIBC_NAMESPACE_DECL
 
 #endif // LLVM_LIBC_SRC_MATH_FADD_H
diff --git a/libc/src/math/generic/fadd.cpp b/libc/src/math/generic/fadd.cpp
index 966954ade8..66e5188cbc 100644
--- a/libc/src/math/generic/fadd.cpp
+++ b/libc/src/math/generic/fadd.cpp
@@ -5,19 +5,16 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-  
+
 #include "src/math/fadd.h"
-#include "src/__support/macros/config.h"
 #include "src/__support/FPUtil/generic/add_sub.h"
 #include "src/__support/common.h"
-
+#include "src/__support/macros/config.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
 LLVM_LIBC_FUNCTION(float, fadd, (double x, double y)) {
-    return fputil::generic::add<float>(x,y);
-    
+  return fputil::generic::add<float>(x, y);
 }
 
-
-} // namespace LIBC_NAMESPACE_DECLS
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/test/src/math/smoke/fadd_test.cpp b/libc/test/src/math/smoke/fadd_test.cpp
index 24f53dcbd4..fe9ac8b252 100644
--- a/libc/test/src/math/smoke/fadd_test.cpp
+++ b/libc/test/src/math/smoke/fadd_test.cpp
@@ -10,5 +10,4 @@
 
 #include "src/math/fadd.h"
 
-
 LIST_ADD_TESTS(float, double, LIBC_NAMESPACE::fadd)

``````````

</details>


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


More information about the libc-commits mailing list