This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Small extension to MD_SCHED hack


On Fri, Oct 16, 1998 at 08:44:04PM +0200, Jan Hubicka wrote:
> MD_SCHED_VARIABLE_ISSUE can say "I am full now", but can't say "I will not
> accept this instruction". So at least one instruction must be accepted,
> if I understand it correctly...

This would be equivalent to getting MD_SCHED_VARIABLE_ISSUE to signal
that cycles ought to be skipped entirely.  We could do this by revising
the interpretation of can_issue_more to include a useful definition of
negative numbers, that is, interpret -n to mean skip n extra cycles.

Untested, but you get the idea.


r~



Index: haifa-sched.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/haifa-sched.c,v
retrieving revision 1.71
diff -c -p -d -r1.71 haifa-sched.c
*** haifa-sched.c	1998/10/16 00:08:34	1.71
--- haifa-sched.c	1998/10/16 19:38:04
*************** schedule_block (bb, rgn_n_insns)
*** 6826,6842 ****
      new_needs |= NEED_TAIL;
  
    /* loop until all the insns in BB are scheduled.  */
    while (sched_target_n_insns < target_n_insns)
      {
        int b1;
  
!       clock_var++;
  
!       /* Add to the ready list all pending insns that can be issued now.
!          If there are no ready insns, increment clock until one
!          is ready and add all pending insns at that point to the ready
!          list.  */
!       n_ready = queue_to_ready (ready, n_ready);
  
        if (n_ready == 0)
  	abort ();
--- 6826,6850 ----
      new_needs |= NEED_TAIL;
  
    /* loop until all the insns in BB are scheduled.  */
+   can_issue_more = 0;
    while (sched_target_n_insns < target_n_insns)
      {
        int b1;
  
!       /* When can_issue_more is negative, it means all resources are
! 	 blocked.  This can only ocurr through MD_SCHED_VARIABLE_ISSUE
! 	 fiddling.  */
!       do 
! 	{
!           clock_var++;
  
!           /* Add to the ready list all pending insns that can be issued now.
!              If there are no ready insns, increment clock until one
!              is ready and add all pending insns at that point to the ready
!              list.  */
!           n_ready = queue_to_ready (ready, n_ready);
! 	}
!       while (can_issue_more++ < 0)
  
        if (n_ready == 0)
  	abort ();
*************** schedule_block (bb, rgn_n_insns)
*** 6863,6869 ****
           It is important to count down from n_ready, because n_ready may change
           as insns are issued.  */
        can_issue_more = issue_rate;
!       for (i = n_ready - 1; i >= 0 && can_issue_more; i--)
  	{
  	  rtx insn = ready[i];
  	  int cost = actual_hazard (insn_unit (insn), insn, clock_var, 0);
--- 6871,6877 ----
           It is important to count down from n_ready, because n_ready may change
           as insns are issued.  */
        can_issue_more = issue_rate;
!       for (i = n_ready - 1; i >= 0 && can_issue_more > 0; i--)
  	{
  	  rtx insn = ready[i];
  	  int cost = actual_hazard (insn_unit (insn), insn, clock_var, 0);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]