]> git.ipfire.org Git - thirdparty/gcc.git/commit
[RISCV] Use constraints/predicates instead of checking const_int directly for shNadd...
authorAndrew Pinski <apinski@marvell.com>
Mon, 15 Aug 2022 17:50:50 +0000 (17:50 +0000)
committerAndrew Pinski <apinski@marvell.com>
Wed, 24 Aug 2022 19:15:32 +0000 (12:15 -0700)
commitb7d4b734f2d81eccb67903e4fa8f94249238d39c
tree1aafb054ee66e3b89c70914d0cedfecd699aa2d6
parent473d7aad848fe6ec151e7445e06c6e06ee4bd576
[RISCV] Use constraints/predicates instead of checking const_int directly for shNadd patterns

This simplifies the code by adding a predicate and a constraint for 1/2/3.
The aarch64 backend has a similar predicate called aarch64_shift_imm_<mode>
which they use there.

OK? Built and tested on riscv32-linux-gnu and riscv64-linux-gnu with no regressions.

Thanks,
Andrew Pinski

gcc/ChangeLog:

* config/riscv/constraints.md (Ds3): New constraint.
* config/riscv/predicates.md (imm123_operand): New predicate.
* config/riscv/bitmanip.md (*shNadd): Use Ds3 and imm123_operand.
(*shNadduw): Likewise.
gcc/config/riscv/bitmanip.md
gcc/config/riscv/constraints.md
gcc/config/riscv/predicates.md