From 0550f1bb6ca70672b47562eff1a7f506f4b2a791 Mon Sep 17 00:00:00 2001 From: nickc Date: Mon, 25 Apr 2016 11:59:44 +0000 Subject: [PATCH] * config/msp430/msp430.md (ashlhi3): Optimize one bit shifts. (ashrhi3): Likewise. (lshrhi3): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235410 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/config/msp430/msp430.md | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2dac38eff7b..8a9a29b61c0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-04-25 DJ Delorie + + * config/msp430/msp430.md (ashlhi3): Optimize one bit shifts. + (ashrhi3): Likewise. + (lshrhi3): Likewise. + 2016-04-25 Richard Biener PR tree-optimization/70780 diff --git a/gcc/config/msp430/msp430.md b/gcc/config/msp430/msp430.md index 4df49708adb..abab672a956 100644 --- a/gcc/config/msp430/msp430.md +++ b/gcc/config/msp430/msp430.md @@ -756,6 +756,9 @@ && REG_P (operands[1]) && CONST_INT_P (operands[2])) emit_insn (gen_430x_shift_left (operands[0], operands[1], operands[2])); + else if (CONST_INT_P (operands[2]) + && INTVAL (operands[2]) == 1) + emit_insn (gen_slli_1 (operands[0], operands[1])); else msp430_expand_helper (operands, \"__mspabi_slli\", true); DONE; @@ -825,6 +828,9 @@ && REG_P (operands[1]) && CONST_INT_P (operands[2])) emit_insn (gen_430x_arithmetic_shift_right (operands[0], operands[1], operands[2])); + else if (CONST_INT_P (operands[2]) + && INTVAL (operands[2]) == 1) + emit_insn (gen_srai_1 (operands[0], operands[1])); else msp430_expand_helper (operands, \"__mspabi_srai\", true); DONE; @@ -910,6 +916,9 @@ && REG_P (operands[1]) && CONST_INT_P (operands[2])) emit_insn (gen_430x_logical_shift_right (operands[0], operands[1], operands[2])); + else if (CONST_INT_P (operands[2]) + && INTVAL (operands[2]) == 1) + emit_insn (gen_srli_1 (operands[0], operands[1])); else msp430_expand_helper (operands, \"__mspabi_srli\", true); DONE; -- 2.11.4.GIT