summaryrefslogtreecommitdiff
path: root/libc/src/math/generic/log1pf.cpp
AgeCommit message (Collapse)Author
2025-03-11[libc][math] Skip checking for exceptional values when ↵lntue
LIBC_MATH_SKIP_ACCURATE_PASS is set. (#130811)
2025-03-11[libc] Provide more fine-grained control of FMA instruction for ARM targets. ↵lntue
(#130700)
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-03-20[libc][NFC] Move `Sign` type to separate header (#85930)Guillaume Chatelet
2024-01-30[libc][NFC] Move functions from `FPBits` to `FPRep`, make `bits` member ↵Guillaume Chatelet
private (#79974)
2024-01-30[libc][NFC] Rename `FPBits` nan functions (#79998)Guillaume Chatelet
- [libc][NFC] Rename FPBits nan functions - rename build_signaling_nan in signaling_nan - rename build_quiet_nan to quiet_nan
2024-01-23[libc][NFC] Remove `FPBits` cast operator (#79142)Guillaume Chatelet
The semantics for casting can range from "bitcast" (same representation) to "different representation", to "type promotion". Here we remove the cast operator and force usage of `get_val` as the only function to get the floating point value, making the intent clearer and more consistent.
2024-01-23[reland][libc] Remove unnecessary `FPBits` functions and properties (#79128)Guillaume Chatelet
- reland #79113 - Fix aarch64 RISC-V build
2024-01-23Revert "[libc] Remove unnecessary `FPBits` functions and properties" (#79118)Guillaume Chatelet
Reverts llvm/llvm-project#79113 It broke aarch64 build bot machines.
2024-01-23[libc] Remove unnecessary `FPBits` functions and properties (#79113)Guillaume Chatelet
This patch reduces the surface of `FPBits`.
2024-01-18[libc][NFC] Introduce a Sign type for FPBits (#78500)Guillaume Chatelet
Another patch is needed to cover `DyadicFloat` and `NormalFloat` constructors.
2023-12-15[libc][NFC] Rename `MANTISSA_WIDTH` in `FRACTION_LEN` (#75489)Guillaume Chatelet
This one might be a bit controversial since the terminology has been introduced from the start but I think `FRACTION_LEN` is a better name here. AFAICT it really is "the number of bits after the decimal dot when the number is in normal form." `MANTISSA_WIDTH` is less precise as it's unclear whether we take the leading bit into account. This patch also renames most of the properties to use the `_LEN` suffix and fixes useless casts or variables.
2023-12-14[libc][NFC] Remove MantissaWidth traits (#75458)Guillaume Chatelet
Same as #75362, the traits does not bring a lot of value over `FloatProperties::MANTISSA_WIDTH` (or `FPBits::MANTISSA_WIDTH`).
2023-12-11[libc][NFC] Fix mixed up biased/unbiased exponent (#75037)Guillaume Chatelet
According to [wikipedia](https://en.wikipedia.org/wiki/Exponent_bias) the "biased exponent" is the encoded form that is always positive whereas the unbiased form is the actual "real" exponent that can be positive or negative. `FPBits` seems to be using `unbiased_exponent` to describe the encoded form (unsigned). This patch simply use `biased` instead of `unbiased`.
2023-12-08[libc][NFC] Clean up conversion warnings in math function implementations. ↵lntue
(#74697)
2023-09-28[libc][math] Implement double precision expm1 function correctly rounded for ↵lntue
all rounding modes. (#67048) Implementing expm1 function for double precision based on exp function algorithm: - Reduced x = log2(e) * (hi + mid1 + mid2) + lo, where: * hi is an integer * mid1 * 2^-6 is an integer * mid2 * 2^-12 is an integer * |lo| < 2^-13 + 2^-30 - Then exp(x) - 1 = 2^hi * 2^mid1 * 2^mid2 * exp(lo) - 1 ~ 2^hi * (2^mid1 * 2^mid2 * (1 + lo * P(lo)) - 2^(-hi) ) - We evaluate fast pass with P(lo) is a degree-3 Taylor polynomial of (e^lo - 1) / lo in double precision - If the Ziv accuracy test fails, we use degree-6 Taylor polynomial of (e^lo - 1) / lo in double double precision - If the Ziv accuracy test still fails, we re-evaluate everything in 128-bit precision.
2023-09-26[libc] Mass replace enclosing namespace (#67032)Guillaume Chatelet
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
2023-03-23[libc] Fix some math conversion warningsAlex Brachet
Differential Revision: https://reviews.llvm.org/D146738
2023-03-07[libc][math] Switch math functions to use libc_errno and fix some errno and ↵Tue Ly
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
2023-02-11[libc] Update macros/optimization.h build dependency for CMake and Bazel.Tue Ly
Update macros/optimization.h build dependency for CMake and Bazel. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D143805
2023-02-10[libc][math] Update exceptional cases for logf, log10f, log2f, log1pf.Tue Ly
Properly set floating point exceptions and add more exceptional values for non-FMA x86-64 targets. Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D143699
2022-06-03[libc] Automatically add -mfma flag for architectures supporting FMA.Tue Ly
Detect if the architecture supports FMA instructions and if the targets depend on fma. Reviewed By: gchatelet Differential Revision: https://reviews.llvm.org/D123615
2022-04-08[libc] Add support for x86-64 targets that do not have FMA instructions.Tue Ly
Make FMA flag checks more accurate for x86-64 targets, and refactor polyeval to use multiply and add instead when FMA instructions are not available. Reviewed By: michaelrj, sivachandra Differential Revision: https://reviews.llvm.org/D123335
2022-03-04[libc] Remove the redundant header FPUtil/FEnvUtils.hTue Ly
Remove the redundant header FPUtil/FEnvUtils.h, use FPUtil/FEnvImpl.h header instead. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D120965
2022-02-08[libc] Replace type punning with bit_castGuillaume Chatelet
Although type punning is defined for union in C, it is UB in C++. This patch introduces a bit_cast function to convert between types in a safe way. This is necessary to get llvm-libc compile with GCC. This patch is extracted from D119002. Differential Revision: https://reviews.llvm.org/D119145
2022-02-07[libc] Return a float NaN for log1pf instead of double NaN.Tue Ly
2022-02-07[libc] Implement log1pf correctly rounded to all rounding modes.Tue Ly
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