diff --git a/tools/flang2/docs/register.n b/tools/flang2/docs/register.n index 9f87cdc1d6a..1ec15dc0092 100644 --- a/tools/flang2/docs/register.n +++ b/tools/flang2/docs/register.n @@ -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 diff --git a/tools/flang2/flang2exe/aarch64-Linux/machreg.h b/tools/flang2/flang2exe/aarch64-Linux/machreg.h index 482348e8be7..f44e81d3caa 100644 --- a/tools/flang2/flang2exe/aarch64-Linux/machreg.h +++ b/tools/flang2/flang2exe/aarch64-Linux/machreg.h @@ -259,13 +259,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: @@ -330,17 +323,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; @@ -393,7 +377,6 @@ extern RGSETB rgsetb; int mr_getnext(int rtype); int mr_getreg(int rtype); int mr_get_rgset(); - int mr_gindex(int rtype, int regno); void mr_end(); void mr_init(); void mr_reset_frglobals(); diff --git a/tools/flang2/flang2exe/machreg.cpp b/tools/flang2/flang2exe/machreg.cpp index 03ea19d2063..5e1e64d1e8f 100644 --- a/tools/flang2/flang2exe/machreg.cpp +++ b/tools/flang2/flang2exe/machreg.cpp @@ -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, ERR_Severe); -#endif - return (reg[rtype].mach_reg->Class == 'x'); -} - void mr_reset_numglobals(int reduce_by) { @@ -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 * @@ -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. * @@ -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, - ERR_Severe); - - 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() @@ -379,53 +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, ERR_Severe); - } - 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; - ILI_OP opc; - int 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, ERR_Warning); - SET_RGSET_XR(BIH_RGSET(bih), opn); - break; - default: - break; - } - } -} diff --git a/tools/flang2/flang2exe/ppc64le-Linux/machreg.h b/tools/flang2/flang2exe/ppc64le-Linux/machreg.h index 482348e8be7..f44e81d3caa 100644 --- a/tools/flang2/flang2exe/ppc64le-Linux/machreg.h +++ b/tools/flang2/flang2exe/ppc64le-Linux/machreg.h @@ -259,13 +259,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: @@ -330,17 +323,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; @@ -393,7 +377,6 @@ extern RGSETB rgsetb; int mr_getnext(int rtype); int mr_getreg(int rtype); int mr_get_rgset(); - int mr_gindex(int rtype, int regno); void mr_end(); void mr_init(); void mr_reset_frglobals(); diff --git a/tools/flang2/flang2exe/x86_64-Linux/machreg.h b/tools/flang2/flang2exe/x86_64-Linux/machreg.h index abf475c0084..188b39577ae 100644 --- a/tools/flang2/flang2exe/x86_64-Linux/machreg.h +++ b/tools/flang2/flang2exe/x86_64-Linux/machreg.h @@ -417,13 +417,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: @@ -488,17 +481,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; @@ -563,11 +547,6 @@ int mr_getreg(int rtype); */ int mr_get_rgset(void); -/** - \brief ... - */ -int mr_gindex(int rtype, int regno); - /** \brief ... */