From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2F4583858C00; Thu, 23 Feb 2023 23:32:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F4583858C00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677195164; bh=3vNxrYwgbRk9Os0q80FEBKwDsfGOEFl/gyMB9BtOUQI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mTlqO8uija30i1hwttqQBm+xDETZDFonQp2cRjeZFAEBnJLRogB/pxq9Ty+d61NDo GVh/80LnYaT8vAYDHtbv1vo0N11AsFYlV9vg5fCMwRsdF8Uv1F1vyVLl1z1sfzQBvY 7AbCs3m5TbV+jP5QtFTCY0BYIDiIpeW6BV01Y37c= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108874] [10/11/12/13 Regression] Missing bswap detection Date: Thu, 23 Feb 2023 23: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: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.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: 10.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed cf_reconfirmed_on cf_gcctarget keywords bug_status 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=3D108874 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2023-02-23 Target|arm |arm, aarch64 Keywords|needs-bisection | Status|UNCONFIRMED |NEW --- Comment #5 from Andrew Pinski --- How it worked before because of the following combine, removing 1 instructi= on and then doing the 4->1 matching: Trying 7 -> 10: (set (reg:SI 80 [ D.3188 ]) (ior:SI (lshiftrt:SI (reg:SI 81 [ D.3187 ]) (const_int 8 [0x8])) (reg:SI 84 [ D.3187 ]))) So we could match add a pattern/split that matching this combine: Trying 6, 7 -> 10: 6: r99:SI=3Dr97:SI 0>>0x8 7: r100:SI=3Dr99:SI&0xff00ff REG_DEAD r99:SI 10: r98:SI=3Dr100:SI|r102:SI REG_DEAD r102:SI REG_DEAD r100:SI Failed to match this instruction: (set (reg:SI 98) (ior:SI (and:SI (lshiftrt:SI (reg/v:SI 97 [ x ]) (const_int 8 [0x8])) (const_int 16711935 [0xff00ff])) (reg:SI 102))) into two, pushing the and before the shift right. Note this would require modifying both the arm and aarch64 backends but it seems doable.=