summaryrefslogtreecommitdiff
path: root/libc/src/math/generic/log.cpp
AgeCommit message (Collapse)Author
2025-03-11[libc] Provide more fine-grained control of FMA instruction for ARM targets. ↵lntue
(#130700)
2025-03-05[libc][math] Add skip accurate pass option for exp*, log*, and powf ↵lntue
functions. (#129831)
2024-10-26[libc][math] Add tests and fix some issues with FTZ/DAZ modes. (#113744)lntue
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-02-16[reland][libc][NFC] Use user defined literals to build 128 and 256 bit ↵Guillaume Chatelet
constants (#81998) - #81835 - Fix for platforms where uint64_t is not available
2024-02-15Revert "[reland][libc][NFC] Use user defined literals to build 128 and 256 ↵Guillaume Chatelet
bit constants" (#81882) Reverts llvm/llvm-project#81835 This is breaking arm32 which does not support 64 bit types.
2024-02-15[reland][libc][NFC] Use user defined literals to build 128 and 256 bit ↵Guillaume Chatelet
constants (#81835) This is a reland of #81746
2024-02-14Revert "[libc][NFC] Use user defined literals to build 128 and 256 bit ↵Guillaume Chatelet
constants." (#81771) Reverts llvm/llvm-project#81746
2024-02-14[libc][NFC] Use user defined literals to build 128 and 256 bit constants. ↵Guillaume Chatelet
(#81746)
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[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] Use the Sign type for DyadicFloat (#78577)Guillaume Chatelet
2024-01-18[libc][NFC] Introduce a Sign type for FPBits (#78500)Guillaume Chatelet
Another patch is needed to cover `DyadicFloat` and `NormalFloat` constructors.
2024-01-04[libc][NFC] Simplify `FPBits` (#76835)Guillaume Chatelet
This patch reduces the scope of `FPBits` exported variables and functions. It also moves storage up into `FPRep` and tries to make the default and specialized versions of `FPBits` more uniform. The next step is to move the specialization from `FPBits` to `FPRep` so we can manipulate floating point representations through `FPType` alone - that is - independently from the host architecture.
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-13Revert "[libc][NFC] Implement `FPBits` in terms of `FloatProperties` to ↵Guillaume Chatelet
reduce clutter" (#75304) Reverts llvm/llvm-project#75196 GCC complains about change of meaning for `FPBits` ``` /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/generic/FMod.h:188:9: error: declaration of ‘using FPBits = struct __llvm_libc_18_0_0_git::fputil::FPBits<T>’ changes meaning of ‘FPBits’ [-fpermissive] 188 | using FPBits = FPBits<T>; | ^~~~~~ ``` I'll reland with a different name.
2023-12-13[libc][NFC] Implement `FPBits` in terms of `FloatProperties` to reduce ↵Guillaume Chatelet
clutter (#75196) Also make type naming consistent: - `UIntType` instead of `intU_t` - `FPBits` instead of `FPBits_t`, `FPB`
2023-12-08[libc][NFC] Clean up conversion warnings in math function implementations. ↵lntue
(#74697)
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-05-23[libc][math] Implement double precision log function correctly rounded to ↵Tue Ly
all rounding modes. Implement double precision log function correctly rounded to all rounding modes. See https://reviews.llvm.org/D150014 for a more detail description of the algorithm. **Performance** - For `0.5 <= x <= 2`, the fast pass hitting rate is about 99.93%. - Reciprocal throughput from CORE-MATH's perf tool on Ryzen 5900X: ``` $ ./perf.sh log GNU libc version: 2.35 GNU libc release: stable -- CORE-MATH reciprocal throughput -- with FMA [####################] 100 % Ntrial = 20 ; Min = 17.465 + 0.596 clc/call; Median-Min = 0.602 clc/call; Max = 18.389 clc/call; -- CORE-MATH reciprocal throughput -- without FMA (-march=x86-64-v2) [####################] 100 % Ntrial = 20 ; Min = 54.961 + 2.606 clc/call; Median-Min = 2.180 clc/call; Max = 59.583 clc/call; -- System LIBC reciprocal throughput -- [####################] 100 % Ntrial = 20 ; Min = 12.608 + 0.276 clc/call; Median-Min = 0.359 clc/call; Max = 13.147 clc/call; -- LIBC reciprocal throughput -- with FMA [####################] 100 % Ntrial = 20 ; Min = 20.952 + 0.468 clc/call; Median-Min = 0.602 clc/call; Max = 21.881 clc/call; -- LIBC reciprocal throughput -- without FMA [####################] 100 % Ntrial = 20 ; Min = 18.569 + 0.552 clc/call; Median-Min = 0.601 clc/call; Max = 19.259 clc/call; ``` - Latency from CORE-MATH's perf tool on Ryzen 5900X: ``` $ ./perf.sh log --latency GNU libc version: 2.35 GNU libc release: stable -- CORE-MATH latency -- with FMA [####################] 100 % Ntrial = 20 ; Min = 48.431 + 0.699 clc/call; Median-Min = 0.073 clc/call; Max = 51.269 clc/call; -- CORE-MATH latency -- without FMA (-march=x86-64-v2) [####################] 100 % Ntrial = 20 ; Min = 64.865 + 3.235 clc/call; Median-Min = 3.475 clc/call; Max = 71.788 clc/call; -- System LIBC latency -- [####################] 100 % Ntrial = 20 ; Min = 42.151 + 2.090 clc/call; Median-Min = 2.270 clc/call; Max = 44.773 clc/call; -- LIBC latency -- with FMA [####################] 100 % Ntrial = 20 ; Min = 35.266 + 0.479 clc/call; Median-Min = 0.373 clc/call; Max = 36.798 clc/call; -- LIBC latency -- without FMA [####################] 100 % Ntrial = 20 ; Min = 48.518 + 0.484 clc/call; Median-Min = 0.500 clc/call; Max = 49.896 clc/call; ``` - Accurate pass latency: ``` $ ./perf.sh log --latency --simple_stat GNU libc version: 2.35 GNU libc release: stable -- CORE-MATH latency -- with FMA 598.306 -- CORE-MATH latency -- without FMA (-march=x86-64-v2) 632.925 -- LIBC latency -- with FMA 455.632 -- LIBC latency -- without FMA 488.564 ``` Reviewed By: zimmermann6 Differential Revision: https://reviews.llvm.org/D150131