[libclc] libclc: Update log1p (PR #188186)

via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 24 00:21:15 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 cl,inc -- libclc/clc/include/clc/math/clc_ep_decl.inc libclc/clc/lib/generic/math/clc_ep.inc libclc/clc/lib/generic/math/clc_log1p.cl libclc/clc/lib/generic/math/clc_log1p.inc --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/libclc/clc/lib/generic/math/clc_log1p.cl b/libclc/clc/lib/generic/math/clc_log1p.cl
index 557bd0d14..9f6ef5c28 100644
--- a/libclc/clc/lib/generic/math/clc_log1p.cl
+++ b/libclc/clc/lib/generic/math/clc_log1p.cl
@@ -9,11 +9,11 @@
 #include "clc/clc_convert.h"
 #include "clc/float/definitions.h"
 #include "clc/internal/clc.h"
-#include "clc/math/clc_fma.h"
 #include "clc/math/clc_ep.h"
-#include "clc/math/clc_mad.h"
 #include "clc/math/clc_fabs.h"
+#include "clc/math/clc_fma.h"
 #include "clc/math/clc_log2_fast.h"
+#include "clc/math/clc_mad.h"
 #include "clc/math/math.h"
 #include "clc/relational/clc_isinf.h"
 
diff --git a/libclc/clc/lib/generic/math/clc_log1p.inc b/libclc/clc/lib/generic/math/clc_log1p.inc
index c86b5afa6..b256c87d2 100644
--- a/libclc/clc/lib/generic/math/clc_log1p.inc
+++ b/libclc/clc/lib/generic/math/clc_log1p.inc
@@ -38,11 +38,11 @@ _CLC_OVERLOAD _CLC_DEF _CLC_CONST __CLC_DOUBLEN __clc_log1p(__CLC_DOUBLEN x) {
   return z;
 }
 
-
 #elif __CLC_FPSIZE == 16
 
 _CLC_OVERLOAD _CLC_DEF _CLC_CONST __CLC_HALFN __clc_log1p(__CLC_HALFN x) {
-  __CLC_HALFN ret = __CLC_CONVERT_HALFN(__clc_log2_fast(__CLC_CONVERT_FLOATN(x) + 1.0f) * 0x1.62e430p-1f);
+  __CLC_HALFN ret = __CLC_CONVERT_HALFN(
+      __clc_log2_fast(__CLC_CONVERT_FLOATN(x) + 1.0f) * 0x1.62e430p-1f);
   __CLC_HALFN p = __clc_mad(x, x * __clc_mad(x, 0x1.555556p-2h, -0.5h), x);
   return __clc_fabs(x) < 0x1.0p-6h ? p : ret;
 }

``````````

</details>


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


More information about the cfe-commits mailing list