From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7E7A03858C2B; Thu, 3 Nov 2022 09:55:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7E7A03858C2B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667469308; bh=GRQN7CfnuYQhcpNaal1C7mA7DbPipawsWkC/0MS7uHg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gR39qNI1afIkp+yyVMKtzDNtvFYwTZDtD/iq6r/IETu2kcfiAduI9gISGoOmUuvEL Lu8gheWrnOUOzZBqeZzbE+ef8GngMyTzahRr83079UFg+71QgmsYOwZGaDKqFIpL8Y gZALUsXQu96Duu3bysZnT8hqQYvJXM2NZlxblQGA= From: "lh_mouse at 126 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: Thu, 03 Nov 2022 09:55:07 +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: lh_mouse at 126 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: cc 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D80878 LIU Hao changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lh_mouse at 126 dot com --- Comment #36 from LIU Hao --- (In reply to Andrew Pinski from comment #1) > IIRC this was removed as the instruction cannot be used for read only mem= ory. That's not a valid argument. The first argument is a pointer to non-const t= ype, and whoever passes a read-only object bears the risk on their own. As mention in previous posts, the double-word compare-and-swap operation is invaluable for many algorithms. The fact that GCC does not generate it, even when requested explicitly with `-mcx16`, is silly and unacceptable. --- Comment #37 from LIU Hao --- (In reply to Andrew Pinski from comment #31) > 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). >=20 Can this be made using MOVDQA instead? I haven't tested this though, just o= ut of curiosity.=