summaryrefslogtreecommitdiff
path: root/libc/src/math/generic/sqrtf128.cpp
AgeCommit message (Collapse)Author
2025-02-15[libc][math] Fix sqrtf128 implicit conversions. (#127154)lntue
This fixes rv32 buildbot failure from https://github.com/llvm/llvm-project/pull/122578
2025-02-13[libc][math] Improve the performance of sqrtf128. (#122578)lntue
Use a combination of polynomial approximation and Newton-Raphson iterations in 64-bit and 128-bit integers to improve the performance of sqrtf128. The correct rounding is provided by squaring the result and comparing it with the argument. Performance improvement using the newly added perf test: - My function = the improved implementation from this PR - Other function = current implementation using `libc/src/__support/FPUtil/generic/sqrt.h` ``` Performance tests with inputs in denormal range: -- My function -- Total time : 1260765265 ns Average runtime : 125.951 ns/op Ops per second : 7939623 op/s -- Other function -- Total time : 7160726518 ns Average runtime : 715.357 ns/op Ops per second : 1397902 op/s -- Average runtime ratio -- Mine / Other's : 0.176067 Performance tests with inputs in normal range: -- My function -- Total time : 373003808 ns Average runtime : 37.2631 ns/op Ops per second : 26836189 op/s -- Other function -- Total time : 7353398916 ns Average runtime : 734.605 ns/op Ops per second : 1361275 op/s -- Average runtime ratio -- Mine / Other's : 0.0507254 ``` --------- Co-authored-by: Alexei Sibidanov <sibid@uvic.ca>
2024-07-12[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98597)Petr Hosek
This is a part of #97655.
2024-07-12Revert "[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace ↵Mehdi Amini
declaration" (#98593) Reverts llvm/llvm-project#98075 bots are broken
2024-07-11[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98075)Petr Hosek
This is a part of #97655.
2024-06-13[libc][math][c23] Add f16sqrtf C23 math function (#95251)OverMighty
Part of #95250.
2024-01-24[libc] Add sqrtf128 implementation for Linux x86_64. (#79195)felixh5678
Co-authored-by: Tue Ly <lntue@google.com> Co-authored-by: Felix <felix@Dirks-MacBook-Pro.local>