| Age | Commit message (Collapse) | Author |
|
Add tests for signaling NaNs, and fix function behavior for handling
signaling NaN input.
Fixes https://github.com/llvm/llvm-project/issues/124812
|
|
LIBC_MATH_SKIP_ACCURATE_PASS is set. (#130811)
|
|
(#130700)
|
|
|
|
This is a part of #97655.
|
|
declaration" (#98593)
Reverts llvm/llvm-project#98075
bots are broken
|
|
This is a part of #97655.
|
|
- [libc][NFC] Rename FPBits nan functions
- rename build_signaling_nan in signaling_nan
- rename build_quiet_nan to quiet_nan
|
|
- reland #79113
- Fix aarch64 RISC-V build
|
|
Reverts llvm/llvm-project#79113
It broke aarch64 build bot machines.
|
|
This patch reduces the surface of `FPBits`.
|
|
This is step 4 of
https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079
|
|
Differential Revision: https://reviews.llvm.org/D146738
|
|
floating point exceptions.
Switch math functions to use libc_errno and fix some errno and
floating point exceptions
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D145349
|
|
Set FE_OVERFLOW and FE_UNDERFLOW for expf, exp2f, exp10f, expm1f, sinhf
and coshf.
Reviewed By: sivachandra, renyichen
Differential Revision: https://reviews.llvm.org/D144340
|
|
|
|
|
|
|
|
|
|
|
|
See https://github.com/llvm/llvm-project/issues/59866
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D143098
|
|
This implements the same behavior as D141997 but makes sure that the same detection mechanism is used between CMake and source code.
Reviewed By: sivachandra, lntue
Differential Revision: https://reviews.llvm.org/D142108
|
|
try_compile instead of try_run."
The build bots are failing.
This reverts commit c84d74f5bfe810744de1268eb0516a6622e4aa73.
|
|
try_run.
This implements the same behavior as D141997 but makes sure that the same detection mechanism is used between CMake and source code.
Differential Revision: https://reviews.llvm.org/D142108
|
|
instead of try_run."
Build bots are failing.
https://lab.llvm.org/buildbot/#/builders/90/builds/44634
This reverts commit 9acc2f37bdfce08ca0c2faec03392db10d1bb7a9.
|
|
This implements the same behavior as D141997 but makes sure that the same detection mechanism is used between CMake and source code.
Differential Revision: https://reviews.llvm.org/D142108
|
|
Simplify `tanf` implementation and improve its performance.
Completely reuse the implementation of `sinf`, `cosf`, `sincosf` and use
the definition `tan(x) = sin(x)/cos(x)`.
Performance benchmark using perf tool from the CORE-MATH project on Ryzen 1700:
```
$ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh tanf
GNU libc version: 2.35
GNU libc release: stable
CORE-MATH reciprocal throughput : 18.558
System LIBC reciprocal throughput : 49.919
BEFORE:
LIBC reciprocal throughput : 36.480
LIBC reciprocal throughput : 27.217 (with `-msse4.2` flag)
LIBC reciprocal throughput : 20.205 (with `-mfma` flag)
AFTER:
LIBC reciprocal throughput : 30.337
LIBC reciprocal throughput : 21.072 (with `-msse4.2` flag)
LIBC reciprocal throughput : 15.804 (with `-mfma` flag)
$ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh tanf --latency
GNU libc version: 2.35
GNU libc release: stable
CORE-MATH latency : 56.702
System LIBC latency : 107.206
BEFORE
LIBC latency : 97.598
LIBC latency : 91.119 (with `-msse4.2` flag)
LIBC latency : 82.655 (with `-mfma` flag)
AFTER
LIBC latency : 74.560
LIBC latency : 66.575 (with `-msse4.2` flag)
LIBC latency : 61.636 (with `-mfma` flag)
```
Reviewed By: zimmermann6
Differential Revision: https://reviews.llvm.org/D134575
|
|
Update the utility functions for checking exceptional values of math
functions to use cpp::optional return values.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D133134
|
|
Implement tanf function correctly rounded for all rounding modes.
We use the range reduction that is shared with `sinf`, `cosf`, and `sincosf`:
```
k = round(x * 32/pi) and y = x * (32/pi) - k.
```
Then we use the tangent of sum formula:
```
tan(x) = tan((k + y)* pi/32) = tan((k mod 32) * pi / 32 + y * pi/32)
= (tan((k mod 32) * pi/32) + tan(y * pi/32)) / (1 - tan((k mod 32) * pi/32) * tan(y * pi/32))
```
We need to make a further reduction when `k mod 32 >= 16` due to the pole at `pi/2` of `tan(x)` function:
```
if (k mod 32 >= 16): k = k - 31, y = y - 1.0
```
And to compute the final result, we store `tan(k * pi/32)` for `k = -15..15` in a table of 32 double values,
and evaluate `tan(y * pi/32)` with a degree-11 minimax odd polynomial generated by Sollya with:
```
> P = fpminimax(tan(y * pi/32)/y, [|0, 2, 4, 6, 8, 10|], [|D...|], [0, 1.5]);
```
Performance benchmark using `perf` tool from the CORE-MATH project on Ryzen 1700:
```
$ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh tanf
CORE-MATH reciprocal throughput : 18.586
System LIBC reciprocal throughput : 50.068
LIBC reciprocal throughput : 33.823
LIBC reciprocal throughput : 25.161 (with `-msse4.2` flag)
LIBC reciprocal throughput : 19.157 (with `-mfma` flag)
$ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh tanf --latency
GNU libc version: 2.31
GNU libc release: stable
CORE-MATH latency : 55.630
System LIBC latency : 106.264
LIBC latency : 96.060
LIBC latency : 90.727 (with `-msse4.2` flag)
LIBC latency : 82.361 (with `-mfma` flag)
```
Reviewed By: orex
Differential Revision: https://reviews.llvm.org/D131715
|