From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3C2EE3858C36; Mon, 10 Jul 2023 04:27:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C2EE3858C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688963230; bh=RjGpZDFPdLowJCjHBOPRkVi7jvCF2q0Z6smHcIGDZWo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=b2oq0Pgf46qZSIRuH//dRdB2q+NuUTDdMgb2sjLpcWvg9KzGNFfA7QSkMh9RxEAfO RLETUg7AVb9e4SL6LJ4FOZEK6+wWGbCUYf86o2w3LEFZbOyC7UYdvJ5H+49p5CwygC CKkoauhThD2wi6jorh3SSgOmAJc1Tk+k3xX9a8nA= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110591] [i386] (Maybe) Missed optimisation: _cmpccxadd sets flags Date: Mon, 10 Jul 2023 04:27:09 +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: 13.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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=3D110591 --- Comment #2 from Hongtao.liu --- (In reply to Hongtao.liu from comment #1) > I guess we can add a peephole for this, middle-end optimizer doesn't know > cmpccxadd set EFLAGS same as cmp. We already have a peephole for cmpxchg, for cmpxchg it's only valid for CCZmode, but for cmpccxadd, it should be ok for all CCmode since it sets EF= LAGS exactly the same as CMP. The _CMPCCX_Z in the intrinsic is used as conditio= n of updating memory.=