Skip to content

Commit 7fa7771

Browse files
committed
machreg: in order to ease further arch specific improvements, remove unused functions
Signed-off-by: Paul Osmialowski <[email protected]>
1 parent 07c5b09 commit 7fa7771

File tree

5 files changed

+0
-180
lines changed

5 files changed

+0
-180
lines changed

tools/flang2/docs/register.n

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -366,21 +366,4 @@ If one is not available,
366366
.cw MR_NOREG
367367
is returned.
368368
.lp
369-
.CS
370-
int mr_gindex(rtype, reg)
371-
int rtype, reg;
372-
.CE
373-
.ip
374-
This function maps a register type,
375-
.cw rtype ,
376-
and a global machine register number,
377-
.cw reg ,
378-
to an index value in the range
379-
.cw 0..MR_NUMGLB-1 .
380-
This routine is aware that certain register types may map to the
381-
same machine register set.
382-
This routine provides a mechanism for ensuring that the history
383-
of a machine register can be kept regardless of the many to one register
384-
type mapping.
385-
.lp
386369
.nr 5n

tools/flang2/flang2exe/aarch64-Linux/machreg.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,6 @@ extern int mr_res_xr[MR_MAX_XREG_RES + 1];
259259
*/
260260
#define MR_IR_AVAIL(c) 0
261261

262-
/* Define gindex bounds for the set of global irs/ars and scratch
263-
* irs/ars. MUST BE CONSISTENT with mr_gindex().
264-
*/
265-
#define MR_GI_IR_LOW 0
266-
#define MR_GI_IR_HIGH (MR_U1 - MR_L1)
267-
#define MR_GI_IS_SCR_IR(i) ((i) > (MR_U1 - MR_L1))
268-
269262
/* Machine Register Information -
270263
*
271264
* This information is in two pieces:
@@ -330,17 +323,8 @@ typedef struct {/* three -word bit-vector */
330323
int xr;
331324
} RGSET;
332325

333-
#define RGSETG(i) rgsetb.stg_base[i]
334-
335326
#define RGSET_XR(i) rgsetb.stg_base[i].xr
336327

337-
#define SET_RGSET_XR(i, reg) \
338-
{ \
339-
RGSET_XR(i) |= (1 << (reg)); \
340-
}
341-
342-
#define TST_RGSET_XR(i, reg) ((RGSET_XR(i) >> (reg)) & 1)
343-
344328
typedef struct {
345329
RGSET *stg_base;
346330
int stg_avail;
@@ -393,7 +377,6 @@ extern RGSETB rgsetb;
393377
int mr_getnext(int rtype);
394378
int mr_getreg(int rtype);
395379
int mr_get_rgset();
396-
int mr_gindex(int rtype, int regno);
397380
void mr_end();
398381
void mr_init();
399382
void mr_reset_frglobals();

tools/flang2/flang2exe/machreg.cpp

Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,6 @@ mr_init()
137137

138138
}
139139

140-
static int
141-
mr_isxmm(int rtype)
142-
{
143-
#if DEBUG
144-
assert((rtype == RATA_SP || rtype == RATA_DP || rtype == RATA_CSP ||
145-
rtype == RATA_CDP),
146-
"mr_isxmm bad rtype", rtype, ERR_Severe);
147-
#endif
148-
return (reg[rtype].mach_reg->Class == 'x');
149-
}
150-
151140
void
152141
mr_reset_numglobals(int reduce_by)
153142
{
@@ -218,19 +207,6 @@ _mr_getreg(int rtype)
218207
return (mr->next_global++);
219208
}
220209

221-
/** \brief map a register type and global register number to an index value in
222-
* the range 0 .. MR_NUMGLB-1, taking into consideration that certain
223-
* register types map to the same machine register set.
224-
*
225-
* This is used by * the optimizer to index into its register history table.
226-
*/
227-
int
228-
mr_gindex(int rtype, int regno)
229-
{
230-
MACH_REG *mr = reg[rtype].mach_reg;
231-
return ((regno - mr->first_global) + mr->mapbase);
232-
}
233-
234210
/** \brief communicate to the scheduler the first global register not assigned
235211
* for each register class
236212
*
@@ -251,13 +227,6 @@ mr_end()
251227

252228
}
253229

254-
void
255-
static mr_reset_fpregs()
256-
{
257-
mach_reg[1].next_global = mach_reg[1].first_global;
258-
mach_reg[2].next_global = mach_reg[2].first_global;
259-
}
260-
261230
/** \brief Initialize for scanning the entire machine register set used for
262231
* rtype.
263232
*
@@ -334,33 +303,6 @@ int _mr_getnext(int rtype)
334303
return mreg;
335304
}
336305

337-
/* RGSET functions */
338-
static void
339-
mr_init_rgset()
340-
{
341-
RGSET tmp;
342-
int bihx;
343-
344-
/* just verify that regs all fit in RGSET fields. (+1 below is because
345-
* current RGSET macro's assume regs start at 1, position 0 in bitfields
346-
* is wasted. TST_ and SET_ macros could be changed along with these
347-
* asserts to save the bit.
348-
*/
349-
assert(sizeof(tmp.xr) * 8 >= mach_reg[2].max + 1, "RGSET xr ops invalid", 0,
350-
ERR_Severe);
351-
352-
rgsetb.stg_avail = 1;
353-
354-
/* make sure BIH_RGSET fields are fresh. */
355-
bihx = gbl.entbih;
356-
for (;;) {
357-
BIH_RGSET(bihx) = 0;
358-
if (BIH_LAST(bihx))
359-
break;
360-
bihx = BIH_NEXT(bihx);
361-
}
362-
}
363-
364306
/** \brief allocate and initialize a RGSET entry. */
365307
int
366308
mr_get_rgset()
@@ -379,53 +321,3 @@ mr_get_rgset()
379321

380322
return rgset;
381323
}
382-
383-
static void
384-
mr_dmp_rgset(int rgseti)
385-
{
386-
int i;
387-
int cnt = 0;
388-
389-
fprintf(gbl.dbgfil, "rgset %d:", rgseti);
390-
if (rgseti == 0) {
391-
fprintf(gbl.dbgfil, " null");
392-
assert(RGSET_XR(0) == 0, "mr_dmp_rgset says someone was writing 0", 0, ERR_Severe);
393-
}
394-
for (i = XR_FIRST; i <= XR_LAST; i++) {
395-
if (TST_RGSET_XR(rgseti, i)) {
396-
fprintf(gbl.dbgfil, " xmm%d", i);
397-
cnt++;
398-
}
399-
}
400-
fprintf(gbl.dbgfil, " total %d\n", cnt);
401-
}
402-
403-
/* called from flow.c to tell globalreg, and scheduler which
404-
xmm regs are used by the vectorizer.
405-
*/
406-
static void
407-
mr_bset_xmm_rgset(int ili, int bih)
408-
{
409-
int j, opn;
410-
ILI_OP opc;
411-
int noprs;
412-
413-
if (BIH_RGSET(bih) == 0) {
414-
BIH_RGSET(bih) = mr_get_rgset();
415-
}
416-
417-
opc = ILI_OPC(ili);
418-
noprs = ilis[opc].oprs;
419-
for (j = 1; j <= noprs; j++) {
420-
opn = ILI_OPND(ili, j);
421-
switch (IL_OPRFLAG(opc, j)) {
422-
case ILIO_XMM:
423-
assert(opn >= XR_FIRST && opn <= XR_LAST,
424-
"mr_bset_xmm_rgset: bad xmm register value", ili, ERR_Warning);
425-
SET_RGSET_XR(BIH_RGSET(bih), opn);
426-
break;
427-
default:
428-
break;
429-
}
430-
}
431-
}

tools/flang2/flang2exe/ppc64le-Linux/machreg.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,6 @@ extern int mr_res_xr[MR_MAX_XREG_RES + 1];
259259
*/
260260
#define MR_IR_AVAIL(c) 0
261261

262-
/* Define gindex bounds for the set of global irs/ars and scratch
263-
* irs/ars. MUST BE CONSISTENT with mr_gindex().
264-
*/
265-
#define MR_GI_IR_LOW 0
266-
#define MR_GI_IR_HIGH (MR_U1 - MR_L1)
267-
#define MR_GI_IS_SCR_IR(i) ((i) > (MR_U1 - MR_L1))
268-
269262
/* Machine Register Information -
270263
*
271264
* This information is in two pieces:
@@ -330,17 +323,8 @@ typedef struct {/* three -word bit-vector */
330323
int xr;
331324
} RGSET;
332325

333-
#define RGSETG(i) rgsetb.stg_base[i]
334-
335326
#define RGSET_XR(i) rgsetb.stg_base[i].xr
336327

337-
#define SET_RGSET_XR(i, reg) \
338-
{ \
339-
RGSET_XR(i) |= (1 << (reg)); \
340-
}
341-
342-
#define TST_RGSET_XR(i, reg) ((RGSET_XR(i) >> (reg)) & 1)
343-
344328
typedef struct {
345329
RGSET *stg_base;
346330
int stg_avail;
@@ -393,7 +377,6 @@ extern RGSETB rgsetb;
393377
int mr_getnext(int rtype);
394378
int mr_getreg(int rtype);
395379
int mr_get_rgset();
396-
int mr_gindex(int rtype, int regno);
397380
void mr_end();
398381
void mr_init();
399382
void mr_reset_frglobals();

tools/flang2/flang2exe/x86_64-Linux/machreg.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -417,13 +417,6 @@ extern int mr_res_xr[MR_MAX_XREG_RES];
417417
*/
418418
#define MR_IR_AVAIL(c) 0
419419

420-
/* Define gindex bounds for the set of global irs/ars and scratch
421-
* irs/ars. MUST BE CONSISTENT with mr_gindex().
422-
*/
423-
#define MR_GI_IR_LOW 0
424-
#define MR_GI_IR_HIGH (MR_U1 - MR_L1)
425-
#define MR_GI_IS_SCR_IR(i) ((i) > (MR_U1 - MR_L1))
426-
427420
/* Machine Register Information -
428421
*
429422
* This information is in two pieces:
@@ -488,17 +481,8 @@ typedef struct {/* three -word bit-vector */
488481
int xr;
489482
} RGSET;
490483

491-
#define RGSETG(i) rgsetb.stg_base[i]
492-
493484
#define RGSET_XR(i) rgsetb.stg_base[i].xr
494485

495-
#define SET_RGSET_XR(i, reg) \
496-
{ \
497-
RGSET_XR(i) |= (1 << (reg)); \
498-
}
499-
500-
#define TST_RGSET_XR(i, reg) ((RGSET_XR(i) >> (reg)) & 1)
501-
502486
typedef struct {
503487
RGSET *stg_base;
504488
int stg_avail;
@@ -563,11 +547,6 @@ int mr_getreg(int rtype);
563547
*/
564548
int mr_get_rgset(void);
565549

566-
/**
567-
\brief ...
568-
*/
569-
int mr_gindex(int rtype, int regno);
570-
571550
/**
572551
\brief ...
573552
*/

0 commit comments

Comments
 (0)