diff options
author | Stephane Carrez <stcarrez@nerim.fr> | 2002-07-05 23:59:17 +0200 |
---|---|---|
committer | Stephane Carrez <ciceron@gcc.gnu.org> | 2002-07-05 23:59:17 +0200 |
commit | 4c8aed1419361e544f919f2455308da2bc6d04f4 (patch) | |
tree | d162b2f3347296f8dac95d028bc71e6d4d09f9e7 /gcc | |
parent | 99ed68ea7fc100ae77cde16219bafc4c693a7d0f (diff) | |
download | gcc-4c8aed1419361e544f919f2455308da2bc6d04f4.zip gcc-4c8aed1419361e544f919f2455308da2bc6d04f4.tar.gz gcc-4c8aed1419361e544f919f2455308da2bc6d04f4.tar.bz2 |
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: r55270
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/config/m68hc11/m68hc11.md | 30 |
2 files changed, 26 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 39e005b..0034982 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,9 +1,16 @@ +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 Vladimir Makarov <vmakarov@redhat.com> * genautomata.c (output_max_insn_queue_index_def): Take latencies into account. -2002-07-06 Stephane Carrez <stcarrez@nerim.fr> +2002-07-05 Stephane Carrez <stcarrez@nerim.fr> * 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 7ee9ffa..379bee5 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\"; }") |