RISC-V: Add patterns to convert AND mask to two shifts.
authorJim Wilson <jimw@sifive.com>
Sat, 30 Jun 2018 21:52:01 +0000 (21:52 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Sat, 30 Jun 2018 21:52:01 +0000 (14:52 -0700)
commit666fdc46bc848984ee7d2906f2dfe10e1ee5d535
treedfcba939f1bcd8dc96d335edf960ac2bf2c767a9
parent3330053ecaafe8bca82cc3845be9b2d01a614eb1
RISC-V: Add patterns to convert AND mask to two shifts.

gcc/
* config/riscv/predicates.md (p2m1_shift_operand): New.
(high_mask_shift_operand): New.
* config/riscv/riscv.md (lshrsi3_zero_extend_3+1): New combiner
pattern using p2m1_shift_operand.
(lshsi3_zero_extend_3+2): New combiner pattern using
high_mask_shift_operand.

gcc/testsuite/
* gcc.target/riscv/shift-shift-1.c: New.
* gcc.target/riscv/shift-shift-2.c: New.
* gcc.target/riscv/shift-shift-3.c: New.

From-SVN: r262278
gcc/ChangeLog
gcc/config/riscv/predicates.md
gcc/config/riscv/riscv.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/riscv/shift-shift-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/shift-shift-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/shift-shift-3.c [new file with mode: 0644]