public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jens.seifert at de dot ibm.com" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-106536-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106536

            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

             reply	other threads:[~2022-08-05 10:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-05 10:17 jens.seifert at de dot ibm.com [this message]
2022-09-13 16:25 ` [Bug target/106536] " segher at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-106536-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).