RISC-V: Fix for combine bug with shift and AND operations.
authorJim Wilson <jimw@sifive.com>
Mon, 2 Apr 2018 22:37:21 +0000 (22:37 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Mon, 2 Apr 2018 22:37:21 +0000 (15:37 -0700)
commitb7ef9225f7f997a37f96a3a9c2eb31533865822b
tree2b4c1d1ef35215676c1927b0b1a197e2a919dce6
parent82a926bf06e8b7989ee189ef2b3bf7a6c055d6b8
RISC-V: Fix for combine bug with shift and AND operations.

PR rtl-optimization/84660
gcc/
* config/riscv/riscv.h (SHIFT_COUNT_TRUNCATED): Set to zero.
* config/riscv/riscv.md (<optab>si3): Use QImode shift count.
(<optab>di3, <optab>si3_extend): Likewise.
(<optab>si3_mask, <optab>si3_mask_1): New.
(<optab>di3_mask, <optab>di3_mask_1): New.
(<optab>si3_extend_mask, <optab>si3_extend_mask_1): New.
(lshrsi3_zero_extend_1): Use VOIDmode shift count.
* config/riscv/sync.md (atomic_test_and_set): Emit QImode shift count.
gcc/testsuite/
* gcc.target/riscv/pr84660.c: New.
* gcc.target/riscv/shift-and-1.c: New.
* gcc.target/riscv/shift-and-2.c: New.

From-SVN: r259019
gcc/ChangeLog
gcc/config/riscv/riscv.h
gcc/config/riscv/riscv.md
gcc/config/riscv/sync.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/riscv/pr84660.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/shift-and-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/shift-and-2.c [new file with mode: 0644]