h8300.md (movsi_h8300hs): Optimize loading of several special constants.

* h8300.md (movsi_h8300hs): Optimize loading of several
	special constants.

From-SVN: r45261
This commit is contained in:
Kazu Hirata 2001-08-29 16:01:59 +00:00 committed by Kazu Hirata
parent 45a4bc1dc5
commit b3a68dbae8
2 changed files with 29 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2001-08-29 Kazu Hirata <kazu@hxi.com>
* h8300.md (movsi_h8300hs): Optimize loading of several
special constants.
2001-08-29 Kazu Hirata <kazu@hxi.com>
* config/h8300/lib1funcs.asm: Fix comment typos.

View File

@ -436,12 +436,31 @@
return \"sub.l\\t%S0,%S0\;add.b\\t%1,%x0\";
}
/* Now look for small negative numbers. We can subtract them
from zero to get the desired constant. */
if (val == -4 || val == -2 || val == -1)
/* Look for constants that can be obtained by subs, inc, and
dec to 0. */
switch (val)
{
operands[1] = GEN_INT (-INTVAL (operands[1]));
return \"sub.l\\t%S0,%S0\;subs\\t%1,%S0\";
case 0xffffffff:
return \"sub.l\\t%S0,%S0\;subs\\t#1,%S0\";
case 0xfffffffe:
return \"sub.l\\t%S0,%S0\;subs\\t#2,%S0\";
case 0xfffffffc:
return \"sub.l\\t%S0,%S0\;subs\\t#4,%S0\";
case 0x0000ffff:
return \"sub.l\\t%S0,%S0\;dec.w\\t#1,%f0\";
case 0x0000fffe:
return \"sub.l\\t%S0,%S0\;dec.w\\t#2,%f0\";
case 0xffff0000:
return \"sub.l\\t%S0,%S0\;dec.w\\t#1,%e0\";
case 0xfffe0000:
return \"sub.l\\t%S0,%S0\;dec.w\\t#2,%e0\";
case 0x00010000:
return \"sub.l\\t%S0,%S0\;inc.w\\t#1,%e0\";
case 0x00020000:
return \"sub.l\\t%S0,%S0\;inc.w\\t#2,%e0\";
}
}
}