summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkkojima <kkojima@138bc75d-0d04-0410-961f-82ee72b054a4>2014-09-02 22:32:29 +0000
committerkkojima <kkojima@138bc75d-0d04-0410-961f-82ee72b054a4>2014-09-02 22:32:29 +0000
commitd31b00b18a3134ea2b0c6e7cb24cd4a3167856b2 (patch)
tree5045ba6aba4788308a61590364ad3347889afdbe
parentba43885dfada3fc190106f9ac50e13e14c00fe18 (diff)
downloadppe42-gcc-d31b00b18a3134ea2b0c6e7cb24cd4a3167856b2.tar.gz
ppe42-gcc-d31b00b18a3134ea2b0c6e7cb24cd4a3167856b2.zip
PR target/62261
* config/sh/sh.md (ashlsi3): Handle negative shift count for TARGET_SHMEDIA. (ashldi3, ashrsi3, ashrdi3, lshrsi3, lshrdi3): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@214833 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/sh/sh.md36
2 files changed, 46 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e1bd8f2f29b..a3d3dd30ed5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,6 +1,16 @@
2014-09-02 Kaz Kojima <kkojima@gcc.gnu.org>
Backport from mainline
+ 2014-08-27 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ PR target/62261
+ * config/sh/sh.md (ashlsi3): Handle negative shift count for
+ TARGET_SHMEDIA.
+ (ashldi3, ashrsi3, ashrdi3, lshrsi3, lshrdi3): Likewise.
+
+2014-09-02 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ Backport from mainline
2014-08-25 Kaz Kojima <kkojima@gcc.gnu.org>
PR target/62111
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 41da93fe983..7978be4e4bf 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -4563,6 +4563,12 @@ label:
{
if (TARGET_SHMEDIA)
{
+ if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) < 0)
+ {
+ operands[2] = GEN_INT (-INTVAL (operands[2]));
+ emit_insn (gen_ashrsi3_media (operands[0], operands[1], operands[2]));
+ DONE;
+ }
emit_insn (gen_ashlsi3_media (operands[0], operands[1], operands[2]));
DONE;
}
@@ -4803,6 +4809,12 @@ label:
{
if (TARGET_SHMEDIA)
{
+ if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) < 0)
+ {
+ operands[2] = GEN_INT (-INTVAL (operands[2]));
+ emit_insn (gen_ashrdi3_media (operands[0], operands[1], operands[2]));
+ DONE;
+ }
emit_insn (gen_ashldi3_media (operands[0], operands[1], operands[2]));
DONE;
}
@@ -4896,6 +4908,12 @@ label:
{
if (TARGET_SHMEDIA)
{
+ if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) < 0)
+ {
+ operands[2] = GEN_INT (-INTVAL (operands[2]));
+ emit_insn (gen_ashlsi3_media (operands[0], operands[1], operands[2]));
+ DONE;
+ }
emit_insn (gen_ashrsi3_media (operands[0], operands[1], operands[2]));
DONE;
}
@@ -4995,6 +5013,12 @@ label:
{
if (TARGET_SHMEDIA)
{
+ if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) < 0)
+ {
+ operands[2] = GEN_INT (-INTVAL (operands[2]));
+ emit_insn (gen_ashldi3_media (operands[0], operands[1], operands[2]));
+ DONE;
+ }
emit_insn (gen_ashrdi3_media (operands[0], operands[1], operands[2]));
DONE;
}
@@ -5069,6 +5093,12 @@ label:
{
if (TARGET_SHMEDIA)
{
+ if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) < 0)
+ {
+ operands[2] = GEN_INT (-INTVAL (operands[2]));
+ emit_insn (gen_ashlsi3_media (operands[0], operands[1], operands[2]));
+ DONE;
+ }
emit_insn (gen_lshrsi3_media (operands[0], operands[1], operands[2]));
DONE;
}
@@ -5263,6 +5293,12 @@ label:
{
if (TARGET_SHMEDIA)
{
+ if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) < 0)
+ {
+ operands[2] = GEN_INT (-INTVAL (operands[2]));
+ emit_insn (gen_ashldi3_media (operands[0], operands[1], operands[2]));
+ DONE;
+ }
emit_insn (gen_lshrdi3_media (operands[0], operands[1], operands[2]));
DONE;
}
OpenPOWER on IntegriCloud