This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/80878] -mcx16 (enable 128 bit CAS) on x86_64 seems not to work on 7.1.0


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]