Age | Commit message (Collapse) | Author | Files | Lines |
|
This reverts commit 92523a35a827539db8557bbc3ecab7f9ea3f6ade.
Reland to see whether CIs are updated.
|
|
added getchar and getchar_unlocked which are just wrappers getc and getc_unlocked respectively.
Reviewed By: sivachandra, lntue, michaelrj
Differential Revision: https://reviews.llvm.org/D147919
|
|
Summary:
When we detect the architectures via `native` we can have systems with
multiple of the same GPU. We need to remove duplicates or else we will
try to build the same target multiple times.
|
|
Just seemed to be missing an assertion.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D148289
|
|
Just add `__llvm_libc::` to makes things clearer.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D148292
|
|
Test was incorrectly named/commented after the sched_{set|get}affinity
functions.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D148044
|
|
`getrandom` should return the number of bytes successfully set on
success, not `0`.
Reviewed By: sivachandra, michaelrj
Differential Revision: https://reviews.llvm.org/D147981
|
|
Implements: https://linux.die.net/man/2/sched_yield
Possibly we don't need the return value check / errno as according to
both the manpage (and current linux source) `sched_yield` cannot fail.
Reviewed By: sivachandra, michaelrj
Differential Revision: https://reviews.llvm.org/D147985
|
|
String to float has a condition to prevent overflowing the exponent with
the E notation. To do this it checks if adding that exponent to the
exponent found by parsing the number is greater than the maximum
exponent for the given size of float. The if statements had a gap on
exactly the maximum exponent value that caused it to be treated as the
minimum exponent value. This patch fixes those conditions.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D148152
|
|
Differential Revision: https://reviews.llvm.org/D148052
|
|
Introduce the `memmem` libc string function.
`memmem_implementation` performs shared logic for `strstr`,
`strcasestr`, and `memmem`; essentially reconfiguring what was the
`strstr_implementation` to support length parameters.
Differential Revision: https://reviews.llvm.org/D147822
|
|
Per https://reviews.llvm.org/D147970#4256889, swab.cpp is moved out of
the /linux subdirectory and cmake specifications are amended to reflect
that swab is not OS-specific.
Differential Revision: https://reviews.llvm.org/D147988
|
|
Simplify the range reduction steps by choosing the reduction constants
carefully so that the reduced arguments v = r*m_x - 1 and v^2 are exact in double
precision, even without FMA instructions, and -2^-8 <= v < 2^-7.
Reviewed By: zimmermann6
Differential Revision: https://reviews.llvm.org/D147759
|
|
This is ok as we build the libraries with `-ffreestanding` which implies `-fno-builtin` on all functions.
|
|
|
|
|
|
|
|
Differential Revision: https://reviews.llvm.org/D147464
|
|
This reverts commit a0a141fcbe1dfd35032fa5c052e6906180a37fb1.
|
|
Differential Revision: https://reviews.llvm.org/D147464
|
|
Differential Revision: https://reviews.llvm.org/D147463
|
|
Swab implementation is added to libc/src/unistd.
Differential Revision: https://reviews.llvm.org/D147970
|
|
|
|
Simplify the range reduction steps by choosing the reduction constants
carefully so that the reduced arguments v = r*m_x - 1 and v^2 are exact in double
precision, even without FMA instructions, and -2^-8 <= v < 2^-7. This allows the
polynomial evaluations to be parallelized more efficiently.
Reviewed By: santoshn, zimmermann6
Differential Revision: https://reviews.llvm.org/D147755
|
|
The ctype functions will sometimes be passed negative numbers, such as
EOF. Some of the previous implementations didn't handle these properly.
Additionally, the tests did not check any negative numbers. These
problems have been fixed.
This patch fixes https://github.com/llvm/llvm-project/issues/62000
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D147813
|
|
Differential Revision: https://reviews.llvm.org/D147795
|
|
|
|
Simplify the range reduction steps by choosing the reduction constants
carefully so that the reduced arguments v = r*m_x - 1 and v^2 are exact in double
precision, even without FMA instructions, and -2^-8 <= v < 2^-7. This allows the
polynomial evaluations to be parallelized more efficiently.
Reviewed By: zimmermann6
Differential Revision: https://reviews.llvm.org/D147676
|
|
|
|
This allows to use the type traits with types that are non constructible from integers.
|
|
|
|
|
|
Introduce `strxfrm` and unit tests. The current implementation is
introduced without locale support.
The simplified function performs a `memcpy` if the `n` value is large
enough to store the source len + '\0', otherwise `dest` is unmodified.
Ticket: https://fxbug.dev/124217
Differential Revision: https://reviews.llvm.org/D147478
|
|
Differential Revision: https://reviews.llvm.org/D147503
|
|
Let RISCV64 targets math implementations with and without FMA
automatically.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D146730
|
|
|
|
Summary:
If the target for these tools doesn't exist we should simply assume that
they will be provided externally. This allows building `libc` standalone
with an external installation of `clang`.
|
|
The packaged version of the `libc` library does not depend on the CUDA
installation because it only uses `clang` and emits LLVM-IR. However,
for testing we directly need the CUDA toolkit to emit and execute the
files. This patch explicitly passes `--cuda-path` to the relevant
compilations for NVPTX testing.
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D147653
|
|
|
|
Previously if you specified an exponent of more than 10000 in string to
float (e.g. "1e10001") it would treat it as 10000. A bug was discovered
where by having more than 10000 zeroes after a decimal point and an
exponent of more than 10000 this would cause the code to return the
incorrect value.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D147474
|
|
Introduce strchrnul implementation and unit tests.
Submitting on behalf of Caslyn@
Differential Revision: https://reviews.llvm.org/D147346
|
|
Summary:
This part was ignored and we just hoped that shutting down the runtime
freed these correctly. But it's best to be specific and free the memory
we've allocated.
|
|
Summary:
This implementation was buggy and inefficient. Fine-grained memory can
only be allocated on a page-level granularity. Which means that each
allocated string used about 4096 bytes. This is wasteful in general, and
also allowed for buggy behaviour. The previous copying of the
environment vector only worked because the large buffer size meant that
we would typically have a null byte after the allocated memory. However
this would break if the vector was larger than a page. This patch
allocates everything into a single buffer. It makes it easier to free,
use, and it more correct.
|
|
This is an implementation of https://discourse.llvm.org/t/rfc-running-libc-unit-tests-as-integration-tests/69461.
Differential Revision: https://reviews.llvm.org/D147231
|
|
in LibcTest"
Build bot detected a memory leak.
This reverts commit b82d04ea4b4f26037be369f101ae7011975df486.
|
|
This is an implementation of https://discourse.llvm.org/t/rfc-running-libc-unit-tests-as-integration-tests/69461.
Differential Revision: https://reviews.llvm.org/D147231
|
|
Does not build with gcc.
This reverts commit fc5ae0a7a45bdb5251f3dad3fc07047f987ca447.
|
|
This is an implementation of https://discourse.llvm.org/t/rfc-running-libc-unit-tests-as-integration-tests/69461.
Differential Revision: https://reviews.llvm.org/D147231
|
|
|
|
This patch makes use of `cpp::string_view` instead of `const char*` for `write_to_stderr`. This helps sending non null-terminated buffers such as a single character, `cpp::string_view` or `cpp::string`.
It also fizes the gpu version that had several bugs (See https://reviews.llvm.org/D145913#4236641).
Differential Revision: https://reviews.llvm.org/D147375
|