Re-haifa-sched.c for SPARC

phani narasimhan venkata sesha myreddy phani.sesha@wipro.com
Tue Jun 20 02:35:00 GMT 2000


hai all,
i am using the haifa-sched.c to generated the optimal code for
ultrasparcs.


The program is loop.c

The test program i was using is:-

-------------------------------------------
#include<stdio.h>
void main(){
int i=1;
int a[]={0,1,4,6,5,3,2};
int max=a[0];
do{
 if(a[i] > max) max = a[i];
 i++;
} while(i<7);
printf("%d\n",max);
}
---------------------------------------------
The output of loop.c.sched
i am cut and pasting the bock 0 visualisation:

;; Function main

;;   ======================================================
;;   -- basic block 0 from 91 to 106 -- before reload
;;   ======================================================


;;      UltraSPARC Looking at [IEUN(8) IEUN(19) IEUN(22) IEUN(25)
IEUN(28) IEUN(31) IEUN
(35) IEUN(105) IEUN(106)]
;;      UltraSPARC Launched   [IEUN(8) IEUN(19)]

;;      Ready list (t =  1):    106  105  35  31  28  25  22  19  8  12

;;      UltraSPARC Looking at [IEUN(22) IEUN(25) IEUN(28) IEUN(31)
LSU(20) LSU(14) LSU(17) IEUN(35) IEUN(105) IEUN(106)]
;;      UltraSPARC Launched   [IEUN(22) IEUN(25) LSU(20)]

;;      Ready list (t =  2):    106  105  35  17  14  28  31  20  25  22

;;      UltraSPARC Looking at [IEUN(28) IEUN(31) LSU(23) LSU(26) LSU(14)
LSU(17) IEUN(35
) IEUN(105) IEUN(106)]
;;      UltraSPARC Launched   [IEUN(28) IEUN(31) LSU(23)]
;;      Ready list (t =  3):    106  105  35  17  14  26  23  31  28

;;      UltraSPARC Looking at [LSU(26) LSU(29) LSU(32) LSU(14) LSU(17)
IEUN(35) IEUN(105
) IEUN(106)]
;;      UltraSPARC Launched   [IEUN(35) IEUN(105) LSU(32)]

;;      Ready list (t =  4):    106  29  26  17  14  32  105  35

;;      UltraSPARC Looking at [LSU(26) LSU(29) LSU(14) LSU(17)
IEUN(106)]
;;      UltraSPARC Launched   [IEUN(106) LSU(29)]

;;      Ready list (t =  5):    26  17  14  29  106

;;      UltraSPARC Looking at [LSU(26) LSU(14) LSU(17)]
;;      UltraSPARC Launched   [LSU(26)]

;;      Ready list (t =  6):    17  14  26

;;      UltraSPARC Looking at [LSU(14) LSU(17)]
;;      UltraSPARC Launched   [LSU(14)]

;;      Ready list (t =  7):    17  14
;;      UltraSPARC Looking at [LSU(17)]
;;      UltraSPARC Launched   [LSU(17)]

;;      Ready list (t =  8):    17
;;      Ready list (final):
--------------------------------------------------------------------------

Consider the ready list at t=2
;;      UltraSPARC Looking at [IEUN(22) IEUN(25) IEUN(28) IEUN(31)
LSU(20) LSU(14) LSU(17) IEUN(35) IEUN(105) IEUN(106)]
;;      UltraSPARC Launched   [IEUN(22) IEUN(25) LSU(20)]

;;      Ready list (t =  2):    106  105  35  17  14  28  31  20  25  22

Here the insn 20 got swapped with insn 28. My concern here instead of
swapping
the insn should be pushed down the list. Then only we are respecting the
order
generated by the rank_of_schedule while doing the qsort().

Eventhoug the current exaple doesn't strongly defect the generation, as
the bundle
ends with the 3 insns. consider a case where x1,x2,x3 are there in the
order  and
 x1 got swapped with x3, so the order becomes x3,x2,x1 and assume
in the next slot in the bundle both x1 and x2 can go but we select x2
and leave
x1. My concen is that in such senario x1 should be slected before x2, so
that
we repect the incoming order.

Execuse me if i am wrong. Hope somebody working on ultrasparc
CPU reply to my question at the earliest.
ThankYou,
phani.


More information about the Gcc-bugs mailing list