From e8f4e47da5c638d3e316739c4ae52268ad8f1d73 Mon Sep 17 00:00:00 2001 From: ceriel Date: Tue, 21 Jun 1988 16:10:19 +0000 Subject: [PATCH] better info for SLI --- util/ego/cs/cs_profit.c | 20 ++++++++++++-------- util/ego/descr/m68020.descr | 3 ++- util/ego/descr/m68k2.descr | 3 ++- util/ego/descr/m68k4.descr | 3 ++- util/ego/descr/pdp.descr | 3 ++- util/ego/descr/vax4.descr | 3 ++- 6 files changed, 22 insertions(+), 13 deletions(-) diff --git a/util/ego/cs/cs_profit.c b/util/ego/cs/cs_profit.c index dab15e99e..efd337802 100644 --- a/util/ego/cs/cs_profit.c +++ b/util/ego/cs/cs_profit.c @@ -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; diff --git a/util/ego/descr/m68020.descr b/util/ego/descr/m68020.descr index 0c4a7c6a9..c99d9361f 100644 --- a/util/ego/descr/m68020.descr +++ b/util/ego/descr/m68020.descr @@ -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 diff --git a/util/ego/descr/m68k2.descr b/util/ego/descr/m68k2.descr index 893312feb..bd4bf4365 100644 --- a/util/ego/descr/m68k2.descr +++ b/util/ego/descr/m68k2.descr @@ -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 diff --git a/util/ego/descr/m68k4.descr b/util/ego/descr/m68k4.descr index 5273045b8..d834b7ddf 100644 --- a/util/ego/descr/m68k4.descr +++ b/util/ego/descr/m68k4.descr @@ -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 diff --git a/util/ego/descr/pdp.descr b/util/ego/descr/pdp.descr index c8bd382d5..f47f222f4 100644 --- a/util/ego/descr/pdp.descr +++ b/util/ego/descr/pdp.descr @@ -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 diff --git a/util/ego/descr/vax4.descr b/util/ego/descr/vax4.descr index bee2b6771..bdd5a1ff3 100644 --- a/util/ego/descr/vax4.descr +++ b/util/ego/descr/vax4.descr @@ -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 -- 2.34.1