-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc++][math] Add constexpr
for std::signbit()
#105946
Merged
Merged
+98
−6
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
robincaloudis
force-pushed
the
rc-signbit
branch
from
August 24, 2024 16:06
8557bf4
to
17bd05b
Compare
✅ With the latest revision this PR passed the C/C++ code formatter. |
robincaloudis
force-pushed
the
rc-signbit
branch
25 times, most recently
from
August 27, 2024 13:47
a22802a
to
5ceea95
Compare
llvmbot
added
the
libc++
libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
label
Aug 28, 2024
robincaloudis
force-pushed
the
rc-signbit
branch
6 times, most recently
from
August 30, 2024 08:19
12d1510
to
0fddfac
Compare
@philnik777, could you have another look? |
ldionne
reviewed
Aug 30, 2024
philnik777
reviewed
Aug 30, 2024
robincaloudis
force-pushed
the
rc-signbit
branch
from
August 31, 2024 08:25
5e66d55
to
23085d3
Compare
robincaloudis
force-pushed
the
rc-signbit
branch
6 times, most recently
from
September 1, 2024 15:21
d843b87
to
f01f15c
Compare
philnik777
reviewed
Sep 4, 2024
We will add the overloads in a seperate patch.
Custom notes are encoded via GitHub issues from now on.
robincaloudis
force-pushed
the
rc-signbit
branch
from
September 4, 2024 16:23
f01f15c
to
b02f003
Compare
philnik777
approved these changes
Sep 5, 2024
VitaNuo
pushed a commit
to VitaNuo/llvm-project
that referenced
this pull request
Sep 12, 2024
## Why Since 18th of August, the floating point comparison builtin ``__builtin_signbit`` is available in Clang as constant expression (llvm#94118). ## What * Implement `constexpr` for `std::signbit()` as defined by [P0533R9](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) (new C++23 feature) * Restrict execution of tests to tip-of-trunk Clang as builtin is not yet available (note that builtin is available in GCC)
philnik777
pushed a commit
that referenced
this pull request
Sep 12, 2024
…pes for `std::signbit` (#106566) ## Why Following up on #105946, this patch provides the floating point overloads for `std::signbit` as defined by [P0533R9](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf). ## What * Test and add overloads for cv-unqualified floating point types * Remove constrained overload as it is not needed anymore * Make use of `template<class = void>` as the universal C runtime (UCRT) needed for Clang-Cl comes with overloads for all cv-unqualified floating point types (float, double, long double) for `std::signbit()` by itself [in the WinSDK](https://github.com/microsoft/win32metadata/blob/e012b29924c53aa941fc010850b68331b0c3ea80/generation/WinSDK/RecompiledIdlHeaders/ucrt/corecrt_math.h#L309-L322). In a certain way, this can be seen as a deviation from the C standard. We need to work around it as the compilation would otherwise error out due to duplicated definitions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
Since 18th of August, the floating point comparison builtin
__builtin_signbit
is available in Clang as constant expression (#94118).What
constexpr
forstd::signbit()
as defined by P0533R9 (new C++23 feature)