jyknight wrote:

There's two sets of atomic functions:
`__atomic_*` are provided by libatomic, and might use locking, or not.
`__sync_*` should always be lock-free. These are only used on certain 
architectures where it's guaranteed that the operation _can_ be implemented 
lock-free, but it's desirable for whatever reason to not do so inline.

For this patch, I think the correct behavior is:
- If Zalrsc is present, but Zaamo is not, you may either emit an LR/SC loop 
(what I'd recommend), or emit an out-of-line call to `__sync_*` (which needs to 
be implemented with that LR/SC loop.)
- If Zaamo is present, but neither Zalrsc nor Zacas are present, I think 
there's no way to implement a cmpxchg operation. This means lock-free atomics 
cannot be supported, so it should `setMaxAtomicSizeInBitsSupported(0)`.

https://github.com/llvm/llvm-project/pull/77424
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to