From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9F8FE3858D20; Mon, 27 Feb 2023 09:01:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F8FE3858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677488513; bh=+UnK1xyUIA9E4FuXxj32eH99nu9rm227d445yIlTIA8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SM28z8bOsGJ3l0KCSyr2WdLLhB3hCQaHbmLlMtUj23XZmi+qTqrBQk/L6JXjItf7l GrKItq2guiDlBjxaUj+MrZGOeqR11NO/ZxfBNMmjBy0PitG+1cfw3AFPg2+dgEbQNW s1fCc8c/nv/1D8xitU/+R5dUFwJcJsxwdVhLP7sE= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108938] Missing bswap detection Date: Mon, 27 Feb 2023 09:01:52 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org 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=3D108938 --- Comment #3 from Jakub Jelinek --- You're right. Then we should handle it more generically, basically check if either the CMPNOP or CMPXCHG patterns (well, their narrowed counterparts based on size) would match if rotated by a multiple of 8 and rotate optab is present for t= hat mode. Then it would handle even cases like 64-bit bswap followed by a single rota= te.=20 It needs to be done after comparison of CMPNOP and CMPXCHG non-rotated thou= gh, because we want to preserve current behavior for 16-bit nop/bswap candidate= s.=