Skip to content

Commit

Permalink
machreg: in order to ease further arch specific improvements, remove …
Browse files Browse the repository at this point in the history
…unused functions

Signed-off-by: Paul Osmialowski <[email protected]>
  • Loading branch information
pawosm-arm committed Jul 18, 2017
1 parent 0fcf1e8 commit 936c5e3
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 174 deletions.
17 changes: 0 additions & 17 deletions tools/flang2/docs/register.n
Original file line number Diff line number Diff line change
Expand Up @@ -366,21 +366,4 @@ If one is not available,
.cw MR_NOREG
is returned.
.lp
.CS
int mr_gindex(rtype, reg)
int rtype, reg;
.CE
.ip
This function maps a register type,
.cw rtype ,
and a global machine register number,
.cw reg ,
to an index value in the range
.cw 0..MR_NUMGLB-1 .
This routine is aware that certain register types may map to the
same machine register set.
This routine provides a mechanism for ensuring that the history
of a machine register can be kept regardless of the many to one register
type mapping.
.lp
.nr 5n
17 changes: 0 additions & 17 deletions tools/flang2/flang2exe/aarch64-Linux/machreg.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,6 @@ extern int mr_res_xr[MR_MAX_XREG_RES + 1];
*/
#define MR_IR_AVAIL(c) 0

/* Define gindex bounds for the set of global irs/ars and scratch
* irs/ars. MUST BE CONSISTENT with mr_gindex().
*/
#define MR_GI_IR_LOW 0
#define MR_GI_IR_HIGH (MR_U1 - MR_L1)
#define MR_GI_IS_SCR_IR(i) ((i) > (MR_U1 - MR_L1))

/* Machine Register Information -
*
* This information is in two pieces:
Expand Down Expand Up @@ -325,17 +318,8 @@ typedef struct {/* three -word bit-vector */
int xr;
} RGSET;

#define RGSETG(i) rgsetb.stg_base[i]

#define RGSET_XR(i) rgsetb.stg_base[i].xr

#define SET_RGSET_XR(i, reg) \
{ \
RGSET_XR(i) |= (1 << (reg)); \
}

#define TST_RGSET_XR(i, reg) ((RGSET_XR(i) >> (reg)) & 1)

typedef struct {
RGSET *stg_base;
int stg_avail;
Expand Down Expand Up @@ -388,7 +372,6 @@ extern RGSETB rgsetb;
extern int mr_getnext(int rtype);
extern int mr_getreg(int rtype);
extern int mr_get_rgset();
extern int mr_gindex(int rtype, int regno);
extern void mr_end();
extern void mr_init();
extern void mr_reset_frglobals();
Expand Down
106 changes: 0 additions & 106 deletions tools/flang2/flang2exe/machreg.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,6 @@ mr_init()

}

static int
mr_isxmm(int rtype)
{
#if DEBUG
assert((rtype == RATA_SP || rtype == RATA_DP || rtype == RATA_CSP ||
rtype == RATA_CDP),
"mr_isxmm bad rtype", rtype, 3);
#endif
return (reg[rtype].mach_reg->class == 'x');
}

void
mr_reset_numglobals(int reduce_by)
{
Expand Down Expand Up @@ -218,19 +207,6 @@ _mr_getreg(int rtype)
return (mr->next_global++);
}

/** \brief map a register type and global register number to an index value in
* the range 0 .. MR_NUMGLB-1, taking into consideration that certain
* register types map to the same machine register set.
*
* This is used by * the optimizer to index into its register history table.
*/
int
mr_gindex(int rtype, int regno)
{
MACH_REG *mr = reg[rtype].mach_reg;
return ((regno - mr->first_global) + mr->mapbase);
}

/** \brief communicate to the scheduler the first global register not assigned
* for each register class
*
Expand All @@ -251,13 +227,6 @@ mr_end()

}

void
static mr_reset_fpregs()
{
mach_reg[1].next_global = mach_reg[1].first_global;
mach_reg[2].next_global = mach_reg[2].first_global;
}

/** \brief Initialize for scanning the entire machine register set used for
* rtype.
*
Expand Down Expand Up @@ -334,33 +303,6 @@ int _mr_getnext(int rtype)
return mreg;
}

/* RGSET functions */
static void
mr_init_rgset()
{
RGSET tmp;
int bihx;

/* just verify that regs all fit in RGSET fields. (+1 below is because
* current RGSET macro's assume regs start at 1, position 0 in bitfields
* is wasted. TST_ and SET_ macros could be changed along with these
* asserts to save the bit.
*/
assert(sizeof(tmp.xr) * 8 >= mach_reg[2].max + 1, "RGSET xr ops invalid", 0,
3);

rgsetb.stg_avail = 1;

/* make sure BIH_RGSET fields are fresh. */
bihx = gbl.entbih;
for (;;) {
BIH_RGSET(bihx) = 0;
if (BIH_LAST(bihx))
break;
bihx = BIH_NEXT(bihx);
}
}

/** \brief allocate and initialize a RGSET entry. */
int
mr_get_rgset()
Expand All @@ -379,51 +321,3 @@ mr_get_rgset()

return rgset;
}

static void
mr_dmp_rgset(int rgseti)
{
int i;
int cnt = 0;

fprintf(gbl.dbgfil, "rgset %d:", rgseti);
if (rgseti == 0) {
fprintf(gbl.dbgfil, " null");
assert(RGSET_XR(0) == 0, "mr_dmp_rgset says someone was writing 0", 0, 3);
}
for (i = XR_FIRST; i <= XR_LAST; i++) {
if (TST_RGSET_XR(rgseti, i)) {
fprintf(gbl.dbgfil, " xmm%d", i);
cnt++;
}
}
fprintf(gbl.dbgfil, " total %d\n", cnt);
}

/* called from flow.c to tell globalreg, and scheduler which
xmm regs are used by the vectorizer.
*/
static void
mr_bset_xmm_rgset(int ili, int bih)
{
int j, opn, opc, noprs;

if (BIH_RGSET(bih) == 0) {
BIH_RGSET(bih) = mr_get_rgset();
}

opc = ILI_OPC(ili);
noprs = ilis[opc].oprs;
for (j = 1; j <= noprs; j++) {
opn = ILI_OPND(ili, j);
switch (IL_OPRFLAG(opc, j)) {
case ILIO_XMM:
assert(opn >= XR_FIRST && opn <= XR_LAST,
"mr_bset_xmm_rgset: bad xmm register value", ili, 2);
SET_RGSET_XR(BIH_RGSET(bih), opn);
break;
default:
break;
}
}
}
17 changes: 0 additions & 17 deletions tools/flang2/flang2exe/ppc64le-Linux/machreg.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,6 @@ extern int mr_res_xr[MR_MAX_XREG_RES + 1];
*/
#define MR_IR_AVAIL(c) 0

/* Define gindex bounds for the set of global irs/ars and scratch
* irs/ars. MUST BE CONSISTENT with mr_gindex().
*/
#define MR_GI_IR_LOW 0
#define MR_GI_IR_HIGH (MR_U1 - MR_L1)
#define MR_GI_IS_SCR_IR(i) ((i) > (MR_U1 - MR_L1))

/* Machine Register Information -
*
* This information is in two pieces:
Expand Down Expand Up @@ -325,17 +318,8 @@ typedef struct {/* three -word bit-vector */
int xr;
} RGSET;

#define RGSETG(i) rgsetb.stg_base[i]

#define RGSET_XR(i) rgsetb.stg_base[i].xr

#define SET_RGSET_XR(i, reg) \
{ \
RGSET_XR(i) |= (1 << (reg)); \
}

#define TST_RGSET_XR(i, reg) ((RGSET_XR(i) >> (reg)) & 1)

typedef struct {
RGSET *stg_base;
int stg_avail;
Expand Down Expand Up @@ -388,7 +372,6 @@ extern RGSETB rgsetb;
extern int mr_getnext(int rtype);
extern int mr_getreg(int rtype);
extern int mr_get_rgset();
extern int mr_gindex(int rtype, int regno);
extern void mr_end();
extern void mr_init();
extern void mr_reset_frglobals();
Expand Down
17 changes: 0 additions & 17 deletions tools/flang2/flang2exe/x86_64-Linux/machreg.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,6 @@ extern int mr_res_xr[MR_MAX_XREG_RES];
*/
#define MR_IR_AVAIL(c) 0

/* Define gindex bounds for the set of global irs/ars and scratch
* irs/ars. MUST BE CONSISTENT with mr_gindex().
*/
#define MR_GI_IR_LOW 0
#define MR_GI_IR_HIGH (MR_U1 - MR_L1)
#define MR_GI_IS_SCR_IR(i) ((i) > (MR_U1 - MR_L1))

/* Machine Register Information -
*
* This information is in two pieces:
Expand Down Expand Up @@ -462,17 +455,8 @@ typedef struct {/* three -word bit-vector */
int xr;
} RGSET;

#define RGSETG(i) rgsetb.stg_base[i]

#define RGSET_XR(i) rgsetb.stg_base[i].xr

#define SET_RGSET_XR(i, reg) \
{ \
RGSET_XR(i) |= (1 << (reg)); \
}

#define TST_RGSET_XR(i, reg) ((RGSET_XR(i) >> (reg)) & 1)

typedef struct {
RGSET *stg_base;
int stg_avail;
Expand Down Expand Up @@ -525,7 +509,6 @@ extern RGSETB rgsetb;
extern int mr_getnext(int rtype);
extern int mr_getreg(int rtype);
extern int mr_get_rgset();
extern int mr_gindex(int rtype, int regno);
extern void mr_end();
extern void mr_init();
extern void mr_reset_frglobals();
Expand Down

0 comments on commit 936c5e3

Please sign in to comment.