sched.c macro patches.

GrahamS grahams@rcp.co.uk
Mon May 17 07:12:00 GMT 1999


Hi

The first patch copies a patch to haifa-sched.c from rth@cygnus.com
applied
on 7th Mar 1999.  

The remaining are more of my macro patches.

Graham

	* sched.c (ENCODE_BLOCKAGE): Don't shift unit too far.
	* This is rth@cygnus.com haifa-sched.c patch
	* (DONE_PRIORITY): Parenthesise macro.
	* (NEXT_Q_AFTER): Add parenthesis 
	* (SCHED_SORT): Likewise

*** sched.c.orig	Sat May 15 21:45:12 1999
--- sched.c	Sat May 15 21:46:57 1999
*************** static unsigned int *insn_blockage;
*** 182,188 ****
  #define UNIT_BITS 5
  #define BLOCKAGE_MASK ((1 << BLOCKAGE_BITS) - 1)
  #define ENCODE_BLOCKAGE(U,R)				\
!   ((((U) << UNIT_BITS) << BLOCKAGE_BITS			\
      | MIN_BLOCKAGE_COST (R)) << BLOCKAGE_BITS		\
     | MAX_BLOCKAGE_COST (R))
  #define UNIT_BLOCKED(B) ((B) >> (2 * BLOCKAGE_BITS))
--- 182,188 ----
  #define UNIT_BITS 5
  #define BLOCKAGE_MASK ((1 << BLOCKAGE_BITS) - 1)
  #define ENCODE_BLOCKAGE(U,R)				\
!   (((U) << BLOCKAGE_BITS				\
      | MIN_BLOCKAGE_COST (R)) << BLOCKAGE_BITS		\
     | MAX_BLOCKAGE_COST (R))
  #define UNIT_BLOCKED(B) ((B) >> (2 * BLOCKAGE_BITS))
*************** static unsigned int *insn_blockage;
*** 194,200 ****
  #define MIN_BLOCKAGE_COST(R) ((R) >> (HOST_BITS_PER_INT / 2))
  #define MAX_BLOCKAGE_COST(R) ((R) & ((1 << (HOST_BITS_PER_INT / 2)) -
1))
  
! #define DONE_PRIORITY	-1
  #define MAX_PRIORITY	0x7fffffff
  #define TAIL_PRIORITY	0x7ffffffe
  #define LAUNCH_PRIORITY	0x7f000001
--- 194,200 ----
  #define MIN_BLOCKAGE_COST(R) ((R) >> (HOST_BITS_PER_INT / 2))
  #define MAX_BLOCKAGE_COST(R) ((R) & ((1 << (HOST_BITS_PER_INT / 2)) -
1))
  
! #define DONE_PRIORITY	(-1)
  #define MAX_PRIORITY	0x7fffffff
  #define TAIL_PRIORITY	0x7ffffffe
  #define LAUNCH_PRIORITY	0x7f000001
*************** static rtx insn_queue[INSN_QUEUE_SIZE];
*** 288,294 ****
  static int q_ptr = 0;
  static int q_size = 0;
  #define NEXT_Q(X) (((X)+1) & (INSN_QUEUE_SIZE-1))
! #define NEXT_Q_AFTER(X,C) (((X)+C) & (INSN_QUEUE_SIZE-1))
  
  /* Vector indexed by INSN_UID giving the minimum clock tick at which
     the insn becomes ready.  This is used to note timing constraints
for
--- 288,294 ----
  static int q_ptr = 0;
  static int q_size = 0;
  #define NEXT_Q(X) (((X)+1) & (INSN_QUEUE_SIZE-1))
! #define NEXT_Q_AFTER(X,C) (((X)+(C)) & (INSN_QUEUE_SIZE-1))
  
  /* Vector indexed by INSN_UID giving the minimum clock tick at which
     the insn becomes ready.  This is used to note timing constraints
for
*************** sched_note_set (x, death)
*** 1824,1833 ****
  
  #define SCHED_SORT(READY, NEW_READY, OLD_READY) \
    do { if ((NEW_READY) - (OLD_READY) == 1)				\
! 	 swap_sort (READY, NEW_READY);					\
         else if ((NEW_READY) - (OLD_READY) > 1)				\
! 	 qsort (READY, NEW_READY, sizeof (rtx), rank_for_schedule); }	\
!   while (0)
  
  /* Returns a positive value if y is preferred; returns a negative
value if
     x is preferred.  Should never return 0, since that will make the
sort
--- 1824,1833 ----
  
  #define SCHED_SORT(READY, NEW_READY, OLD_READY) \
    do { if ((NEW_READY) - (OLD_READY) == 1)				\
! 	 swap_sort ((READY), (NEW_READY));				\
         else if ((NEW_READY) - (OLD_READY) > 1)				\
! 	 qsort ((READY), (NEW_READY), sizeof (rtx), rank_for_schedule); \
!     } while (0)
  
  /* Returns a positive value if y is preferred; returns a negative
value if
     x is preferred.  Should never return 0, since that will make the
sort


More information about the Gcc-patches mailing list