On Thu, 17 Nov 2022 at 15:30, Jeff Law <jeffreya...@gmail.com> wrote:
>
>
> On 11/10/22 14:36, Philipp Tomsich wrote:
> > Add a split for cases where we can use two bclri (or one bclri and an
> > andi) to clear two bits.
> >
> > gcc/ChangeLog:
> >
> >       * config/riscv/bitmanip.md (*bclri<mode>_nottwobits): New pattern.
> >       (*bclridisi_nottwobits): New pattern, handling the sign-bit.
> >       * config/riscv/predicates.md (const_nottwobits_operand):
> >       New predicate.
> >
> > gcc/testsuite/ChangeLog:
> >
> >       * gcc.target/riscv/zbs-bclri.c: New test.
>
> Don't we only have to worry about (subreg:DI (reg:SI )) to preserve the
> extension constraints?  Not that I think there's any value in allowing

That is the reason for the !paradoxical_subreg_p(...) check in
"bclri<mode>_nottwobits"... so at pattern will always be safe.

Do you see a risk on the "*bclridisi_nottwobits"?

> HI/QI, mostly wanting to double check my understanding of the extension
> constraints.

QI will be fully covered by simm12 (e.g., using the andi instruction).

For HI, we might in fact want to have a special case (similar to
"*bclridisi_nottwobits") — but the reach of the simm12 seems to cover
enough of 16-bit space that this hasn't shown up (yet) as enough of a
problem to warrant a special case.

Philipp.

Reply via email to