aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.cc
diff options
context:
space:
mode:
authorChristoph Müllner <christoph.muellner@vrull.eu>2024-05-07 22:23:26 +0200
committerChristoph Müllner <christoph.muellner@vrull.eu>2024-05-08 16:09:36 +0200
commit3ee30d7981987b86bd6a9a2675e26fadec48e5cd (patch)
tree5f8aad3390f74b4f82bf72e0efe16e5beba85704 /gcc/cp/parser.cc
parent3b9c760072c7792cbae6f38894756d2b96c2fd8c (diff)
downloadgcc-3ee30d7981987b86bd6a9a2675e26fadec48e5cd.zip
gcc-3ee30d7981987b86bd6a9a2675e26fadec48e5cd.tar.gz
gcc-3ee30d7981987b86bd6a9a2675e26fadec48e5cd.tar.bz2
RISC-V: Cover sign-extensions in lshr<GPR:mode>3_zero_extend_4
The lshr<GPR:mode>3_zero_extend_4 pattern targets bit extraction with zero-extension. This pattern represents the canonical form of zero-extensions of a logical right shift. The same optimization can be applied to sign-extensions. Given the two optimizations are so similar, this patch converts the existing one to also cover the sign-extension case as well. gcc/ChangeLog: * config/riscv/iterators.md (ashiftrt): New code attribute 'extract_shift' and adding extractions to optab. * config/riscv/riscv.md (*lshr<GPR:mode>3_zero_extend_4): Rename to... (*<any_extract:optab><GPR:mode>3):...this and add support for sign-extensions. gcc/testsuite/ChangeLog: * gcc.target/riscv/extend-shift-helpers.h: Add helpers for sign-extension. * gcc.target/riscv/sign-extend-rshift-32.c: New test. * gcc.target/riscv/sign-extend-rshift-64.c: New test. * gcc.target/riscv/sign-extend-rshift.c: New test. Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Diffstat (limited to 'gcc/cp/parser.cc')
0 files changed, 0 insertions, 0 deletions