From: Stephane Carrez Date: Fri, 5 Jul 2002 22:01:18 +0000 (+0200) Subject: m68hc11.md ("*ashlsi3"): Avoid saving y if we know it is dead. X-Git-Tag: releases/gcc-3.1.1~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=582c64face56a13025c26523eca6317b0a1b0cae;p=thirdparty%2Fgcc.git m68hc11.md ("*ashlsi3"): Avoid saving y if we know it is dead. * config/m68hc11/m68hc11.md ("*ashlsi3"): Avoid saving y if we know it is dead. ("*ashrsi3"): Likewise. ("*lshrsi3"): Likewise. From-SVN: r55271 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a0c5b8a58c47..1058aed0db6d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,11 @@ -2002-07-06 Stephane Carrez +2002-07-05 Stephane Carrez + + * config/m68hc11/m68hc11.md ("*ashlsi3"): Avoid saving y if we know + it is dead. + ("*ashrsi3"): Likewise. + ("*lshrsi3"): Likewise. + +2002-07-05 Stephane Carrez * config/m68hc11/m68hc11.md (peephole2): New peephole2 to optimize address computation and memory moves. diff --git a/gcc/config/m68hc11/m68hc11.md b/gcc/config/m68hc11/m68hc11.md index 7ee9ffa29d38..379bee58219f 100644 --- a/gcc/config/m68hc11/m68hc11.md +++ b/gcc/config/m68hc11/m68hc11.md @@ -4697,16 +4697,18 @@ 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\"; }") @@ -5105,16 +5107,18 @@ 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\"; }") @@ -5449,16 +5453,18 @@ 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\"; }")