From: Jeff Law Date: Thu, 21 May 2015 17:18:16 +0000 (-0600) Subject: pa.md (add-with-constant splitter): Use ASHIFT rather than MULT for shadd sequences. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f3da53751662e7a4e2fd6a1c119565518f1e2c63;p=gcc.git 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 --- 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 + + * config/pa/pa.md (add-with-constant splitter): Use ASHIFT rather + than MULT for shadd sequences. + 2015-05-08 Jan Hubicka * 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 + + * gcc.target/hppa/shadd-4.c: New test. + 2015-05-08 Michael Matz * 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; +}