From: Philipp Tomsich <philipp.tomsich@vrull.eu>
To: Jeff Law <jeffreyalaw@gmail.com>
Cc: gcc-patches@gcc.gnu.org, Kito Cheng <kito.cheng@gmail.com>,
Christoph Muellner <christoph.muellner@vrull.eu>,
Vineet Gupta <vineetg@rivosinc.com>,
Jeff Law <jlaw@ventanamicro.com>,
Palmer Dabbelt <palmer@rivosinc.com>
Subject: Re: [PATCH] RISC-V: Use binvi to cover more immediates than with xori alone
Date: Wed, 16 Nov 2022 10:17:42 +0100 [thread overview]
Message-ID: <CAAeLtUBNmeUEZkF5ODXxG-dMtRz9UQ8T6uHPonQf0XZF1aQjmg@mail.gmail.com> (raw)
In-Reply-To: <1c091d0d-e355-8fd8-8c6b-1bfe77f20291@gmail.com>
On Wed, 16 Nov 2022 at 04:45, Jeff Law <jeffreyalaw@gmail.com> wrote:
>
>
> On 11/10/22 14:35, Philipp Tomsich wrote:
> > Sequences of the form "a ^ C" with C being the positive half of a
> > signed immediate's range with one extra bit set in addtion are mapped
> > to xori and one binvi to avoid using a temporary (and a multi-insn
> > sequence to load C into that temporary).
> >
> > gcc/ChangeLog:
> >
> > * config/riscv/bitmanip.md (*binvi<mode>_extrabit): New pattern.
> >
> > gcc/testsuite/ChangeLog:
> >
> > * gcc.target/riscv/zbs-binvi.c: New test.
>
> Could this have been potentially done by extending the ior pattern with
> a code iterator that covered IOR/XOR?
>
>
> Not a big deal, but if it'd work, consider to avoid the pattern duplication.
We'll rework to using an iterator and a mapping in v2 for the
following cases, folding into a single patch:
- X | C => bseti
- X & ~C => bclri
- X ^ C => binvi
Thanks.
Philipp.
prev parent reply other threads:[~2022-11-16 9:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-10 21:35 Philipp Tomsich
2022-11-16 3:45 ` Jeff Law
2022-11-16 9:17 ` Philipp Tomsich [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=CAAeLtUBNmeUEZkF5ODXxG-dMtRz9UQ8T6uHPonQf0XZF1aQjmg@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).