On 4/10/23 14:59, Philipp Tomsich wrote:
On Mon, 10 Apr 2023 at 17:57, Jeff Law <jeffreya...@gmail.com> wrote:



On 4/9/23 23:07, Lin Sinan via Gcc-patches wrote:
From: Sinan Lin <linsinan....@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 via email to