History log of /llvm-project-15.0.7/libc/utils/MPFRWrapper/MPFRUtils.cpp (Results 1 – 25 of 46)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init
# 04c681d1 13-Jul-2022 Alex Brachet <[email protected]>

[libc] Specify rounding mode for strto[f|d] tests

The specified rounding mode will be used and restored
to what it was before the test ran.

Additionally, it moves ForceRoundingMode and RoundingMode

[libc] Specify rounding mode for strto[f|d] tests

The specified rounding mode will be used and restored
to what it was before the test ran.

Additionally, it moves ForceRoundingMode and RoundingMode
out of MPFRUtils to be used in more places.

Differential Revision: https://reviews.llvm.org/D129685

show more ...


Revision tags: llvmorg-14.0.6, llvmorg-14.0.5
# b8e8012a 06-Jun-2022 Kirill Okhotnikov <[email protected]>

[libc][math] fmod/fmodf implementation.

This is a implementation of find remainder fmod function from standard libm.
The underline algorithm is developed by myself, but probably it was first
invente

[libc][math] fmod/fmodf implementation.

This is a implementation of find remainder fmod function from standard libm.
The underline algorithm is developed by myself, but probably it was first
invented before.
Some features of the implementation:
1. The code is written on more-or-less modern C++.
2. One general implementation for both float and double precision numbers.
3. Spitted platform/architecture dependent and independent code and tests.
4. Tests covers 100% of the code for both float and double numbers. Tests cases with NaN/Inf etc is copied from glibc.
5. The new implementation in general 2-4 times faster for “regular” x,y values. It can be 20 times faster for x/y huge value, but can also be 2 times slower for double denormalized range (according to perf tests provided).
6. Two different implementation of division loop are provided. In some platforms division can be very time consuming operation. Depend on platform it can be 3-10 times slower than multiplication.

Performance tests:

The test is based on core-math project (https://gitlab.inria.fr/core-math/core-math). By Tue Ly suggestion I took hypot function and use it as template for fmod. Preserving all test cases.

`./check.sh <--special|--worst> fmodf` passed.
`CORE_MATH_PERF_MODE=rdtsc ./perf.sh fmodf` results are

```
GNU libc version: 2.35
GNU libc release: stable
21.166 <-- FPU
51.031 <-- current glibc
37.659 <-- this fmod version.
```

show more ...


Revision tags: llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1
# c28a522f 07-Feb-2022 Guillaume Chatelet <[email protected]>

[libc][NFC] moving template specialization outside class declaration

This is necessary to get llvm-libc compile with GCC.
This patch is extracted from D119002.

Differential Revision: https://review

[libc][NFC] moving template specialization outside class declaration

This is necessary to get llvm-libc compile with GCC.
This patch is extracted from D119002.

Differential Revision: https://reviews.llvm.org/D119142

show more ...


# 9e7688c7 04-Feb-2022 Tue Ly <[email protected]>

[libc] Implement log1pf correctly rounded to all rounding modes.

Implement log1pf correctly rounded to all rounding modes relying on logf implementation for exponent > 2^(-8).

Reviewed By: sivachan

[libc] Implement log1pf correctly rounded to all rounding modes.

Implement log1pf correctly rounded to all rounding modes relying on logf implementation for exponent > 2^(-8).

Reviewed By: sivachandra, zimmermann6

Differential Revision: https://reviews.llvm.org/D118962

show more ...


Revision tags: llvmorg-15-init
# e581841e 25-Jan-2022 Tue Ly <[email protected]>

[libc] Implement log10f correctly rounded for all rounding modes.

Based on RLIBM implementation similar to logf and log2f. Most of the exceptional inputs are the exact powers of 10.

Reviewed By: s

[libc] Implement log10f correctly rounded for all rounding modes.

Based on RLIBM implementation similar to logf and log2f. Most of the exceptional inputs are the exact powers of 10.

Reviewed By: sivachandra, zimmermann6, santoshn, jpl169

Differential Revision: https://reviews.llvm.org/D118093

show more ...


Revision tags: llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2
# 63d2df00 15-Dec-2021 Tue Ly <[email protected]>

[libc] Implement correctly rounded log2f based on RLIBM library.

Implement log2f based on RLIBM library correctly rounded for all rounding modes.

Reviewed By: sivachandra, michaelrj, santoshn, jpl1

[libc] Implement correctly rounded log2f based on RLIBM library.

Implement log2f based on RLIBM library correctly rounded for all rounding modes.

Reviewed By: sivachandra, michaelrj, santoshn, jpl169, zimmermann6

Differential Revision: https://reviews.llvm.org/D115828

show more ...


# c386d6eb 14-Jan-2022 Tue Ly <[email protected]>

[libc] Fix precision constants for long double in MPFRUtils.cpp.


# 8cd81274 11-Jan-2022 Tue Ly <[email protected]>

[libc] Add multithreading support for exhaustive testing and MPFRUtils.

Add threading support for exhaustive testing and MPFRUtils.

Reviewed By: sivachandra

Differential Revision: https://reviews.

[libc] Add multithreading support for exhaustive testing and MPFRUtils.

Add threading support for exhaustive testing and MPFRUtils.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D117028

show more ...


# cce65077 07-Jan-2022 Tue Ly <[email protected]>

[libc] Add rounding mode support for MPFR testing macros.

Add an extra argument for rounding mode to EXPECT_MPFR_MATCH and ASSERT_MPFR_MATCH macros.

Reviewed By: sivachandra, michaelrj

Differentia

[libc] Add rounding mode support for MPFR testing macros.

Add an extra argument for rounding mode to EXPECT_MPFR_MATCH and ASSERT_MPFR_MATCH macros.

Reviewed By: sivachandra, michaelrj

Differential Revision: https://reviews.llvm.org/D116777

show more ...


# 60509623 23-Dec-2021 Siva Chandra Reddy <[email protected]>

[libc][obvious] Fix style of MPFRWrapper.


# d08a801b 06-Dec-2021 Tue Ly <[email protected]>

[libc] Implement correctly rounded logf based on RLIBM library.

Implement correctly rounded logf based on RLIBM library: https://people.cs.rutgers.edu/~sn349/rlibm/.

Reviewed By: sivachandra, santo

[libc] Implement correctly rounded logf based on RLIBM library.

Implement correctly rounded logf based on RLIBM library: https://people.cs.rutgers.edu/~sn349/rlibm/.

Reviewed By: sivachandra, santoshn, jpl169, zimmermann6

Differential Revision: https://reviews.llvm.org/D115408

show more ...


Revision tags: llvmorg-13.0.1-rc1
# 1c92911e 19-Nov-2021 Michael Jones <[email protected]>

[libc] apply new lint rules

This patch applies the lint rules described in the previous patch. There
was also a significant amount of effort put into manually fixing things,
since all of the templat

[libc] apply new lint rules

This patch applies the lint rules described in the previous patch. There
was also a significant amount of effort put into manually fixing things,
since all of the templated functions, or structs defined in /spec, were
not updated and had to be handled manually.

Reviewed By: sivachandra, lntue

Differential Revision: https://reviews.llvm.org/D114302

show more ...


# 32568fc9 01-Dec-2021 Tue Ly <[email protected]>

[libc] Fix a bug in MPFRUtils making ULP values off by 2^(-mantissaWidth).

Fix a bug in MPFRUtils making ULP values off by 2^(-mantissaWidth) and incorrect eps for denormal numbers.

Differential Re

[libc] Fix a bug in MPFRUtils making ULP values off by 2^(-mantissaWidth).

Fix a bug in MPFRUtils making ULP values off by 2^(-mantissaWidth) and incorrect eps for denormal numbers.

Differential Revision: https://reviews.llvm.org/D114878

show more ...


# 0aea170b 02-Nov-2021 Guillaume Chatelet <[email protected]>

[libc] Add more robust compile time architecture detection

We may want to restrict the detected platforms to only `x86_64` and `aarch64`.
There are still custom detection in api.td but I don't think

[libc] Add more robust compile time architecture detection

We may want to restrict the detected platforms to only `x86_64` and `aarch64`.
There are still custom detection in api.td but I don't think we can handle these:
- config/linux/api.td:205
- config/linux/api.td:199

Differential Revision: https://reviews.llvm.org/D112818

show more ...


# fe953b15 29-Oct-2021 Guillaume Chatelet <[email protected]>

Revert "[libc] Add more robust compile time architecture detection"

This reverts commit a72e2499865b55cb007b63673100c06cc85faf97.


# a72e2499 29-Oct-2021 Guillaume Chatelet <[email protected]>

[libc] Add more robust compile time architecture detection

We may want to restrict the detected platforms to only `x86_64` and `aarch64`.
There are still custom detection in api.td but I don't think

[libc] Add more robust compile time architecture detection

We may want to restrict the detected platforms to only `x86_64` and `aarch64`.
There are still custom detection in api.td but I don't think we can handle these:
- config/linux/api.td:205
- config/linux/api.td:199

Differential Revision: https://reviews.llvm.org/D112818

show more ...


# 6c3f53c7 27-Oct-2021 Siva Chandra Reddy <[email protected]>

[libc][NFC] Move test related pieces from FPUtil to util/UnitTest.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D112673


# f362aea4 27-Oct-2021 Siva Chandra Reddy <[email protected]>

[libc][NFC] Move utils/CPP to src/__support/CPP.

The idea is to move all pieces related to the actual libc sources to the
"src" directory. This allows downstream users to ship and build just the
"sr

[libc][NFC] Move utils/CPP to src/__support/CPP.

The idea is to move all pieces related to the actual libc sources to the
"src" directory. This allows downstream users to ship and build just the
"src" directory.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D112653

show more ...


Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2
# ca6b3542 04-Jun-2021 Siva Chandra Reddy <[email protected]>

[libc] Add range reduction functions based on Paine and Hanek algorithm.

These functions will be used in a future patch to implement
trigonometric functions. Unit tests have been added but to the
li

[libc] Add range reduction functions based on Paine and Hanek algorithm.

These functions will be used in a future patch to implement
trigonometric functions. Unit tests have been added but to the
libc-long-running-tests suite. The unit tests long running because we
compare against MPFR computations performed at 1280 bits of precision.

Some cleanups or elimination of repeated patterns can be done as follow
up changes.

Differential Revision: https://reviews.llvm.org/D104817

show more ...


# c120edc7 05-Aug-2021 Michael Jones <[email protected]>

[libc][nfc] move ctype_utils and FPUtils to __support

Some ctype functions are called from other libc functions (e.g. isspace
is used in atoi). By moving ctype_utils.h to __support it becomes easier

[libc][nfc] move ctype_utils and FPUtils to __support

Some ctype functions are called from other libc functions (e.g. isspace
is used in atoi). By moving ctype_utils.h to __support it becomes easier
to include just the implementations of these functions. For these
reasons the implementation for isspace was moved into
ctype_utils as well.

FPUtils was moved to simplify the build order, and to clarify which
files are a part of the actual libc.

Many files were modified to accomodate these changes, mostly changing
the #include paths.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D107600

show more ...


# dba74c68 01-Jul-2021 Siva Chandra Reddy <[email protected]>

[libc] Make ULP error reflect the bit distance more closely.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D105334


# d5700bb6 19-Jun-2021 Siva Chandra Reddy <[email protected]>

[libc] Calculate ulp error after rounding MPFR result to the result type.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D104615


Revision tags: llvmorg-12.0.1-rc1
# 4e5f8b4d 23-Apr-2021 Tue Ly <[email protected]>

[libc] Add implementation of expm1f.

Use expm1f(x) = exp(x) - 1 for |x| > ln(2).
For |x| <= ln(2), divide it into 3 subintervals: [-ln2, -1/8], [-1/8, 1/8], [1/8, ln2]
and use a degree-6 polynomial

[libc] Add implementation of expm1f.

Use expm1f(x) = exp(x) - 1 for |x| > ln(2).
For |x| <= ln(2), divide it into 3 subintervals: [-ln2, -1/8], [-1/8, 1/8], [1/8, ln2]
and use a degree-6 polynomial approximation generated by Sollya's fpminmax for each interval.
Errors < 1.5 ULPs when we use fma to evaluate the polynomials.

Differential Revision: https://reviews.llvm.org/D101134

show more ...


# 861dc759 12-May-2021 Siva Chandra Reddy <[email protected]>

[libc] Add x86_64 implementations of double precision cos, sin and tan.

The implementations use the x86_64 FPU instructions. These instructions
are extremely slow compared to a polynomial based soft

[libc] Add x86_64 implementations of double precision cos, sin and tan.

The implementations use the x86_64 FPU instructions. These instructions
are extremely slow compared to a polynomial based software
implementation. Also, their accuracy falls drastically once the input
goes beyond 2PI. To improve both the speed and accuracy, we will be
taking the following approach going forward:
1. As a follow up to this CL, we will implement a range reduction algorithm
which will expand the accuracy to the entire double precision range.
2. After that, we will replace the HW instructions with a polynomial
implementation to improve the run time.

After step 2, the implementations will be accurate, performant and target
architecture independent.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D102384

show more ...


# 6666e0d7 12-Apr-2021 Siva Chandra Reddy <[email protected]>

[libc] Make FPBits a union.

This helps us avoid the uncomfortable reinterpret-casts. Avoiding the
reinterpret casts prevents us from tripping the sanitizers as well.

Reviewed By: lntue

Differentia

[libc] Make FPBits a union.

This helps us avoid the uncomfortable reinterpret-casts. Avoiding the
reinterpret casts prevents us from tripping the sanitizers as well.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D100360

show more ...


12