public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Christoph Müllner" <christoph.muellner@vrull.eu>
To: Jeff Law <jeffreyalaw@gmail.com>
Cc: gcc-patches@gcc.gnu.org, Kito Cheng <kito.cheng@sifive.com>,
	 Jim Wilson <jim.wilson.gcc@gmail.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	 Andrew Waterman <andrew@sifive.com>,
	Philipp Tomsich <philipp.tomsich@vrull.eu>,
	 Vineet Gupta <vineetg@rivosinc.com>
Subject: Re: [PATCH v2 4/4] RISC-V: Cover sign-extensions in lshr<GPR:mode>3_zero_extend_4
Date: Wed, 8 May 2024 16:05:27 +0200	[thread overview]
Message-ID: <CAEg0e7iRZ9JgQ1VBj_zxtZFnu2Q_kpV6wzRLuN_fS5A1yOMLsA@mail.gmail.com> (raw)
In-Reply-To: <4a232342-332a-42e5-aac6-ef9148cae5b6@gmail.com>

On Wed, May 8, 2024 at 3:48 PM Jeff Law <jeffreyalaw@gmail.com> wrote:
>
>
>
> On 5/8/24 1:36 AM, Christoph Müllner wrote:
> > The lshr<GPR:mode>3_zero_extend_4 pattern targets bit extraction
> > with zero-extension. This pattern represents the canonical form
> > of zero-extensions of a logical right shift.
> >
> > The same optimization can be applied to sign-extensions.
> > Given the two optimizations are so similar, this patch converts
> > the existing one to also cover the sign-extension case as well.
> >
> > gcc/ChangeLog:
> >
> >       * config/riscv/iterators.md (ashiftrt): New code attribute
> >       'extract_shift' and adding extractions to optab.
> >       * config/riscv/riscv.md (*lshr<GPR:mode>3_zero_extend_4): Rename to...
> >       (*<any_extract:optab><GPR:mode>3):...this and add support for
> >       sign-extensions.
> >
> > gcc/testsuite/ChangeLog:
> >
> >       * gcc.target/riscv/extend-shift-helpers.h: Add helpers for
> >       sign-extension.
> >       * gcc.target/riscv/sign-extend-rshift-32.c: New test.
> >       * gcc.target/riscv/sign-extend-rshift-64.c: New test.
> >       * gcc.target/riscv/sign-extend-rshift.c: New test.
> Oh, I see, you handled the special case with this patch.  Ignore my
> comment on 3/4.  3/4 is fine, as is this patch.

Oh, yes, I forgot to add this to 3/4.

Thanks!

>
> Thanks!
>
> jeff

  reply	other threads:[~2024-05-08 14:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-08  7:36 [PATCH v2 1/4] RISC-V: Add test for sraiw-31 special case Christoph Müllner
2024-05-08  7:36 ` [PATCH v2 2/4] RISC-V: Cover sign-extensions in lshrsi3_zero_extend_2 Christoph Müllner
2024-05-08 13:40   ` Jeff Law
2024-05-08  7:36 ` [PATCH v2 3/4] RISC-V: Add zero_extract support for rv64gc Christoph Müllner
2024-05-08 13:46   ` Jeff Law
2024-05-08  7:36 ` [PATCH v2 4/4] RISC-V: Cover sign-extensions in lshr<GPR:mode>3_zero_extend_4 Christoph Müllner
2024-05-08 13:48   ` Jeff Law
2024-05-08 14:05     ` Christoph Müllner [this message]
2024-05-08 13:38 ` [PATCH v2 1/4] RISC-V: Add test for sraiw-31 special case Jeff Law

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=CAEg0e7iRZ9JgQ1VBj_zxtZFnu2Q_kpV6wzRLuN_fS5A1yOMLsA@mail.gmail.com \
    --to=christoph.muellner@vrull.eu \
    --cc=andrew@sifive.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=jim.wilson.gcc@gmail.com \
    --cc=kito.cheng@sifive.com \
    --cc=palmer@dabbelt.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=vineetg@rivosinc.com \
    /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).