m68hc11.c (m68hc11_gen_rotate): Set carry before each 16-bit rotation.
authorStephane Carrez <stcarrez@nerim.fr>
Mon, 10 Mar 2003 21:27:46 +0000 (22:27 +0100)
committerStephane Carrez <ciceron@gcc.gnu.org>
Mon, 10 Mar 2003 21:27:46 +0000 (22:27 +0100)
* config/m68hc11/m68hc11.c (m68hc11_gen_rotate): Set carry before
each 16-bit rotation.

From-SVN: r64125

gcc/ChangeLog
gcc/config/m68hc11/m68hc11.c

index 703a28075041a1949c3dd268dfff976f52d83148..92c8db4d459fd5fedab8cd46437677318d9b72cc 100644 (file)
@@ -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
index 46d28a090855e1aee06c85514479bc634a52e0eb..9ccac2ee657487b1e44d0535fbe14d23417cdea2 100644 (file)
@@ -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);