summaryrefslogtreecommitdiff
path: root/libc/src/__support/CPP/algorithm.h
AgeCommit message (Collapse)Author
2025-10-17Revert "[libc] add basic lifetime annotations for support data structures" ↵Schrodinger ZHU Yifan
(#164012) Reverts llvm/llvm-project#145933 due to broken aarch64 buildbots.
2025-10-17[libc] add basic lifetime annotations for support data structures (#145933)Schrodinger ZHU Yifan
fix #145932 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-02 [libc] Implement generic SIMD helper 'simd.h' and implement strlen (#152605)Joseph Huber
Summary: This PR introduces a new 'simd.h' header that implements an interface similar to the proposed `stdx::simd` in C++. However, we instead wrap around the LLVM internal type. This makes heavy use of the clang vector extensions and boolean vectors, instead using primitive vector types instead of a class (many benefits to this). I use this interface to implement a generic strlen implementation, but propse we use this for math. Right now this requires a feature only introduced in clang-22.
2025-02-04[libc] Alternative algorithm for decimal FP printf (#123643)Simon Tatham
The existing options for bin→dec float conversion are all based on the Ryū algorithm, which generates 9 output digits at a time using a table lookup. For users who can't afford the space cost of the table, the table-lookup subroutine is replaced with one that computes the needed table entry on demand, but the algorithm is otherwise unmodified. The performance problem with computing table entries on demand is that now you need to calculate a power of 10 for each 9 digits you output. But if you're calculating a custom power of 10 anyway, it's easier to just compute one, and multiply the _whole_ mantissa by it. This patch adds a header file alongside `float_dec_converter.h`, which replaces the whole Ryū system instead of just the table-lookup routine, implementing this alternative simpler algorithm. The result is accurate enough to satisfy (minimally) the accuracy demands of IEEE 754-2019 even in 128-bit long double. The new float128 test cases demonstrate this by testing the cases closest to the 39-digit rounding boundary. In my tests of generating 39 output digits (the maximum number supported by this algorithm) this code is also both faster and smaller than the USE_DYADIC_FLOAT version of the existing Ryū code.
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-06-03[libc][CPP] Add all_of and find_if_not to algorithm.h (#94058)PiJoules
This is needed for the allocator implementation for malloc.
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-09-21[libc][clang-tidy] Add llvm-header-guard to get consistant naming and ↵Guillaume Chatelet
prevent file copy/paste issues. (#66477)
2023-08-10[libc] add the CPP algorithm header for min/maxGuillaume Chatelet
Reviewed By: jhuber6, sivachandra Differential Revision: https://reviews.llvm.org/D157405