summaryrefslogtreecommitdiff
path: root/gcc/config/h8300/h8300.md
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/h8300/h8300.md')
-rw-r--r--gcc/config/h8300/h8300.md60
1 files changed, 32 insertions, 28 deletions
diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md
index e0053688576..e340d940be9 100644
--- a/gcc/config/h8300/h8300.md
+++ b/gcc/config/h8300/h8300.md
@@ -411,38 +411,42 @@
|| register_operand (operands[1], SImode))"
"*
{
- if (which_alternative == 0)
- return \"sub.l %S0,%S0\";
- if (which_alternative == 6)
- return \"clrmac\";
- if (which_alternative == 7)
- return \"clrmac\;ldmac %1,macl\";
- if (which_alternative == 8)
- return \"stmac macl,%0\";
- if (GET_CODE (operands[1]) == CONST_INT)
+ switch (which_alternative)
{
- int val = INTVAL (operands[1]);
-
- /* Look for constants which can be made by adding an 8-bit
- number to zero in one of the two low bytes. */
- if (val == (val & 0xff))
+ case 0:
+ return \"sub.l %S0,%S0\";
+ case 6:
+ return \"clrmac\";
+ case 7:
+ return \"clrmac\;ldmac %1,macl\";
+ case 8:
+ return \"stmac macl,%0\";
+ default:
+ if (GET_CODE (operands[1]) == CONST_INT)
{
- operands[1] = GEN_INT ((char)val & 0xff);
- return \"sub.l %S0,%S0\;add.b %1,%w0\";
- }
+ int val = INTVAL (operands[1]);
+
+ /* Look for constants which can be made by adding an 8-bit
+ number to zero in one of the two low bytes. */
+ if (val == (val & 0xff))
+ {
+ operands[1] = GEN_INT ((char)val & 0xff);
+ return \"sub.l %S0,%S0\;add.b %1,%w0\";
+ }
- if (val == (val & 0xff00))
- {
- operands[1] = GEN_INT ((char)(val >> 8) & 0xff);
- return \"sub.l %S0,%S0\;add.b %1,%x0\";
- }
+ if (val == (val & 0xff00))
+ {
+ operands[1] = GEN_INT ((char)(val >> 8) & 0xff);
+ return \"sub.l %S0,%S0\;add.b %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)
- {
- operands[1] = GEN_INT (-INTVAL (operands[1]));
- return \"sub.l %S0,%S0\;subs %1,%S0\";
+ /* Now look for small negative numbers. We can subtract them
+ from zero to get the desired constant. */
+ if (val == -4 || val == -2 || val == -1)
+ {
+ operands[1] = GEN_INT (-INTVAL (operands[1]));
+ return \"sub.l %S0,%S0\;subs %1,%S0\";
+ }
}
}
return \"mov.l %S1,%S0\";