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>
|
|
This patch corrects the `using`-declaration in `libc/shared/sign.h`.
The previous change (#150083) incorrectly used the `LIBC_NAMESPACE_DECL`
macro. This is corrected to use `LIBC_NAMESPACE`.
|
|
mbrtowc was not handling null destination correctly
---------
Co-authored-by: Sriya Pratipati <sriyap@google.com>
|
|
Implemented fuzz test for cbrt
Co-authored-by: Sriya Pratipati <sriyap@google.com>
|
|
created internal wcsspn to avoid duplicated code
---------
Co-authored-by: Sriya Pratipati <sriyap@google.com>
|
|
This patch exposes the internal `Sign` type for shared use by other LLVM
subprojects, following the pattern established by `FPBits`.
The `FPBits` utility is exposed via `libc/shared/fp_bits.h`. However,
its public interface relies on the `Sign` type for, e.g., creating
signed infinities and returning the sign of a value. Currently, users of
the shared `FPBits` have no way to access the `Sign` type.
Following the existing pattern for sharing `libc` utilities, this patch
adds a new public header `libc/shared/sign.h`. This header simply
includes the internal `src/__support/sign.h` and brings the `Sign` type
into the `shared` namespace.
|
|
(#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.
|
|
stdio test suite. (#149740)
|
|
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 patch temporarily disables bfloat16_test for full build mode, until
the MPCommon target is updated so that mpfr_inc.h is not included in the
MPCommon.h header.
This should fix the rv32 buildbot failures.
|
|
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
|
|
|
|
|
|
Remove all the .h.def files that already express nothing
whatsoever not already expressed in YAML. Clean up a few YAML
files without materially changing any generated header output.
Many more .h.def files remain that need a bit of conversion in
YAML to express macro requirements and such.
|
|
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
|
|
https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/math.h.html
|
|
|
|
https://github.com/llvm/llvm-project/pull/147931
|
|
Remove the unnecessary .h.def file and move all the macro
definitions directly into dlfcn.yaml.
|
|
Add basic configurations to generate wctype.h header file. To begin with
this header file just exposes one function iswalpha.
|