public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/109657] (a ? -1 : 0) | b could be optimized better for aarch64
Date: Tue, 02 May 2023 21:10:54 +0000	[thread overview]
Message-ID: <bug-109657-4-qittZ16vNl@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109657-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>:

https://gcc.gnu.org/g:7cc33d12dca84befde69259a17fab8224e2e4025

commit r14-412-g7cc33d12dca84befde69259a17fab8224e2e4025
Author: Andrew Pinski <apinski@marvell.com>
Date:   Fri Apr 28 05:22:34 2023 +0000

    target: [PR109657] (a ? -1 : 0) | b could be optimized better for aarch64

    There is no canonical form for this case defined. So the aarch64 backend
needs
    a pattern to match both of these forms.

    The forms are:
    (set (reg/i:SI 0 x0)
        (if_then_else:SI (eq (reg:CC 66 cc)
                (const_int 0 [0]))
            (reg:SI 97)
            (const_int -1 [0xffffffffffffffff])))
    and
    (set (reg/i:SI 0 x0)
        (ior:SI (neg:SI (ne:SI (reg:CC 66 cc)
                    (const_int 0 [0])))
            (reg:SI 102)))

    Currently the aarch64 backend matches the first form so this
    patch adds a insn_and_split to match the second form and
    convert it to the first form.

    OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions

            PR target/109657

    gcc/ChangeLog:

            * config/aarch64/aarch64.md (*cmov<mode>_insn_m1): New
            insn_and_split pattern.

    gcc/testsuite/ChangeLog:

            * gcc.target/aarch64/csinv-2.c: New test.

  parent reply	other threads:[~2023-05-02 21:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 22:47 [Bug target/109657] New: " pinskia at gcc dot gnu.org
2023-04-28  5:07 ` [Bug target/109657] " pinskia at gcc dot gnu.org
2023-04-28 23:35 ` pinskia at gcc dot gnu.org
2023-05-02 21:10 ` cvs-commit at gcc dot gnu.org [this message]
2023-05-02 21:11 ` pinskia 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-109657-4-qittZ16vNl@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).