[libc-commits] [libc] [libc] Address sincosf size bloat (PR #179004)
via libc-commits
libc-commits at lists.llvm.org
Fri Jan 30 21:16:53 PST 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 -- libc/src/__support/math/sincosf.h libc/src/__support/math/sincosf_float_eval.h libc/src/__support/math/sincosf_utils.h --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/sincosf_utils.h b/libc/src/__support/math/sincosf_utils.h
index f5514bba0..b13a39999 100644
--- a/libc/src/__support/math/sincosf_utils.h
+++ b/libc/src/__support/math/sincosf_utils.h
@@ -61,8 +61,8 @@ LIBC_INLINE_VAR const double SIN_K_PI_OVER_32[64] = {
};
LIBC_INLINE void sincosf_poly_eval(int64_t k, double y, double &sin_k,
- double &cos_k, double &sin_y,
- double &cosm1_y) {
+ double &cos_k, double &sin_y,
+ double &cosm1_y) {
// After range reduction, k = round(x * 32 / pi) and y = (x * 32 / pi) - k.
// So k is an integer and -0.5 <= y <= 0.5.
// Then sin(x) = sin((k + y)*pi/32)
@@ -89,8 +89,7 @@ LIBC_INLINE void sincosf_poly_eval(int64_t k, double y, double &sin_k,
}
LIBC_INLINE void sincosf_eval(double xd, uint32_t x_abs, double &sin_k,
- double &cos_k, double &sin_y,
- double &cosm1_y) {
+ double &cos_k, double &sin_y, double &cosm1_y) {
int64_t k;
double y;
@@ -115,7 +114,7 @@ LIBC_INLINE int64_t range_reduction_sincospi(double x, double &y) {
}
LIBC_INLINE void sincospif_eval(double xd, double &sin_k, double &cos_k,
- double &sin_y, double &cosm1_y) {
+ double &sin_y, double &cosm1_y) {
double y;
int64_t k = range_reduction_sincospi(xd, y);
sincosf_poly_eval(k, y, sin_k, cos_k, sin_y, cosm1_y);
``````````
</details>
https://github.com/llvm/llvm-project/pull/179004
More information about the libc-commits
mailing list