public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Lin Sinan <mynameisxiaou@gmail.com>, gcc-patches@gcc.gnu.org
Cc: philipp.tomsich@vrull.eu, kito.cheng@gmail.com,
	palmer@dabbelt.com, andrew@sifive.com,
	Sinan Lin <linsinan.lsn@linux.alibaba.com>
Subject: Re: [PATCH] RISC-V: avoid splitting small constant in <or_optab>i<mode>_extrabit pattern
Date: Mon, 10 Apr 2023 09:57:22 -0600	[thread overview]
Message-ID: <88a0ea4e-7d5d-13c2-b73c-87fc35f682bb@gmail.com> (raw)
In-Reply-To: <20230410050701.10254-1-mynameisxiaou@gmail.com>



On 4/9/23 23:07, Lin Sinan via Gcc-patches wrote:
> From: Sinan Lin <linsinan.lsn@linux.alibaba.com>
> 
> there is no need to split an xori/ori with an small constant. take the test
> case `int foo(int idx) { return idx|3; }` as an example,
> 
> rv64im_zba generates:
>          ori     a0,a0,3
>          ret
> but, rv64im_zba_zbs generates:
>          ori     a0,a0,1
>          ori     a0,a0,2
>          ret
> 
> with this change, insn `ori r2,r1,3` will not be splitted in zbs.
> ---
>   gcc/config/riscv/predicates.md                     |  2 +-
>   .../gcc.target/riscv/zbs-extra-bit-or-twobits.c    | 14 ++++++++++++++
>   2 files changed, 15 insertions(+), 1 deletion(-)
>   create mode 100644 gcc/testsuite/gcc.target/riscv/zbs-extra-bit-or-twobits.c
A minor oversight in the VRULL patches in this space.  This is actually 
a regression as we were previously generating the single [xo]ri.


The patch looks fine, though it does need to go through a test cycle.

jeff


  reply	other threads:[~2023-04-10 15:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-10  5:07 Lin Sinan
2023-04-10 15:57 ` Jeff Law [this message]
2023-04-10 20:59   ` Philipp Tomsich
2023-04-11 16:19     ` Jeff Law
2023-04-11 16:28 ` Jeff Law

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=88a0ea4e-7d5d-13c2-b73c-87fc35f682bb@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=andrew@sifive.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kito.cheng@gmail.com \
    --cc=linsinan.lsn@linux.alibaba.com \
    --cc=mynameisxiaou@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=philipp.tomsich@vrull.eu \
    /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).