From: Philipp Tomsich <philipp.tomsich@vrull.eu>
To: Kito Cheng <kito.cheng@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
Andrew Waterman <andrew@sifive.com>,
Vineet Gupta <vineetg@rivosinc.com>
Subject: Re: [PATCH v1 1/3] RISC-V: add consecutive_bits_operand predicate
Date: Tue, 14 Jun 2022 13:38:33 +0200 [thread overview]
Message-ID: <CAAeLtUBCsFfzkbhUNbAh9L=vYxoU1qvHso0P_Zs6KhTkKZrs0A@mail.gmail.com> (raw)
In-Reply-To: <CA+yXCZBiro=Ux=W01vR+g1_LFheRbM-x=k5=-iT-q=Czaz=VYA@mail.gmail.com>
Thanks, applied to master!
On Tue, 7 Jun 2022 at 12:26, Kito Cheng <kito.cheng@gmail.com> wrote:
>
> LGTM
>
>
> On Wed, May 25, 2022 at 5:48 AM Philipp Tomsich
> <philipp.tomsich@vrull.eu> wrote:
> >
> > Provide an easy way to constrain for constants that are a a single,
> > consecutive run of ones.
> >
> > gcc/ChangeLog:
> >
> > * config/riscv/predicates.md (consecutive_bits_operand):
> > Implement new predicate.
> >
> > Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
> > ---
> >
> > gcc/config/riscv/predicates.md | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/gcc/config/riscv/predicates.md b/gcc/config/riscv/predicates.md
> > index c37caa2502b..90db5dfcdd5 100644
> > --- a/gcc/config/riscv/predicates.md
> > +++ b/gcc/config/riscv/predicates.md
> > @@ -243,3 +243,14 @@ (define_predicate "const63_operand"
> > (define_predicate "imm5_operand"
> > (and (match_code "const_int")
> > (match_test "INTVAL (op) < 5")))
> > +
> > +;; A CONST_INT operand that consists of a single run of consecutive set bits.
> > +(define_predicate "consecutive_bits_operand"
> > + (match_code "const_int")
> > +{
> > + unsigned HOST_WIDE_INT val = UINTVAL (op);
> > + if (exact_log2 ((val >> ctz_hwi (val)) + 1) < 0)
> > + return false;
> > +
> > + return true;
> > +})
> > --
> > 2.34.1
> >
next prev parent reply other threads:[~2022-06-14 11:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-24 21:47 [PATCH v1 0/3] RISC-V: Improve sequences with shifted zero-extended operands Philipp Tomsich
2022-05-24 21:47 ` [PATCH v1 1/3] RISC-V: add consecutive_bits_operand predicate Philipp Tomsich
2022-06-07 10:25 ` Kito Cheng
2022-06-14 11:38 ` Philipp Tomsich [this message]
2022-05-24 21:47 ` [PATCH v1 2/3] RISC-V: Split slli+sh[123]add.uw opportunities to avoid zext.w Philipp Tomsich
2022-06-07 10:25 ` Kito Cheng
2022-06-14 11:39 ` Philipp Tomsich
2022-06-17 8:34 ` Andreas Schwab
2022-06-17 14:00 ` Kito Cheng
2022-06-17 14:19 ` Philipp Tomsich
2022-05-24 21:47 ` [PATCH v1 3/3] RISC-V: Replace zero_extendsidi2_shifted with generalized split Philipp Tomsich
2022-06-07 10:24 ` Kito Cheng
2022-06-07 10:50 ` Philipp Tomsich
2022-06-07 13:18 ` Kito Cheng
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='CAAeLtUBCsFfzkbhUNbAh9L=vYxoU1qvHso0P_Zs6KhTkKZrs0A@mail.gmail.com' \
--to=philipp.tomsich@vrull.eu \
--cc=andrew@sifive.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=kito.cheng@gmail.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).