From: Philipp Tomsich <philipp.tomsich@vrull.eu>
To: Jeff Law <jeffreyalaw@gmail.com>
Cc: gcc-patches@gcc.gnu.org, Jeff Law <jlaw@ventanamicro.com>,
Palmer Dabbelt <palmer@rivosinc.com>,
Christoph Muellner <christoph.muellner@vrull.eu>,
Kito Cheng <kito.cheng@gmail.com>,
Vineet Gupta <vineetg@rivosinc.com>
Subject: Re: [PATCH] RISC-V: Optimize masking with two clear bits not a SMALL_OPERAND
Date: Thu, 17 Nov 2022 15:43:01 +0100 [thread overview]
Message-ID: <CAAeLtUBp97awVGnFPjqZywA47MCY1Yqnun=ZbdoXFQhAqoy63g@mail.gmail.com> (raw)
In-Reply-To: <1d164b26-57b6-8c17-18cd-79e8dc77d29d@gmail.com>
On Thu, 17 Nov 2022 at 15:30, Jeff Law <jeffreyalaw@gmail.com> wrote:
>
>
> On 11/10/22 14:36, Philipp Tomsich wrote:
> > Add a split for cases where we can use two bclri (or one bclri and an
> > andi) to clear two bits.
> >
> > gcc/ChangeLog:
> >
> > * config/riscv/bitmanip.md (*bclri<mode>_nottwobits): New pattern.
> > (*bclridisi_nottwobits): New pattern, handling the sign-bit.
> > * config/riscv/predicates.md (const_nottwobits_operand):
> > New predicate.
> >
> > gcc/testsuite/ChangeLog:
> >
> > * gcc.target/riscv/zbs-bclri.c: New test.
>
> Don't we only have to worry about (subreg:DI (reg:SI )) to preserve the
> extension constraints? Not that I think there's any value in allowing
That is the reason for the !paradoxical_subreg_p(...) check in
"bclri<mode>_nottwobits"... so at pattern will always be safe.
Do you see a risk on the "*bclridisi_nottwobits"?
> HI/QI, mostly wanting to double check my understanding of the extension
> constraints.
QI will be fully covered by simm12 (e.g., using the andi instruction).
For HI, we might in fact want to have a special case (similar to
"*bclridisi_nottwobits") — but the reach of the simm12 seems to cover
enough of 16-bit space that this hasn't shown up (yet) as enough of a
problem to warrant a special case.
Philipp.
next prev parent reply other threads:[~2022-11-17 14:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-10 21:36 Philipp Tomsich
2022-11-17 14:30 ` Jeff Law
2022-11-17 14:43 ` Philipp Tomsich [this message]
2022-11-17 14:53 ` Jeff Law
2022-11-17 15:37 ` Philipp Tomsich
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='CAAeLtUBp97awVGnFPjqZywA47MCY1Yqnun=ZbdoXFQhAqoy63g@mail.gmail.com' \
--to=philipp.tomsich@vrull.eu \
--cc=christoph.muellner@vrull.eu \
--cc=gcc-patches@gcc.gnu.org \
--cc=jeffreyalaw@gmail.com \
--cc=jlaw@ventanamicro.com \
--cc=kito.cheng@gmail.com \
--cc=palmer@rivosinc.com \
--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).