Skip to content
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

Implement __builtin_clear_padding (used by libstdc++ for P0528R3/P1123R0) #64830

Open
comex opened this issue Aug 19, 2023 · 2 comments
Open
Labels
clang:codegen libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Comments

@comex
Copy link
Contributor

comex commented Aug 19, 2023

This is basically identical to #46030 ("Implement __builtin_zero_non_value_bits which was recently added to MSVC") except for GCC instead of MSVC.

C++20 includes P0528R3 and P1123R0, which together require std::atomic<T>::compare_exchange_strong and std::atomic_ref<T>::compare_exchange_strong to ignore any padding bits that exist in T. libstdc++ implements this using a builtin added to GCC, __builtin_clear_padding. Clang should implement this so that the feature works correctly when using libstdc++ with Clang.

See also:

@llvmbot
Copy link
Member

llvmbot commented Aug 19, 2023

@llvm/issue-subscribers-clang-codegen

@ghostway0
Copy link

ghostway0 commented Jan 31, 2024

When is alignment decided for specific fields? Isn't it in LLVM itself, later in the pipeline? If I recalled correctly, this might need to be an intrinsic - right?

@EricWF EricWF added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:codegen libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

No branches or pull requests

5 participants