https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108659

--- Comment #3 from Niall Douglas <s_gccbugzilla at nedprod dot com> ---
> AMD has guaranteed it, but there is still VIA and Zhaoxin and while we have 
> some statement from the latter, I'm not sure it is enough and we don't have 
> anything from VIA.  See PR104688 for details.

I'm wondering if a compiler opt out flag like -no-msseatomic16 to turn off use
of SSE for 128 bit atomics wouldn't be an idea? Given the small market share of
those CPU vendors, seems a shame to hold up implementation.

(Also, if you do turn it on by default and advertise that widely, I suspect
those vendors will hurry up with their documentation)

> FWIW, the GCC codegen for aarch64 is at https://godbolt.org/z/qvx9484nY (arm 
> and aarch64 are different targets). It emits a call to libatomic, which for 
> GCC 13 will use a lockless implementation when possible at runtime, see 
> g:d1288d850944f69a795e4ff444a427eba3fec11b

Thanks for the catch, my mistake. It would seem the codegen is similarly
inferior to the codegen from clang for both aarch64 and x64.

You may be interested in reading https://reviews.llvm.org/D110069. It wanted to
have LLVM generate a 128 bit AArch64 CAS for atomics. LLVM merged that change,
it'll be in the next release.

Reply via email to