From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 63BDF3A600EF; Fri, 7 May 2021 12:27:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 63BDF3A600EF From: "s_gccbugzilla at nedprod dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/80878] -mcx16 (enable 128 bit CAS) on x86_64 seems not to work on 7.1.0 Date: Fri, 07 May 2021 12:27:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 7.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: s_gccbugzilla at nedprod dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 May 2021 12:27:39 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D80878 --- Comment #33 from Niall Douglas --- (In reply to Andrew Pinski from comment #31) >=20 > Again the problem is stuff like: > static const _Atomic __int128_t t =3D 2000; >=20 > __int128_t g(void) > { > return t; > } >=20 > DOES NOT WORK if you use CAS (or ldaxp/stlxp). I think we are talking about different things here. You are talking about calling convention. I'm talking about std::atomic<__int128>::compare_exchange_weak() i.e. that the specific member function compare_exchange_weak() is not generating cmpxchg16b if compiled w= ith GCC, but does with clang. Re: your original point, I cannot say anything about _Atomic. However, for std::atomic<__int128>, as __int128 is not an integral type it seems reasona= ble to me that its specialisation tell the compiler to not store it in read only memory. Mark it with attribute section, give it a non-trivial destructor, or whatever it needs. Perhaps I ought to open a separate issue here, as my specific problem is th= at std::atomic<__int128>::compare_exchange_weak() is not using cmpxchg16b? Mr. Wakely your thoughts?=