Age | Commit message (Collapse) | Author | Files | Lines |
|
Reverts llvm/llvm-project#149423
Failing nullptr crash when using sanitizer
|
|
Implemented an internal multi-byte to wide character string conversion
function, public functions, and tests
---------
Co-authored-by: Sriya Pratipati <sriyap@google.com>
|
|
LIBC_HAS_SANITIZER (which is defined if ASan, MSan, or UBSan is enabled)
is currently used to implicitly disable null checks, normally enabled
via LIBC_ADD_NULL_CHECKS config value. Remove this condition, and rely
purely on the config value instead:
* LIBC_HAS_SANITIZER will be true even for UBSan modes which doesn't
rely on null checks at all (e.g. -fsanitize=alignment)
* null checks today (implemented via __builtin_trap) should function
normally today even when sanitizer is enabled - trap is still a trap
* tests have been migrated to WITH_SIGNAL(-1) which doesn't prescript a
particular signal / exit-code, and thus should pass even if sanitizers
override the default ones.
|
|
|
|
Implemented internal wcs to mbs internal function + tests
Impelemented wcs to mbs public functions
|
|
When trying to use <setjmp.h>, it will try to include
llvm-libc-types/sigjmp_buf.h due to the way that headergen works. This
commit creates a dummy file, as the real implementation is found in
llvm-libc-types/jmp_buf.h.
|
|
Implemented wcsdup by templating internal strdup function
|
|
Implemented mblen and mbrlen as well as tests
---------
Co-authored-by: Sriya Pratipati <sriyap@google.com>
|
|
(#150345)
|
|
<stdint.h> includes. (#150303)
https://github.com/llvm/llvm-project/issues/149993
|
|
https://lab.llvm.org/buildbot/#/builders/10/builds/10047/steps/5/logs/stdio
|
|
Summary:
The scheme we use to find a free bit is to just do a random walk. This
works very well up until you start to completely saturate the bitfield.
Because the result of the fetch_or yields the previous value, we can
search this to go to any known empty bits as our next guess. This
effectively increases our liklihood of finding a match after two tries
by 32x since the distribution is random.
This *massively* improves performance when a lot of memory is allocated
without freeing, as it now doesn't takea one in a million shot to fill
that last bit. A further change could improve this further by only
*mostly* filling the slab, allowing 1% to be free at all times.
|
|
Summary:
This patch changes the `find_slab` logic to simply cache the most
successful slot. This means the happy fast path is now a single atomic
load on this index. I removed the SIMT shuffling logic that did slab
lookups wave-parallel. Here I am considering the actual traversal to be
comparatively unlikely, so it's not overly bad that it takes longer.
ideally one thread finds a slot and shared it with the rest so we only
pay that cost once.
---------
Co-authored-by: Shilei Tian <i@tianshilei.me>
|
|
(#150264)
Fixing bot failures:
https://lab.llvm.org/buildbot/#/builders/10/builds/10025
|
|
|
|
Signed-off-by: Krishna Pandey <kpandey81930@gmail.com>
|
|
BFloat16 (#150087)
Signed-off-by: Krishna Pandey <kpandey81930@gmail.com>
|
|
mbrtowc was not handling null destination correctly
---------
Co-authored-by: Sriya Pratipati <sriyap@google.com>
|
|
created internal wcsspn to avoid duplicated code
---------
Co-authored-by: Sriya Pratipati <sriyap@google.com>
|
|
(#144983)
The PR implements the following generic comparison operation functions
for floating point types along with unittests:
- `fputil::equals`
- `fputil::less_than`
- `fputil::less_than_or_equals`
- `fputil::greater_than`
- `fputil::greater_than_or_equals`
---------
Signed-off-by: krishna2803 <kpandey81930@gmail.com>
Signed-off-by: Krishna Pandey <kpandey81930@gmail.com>
Co-authored-by: OverMighty <its.overmighty@gmail.com>
|
|
src/__support/math folder. (#148568)
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
|
|
src/__support/math folder. (#148418)
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
|
|
src/__support/math folder. (#148413)
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
|
|
src/__support/math folder. (#148412)
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
|
|
Adding smoke tests for shared math header.
part of #147386
|
|
string_utils.h uses uintptr_t, and there seems to be no tracking of this
dependency. It seems upstream builds are unaffected but downstream this
is causing a lot of flaky builds.
|
|
I suspect the reason is that we use `add_fp_unittest` in exhaustive
testing, so the suffix `__unit__` is necessary.
|
|
src/__support/math folder. (#148411)
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
|
|
In PR #99785, I disabled a test for `epoll_create` that was intended to
fail on systems where only `epoll_create1` is available. This is because
`epoll_create1` cannot fail in the same way that `epoll_create` does.
Specifically, calling `epoll_create(0)` should result in an EINVAL
error. So, when only `epoll_create1` is available, we should simply
check if the argument is zero and return the error accordingly.
|
|
This PR simplifies how we enable the different fma configs for riscv:
1. Removes __LIBC_RISCV_USE_FMA define
2. Checks if __riscv_flen is defined to set LIBC_TARGET_CPU_HAS_FMA
As a bonus, we enable *FMA_OPT tests for rv32, so any rv32 hardware that
doesn't implement the f/d extensions is also covered by the tests.
|
|
We might pull a header from the host where tv_nsec is not a long,
so compilation would fail with an implicit conversion error.
|
|
When we pull the headers from the system, we might get a suseconds_t
that's a long long, so add a cast to prevent a implicit conversion
error.
|
|
src/__support/math folder. (#148409)
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
|
|
|
|
src/__support/math folder. (#148408)
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
|
|
|
|
Add basic configurations to generate wctype.h header file. To begin with
this header file just exposes one function iswalpha.
|
|
Fixed StringConverter edge case related to destination limit
If we call pop() but there is no space in the dest array, we should
always return the "no space in destination" error even if the following
character is invalid (since we shouldn't really have to look at the next
character)
|
|
src/__support/math folder. (#148405)
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
|
|
The code for `memcpy` is the same as in #148204 but it fixes the build
bot error by using `static_assert(cpp::always_false<decltype(access)>)`
instead of `static_assert(false)` (older compilers fails on
`static_assert(false)` in `constexpr` `else` bodies).
The code for `memset` is new and vastly improves performance over the
current byte per byte implementation.
Both `memset` and `memcpy` implementations use prefetching for sizes >=
64. This lowers a bit the performance for sizes between 64 and 256 but
improves throughput for greater sizes.
|
|
src/__support/math folder. (#148400)
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
|
|
Reverts llvm/llvm-project#148204
`libc-arm32-qemu-debian-dbg` is failing, reverting and investigating
|
|
This patch is in preparation for the Cortex `memset` implementation.
It improves the codegen by generating a prefetch for large sizes.
|
|
src/__support/math folder. (#148761)
- **[libc][math] Refactor exp implementation to header-only in
src/__support/math folder.**
- **Reapply "[libc][math] Refactor exp implementation to header-only in
src/__support/math folder." (#148668)**
|
|
Implemented a string converter class to encapsulate the logic of
converting between utf8 <-> utf32
|
|
Implement public wchar -> integer public functions using templated
internal wcs_to_integer function
|
|
src/__support/math folder." (#148668)
Reverts llvm/llvm-project#148091
Full build bots are failing.
|
|
src/__support/math folder. (#148091)
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
|
|
src/__support/math folder (#147906)
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
Please merge #147901 first
@lntue
|
|
src/__support/math folder. (#147901)
Part of #147386
in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
Please merge #147895 first
|