Remove DImode expansions for 1-bit shifts
commitb86a5e47ed462174d574ea0e77a13472b8522ce4
authorwilco <wilco@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Oct 2017 18:46:02 +0000 (30 18:46 +0000)
committerwilco <wilco@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Oct 2017 18:46:02 +0000 (30 18:46 +0000)
treebc8021aa242ff8a5c91571f998c0664543be9467
parent42a451c3eb41046b97990f1e3bd87b5c7ec78bae
Remove DImode expansions for 1-bit shifts

A left shift of 1 can always be done using an add, so slightly adjust rtx
cost for DImode left shift by 1 so that adddi3 is preferred in all cases,
and the arm_ashldi3_1bit is redundant.

DImode right shifts of 1 are rarely used (6 in total in the GCC binary),
so there is little benefit of the arm_ashrdi3_1bit and arm_lshrdi3_1bit
patterns.  The generated code is better and faster without these shifts
as it allows early expansion, optimization and better register allocation.

    gcc/
* config/arm/arm.md (ashldi3): Remove shift by 1 expansion.
(arm_ashldi3_1bit): Remove pattern.
(ashrdi3): Remove shift by 1 expansion.
(arm_ashrdi3_1bit): Remove pattern.
(lshrdi3): Remove shift by 1 expansion.
(arm_lshrdi3_1bit): Remove pattern.
* config/arm/arm.c (arm_rtx_costs_internal): Slightly increase
cost of ashldi3 by 1.
* config/arm/neon.md (ashldi3_neon): Remove shift by 1 expansion.
(<shift>di3_neon): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254237 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/arm/arm.c
gcc/config/arm/arm.md
gcc/config/arm/neon.md