From: Jeff Law <jeffreyalaw@gmail.com>
To: Philipp Tomsich <philipp.tomsich@vrull.eu>
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 07:53:07 -0700 [thread overview]
Message-ID: <61be3eab-68b0-67d0-262a-32106971ad32@gmail.com> (raw)
In-Reply-To: <CAAeLtUBp97awVGnFPjqZywA47MCY1Yqnun=ZbdoXFQhAqoy63g@mail.gmail.com>
On 11/17/22 07:43, Philipp Tomsich wrote:
> 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"?
It's jut a sanity check for me, I don't have any concerns since you're
avoiding this when working on a paradoxical. But it does make me wonder
if we need a paradoxical check on the other bit twiddles patterns to
prevent them from changing the SImode sign bit in a paradoxical.
Jeff
next prev parent reply other threads:[~2022-11-17 14:53 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
2022-11-17 14:53 ` Jeff Law [this message]
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=61be3eab-68b0-67d0-262a-32106971ad32@gmail.com \
--to=jeffreyalaw@gmail.com \
--cc=christoph.muellner@vrull.eu \
--cc=gcc-patches@gcc.gnu.org \
--cc=jlaw@ventanamicro.com \
--cc=kito.cheng@gmail.com \
--cc=palmer@rivosinc.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).