From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EC5943857405; Thu, 13 Jan 2022 16:34:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC5943857405 From: "segher at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95737] PPC: Unnecessary extsw after negative less than Date: Thu, 13 Jan 2022 16:34:29 +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: 8.3.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: segher at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: segher 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jan 2022 16:34:30 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95737 --- Comment #8 from Segher Boessenkool --- Somewhat more constructive... The problem here is that neg isn't pushed "through" isel insns. This in general means you need to negate both inputs to the isel of course, but there are cases where that is advantageous, like here when both of those inputs are constants (or actually registers, but set to some constant). This is one reason the new set[n]bc[r] insns are so useful to us: it is all one insn, also on RTL level, so it naturally works out in such cases. It also is slightly faster anyway of course, fewer insns and all that, even if for dataflow it is all the same.=