From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3DDEE385828C; Sun, 10 Dec 2023 10:32:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3DDEE385828C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1702204364; bh=5OaTaUNVKH8dk72i1CN0p1kOhyERE1PzklhDZU6/8hQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cYwy5LCHltr9x/+lnH7bvIRw4JE9XTvxoOzlcOJdfy+q0o+fAYjglUMMHbxFuFRml VchxLa7V6CNxagy5LFTFrIFG3odtFCvFmJZSauY5/i3jGL1wfW2SnblShvu4dv1Ide I9hbV/81LtS9ImT3eofIwGdQvnKTVGKGGpT0fxao= From: "admin_public at liblfds dot org" 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: Sun, 10 Dec 2023 10:32:43 +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: admin_public at liblfds dot org 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D80878 --- Comment #43 from admin_public at liblfds dot org --- > I tested CMPXCHG16B with inline assembly on an i7-1165G7 (Dell XPS 13 930= 5) and it turned out to be much slower than CMPXCHG, even slower than a pai= r of calls to `pthread_mutex_lock()` and unlock. Mutexes are faster when single threaded and there's no contention to the locking object. Compare-exchange (8 or 16) is much faster (orders of magni= tude faster) as contention rises. Sometimes you need CAS 16, rather than CAS 8, due to the implementation requirements of lock free data structures.=