This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/80878] -mcx16 (enable 128 bit CAS) on x86_64 seems not to work on 7.1.0
- From: "fw at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 29 Mar 2018 13:52:50 +0000
- Subject: [Bug target/80878] -mcx16 (enable 128 bit CAS) on x86_64 seems not to work on 7.1.0
- Auto-submitted: auto-generated
- References: <bug-80878-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80878
Florian Weimer <fw at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |NEW
Last reconfirmed| |2018-03-29
Resolution|INVALID |---
Ever confirmed|0 |1
--- Comment #11 from Florian Weimer <fw at gcc dot gnu.org> ---
We do have a bug here: libatomic selects CMPXCHG16B based on CPUID support. If
we want to support loads from read-only mappings, we cannot do that, and have
to use locks unconditionally (for all 128-bit atomics, to achieve
synchronization).
So we either need to fix libatomic to use locks consistently, or -mcx16 should
enable the 128 bit CAS instruction (for loads/stores/CAS).
I believe most users who use the 128-bit atomics on x86-64 will want the
lock-free instructions, and not the support for read-only mappings.
Furthermore, the read-only mapping case is most relevant to cross-process
synchronization, and a process-local lock will not achieve synchronization
there.