Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/toolchain/gcc/config/sh - include MANY *.h



details:   https://anonhg.NetBSD.org/src/rev/29142a11feee
branches:  trunk
changeset: 525299:29142a11feee
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Apr 09 17:57:33 2002 +0000

description:
- include MANY *.h
- include sh/sh-protos.h instead of gcc3's tm_p.h
- fix some function's return value
- fix some function's missing argument
- warning fixes

diffstat:

 gnu/dist/toolchain/gcc/config/sh/sh.c |  204 ++++++++++++++++++++-------------
 1 files changed, 122 insertions(+), 82 deletions(-)

diffs (truncated from 527 to 300 lines):

diff -r babeae65a1f8 -r 29142a11feee gnu/dist/toolchain/gcc/config/sh/sh.c
--- a/gnu/dist/toolchain/gcc/config/sh/sh.c     Tue Apr 09 17:54:40 2002 +0000
+++ b/gnu/dist/toolchain/gcc/config/sh/sh.c     Tue Apr 09 17:57:33 2002 +0000
@@ -25,15 +25,22 @@
 
 #include <stdio.h>
 
+#include "system.h"
+#include "insn-config.h"
 #include "rtl.h"
 #include "tree.h"
 #include "flags.h"
 #include "insn-flags.h"
 #include "expr.h"
+#include "except.h"
+#include "function.h"
 #include "regs.h"
 #include "hard-reg-set.h"
 #include "output.h"
 #include "insn-attr.h"
+#include "toplev.h"
+#include "recog.h"
+#include "sh/sh-protos.h"
 
 int code_for_indirect_jump_scratch = CODE_FOR_indirect_jump_scratch;
 
@@ -132,11 +139,33 @@
 
 int assembler_dialect;
 
-rtx get_fpscr_rtx ();
-void emit_sf_insn ();
-void emit_df_insn ();
-
 static void split_branches PROTO ((rtx));
+static int branch_dest PROTO ((rtx));
+static void force_into PROTO ((rtx, rtx));
+static void print_slot PROTO ((rtx));
+static void gen_ashift PROTO ((int, int, rtx));
+static void gen_ashift_hi PROTO ((int, int, rtx));
+static rtx add_constant PROTO ((rtx, enum machine_mode, rtx));
+static void dump_table PROTO ((rtx));
+static int hi_const PROTO ((rtx));
+static int broken_move PROTO ((rtx));
+static int mova_p PROTO ((rtx));
+static rtx find_barrier PROTO ((int, rtx, rtx));
+static int noncall_uses_reg PROTO ((rtx, rtx, rtx *));
+static int regs_used PROTO ((rtx, int));
+static rtx gen_block_redirect PROTO ((rtx, int, int));
+static void fixup_addr_diff_vecs PROTO ((rtx));
+static int get_dest_uid PROTO ((rtx, int));
+static rtx gen_block_redirect PROTO ((rtx, int, int));
+static void fixup_addr_diff_vecs PROTO ((rtx));
+static void output_stack_adjust PROTO ((int, rtx, int));
+static void push PROTO ((int));
+static void pop PROTO ((int));
+static void push_regs PROTO ((int, int));
+static int calc_live_regs PROTO ((int *, int *));
+static void mark_use PROTO ((rtx, rtx *));
+
+
 
 /* Print the operand address in x to the stream.  */
 
@@ -272,6 +301,8 @@
            x = adj_offsettable_operand (x, 4);
          print_operand_address (stream, XEXP (x, 0));
          break;
+       default:
+         break;
        }
       break;
     case 'o':
@@ -281,6 +312,8 @@
        case MINUS: fputs ("sub", stream); break;
        case MULT:  fputs ("mul", stream); break;
        case DIV:   fputs ("div", stream); break;
+       default:
+         break;
        }
       break;
     default:
@@ -305,8 +338,6 @@
     }
 }
 
-static void force_into PROTO ((rtx, rtx));
-
 /* Like force_operand, but guarantees that VALUE ends up in TARGET.  */
 static void
 force_into (value, target)
@@ -499,6 +530,8 @@
     case LEU:
       code = GEU;
       break;
+    default:
+      break;
     }
   if (code != oldcode)
     {
@@ -516,7 +549,7 @@
        && (sh_compare_op1 != const0_rtx
           || code == GTU  || code == GEU || code == LTU || code == LEU))
       || (mode == DImode && sh_compare_op1 != const0_rtx)
-      || TARGET_SH3E && GET_MODE_CLASS (mode) == MODE_FLOAT)
+      || (TARGET_SH3E && GET_MODE_CLASS (mode) == MODE_FLOAT))
     sh_compare_op1 = force_reg (mode, sh_compare_op1);
 
   if (TARGET_SH4 && GET_MODE_CLASS (mode) == MODE_FLOAT)
@@ -785,13 +818,12 @@
 
 char *
 output_branchy_insn (code, template, insn, operands)
+     enum rtx_code code;
      char *template;
-     enum rtx_code code;
      rtx insn;
      rtx *operands;
 {
   rtx next_insn = NEXT_INSN (insn);
-  int label_nr;
 
   if (next_insn && GET_CODE (next_insn) == JUMP_INSN && condjump_p (next_insn))
     {
@@ -835,8 +867,6 @@
 output_file_start (file)
      FILE *file;
 {
-  register int pos;
-
   output_file_directive (file, main_input_filename);
 
   /* Switch to the data section so that the coffsem symbol and the
@@ -1073,7 +1103,7 @@
 /* Output RTL to split a constant shift into its component SH constant
    shift instructions.  */
    
-int
+void
 gen_shifty_op (code, operands)
      int code;
      rtx *operands;
@@ -1121,14 +1151,14 @@
 /* Same as above, but optimized for values where the topmost bits don't
    matter.  */
 
-int
+void
 gen_shifty_hi_op (code, operands)
      int code;
      rtx *operands;
 {
   int value = INTVAL (operands[2]);
   int max, i;
-  void (*gen_fun)();
+  void (*gen_fun) PROTO ((int, int, rtx));
 
   /* This operation is used by and_shl for SImode values with a few
      high bits known to be cleared.  */
@@ -1416,7 +1446,7 @@
   unsigned HOST_WIDE_INT mask;
   int kind = shl_and_kind (left_rtx, mask_rtx, attributes);
   int right, total_shift;
-  int (*shift_gen_fun) PROTO((int, rtx*)) = gen_shifty_hi_op;
+  void (*shift_gen_fun) PROTO((int, rtx*)) = gen_shifty_hi_op;
 
   right = attributes[0];
   total_shift = INTVAL (left_rtx) + right;
@@ -1471,7 +1501,7 @@
       /* If the topmost bit that matters is set, set the topmost bits
         that don't matter.  This way, we might be able to get a shorter
         signed constant.  */
-      if (mask & ((HOST_WIDE_INT)1 << 31 - total_shift))
+      if (mask & ((HOST_WIDE_INT)1 << (31 - total_shift)))
        mask |= (HOST_WIDE_INT)~0 << (31 - total_shift);
     case 2:
       /* Don't expand fine-grained when combining, because that will
@@ -1855,9 +1885,9 @@
 
 static rtx
 add_constant (x, mode, last_value)
-     rtx last_value;
      rtx x;
      enum machine_mode mode;
+     rtx last_value;
 {
   int i;
   rtx lab;
@@ -2200,21 +2230,23 @@
     }
 
   if (num_mova)
-    if (leading_mova)
-      {
-       /* Try as we might, the leading mova is out of range.  Change
-          it into a load (which will become a pcload) and retry.  */
-       SET_SRC (PATTERN (mova)) = XVECEXP (SET_SRC (PATTERN (mova)), 0, 0);
-       INSN_CODE (mova) = -1;
-        return find_barrier (0, 0, mova);
-      }
-    else
-      {
-       /* Insert the constant pool table before the mova instruction,
-          to prevent the mova label reference from going out of range.  */
-       from = mova;
-       good_barrier = found_barrier = barrier_before_mova;
-      }
+    {
+      if (leading_mova)
+       {
+         /* Try as we might, the leading mova is out of range.  Change
+            it into a load (which will become a pcload) and retry.  */
+         SET_SRC (PATTERN (mova)) = XVECEXP (SET_SRC (PATTERN (mova)), 0, 0);
+         INSN_CODE (mova) = -1;
+         return find_barrier (0, 0, mova);
+       }
+      else
+       {
+         /* Insert the constant pool table before the mova instruction,
+            to prevent the mova label reference from going out of range.  */
+         from = mova;
+         good_barrier = found_barrier = barrier_before_mova;
+       }
+    }
 
   if (found_barrier)
     {
@@ -2428,6 +2460,8 @@
     case CALL:
       used |= 0x00ff00f0;
       break;
+    default:
+      break;
     }
 
   fmt = GET_RTX_FORMAT (code);
@@ -2496,7 +2530,7 @@
         the delay slot.  Therefore, find out which registers it uses, and
         try to avoid using them.  */
         
-      for (scan = jump; scan = PREV_INSN (scan); )
+      for (scan = jump; (scan = PREV_INSN (scan)); )
        {
          enum rtx_code code;
 
@@ -2514,7 +2548,8 @@
              break;
            }
        }
-      for (used = dead = 0, scan = JUMP_LABEL (jump); scan = NEXT_INSN (scan); )
+      for (used = dead = 0, scan = JUMP_LABEL (jump);
+          (scan = NEXT_INSN (scan)); )
        {
          enum rtx_code code;
 
@@ -2533,10 +2568,12 @@
                  break;
                }
              if (code == JUMP_INSN)
-               if (jump_left-- && simplejump_p (scan))
-                 scan = JUMP_LABEL (scan);
-               else
-                 break;
+               {
+                 if (jump_left-- && simplejump_p (scan))
+                   scan = JUMP_LABEL (scan);
+                 else
+                   break;
+               }
            }
        }
       /* Mask out the stack pointer again, in case it was
@@ -2606,8 +2643,9 @@
   int address;
 };
 
+static void gen_far_branch PROTO ((struct far_branch *));
 enum mdep_reorg_phase_e mdep_reorg_phase;
-void
+static void
 gen_far_branch (bp)
      struct far_branch *bp;
 {
@@ -3125,7 +3163,6 @@
                  rtx *patp = &PATTERN (scan), pat = *patp;
                  rtx src, dst;
                  rtx lab;
-                 rtx newinsn;
                  rtx newsrc;
                  enum machine_mode mode;
 
@@ -3165,7 +3202,7 @@
                      last_float_move = scan;
                      last_float = src;
                      newsrc = gen_rtx (MEM, mode,
-                                       ((TARGET_SH4 && ! TARGET_FMOVD
+                                       (((TARGET_SH4 && ! TARGET_FMOVD)
                                          || REGNO (dst) == FPUL_REG)
                                         ? r0_inc_rtx
                                         : r0_rtx));



Home | Main Index | Thread Index | Old Index