Add hooks for the machine to override the sorting of the ready list and variable...
authorMichael Meissner <meissner@cygnus.com>
Fri, 26 Jun 1998 13:09:01 +0000 (13:09 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Fri, 26 Jun 1998 13:09:01 +0000 (13:09 +0000)
From-SVN: r20740

gcc/ChangeLog
gcc/haifa-sched.c
gcc/tm.texi

index 87a4a7a87f07760bf3a9308dbbc65fe5589bc7b2..fbfaf6f6fbf2e56cf776ea843d934e99befa3168 100644 (file)
@@ -1,3 +1,10 @@
+Fri Jun 26 16:03:15 1998  Michael Meissner  <meissner@cygnus.com>
+
+       * haifa-sched.c (schedule_block): Add hooks for the machine
+       description to reorder the ready list, and update how many more
+       instructions can be issued this cycle.
+       * tm.texi (MD_SCHED_{INIT,REORDER,VARIABLE_ISSUE}): Document.
+       
 Fri Jun 26 11:54:11 1998  David S. Miller  <davem@pierdol.cobaltmicro.com>
 
        * config/sparc/sparc.h (REGNO_OK_FOR_{INDEX,BASE,FP,CCFP}_P):
index 14eda50a6a4f1602414d21f2178471528e5c65a0..fff73ca8b1b06ba4031d207f465102d822b9469e 100644 (file)
@@ -6725,11 +6725,18 @@ schedule_block (bb, rgn_n_insns)
          }
       }
 
+#ifdef MD_SCHED_INIT
+  MD_SCHED_INIT (dump, sched_verbose);
+#endif
+
   /* no insns scheduled in this block yet */
   last_scheduled_insn = 0;
 
   /* Sort the ready list */
   SCHED_SORT (ready, n_ready);
+#ifdef MD_SCHED_REORDER
+  MD_SCHED_REORDER (dump, sched_verbose, ready, n_ready);
+#endif
 
   if (sched_verbose >= 2)
     {
@@ -6776,6 +6783,9 @@ schedule_block (bb, rgn_n_insns)
 
       /* Sort the ready list.  */
       SCHED_SORT (ready, n_ready);
+#ifdef MD_SCHED_REORDER
+      MD_SCHED_REORDER (dump, sched_verbose, ready, n_ready);
+#endif
 
       if (sched_verbose)
        {
@@ -6865,7 +6875,11 @@ schedule_block (bb, rgn_n_insns)
              last = move_insn (insn, last);
              sched_n_insns++;
 
+#ifdef MD_SCHED_VARIABLE_ISSUE
+             MD_SCHED_VARIABLE_ISSUE (dump, sched_verbose, insn, can_issue_more);
+#else
              can_issue_more--;
+#endif
 
              n_ready = schedule_insn (insn, ready, n_ready, clock_var);
 
index a4fb481e8fc3217255cd9f33bf29b7a312096f0b..6f0d2dd74dfb109ba8663aa4fd20c676fa0bda25 100644 (file)
@@ -7417,6 +7417,38 @@ A C expression that returns how many instructions can be issued at the
 same time if the machine is a superscalar machine.  This is only used by
 the @samp{Haifa} scheduler, and not the traditional scheduler.
 
+@findex MD_SCHED_INIT
+@item MD_SCHED_INIT (@var{file}, @var{verbose}
+A C statement which is executed by the @samp{Haifa} scheduler at the
+beginning of each block of instructions that are to be scheduled.
+@var{file} is either a null pointer, or a stdio stream to write any
+debug output to.  @var{verbose} is the verbose level provided by
+@samp{-fsched-verbose-}@var{n}.
+
+@findex MD_SCHED_REORDER
+@item MD_SCHED_REORDER (@var{file}, @var{verbose}, @var{ready}, @var{n_ready})
+A C statement which is executed by the @samp{Haifa} scheduler after it
+has scheduled the ready list to allow the machine description to reorder
+it (for example to combine two small instructions together on
+@samp{VLIW} machines).  @var{file} is either a null pointer, or a stdio
+stream to write any debug output to.  @var{verbose} is the verbose level
+provided by @samp{-fsched-verbose-}@var{n}.  @var{ready} is a pointer to
+the ready list of instructions that are ready to be scheduled.
+@var{n_ready} is the number of elements in the ready list.  The
+scheduler reads the ready list in reverse order, starting with
+@var{ready}[@var{n_ready}-1] and going to @var{ready}[0].
+
+@findex MD_SCHED_VARIABLE_ISSUE
+@item MD_SCHED_VARIABLE_ISSUE (@var{file}, @var{verbose}, @var{insn}, @var{more})
+A C statement which is executed by the @samp{Haifa} scheduler after it
+has scheduled an insn from the ready list.  @var{file} is either a null
+pointer, or a stdio stream to write any debug output to.  @var{verbose}
+is the verbose level provided by @samp{-fsched-verbose-}@var{n}.
+@var{insn} is the instruction that was scheduled.  @var{more} is the
+number of instructions that can be issued in the current cycle.  The
+@samp{MD_SCHED_VARIABLE_ISSUE} macro is responsible for updating the
+value of @var{more} (typically by @var{more}--).
+
 @findex MAX_INTEGER_COMPUTATION_MODE
 @item MAX_INTEGER_COMPUTATION_MODE
 Define this to the largest integer machine mode which can be used for