[libc-commits] [libc] changed the return cast from static_cast<float16> to fputil::cast<float16> (PR #112889)
via libc-commits
libc-commits at lists.llvm.org
Fri Oct 18 04:58:24 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: wldfngrs (wldfngrs)
<details>
<summary>Changes</summary>
switch to fputil::cast to fix rounding with compiler-rt
---
Full diff: https://github.com/llvm/llvm-project/pull/112889.diff
1 Files Affected:
- (modified) libc/src/math/generic/exp10f16.cpp (+1-1)
``````````diff
diff --git a/libc/src/math/generic/exp10f16.cpp b/libc/src/math/generic/exp10f16.cpp
index f7a8ee3245eda6..006dd5c5544285 100644
--- a/libc/src/math/generic/exp10f16.cpp
+++ b/libc/src/math/generic/exp10f16.cpp
@@ -124,7 +124,7 @@ LLVM_LIBC_FUNCTION(float16, exp10f16, (float16 x)) {
// 10^x = 2^((hi + mid) * log2(10)) * 10^lo
auto [exp2_hi_mid, exp10_lo] = exp10_range_reduction(x);
- return static_cast<float16>(exp2_hi_mid * exp10_lo);
+ return fputil::cast<float16>(exp2_hi_mid * exp10_lo);
}
} // namespace LIBC_NAMESPACE_DECL
``````````
</details>
https://github.com/llvm/llvm-project/pull/112889
More information about the libc-commits
mailing list