Re: [PATCH] RISC-V: Fix wrong partial subreg check for bsetidisi

2023-03-05 Thread Kito Cheng via Gcc-patches
Committed, thanks! On Tue, Feb 28, 2023 at 5:32 PM Philipp Tomsich wrote: > > On Tue, 28 Feb 2023 at 06:00, Lin Sinan wrote: > > > > From: Lin Sinan > > > > The partial subreg check should be for subreg operand(operand 1) instead of > > the immediate operand(operand 2). This change also fix

Re: [PATCH] RISC-V: Fix wrong partial subreg check for bsetidisi

2023-02-28 Thread Philipp Tomsich
On Tue, 28 Feb 2023 at 06:00, Lin Sinan wrote: > > From: Lin Sinan > > The partial subreg check should be for subreg operand(operand 1) instead of > the immediate operand(operand 2). This change also fix pr68648.c in zbs. Good catch. Reviewed-by:

Re: [PATCH] RISC-V: Fix wrong partial subreg check for bsetidisi

2023-02-27 Thread Sinan Lin via Gcc-patches
I encountered a miscompilation case with zbs, where bseti without sign extension emitted from bsetidisi pattern leads to wrong output. Take pr68648.c as an example, -march=rv64gc_zba_zbb_zbs -O3 did not generate sext.w in int bar (void) and led to a wrong value in a0. It seems that the partial

[PATCH] RISC-V: Fix wrong partial subreg check for bsetidisi

2023-02-27 Thread Lin Sinan via Gcc-patches
From: Lin Sinan The partial subreg check should be for subreg operand(operand 1) instead of the immediate operand(operand 2). This change also fix pr68648.c in zbs. gcc/ChangeLog: * config/riscv/bitmanip.md: Fix wrong index in the check. --- gcc/config/riscv/bitmanip.md | 2 +- 1