On Mon, 26 Feb 2018, Ruslan Nikolaev via gcc wrote:
> Well, if libatomic is already doing it when corresponding CPU feature is
> available (i.e., effectively implementing operations using cmpxchg16b), I do
> not see any problem here. mcx16 implies that you *have* cmpxchg16b, therefore
> other code compiled without -mcx16 flag will go to libatomic. Inside
> libatomic, it will detect that cmpxchg16b *is* available, thus making code
> compiled with and without -mcx16 flag completely compatible on a given system.
> Or do I miss something here?

I'd say the main issue is that libatomic is not guaranteed to work like that.
Today it relies on IFUNC for redirection, so you may (and not "will") get the
desired behavior on Glibc (implying Linux), not on other OSes, and neither on
Linux with non-GNU libc (nor on bare metal, for that matter).

Alexander

Reply via email to