[libcxx-commits] [clang] [compiler-rt] [libcxx] [Clang] Support atomic operations on _BitInt(N) (PR #204815)
JF Bastien via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Jun 28 19:18:33 PDT 2026
jfbastien wrote:
> One observation on the example: it's a `fetch_add`, and with the fix I pushed it converges (old 5, new 6) and writes the padding back canonical instead of looping; GCC-14 appears to do the same. `compare_exchange` on that same dirtied object does fail in both, since it's a single native `cmpxchg` over the whole word. The object is out-of-contract either way, so happy to go with whatever behavior you'd prefer to mandate here.
>
> For the well-formed test I'll switch to your store-`b`-then-store-`a`-then-atomics shape.
Yes I think this is the right outcome. If it's a single-instruction cmpxchg that gets emitted, there ain't much we can do.
@Bigcheese and @chandlerc might be able to provide more input, they both cared about this a lot when we were talking about padding bits in atomics.
https://github.com/llvm/llvm-project/pull/204815
More information about the libcxx-commits
mailing list