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 middle-end/101955] (signed<<31)>>31 should become -(signed&1)
Date: Mon, 30 Oct 2023 16:23:08 +0000	[thread overview]
Message-ID: <bug-101955-4-ZktFlLLE9X@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101955-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Roger Sayle <sayle@gcc.gnu.org>:

https://gcc.gnu.org/g:a3da9adeb457d4f01c4e695a9621f90c2e2a5e68

commit r14-5014-ga3da9adeb457d4f01c4e695a9621f90c2e2a5e68
Author: Roger Sayle <roger@nextmovesoftware.com>
Date:   Mon Oct 30 16:21:28 2023 +0000

    ARC: Convert (signed<<31)>>31 to -(signed&1) without barrel shifter.

    This patch optimizes PR middle-end/101955 for the ARC backend.  On ARC
    CPUs with a barrel shifter, using two shifts is optimal as:

            asl_s   r0,r0,31
            asr_s   r0,r0,31

    but without a barrel shifter, GCC -O2 -mcpu=em currently generates:

            and     r2,r0,1
            ror     r2,r2
            add.f   0,r2,r2
            sbc     r0,r0,r0

    with this patch, we now generate the smaller, faster and non-flags
    clobbering:

            bmsk_s  r0,r0,0
            neg_s   r0,r0

    2023-10-30  Roger Sayle  <roger@nextmovesoftware.com>

    gcc/ChangeLog
            PR middle-end/101955
            * config/arc/arc.md (*extvsi_1_0): New define_insn_and_split
            to convert sign extract of the least significant bit into an
            AND $1 then a NEG when !TARGET_BARREL_SHIFTER.

    gcc/testsuite/ChangeLog
            PR middle-end/101955
            * gcc.target/arc/pr101955.c: New test case.

      parent reply	other threads:[~2023-10-30 16:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18  5:47 [Bug middle-end/101955] New: " pinskia at gcc dot gnu.org
2021-08-18  5:48 ` [Bug middle-end/101955] " pinskia at gcc dot gnu.org
2021-08-18  6:49 ` rguenth at gcc dot gnu.org
2021-08-18 15:51 ` schwab@linux-m68k.org
2021-08-18 17:51 ` pinskia at gcc dot gnu.org
2021-08-18 19:22 ` jakub at gcc dot gnu.org
2021-11-11  0:21 ` navidrahimi at microsoft dot com
2023-08-04  7:10 ` cvs-commit at gcc dot gnu.org
2023-10-11  7:09 ` cvs-commit at gcc dot gnu.org
2023-10-20 23:08 ` cvs-commit at gcc dot gnu.org
2023-10-30 16:23 ` cvs-commit at gcc dot gnu.org [this message]

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-101955-4-ZktFlLLE9X@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).