aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2003-03-10 22:27:46 +0100
committerStephane Carrez <ciceron@gcc.gnu.org>2003-03-10 22:27:46 +0100
commitae5b570e5727129dffc9a9e8cf2613f1c2b3ea9b (patch)
treee29cde02bfed0ab4d0c312602ef8c55c354e0cd3 /gcc
parent88849449f3f181f6eeebe60059c6baffbd988b8e (diff)
downloadgcc-ae5b570e5727129dffc9a9e8cf2613f1c2b3ea9b.zip
gcc-ae5b570e5727129dffc9a9e8cf2613f1c2b3ea9b.tar.gz
gcc-ae5b570e5727129dffc9a9e8cf2613f1c2b3ea9b.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/m68hc11/m68hc11.c24
2 files changed, 16 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 703a280..92c8db4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2003-03-10 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.c (m68hc11_gen_rotate): Set carry before
+ each 16-bit rotation.
+
2003-03-10 Zack Weinberg <zack@codesourcery.com>
* 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 46d28a0..9ccac2e 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);