diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-05-21 17:18:16 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-05-21 17:18:16 +0000 |
commit | 098e94fb5c1195d82326e394165d8e2a64513eb1 (patch) | |
tree | 2cbb5327c6ed67c66271fe28d2e48f0bbb8e79df | |
parent | 3bdc4a4dad627ab438683aa08e8d4e11542e055a (diff) | |
download | gcc-098e94fb5c1195d82326e394165d8e2a64513eb1.tar.gz |
* config/pa/pa.md (add-with-constant splitter): Use ASHIFT rather
than MULT for shadd sequences.
* gcc.target/hppa/shadd-4.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223495 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/pa/pa.md | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/hppa/shadd-4.c | 8 |
4 files changed, 21 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3ec725535a3..48472bc92b0 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 73c8f6bce13..aaec27d985e 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 46a6bb7ad67..20a437918a3 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 00000000000..e25d148322e --- /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; +} |