From ae5b570e5727129dffc9a9e8cf2613f1c2b3ea9b Mon Sep 17 00:00:00 2001 From: Stephane Carrez Date: Mon, 10 Mar 2003 22:27:46 +0100 Subject: [PATCH] m68hc11.c (m68hc11_gen_rotate): Set carry before each 16-bit rotation. * config/m68hc11/m68hc11.c (m68hc11_gen_rotate): Set carry before each 16-bit rotation. From-SVN: r64125 --- gcc/ChangeLog | 5 +++++ gcc/config/m68hc11/m68hc11.c | 24 +++++++++++------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 703a2807504..92c8db4d459 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-03-10 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_gen_rotate): Set carry before + each 16-bit rotation. + 2003-03-10 Zack Weinberg * c-opts.c (add_prefixed_path): Don't use concat. When diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c index 46d28a09085..9ccac2ee657 100644 --- a/gcc/config/m68hc11/m68hc11.c +++ b/gcc/config/m68hc11/m68hc11.c @@ -3855,15 +3855,15 @@ m68hc11_gen_rotate (code, insn, operands) if (val > 0) { - /* Set the carry to bit-15, but don't change D yet. */ - if (GET_MODE (operands[0]) != QImode) - { - output_asm_insn ("asra", operands); - output_asm_insn ("rola", operands); - } - while (--val >= 0) { + /* Set the carry to bit-15, but don't change D yet. */ + if (GET_MODE (operands[0]) != QImode) + { + output_asm_insn ("asra", operands); + output_asm_insn ("rola", operands); + } + /* Rotate B first to move the carry to bit-0. */ if (D_REG_P (operands[0])) output_asm_insn ("rolb", operands); @@ -3874,14 +3874,12 @@ m68hc11_gen_rotate (code, insn, operands) } else { - /* Set the carry to bit-8 of D. */ - if (val != 0 && GET_MODE (operands[0]) != QImode) - { - output_asm_insn ("tap", operands); - } - while (++val <= 0) { + /* Set the carry to bit-8 of D. */ + if (GET_MODE (operands[0]) != QImode) + output_asm_insn ("tap", operands); + /* Rotate B first to move the carry to bit-7. */ if (D_REG_P (operands[0])) output_asm_insn ("rorb", operands); -- 2.30.2