Commit 629198e2 by Richard Sandiford Committed by Richard Sandiford

mips.c (mips_rtx_costs): In mips16 code, set the cost of 0...255 to 0 when inside a SET.

	* config/mips/mips.c (mips_rtx_costs): In mips16 code, set the cost
	of 0...255 to 0 when inside a SET.

From-SVN: r84804
parent 2bff1abf
2004-07-16 Richard Sandiford <rsandifo@redhat.com> 2004-07-16 Richard Sandiford <rsandifo@redhat.com>
* config/mips/mips.c (mips_rtx_costs): In mips16 code, set the cost
of 0...255 to 0 when inside a SET.
2004-07-16 Richard Sandiford <rsandifo@redhat.com>
* config/mips/mips.md: Remove mips16 define_peepholes. * config/mips/mips.md: Remove mips16 define_peepholes.
2004-07-16 Daniel Berlin <dberlin@dberlin.org> 2004-07-16 Daniel Berlin <dberlin@dberlin.org>
......
...@@ -2192,6 +2192,20 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total) ...@@ -2192,6 +2192,20 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total)
return true; return true;
} }
/* Constants in the range 0...255 can be loaded with an unextended
instruction. They are therefore as cheap as a register move.
Given the choice between "li R1,0...255" and "move R1,R2"
(where R2 is a known constant), it is usually better to use "li",
since we do not want to unnessarily extend the lifetime of R2. */
if (outer_code == SET
&& INTVAL (x) >= 0
&& INTVAL (x) < 256)
{
*total = 0;
return true;
}
/* Otherwise fall through to the handling below. */ /* Otherwise fall through to the handling below. */
case CONST: case CONST:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment