From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C0D1B3858C53; Fri, 5 Aug 2022 10:17:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C0D1B3858C53 From: "jens.seifert at de dot ibm.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106536] New: P9: gcc does not detect setb pattern Date: Fri, 05 Aug 2022 10:17:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jens.seifert at de dot ibm.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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Fri, 05 Aug 2022 10:17:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106536 Bug ID: 106536 Summary: P9: gcc does not detect setb pattern Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: jens.seifert at de dot ibm.com Target Milestone: --- int compare2(unsigned long long a, unsigned long long b) { return (a > b ? 1 : (a < b ? -1 : 0)); } Output: _Z8compare2yy: cmpld 0,3,4 bgt 0,.L5 mfcr 3,128 rlwinm 3,3,1,1 neg 3,3 blr .L5: li 3,1 blr .long 0 .byte 0,9,0,0,0,0,0,0 clang generates: _Z8compare2yy: # @_Z8compare2yy cmpld 3, 4 setb 3, 0 extsw 3, 3 blr .long 0 .quad 0=