aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2015-05-21 11:18:16 -0600
committerJeff Law <law@gcc.gnu.org>2015-05-21 11:18:16 -0600
commitf3da53751662e7a4e2fd6a1c119565518f1e2c63 (patch)
tree2cbb5327c6ed67c66271fe28d2e48f0bbb8e79df
parent65d932637ed3ffb25d08011a02e8ed0129f1aecb (diff)
downloadgcc-f3da53751662e7a4e2fd6a1c119565518f1e2c63.zip
gcc-f3da53751662e7a4e2fd6a1c119565518f1e2c63.tar.gz
gcc-f3da53751662e7a4e2fd6a1c119565518f1e2c63.tar.bz2
pa.md (add-with-constant splitter): Use ASHIFT rather than MULT for shadd sequences.
* config/pa/pa.md (add-with-constant splitter): Use ASHIFT rather than MULT for shadd sequences. * gcc.target/hppa/shadd-4.c: New test. From-SVN: r223495
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/pa/pa.md8
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/hppa/shadd-4.c8
4 files changed, 21 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3ec7255..48472bc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-05-21 Jeff Law <law@redhat.com>
+
+ * config/pa/pa.md (add-with-constant splitter): Use ASHIFT rather
+ than MULT for shadd sequences.
+
2015-05-08 Jan Hubicka <hubicka@ucw.cz>
* alias.c (alias_stats): New static var.
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 73c8f6b..aaec27d 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -5132,7 +5132,7 @@
(clobber (match_operand:SI 4 "register_operand" ""))]
"! pa_cint_ok_for_move (INTVAL (operands[2]))"
[(set (match_dup 4) (match_dup 2))
- (set (match_dup 0) (plus:SI (mult:SI (match_dup 4) (match_dup 3))
+ (set (match_dup 0) (plus:SI (ashift:SI (match_dup 4) (match_dup 3))
(match_dup 1)))]
"
{
@@ -5147,17 +5147,17 @@
if (intval % 2 == 0 && pa_cint_ok_for_move (intval / 2))
{
operands[2] = GEN_INT (intval / 2);
- operands[3] = const2_rtx;
+ operands[3] = const1_rtx;
}
else if (intval % 4 == 0 && pa_cint_ok_for_move (intval / 4))
{
operands[2] = GEN_INT (intval / 4);
- operands[3] = GEN_INT (4);
+ operands[3] = const2_rtx;
}
else if (intval % 8 == 0 && pa_cint_ok_for_move (intval / 8))
{
operands[2] = GEN_INT (intval / 8);
- operands[3] = GEN_INT (8);
+ operands[3] = GEN_INT (3);
}
else if (pa_cint_ok_for_move (-intval))
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 46a6bb7..20a4379 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2015-05-21 Jeff Law <law@redhat.com>
+
+ * gcc.target/hppa/shadd-4.c: New test.
+
2015-05-08 Michael Matz <matz@suse.de>
* gcc.dg/vect/vect-strided-store.c: New test.
diff --git a/gcc/testsuite/gcc.target/hppa/shadd-4.c b/gcc/testsuite/gcc.target/hppa/shadd-4.c
new file mode 100644
index 0000000..e25d1483
--- /dev/null
+++ b/gcc/testsuite/gcc.target/hppa/shadd-4.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-times "sh.add" 1 } } */
+unsigned int
+oof (int uid)
+{
+ return (174 << 7) + uid;
+}