[libc] [llvm] [libc][math] Refactor log_bf16 to Header (PR #186618)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 14 13:01:44 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 cpp,h -- libc/shared/math/log_bf16.h libc/src/__support/math/log_bf16.h libc/shared/math.h libc/src/math/generic/log_bf16.cpp libc/test/shared/shared_math_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/math/log_bf16.h b/libc/src/__support/math/log_bf16.h
index 757507977..d4ab6b6af 100644
--- a/libc/src/__support/math/log_bf16.h
+++ b/libc/src/__support/math/log_bf16.h
@@ -134,8 +134,8 @@ LIBC_INLINE bfloat16 log_bf16(bfloat16 x) {
// Get unbiased exponent
e += x_u >> FPBits::FRACTION_LEN;
- return fputil::cast<bfloat16>(
- fputil::multiply_add(static_cast<float>(e), BF16_LOGF_2, LOG_1_PLUS_M[m]));
+ return fputil::cast<bfloat16>(fputil::multiply_add(
+ static_cast<float>(e), BF16_LOGF_2, LOG_1_PLUS_M[m]));
}
} // namespace math
``````````
</details>
https://github.com/llvm/llvm-project/pull/186618
More information about the llvm-commits
mailing list