summaryrefslogtreecommitdiff
path: root/libc/test/src/math/performance_testing
AgeCommit message (Collapse)Author
2025-07-23[libc][NFC] Add stdint.h proxy header to fix dependency issue with ↵lntue
<stdint.h> includes. (#150303) https://github.com/llvm/llvm-project/issues/149993
2025-04-24[libc][math] Improve performance test framework (#134501)Tejas Vipin
- Merges `BinaryOpSingleOutputPerf.h` and `SingleInputSingleOutputPerf.h` files into a unified `PerfTest.h` and update all performance tests to use this. - Improve the output printed to log file for tests. - Removes unused `run_diff` method and redundant `run_perf` call in `BINARY_INPUT_SINGLE_OUTPUT_PERF_EX` (previously `BINARY_OP_SINGLE_OUTPUT_PERF_EX`) - Change `BINARY_INPUT_SINGLE_OUTPUT_PERF_EX` and `SINGLE_INPUT_SINGLE_OUTPUT_PERF` to not define `main`
2025-03-31[libc][math][c23] Add hypotf16 function (#131991)Tejas Vipin
Implement hypot for Float16 along with tests.
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-09-14[libc][math] Improve fmul performance by using double-double arithmetic. ↵Job Henandez Lara
(#107517) ``` Performance tests with inputs in denormal range: -- My function -- Total time : 2731072304 ns Average runtime : 68.2767 ns/op Ops per second : 14646276 op/s -- Other function -- Total time : 3259744268 ns Average runtime : 81.4935 ns/op Ops per second : 12270913 op/s -- Average runtime ratio -- Mine / Other's : 0.837818 Performance tests with inputs in normal range: -- My function -- Total time : 93467258 ns Average runtime : 2.33668 ns/op Ops per second : 427957777 op/s -- Other function -- Total time : 637295452 ns Average runtime : 15.9324 ns/op Ops per second : 62765299 op/s -- Average runtime ratio -- Mine / Other's : 0.146662 Performance tests with inputs in normal range with exponents close to each other: -- My function -- Total time : 95764894 ns Average runtime : 2.39412 ns/op Ops per second : 417690014 op/s -- Other function -- Total time : 639866770 ns Average runtime : 15.9967 ns/op Ops per second : 62513075 op/s -- Average runtime ratio -- Mine / Other's : 0.149664 ``` --------- Co-authored-by: Tue Ly <lntue@google.com>
2024-08-29[libc][math] Add performance tests for fmul and fmull. (#106262)Job Henandez Lara
2024-08-07[libc][math][c23] Add exp10f16 C23 math function (#101588)OverMighty
Part of #95250.
2024-08-06[libc][math][c23] Add exp2f16 C23 math function (#101217)OverMighty
Part of #95250.
2024-07-31[libc][math][c23] Refactor expf16 (#101373)OverMighty
Also updates and sorts CMake target dependencies, and corrects the smoke test that expected expf16(sNaN) to return sNaN instead of aNaN, although the test still passed, as FPMatcher only checks whether both sides are NaN, not whether they're the same NaN value.
2024-07-30[libc][math][c23] Add expf16 C23 math function (#100632)OverMighty
Part of #95250.
2024-07-23[libc][math] Optimize maximum and minimum functions using builtins when ↵OverMighty
available (#100002)
2024-07-22[libc][math] Optimize copysign{,f,f16} and fabs{,f,f16} with builtins when ↵OverMighty
available (#99037)
2024-07-22[libc][CMake] Set library type of libc_diff_test_utils to STATIC (#99869)OverMighty
Fixes linker errors due to hidden symbols when running CMake with -DBUILD_SHARED_LIBS=ON.
2024-07-15[libc][math] Optimize nearest integer functions using builtins when ↵OverMighty
available (#98376)
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] Add missing dependency on `src.__support.macros.config` (#98552)Petr Hosek
We automatically inject this dependency into all object libraries that use the libc CMake functions, but `libc_diff_test_utils` uses `add_library` so we need to add this dependency manually.
2024-07-11[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98075)Petr Hosek
This is a part of #97655.
2024-07-11[libc][math] Optimize generic nearest integer functions (#98483)OverMighty
2024-06-07[libc][math][c23] Add fmodf16 C23 math function (#94629)OverMighty
Part of #93566.
2024-03-11[libc][math][c23] Add fmodl and fmodf128 math functions. (#84600)lntue
- Allow `FMod` template to have different computational types and make it work for 80-bit long double. - Switch to use `uint64_t` as the intermediate computational types for `float`, significantly reduce the latency of `fmodf` when the exponent difference is large.
2024-03-11[libc][NFC] Clean up test/src/math/differential_testing folder, renaming it ↵lntue
to performance_testing. (#84646) Removing all the diff tests.