public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Philipp Tomsich <philipp.tomsich@vrull.eu>
Cc: Lin Sinan <mynameisxiaou@gmail.com>,
	gcc-patches@gcc.gnu.org, 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: Tue, 11 Apr 2023 10:19:05 -0600	[thread overview]
Message-ID: <ec9c3c10-9b2d-a222-f27b-82d37314c86b@gmail.com> (raw)
In-Reply-To: <CAAeLtUAH6u6SeZk0F4GH-UFZeZDfEqyZfi5pQ3EHAMAWeToOcg@mail.gmail.com>



On 4/10/23 14:59, Philipp Tomsich wrote:
> On Mon, 10 Apr 2023 at 17:57, Jeff Law <jeffreyalaw@gmail.com> wrote:
>>
>>
>>
>> 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.
> 
> Thanks for catching this one!
> 
> I looked this change over and it looks fine.  I hope this is the last
> fallout from this set of changes.
Just for completeness, I bootstrapped and regression tested Sinan's 
change on rv64.  Given it's a regression, I'm going to go ahead and 
commit it to the trunk momentarily.

jeff

  reply	other threads:[~2023-04-11 16:19 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
2023-04-10 20:59   ` Philipp Tomsich
2023-04-11 16:19     ` Jeff Law [this message]
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=ec9c3c10-9b2d-a222-f27b-82d37314c86b@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).