[libcxx-commits] [libcxx] [libc++] Implement P0493R5: Atomic minimum/maximum (PR #180333)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Feb 8 02:39:38 PST 2026


https://github.com/huixie90 commented:

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?

https://github.com/llvm/llvm-project/pull/180333


More information about the libcxx-commits mailing list