OSDN Git Service

* config/h8300/h8300-protos.h: Update the prototype of
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 29 Jan 2002 05:10:13 +0000 (05:10 +0000)
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 29 Jan 2002 05:10:13 +0000 (05:10 +0000)
output_a_shift.
* config/h8300/h8300.c (output_a_shift): Remove an unused
argument 'insn'.  Remove redundant code.
* config/h8300/h8300.md: Adust to the new prototype of
output_a_shift.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49310 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/h8300/h8300-protos.h
gcc/config/h8300/h8300.c
gcc/config/h8300/h8300.md

index ece5c2d..73370c3 100644 (file)
@@ -1,5 +1,14 @@
 2002-01-29  Kazu Hirata  <kazu@hxi.com>
 
+       * config/h8300/h8300-protos.h: Update the prototype of
+       output_a_shift.
+       * config/h8300/h8300.c (output_a_shift): Remove an unused
+       argument 'insn'.  Remove redundant code.
+       * config/h8300/h8300.md: Adust to the new prototype of
+       output_a_shift.
+
+2002-01-29  Kazu Hirata  <kazu@hxi.com>
+
        * config/h8300/h8300-protos.h: Update the prototypes of
        emit_a_rotate and expand_a_rotate.
        * config/h8300/h8300.c (emit_a_rotate): Change the type of the
index 94f94fa..67f0ed9 100644 (file)
@@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA.  */
 
 /* Declarations for functions used in insn-output.c.  */
 #ifdef RTX_CODE
-extern const char *output_a_shift PARAMS ((rtx, rtx *));
+extern const char *output_a_shift PARAMS ((rtx *));
 extern const char *emit_a_rotate PARAMS ((enum rtx_code, rtx *));
 extern const char *output_simode_bld PARAMS ((int, rtx[]));
 extern void print_operand_address PARAMS ((FILE *, rtx));
index 603074b..e996209 100644 (file)
@@ -2431,8 +2431,7 @@ get_shift_alg (shift_type, shift_mode, count, info)
 /* Emit the assembler code for doing shifts.  */
 
 const char *
-output_a_shift (insn, operands)
-     rtx insn ATTRIBUTE_UNUSED;
+output_a_shift (operands)
      rtx *operands;
 {
   static int loopend_lab;
@@ -2517,18 +2516,15 @@ output_a_shift (insn, operands)
          n = info.remainder;
 
          /* Emit two bit shifts first.  */
-         while (n > 1 && info.shift2 != NULL)
+         if (info.shift2 != NULL)
            {
-             output_asm_insn (info.shift2, operands);
-             n -= 2;
+             for (; n > 1; n -= 2)
+               output_asm_insn (info.shift2, operands);
            }
 
          /* Now emit one bit shifts for any residual.  */
-         while (n > 0)
-           {
-             output_asm_insn (info.shift1, operands);
-             n -= 1;
-           }
+         for (; n > 0; n--)
+           output_asm_insn (info.shift1, operands);
 
          /* Keep track of CC.  */
          if (info.cc_valid_p)
@@ -2542,8 +2538,8 @@ output_a_shift (insn, operands)
          {
            int m = GET_MODE_BITSIZE (mode) - n;
            int mask = (shift_type == SHIFT_ASHIFT
-                       ? ((1 << (GET_MODE_BITSIZE (mode) - n)) - 1) << n
-                       : (1 << (GET_MODE_BITSIZE (mode) - n)) - 1);
+                       ? ((1 << m) - 1) << n
+                       : (1 << m) - 1);
            char insn_buf[200];
 
            /* Not all possibilities of rotate are supported.  They shouldn't
@@ -2552,18 +2548,15 @@ output_a_shift (insn, operands)
              abort ();
 
            /* Emit two bit rotates first.  */
-           while (m > 1 && info.shift2 != NULL)
+           if (info.shift2 != NULL)
              {
-               output_asm_insn (info.shift2, operands);
-               m -= 2;
+               for (; m > 1; m -= 2)
+                 output_asm_insn (info.shift2, operands);
              }
 
            /* Now single bit rotates for any residual.  */
-           while (m > 0)
-             {
-               output_asm_insn (info.shift1, operands);
-               m -= 1;
-             }
+           for (; m > 0; m--)
+             output_asm_insn (info.shift1, operands);
 
            /* Now mask off the high bits.  */
            if (TARGET_H8300)
@@ -2579,10 +2572,8 @@ output_a_shift (insn, operands)
                    sprintf (insn_buf, "and\t#%d,%%s0\n\tand\t#%d,%%t0",
                             mask & 255, mask >> 8);
                    break;
-                 case SImode:
-                   abort ();
                  default:
-                   break;
+                   abort ();
                  }
              }
            else
index 4e86213..f67e22e 100644 (file)
                          (match_operand:QI 2 "nonmemory_operand" "KM,rn")]))
    (clobber (match_scratch:QI 4 "=X,&r"))]
   ""
-  "* return output_a_shift (insn, operands);"
+  "* return output_a_shift (operands);"
   [(set_attr "length" "20")
    (set_attr "cc" "clobber")])
 
                          (match_operand:QI 2 "nonmemory_operand" "KM,rn")]))
    (clobber (match_scratch:QI 4 "=X,&r"))]
   ""
-  "* return output_a_shift (insn, operands);"
+  "* return output_a_shift (operands);"
   [(set_attr "length" "20")
    (set_attr "cc" "clobber")])
 
                          (match_operand:QI 2 "nonmemory_operand" "K,rn")]))
    (clobber (match_scratch:QI 4 "=X,&r"))]
   ""
-  "* return output_a_shift (insn, operands);"
+  "* return output_a_shift (operands);"
   [(set_attr "length" "20")
    (set_attr "cc" "clobber")])
 \f