]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
m68hc11.md ("*ashlsi3"): Avoid saving y if we know it is dead.
authorStephane Carrez <stcarrez@nerim.fr>
Fri, 5 Jul 2002 22:01:18 +0000 (00:01 +0200)
committerStephane Carrez <ciceron@gcc.gnu.org>
Fri, 5 Jul 2002 22:01:18 +0000 (00:01 +0200)
* config/m68hc11/m68hc11.md ("*ashlsi3"): Avoid saving y if we know
it is dead.
("*ashrsi3"): Likewise.
("*lshrsi3"): Likewise.

From-SVN: r55271

gcc/ChangeLog
gcc/config/m68hc11/m68hc11.md

index a0c5b8a58c47c05149f36c0308b5b6513b824f5a..1058aed0db6d5acc03eba920eee945a6703c57be 100644 (file)
@@ -1,4 +1,11 @@
-2002-07-06  Stephane Carrez  <stcarrez@nerim.fr>
+2002-07-05  Stephane Carrez  <stcarrez@nerim.fr>
+
+       * config/m68hc11/m68hc11.md ("*ashlsi3"): Avoid saving y if we know
+       it is dead.
+       ("*ashrsi3"): Likewise.
+       ("*lshrsi3"): Likewise.
+
+2002-07-05  Stephane Carrez  <stcarrez@nerim.fr>
 
        * config/m68hc11/m68hc11.md (peephole2): New peephole2 to optimize
        address computation and memory moves.
index 7ee9ffa29d3869e3cf7b5269686d07f814155d1c..379bee58219f73b4fb31d2523b4534c78927f126 100644 (file)
   if (!Y_REG_P (operands[2]))
     {
       rtx ops[1];
+      int y_dead = dead_register_here (insn, iy_reg);
 
       ops[0] = operands[1];
-      output_asm_insn (\"pshy\", operands);
-      if (reg_mentioned_p (stack_pointer_rtx, operands[1]))
+      if (y_dead == 0)
        {
-         ops[0] = adjust_address (operands[1], GET_MODE (operands[1]), 2);
+          output_asm_insn (\"pshy\", operands);
+          if (reg_mentioned_p (stack_pointer_rtx, operands[1]))
+           ops[0] = adjust_address (operands[1], GET_MODE (operands[1]), 2);
        }
       output_asm_insn (\"ldy\\t%0\", ops);
       output_asm_insn (\"bsr\\t___ashlsi3\", operands);
-      return \"puly\";
+      return y_dead == 0 ? \"puly\" : \"\";
     }
   return \"bsr\\t___ashlsi3\";
 }")
   if (!Y_REG_P (operands[2]))
     {
       rtx ops[1];
+      int y_dead = dead_register_here (insn, iy_reg);
 
       ops[0] = operands[1];
-      output_asm_insn (\"pshy\", operands);
-      if (reg_mentioned_p (stack_pointer_rtx, operands[1]))
+      if (y_dead == 0)
        {
-         ops[0] = adjust_address (operands[1], GET_MODE (operands[1]), 2);
+          output_asm_insn (\"pshy\", operands);
+          if (reg_mentioned_p (stack_pointer_rtx, operands[1]))
+           ops[0] = adjust_address (operands[1], GET_MODE (operands[1]), 2);
        }
       output_asm_insn (\"ldy\\t%0\", ops);
       output_asm_insn (\"bsr\\t___ashrsi3\", operands);
-      return \"puly\";
+      return y_dead == 0 ? \"puly\" : \"\";
     }
   return \"bsr\\t___ashrsi3\";
 }")
   if (!Y_REG_P (operands[2]))
     {
       rtx ops[1];
+      int y_dead = dead_register_here (insn, iy_reg);
 
       ops[0] = operands[1];
-      output_asm_insn (\"pshy\", operands);
-      if (reg_mentioned_p (stack_pointer_rtx, operands[1]))
+      if (y_dead == 0)
        {
-         ops[0] = adjust_address (operands[1], GET_MODE (operands[1]), 2);
+          output_asm_insn (\"pshy\", operands);
+          if (reg_mentioned_p (stack_pointer_rtx, operands[1]))
+           ops[0] = adjust_address (operands[1], GET_MODE (operands[1]), 2);
        }
       output_asm_insn (\"ldy\\t%0\", ops);
       output_asm_insn (\"bsr\\t___lshrsi3\", operands);
-      return \"puly\";
+      return y_dead == 0 ? \"puly\" : \"\";
     }
   return \"bsr\\t___lshrsi3\";
 }")