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>,
Jeff Law <jlaw@ventanamicro.com>,
Christoph Muellner <christoph.muellner@vrull.eu>,
Palmer Dabbelt <palmer@rivosinc.com>,
Vineet Gupta <vineetg@rivosinc.com>
Subject: Re: [PATCH v2] RISC-V: No extensions for SImode min/max against safe constant
Date: Fri, 18 Nov 2022 21:24:00 +0100 [thread overview]
Message-ID: <CAAeLtUApHc6ORNNtjFAN6kKquvtN4fxQmjSiQqo1sKbygH3+1Q@mail.gmail.com> (raw)
In-Reply-To: <44c463f0-5ef7-abc7-bc9b-e2c195394086@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1103 bytes --]
Applied to master. Thanks!
--Philipp.
On Fri, 18 Nov 2022 at 21:11, Jeff Law <jeffreyalaw@gmail.com> wrote:
>
> On 11/8/22 17:06, Philipp Tomsich wrote:
> > Optimize the common case of a SImode min/max against a constant
> > that is safe both for sign- and zero-extension.
> > E.g., consider the case
> > int f(unsigned int* a)
> > {
> > const int C = 1000;
> > return *a * 3 > C ? C : *a * 3;
> > }
> > where the constant C will yield the same result in DImode whether
> > sign- or zero-extended.
> >
> > This should eventually go away once the lowering to RTL smartens up
> > and considers the precision/signedness and the value-ranges of the
> > operands to MIN_EXPR nad MAX_EXPR.
> >
> > gcc/ChangeLog:
> >
> > * config/riscv/bitmanip.md (*minmax): Additional pattern for
> > min/max against constants that are extension-invariant.
> > * config/riscv/iterators.md (minmax_optab): Add an iterator
> > that has only min and max rtl.
> >
> > gcc/testsuite/ChangeLog:
> >
> > * gcc.target/riscv/zbb-min-max-02.c: New test.
>
> Ok
>
> jeff
>
>
>
prev parent reply other threads:[~2022-11-18 20:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 0:06 Philipp Tomsich
2022-11-18 20:11 ` Jeff Law
2022-11-18 20:24 ` 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=CAAeLtUApHc6ORNNtjFAN6kKquvtN4fxQmjSiQqo1sKbygH3+1Q@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).