h8300.md (output_a_shift): Clean up the code to output shifts using rotation.
authorKazu Hirata <kazu@cs.umass.edu>
Fri, 20 Dec 2002 04:05:14 +0000 (04:05 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Fri, 20 Dec 2002 04:05:14 +0000 (04:05 +0000)
* config/h8300/h8300.md (output_a_shift): Clean up the code to
output shifts using rotation.

From-SVN: r60353

gcc/ChangeLog
gcc/config/h8300/h8300.c

index 22112f071278d5f336c6b438bf53751ed148db68..209e12fc49629a852330e26ed755fd2783c6ac8f 100644 (file)
@@ -1,3 +1,8 @@
+2002-12-19  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * config/h8300/h8300.md (output_a_shift): Clean up the code to
+       output shifts using rotation.
+
 2002-12-20  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
 
        * flow.c (allocate_reg_life_data): Reset REG_FREQ.
index 078c4a976518c63e59d131f9775e8775fe4b7830..ab2cc1544ed79c2132c3b39c6eb15c99141f05cc 100644 (file)
@@ -3026,30 +3026,28 @@ output_a_shift (operands)
              output_asm_insn (info.shift1, operands);
 
            /* Now mask off the high bits.  */
-           if (TARGET_H8300)
+           switch (mode)
              {
-               switch (mode)
+             case QImode:
+               sprintf (insn_buf, "and\t#%d,%%X0", mask);
+               cc_status.value1 = operands[0];
+               cc_status.flags |= CC_NO_CARRY;
+               break;
+             case HImode:
+               if (TARGET_H8300)
                  {
-                 case QImode:
-                   sprintf (insn_buf, "and\t#%d,%%X0", mask);
-                   cc_status.value1 = operands[0];
-                   cc_status.flags |= CC_NO_CARRY;
-                   break;
-                 case HImode:
                    sprintf (insn_buf, "and\t#%d,%%s0\n\tand\t#%d,%%t0",
                             mask & 255, mask >> 8);
-                   break;
-                 default:
-                   abort ();
                  }
-             }
-           else
-             {
-               sprintf (insn_buf, "and.%c\t#%d,%%%c0",
-                        "bwl"[shift_mode], mask,
-                        mode == QImode ? 'X' : mode == HImode ? 'T' : 'S');
-               cc_status.value1 = operands[0];
-               cc_status.flags |= CC_NO_CARRY;
+               else
+                 {
+                   sprintf (insn_buf, "and.w\t#%d,%%T0", mask);
+                   cc_status.value1 = operands[0];
+                   cc_status.flags |= CC_NO_CARRY;
+                 }
+               break;
+             default:
+               abort ();
              }
            output_asm_insn (insn_buf, operands);
            return "";