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
This commit is contained in:
Graham Stott 2013-07-10 09:26:13 +00:00
parent 055e0a992c
commit ceb2d59f8c
7 changed files with 52 additions and 1 deletions

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}