[libcxx-commits] [libcxx] [libc++] Implement P0493R5: Atomic minimum/maximum (PR #180333)
Connector Switch via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Feb 8 03:40:56 PST 2026
c8ef wrote:
> I think clang does tried to create the builtin that looks like gcc one , but gcc does not actually have it.
>
> ```
> // GCC does not support these, they are a Clang extension.
> def AtomicFetchMax : AtomicBuiltin {
> let Spellings = ["__atomic_fetch_max"];
> let Attributes = [CustomTypeChecking];
> let Prototype = "void(...)";
> }
> ```
>
> Given about, in the `atomic_ref` case, I wonder if we should test if the builtin exists, if so, use it , otherwise fallback to the CAS loop?
Indeed, using the builtin will simplify the implementation for clang. Done.
https://github.com/llvm/llvm-project/pull/180333
More information about the libcxx-commits
mailing list