diff options
author | Graham Stott <grahams@gcc.gnu.org> | 2013-07-10 09:26:13 +0000 |
---|---|---|
committer | Graham Stott <grahams@gcc.gnu.org> | 2013-07-10 09:26:13 +0000 |
commit | ceb2d59f8c6e2ab12e7c010880595919ed8fdcf2 (patch) | |
tree | 2678a70ec6b2960722b58a18b65bcbb6854a469c | |
parent | 055e0a992cfd1b9932042cdda5b5022f1d51e4be (diff) | |
download | gcc-ceb2d59f8c6e2ab12e7c010880595919ed8fdcf2.zip gcc-ceb2d59f8c6e2ab12e7c010880595919ed8fdcf2.tar.gz gcc-ceb2d59f8c6e2ab12e7c010880595919ed8fdcf2.tar.bz2 |
mips.c (mips_rtx_costs): Very slightly increase the cost of MULT when optimizing for size.
* config/mips/mips.c (mips_rtx_costs): Very slightly increase
the cost of MULT when optimizing for size.
* gcc.target/mips/mulsize-1.c: New.
* gcc.target/mips/mulsize-2.c: New.
* gcc.target/mips/mulsize-3.c: New.
* gcc.target/mips/mulsize-4.c: New.
From-SVN: r200867
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/mips/mulsize-1.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/mips/mulsize-2.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/mips/mulsize-3.c | 12 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/mips/mulsize-4.c | 11 |
7 files changed, 52 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0a26cf2..19016a2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2013-07-10 Graham Stott <graham.stott@btinternet.com> + * config/mips/mips.c (mips_rtx_costs): Very slightly increase + the cost of MULT when optimizing for size. + 2013-07-10 Jan-Benedict Glaw <jbglaw@lug-owl.de> * config/cr16/cr16-protos.h: Don't include target.h. diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index bd1d10b..3c5469b 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -3944,7 +3944,7 @@ mips_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED, ? mips_cost->int_mult_si * 3 + 6 : COSTS_N_INSNS (ISA_HAS_MUL3 ? 7 : 9)); else if (!speed) - *total = COSTS_N_INSNS (ISA_HAS_MUL3 ? 1 : 2); + *total = COSTS_N_INSNS (ISA_HAS_MUL3 ? 1 : 2) + 1; else if (mode == DImode) *total = mips_cost->int_mult_di; else diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a9b8829..1b4e046 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2013-07-10 Graham Stott <grahams@btinternet.com> + * gcc.target/mips/mulsize-1.c: New. + * gcc.target/mips/mulsize-2.c: New. + * gcc.target/mips/mulsize-3.c: New. + * gcc.target/mips/mulsize-4.c: New. + 2013-07-09 Marc Glisse <marc.glisse@inria.fr> PR c++/53094 diff --git a/gcc/testsuite/gcc.target/mips/mulsize-1.c b/gcc/testsuite/gcc.target/mips/mulsize-1.c new file mode 100644 index 0000000..4dd5a19 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/mulsize-1.c @@ -0,0 +1,9 @@ +/* { dg-final { scan-assembler "\t.globl\tf7" } } */ +/* { dg-final { scan-assembler "\tsubu\t" } } */ +/* { dg-final { scan-assembler-not "\tli\t" } } */ +/* { dg-final { scan-assembler-not "\tmul\t" } } */ +int +f7(int x) +{ + return x * 7; +} diff --git a/gcc/testsuite/gcc.target/mips/mulsize-2.c b/gcc/testsuite/gcc.target/mips/mulsize-2.c new file mode 100644 index 0000000..c427bfa --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/mulsize-2.c @@ -0,0 +1,9 @@ +/* { dg-final { scan-assembler "\t.globl\tf9" } } */ +/* { dg-final { scan-assembler "\tsubu\t" } } */ +/* { dg-final { scan-assembler-not "\tli\t" } } */ +/* { dg-final { scan-assembler-not "\tmul\t" } } */ +int +f9(int x) +{ + return x * 9; +} diff --git a/gcc/testsuite/gcc.target/mips/mulsize-3.c b/gcc/testsuite/gcc.target/mips/mulsize-3.c new file mode 100644 index 0000000..552d8c9 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/mulsize-3.c @@ -0,0 +1,12 @@ +/* { dg-final { scan-assembler "\t.globl\tf15" } } */ +/* { dg-final { scan-assembler "\tsll\t" } } */ +/* { dg-final { scan-assembler "\tsubu\t" } } */ +/* { dg-final { scan-assembler-not "\tli\t" } } */ +/* { dg-final { scan-assembler-not "\tmul\t" } } */ +int +f15(int x) +{ + return x * 15; +} + +
\ No newline at end of file diff --git a/gcc/testsuite/gcc.target/mips/mulsize-4.c b/gcc/testsuite/gcc.target/mips/mulsize-4.c new file mode 100644 index 0000000..7694d2c --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/mulsize-4.c @@ -0,0 +1,11 @@ +/* { dg-final { scan-assembler "\t.globl\tf17" } } */ +/* { dg-final { scan-assembler "\tsll\t" } } */ +/* { dg-final { scan-assembler "\taddu\t" } } */ +/* { dg-final { scan-assembler-not "\tli\t" } } */ +/* { dg-final { scan-assembler-not "\tmul\t" } } */ +int +f17(int x) +{ + return x * 17; +} +
\ No newline at end of file |