better info for SLI
authorceriel <none@none>
Tue, 21 Jun 1988 16:10:19 +0000 (16:10 +0000)
committerceriel <none@none>
Tue, 21 Jun 1988 16:10:19 +0000 (16:10 +0000)
util/ego/cs/cs_profit.c
util/ego/descr/m68020.descr
util/ego/descr/m68k2.descr
util/ego/descr/m68k4.descr
util/ego/descr/pdp.descr
util/ego/descr/vax4.descr

index dab15e9..efd3378 100644 (file)
@@ -21,9 +21,9 @@
 STATIC cset    addr_modes;
 STATIC cset    cheaps;
 STATIC cset    forbidden;
+STATIC cset    sli_counts;
 STATIC short   LX_threshold;
 STATIC short   AR_limit;
-STATIC bool    DO_sli;
 
 STATIC get_instrs(f, s_p)
        FILE *f;
@@ -100,11 +100,10 @@ cs_machinit(f)
        fscanf(f, "%d", &space);
        AR_limit = space;
 
-       /* Read whether we must eliminate an SLI instruction
+       /* Read for what counts we must not eliminate an SLI instruction
         * when it is part of an array-index computation.
         */
-       fscanf(f, "%d %d", &time, &space);
-       DO_sli = time_space_ratio >= 50 ? time : space;
+       choose_cset(f, &sli_counts, 8 * ws);
 
        /* Read a set of instructions which we do not want to eliminate.
         * Note: only instructions need be given that may in principle
@@ -115,14 +114,19 @@ cs_machinit(f)
        choose_cset(f, &forbidden, sp_lmnem);
 }
 
-STATIC bool is_index(lnp)
+STATIC bool sli_no_eliminate(lnp)
        line_p lnp;
 {
        /* Return whether the SLI-instruction in lnp is part of
-        * an array-index computation.
+        * an array-index computation, and should not be eliminated.
         */
+       offset cst;
+
        return  lnp->l_prev != (line_p) 0 && INSTR(lnp->l_prev) == op_loc &&
-               lnp->l_next != (line_p) 0 && INSTR(lnp->l_next) == op_ads;
+               lnp->l_next != (line_p) 0 && INSTR(lnp->l_next) == op_ads &&
+               (cst = off_set(lnp->l_prev)) == (Celem_t) cst &&
+               Cis_elem((Celem_t) cst, sli_counts)
+               ;
 }
 
 STATIC bool gains(avp)
@@ -139,7 +143,7 @@ STATIC bool gains(avp)
                return off_set(avp->av_found) >= LX_threshold;
 
        if (avp->av_instr == (byte) op_sli)
-               return !is_index(avp->av_found) || DO_sli;
+               return ! sli_no_eliminate(avp->av_found);
 
        if (Cis_elem(avp->av_instr & BMASK, addr_modes))
                return instrgroup(avp->av_found->l_prev) != SIMPLE_LOAD;
index 0c4a7c6..c99d936 100644 (file)
@@ -98,7 +98,8 @@ cheap operations: op_cii op_ciu op_cui op_cuu op_cmi op_cmu op_cmp -1
                  op_cii op_ciu op_cui op_cuu op_cmi op_cmu op_cmp -1
 lexical tresholds: 1 1
 indirection limit: 8
-do sli if index?: no no
+do not eliminate sli if index on shiftcounts:  0 1 2 3 -1
+                                               0 1 2 3 -1
 forbidden operators: -1 -1
 %%SP
 global stack pollution allowed?: no
index 893312f..bd4bf43 100644 (file)
@@ -97,7 +97,8 @@ addressing modes: op_adp op_lof op_ldf op_loi op_dch op_lpb -1
 cheap operations: -1 -1
 lexical tresholds: 1 1
 indirection limit: 8
-do sli if index?: yes yes
+do not eliminate sli if index on shiftcounts:  -1
+                                               -1
 forbidden operators: -1 -1
 %%SP
 global stack pollution allowed?: no
index 5273045..d834b7d 100644 (file)
@@ -97,7 +97,8 @@ addressing modes: op_adp op_lof op_ldf op_loi op_dch op_lpb -1
 cheap operations: -1 -1
 lexical tresholds: 1 1
 indirection limit: 8
-do sli if index?: yes yes
+do not eliminate sli if index on shiftcounts:  -1
+                                               -1
 forbidden operators: -1 -1
 %%SP
 global stack pollution allowed?: no
index c8bd382..f47f222 100644 (file)
@@ -90,7 +90,8 @@ cheap operations: op_cii op_cui op_cfi op_ciu op_cff op_cuu op_cif -1
                  op_cii op_cui op_cfi op_ciu op_cff op_cuu op_cif -1
 lexical tresholds: 1 1
 indirection limit: 8
-do sli if index?: yes yes
+do not eliminate sli if index on shiftcounts:  -1
+                                               -1
 forbidden operators: -1 -1
 %%SP
 global stack pollution allowed?: no
index bee2b67..bdd5a1f 100644 (file)
@@ -112,7 +112,8 @@ cheap operations: op_cii op_cui op_cfi op_ciu op_cff op_cuu op_cif
                  op_cmi op_cmu op_cmf op_cms op_cmp -1
 lexical thresholds: 1 1
 indirection limit: 8
-do sli if index?: no no
+do not eliminate sli if index on shiftcounts:  0 1 2 3 -1
+                                               0 1 2 3 -1
 forbidden operators: -1 -1
 %%SP
 global stack pollution allowed?: yes