Age | Commit message (Collapse) | Author | Files | Lines |
|
Use a seek offset that fits within the file size.
This was missed in presubmit because the FILE based stdio tests aren't
run in
overlay mode; fullbuild is not tested in presubmit.
WRITE_SIZE == 11, so using a value of 42 for offseto would cause the
expression
`WRITE_SIZE - offseto` to evaluate to -31 as an unsigned 64b integer
(18446744073709551585ULL).
Fixes #86928
|
|
We compute atan2f(y, x) in 2 stages:
- Fast step: perform computations in double precision , with relative
errors < 2^-50
- Accurate step: if the result from the Fast step fails Ziv's rounding
test, then we perform computations in double-double precision, with
relative errors < 2^-100.
On Ryzen 5900X, worst-case latency is ~ 200 clocks, compared to average
latency ~ 60 clocks, and average reciprocal throughput ~ 20 clocks.
|
|
Fixes #86928
|
|
Fixes: #85287
|
|
This includes algorithm.h directly to provide the definition for
`cpp:max` in parser.h. This will define `max(...)` in the libc namespace
for build systems that pull in parser.h explicitly.
|
|
|
|
In continuation to: #87097
|
|
Summary:
This has changed, so update it to match the new interface.
|
|
Summary:
The current implementation of RPC tied everything to device IDs and
forced us to do init / shutdown to manage some global state. This turned
out to be a bad idea in situations where we want to track multiple
hetergeneous devices that may report the same device ID in the same
process.
This patch changes the interface to instead create an opaque handle to
the internal device and simply allocates it via `new`. The user will
then take this device and store it to interface with the attached
device. This interface puts the burden of tracking the device identifier
to mapped d evices onto the user, but in return heavily simplifies the
implementation.
|
|
In patch #82461 the sprintf tests were made to use UINTMAX_WIDTH which
isn't defined on all systems. This patch changes it to
sizeof(uintmax_t)*CHAR_BIT which is more portable.
|
|
Resolves #81685. This adds support for wN and wfN length modifiers in
fprintf.
|
|
Adds tests for `inf` and `nan` values to the tests for `strfrom*()`
functions.
Also marks some variables as `[[maybe_unused]]` to silence unused
variable warnings.
|
|
functions. (#86924)"
This reverts commit 7c1c07c92099d3e36e8f362706a5824ab04bdf38.
Fails in presubmit.
Link: https://lab.llvm.org/buildbot/#/builders/90/builds/67461
Link: https://lab.llvm.org/buildbot/#/builders/225/builds/33519
Link: https://lab.llvm.org/buildbot/#/builders/163/builds/53858
Link: https://lab.llvm.org/buildbot/#/builders/250/builds/20983
Link: #86924
|
|
(#86924)
Updates the special case of pseudo infinty as pointed in #85940
|
|
{,u}fromfp{,x}* (#86892)
See
https://github.com/llvm/llvm-project/pull/86692#issuecomment-2024044889
and
https://github.com/llvm/llvm-project/pull/86892#discussion_r1542276037.
cc @lntue @nickdesaulniers
|
|
Critically, we don't want to return an iterator to the end of the underlying
cpp::array "store." Add a test to catch this issue.
This will be used by __cxa_finalize to iterate backwards through a FixedVector.
Link: #85651
|
|
Otherwise we need to pull in stddef.h for the declaration of NULL.
|
|
Summary:
Debug builds don't optimize out certain parts of the code that end up
making the GPU backend crash. This results in regular builds not being
successful just to build the testing objects. Disable them for now in
debug mode.
|
|
This is required to avoid multiple definitions error.
|
|
Hello,
So, I worked on the fmaximum and fminimum functions recently and the
reviewers suggested the structure:
```
if (bitsx ...)
return ...;
if (bitsy ..)
return
...
return ...;
```
So I went ahead and did the same for fmin and fmax. I hope this isnt an
issue for you all. thanks.
---------
Co-authored-by: Job Hernandez <h93@protonmail.com>
|
|
These values vary by system, this flag allows you to toggle their value.
|
|
{,u}fromfp{,x}* (#86692)"
This reverts commit cd17082b24079a31eff0057abe407da5cfb7b0fc because the newly
added tests fail on 32b ARM.
Link: #86692
Link: https://lab.llvm.org/buildbot/#/builders/229/builds/24458
|
|
|
|
Fixes #86546 and removes the macro `LIBC_HAS_BUILTIN`. This was
necessary to support older compilers that did not support
`__has_builtin`. All of the compilers we support already have this
builtin.
See: https://libc.llvm.org/compiler_support.html
All uses now use `__has_builtin` directly
cc @nickdesaulniers
|
|
Flush out the remaining UInt<128> support and add test coverage.
We could have used cpp::popcount in the implementation of
UInt::has_single_bit, but
has_single_bit has a perhaps useful early return.
|
|
The arm32 buildbot reports an error because UInt::operator bool() is explicit,
thus an explicit cast is necessary.
Link: #85940
|
|
Summary:
This needs to go after `extern "C"`.
|
|
Resolves #86547
Replace occurrences of the macro `LIBC_HAS_ATTRIBUTE` with `__has_attribute`.
|
|
Removes unused header includes from `strfrom*()` implementation files.
|
|
The canonicalize test added in #85940 defined the LIBC_NAMESPACE macro.
this macro is intended to be set only by the build system and never in
the code.
|
|
The usage of __builtin_unreachable after calls to quick_exit were distressing.
If a function is properly marked [[noreturn]] then __builtin_unreachable is not
necessary.
Looking into this further, we seem to have header only implementations for CPU
targets. The inline nature of these functions is curious; we're going to exit,
it doesn't matter if we need to pay the call of a function or not. If we just
make these functions have distinct TUs rather than be header only, we can clean
up the cmake rules for quick_exit which were different between CPU and GPU.
Remove darwin support for quick_exit. This isn't being tested, and we can bring
it back when necessary.
|
|
Fixes: #85286
|
|
(#86016)
Fixes https://github.com/llvm/llvm-project/issues/85496.
---------
Co-authored-by: Job Hernandez <h93@protonmail.com>
|
|
fixes #86449
|
|
|
|
Fixes #85279.
cc @lntue
|
|
Follow up to #85438.
Implements the functions `strfromd()` and `strfroml()` introduced in
C23, and unifies the testing framework for `strfrom*()` functions.
|
|
Im working on the floating point fmaximum and fminimum functions right
now in a different pr and I ran the individual tests by doing
```
ninja libc.test.src.math.smoke.<func>_test.__unit__
```
|
|
I'm trying to break up the pieces of supporting __cxa_finalize into smaller
commits. Provide this symbol first, and make use of it from exit.
Next will be to store __dso_handle, then finally to only run callbacks that
were registered from a specific dso.
Link: #85651
Link: https://itanium-cxx-abi.github.io/cxx-abi/abi.html#dso-dtor
|
|
Performed en-masse via:
$ grep -rn "#include <ll" libc/include -l | \
xargs perl -pi -e 's/#include <ll(.*)>/#include "ll$1"/'
$ grep -rn "#include <__" libc/include -l | \
xargs perl -pi -e 's/#include <__(.*)>/#include "__$1"/'
Link: #83463
Link: #83210
|
|
This is a reland of #86147 but with a proper `base()` function.
https://en.cppreference.com/w/cpp/iterator/reverse_iterator/operator_cmp
|
|
The isfinite, isnan, and isinf "functions" are specified by C99..C23 to
be macros that act as type-generic functions. Defining them as their
__builtin_* counterparts works fine for this. However, in C++ the
identifiers need to be usable in different contexts, such as being
declared inside a C++ namespace. So define inline constexpr template
functions for them under `#ifdef __cplusplus`.
|
|
Reverts llvm/llvm-project#86147
|
|
https://en.cppreference.com/w/cpp/iterator/reverse_iterator/operator_cmp
|
|
SYS_rename may be unavailable on architectures such as aarch64 and
riscv.
rename can be implemented in terms of SYS_rename, SYS_renameat, or
SYS_renameat2. I don't have a full picture of the history here, but it
seems
that SYS_renameat might also be unavailable on some platforms.
`man 2 rename` mentions that SYS_renameat2 was added in Linux 3.15. We
don't
need to support such ancient kernel versions prior.
Link: #84980
Link: #85068
|
|
This will replace `__builtin_is_constant_evaluated` in math_extras.h.
|
|
Link: #84980
Link: #85068
|
|
Adds stdio.h's rename() function as defined in n3096. Fixes #84980.
|
|
Summary:
Right now it's difficult to build these utilities standalone becayse
they're keyed off of the other GPU handling. if someone wants to *just*
build these utilities it's not possible without setting up the runtimes
build. Since we can't just build these by default add an option to
enable it.
We can't just use the handling like LIBC_HDRGEN does because this is
only for the GPU build, which isn't fully set up until way later. So
this is probably the easiest way to just allow people to build these
tools even without a GPU build setup.
|
|
Fixes #84244.
Implements the function `strfromf()` introduced in C23, and adds shared
utilities for implementation of other `strfrom*()` functions, including
`strfromd()` and `strfroml()`.
|