Open
Description
This issues came up in implementing P0020R6 Floating Point Atomic for libc++
#67799
Basically we are trying to use __cxx_atomic_fetch_add
for implementing atomic RMW operations. However, this function would error on some platforms for long double
if the representation is x87 fp80 format. On the library (libc++) side, there is no way for us to tell if the function __cxx_atomic_fetch_add
is going to error on the current platform or not.
The builtin should handle this properly: generates FADD IR for platforms that support it, and fallback to the compare-exchange loop on the platforms that don't