From: sandeep Date: Wed, 28 Nov 2001 18:12:36 +0000 (+0000) Subject: a) Moved DPL, DPH, DPX & B before XREGn . ralloc.c/ralloc.h X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=7d8309e491dc6283fe40d69b8a5f1ee66bd50d5d;p=fw%2Fsdcc a) Moved DPL, DPH, DPX & B before XREGn . ralloc.c/ralloc.h b) Changed saveRBank & unsaveRBank routines to save & restore R0-R7 only git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1653 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/ds390/gen.c b/src/ds390/gen.c index cc4aab11..d01c1d7e 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -2160,7 +2160,7 @@ unsaveRBank (int bank, iCode * ic, bool popPsw) } } - for (i = (ds390_nRegs - 1); i >= 0; i--) + for (i = 7; i >= 0; i--) /* only R7-R0 needs to be popped */ { if (options.useXstack) { @@ -2211,7 +2211,7 @@ saveRBank (int bank, iCode * ic, bool pushPsw) emitcode ("mov", "%s,_spx", r->name); } - for (i = 0; i < ds390_nRegs; i++) + for (i = 0; i < 8 ; i++) /* only R0-R7 needs saving */ { if (options.useXstack) { diff --git a/src/ds390/ralloc.c b/src/ds390/ralloc.c index cf85879e..8722a5c9 100644 --- a/src/ds390/ralloc.c +++ b/src/ds390/ralloc.c @@ -68,16 +68,16 @@ regs regs390[] = {REG_GPR, R7_IDX, REG_GPR, "r7", "ar7", "0", 7, 1, 1}, {REG_PTR, R0_IDX, REG_PTR, "r0", "ar0", "0", 0, 1, 1}, {REG_PTR, R1_IDX, REG_PTR, "r1", "ar1", "0", 1, 1, 1}, + {REG_GPR, DPL_IDX, REG_GPR, "dpl", "dpl", "dpl", 0, 0, 0}, + {REG_GPR, DPH_IDX, REG_GPR, "dph", "dph", "dph", 0, 0, 0}, + {REG_GPR, DPX_IDX, REG_GPR, "dpx", "dpx", "dpx", 0, 0, 0}, + {REG_GPR, B_IDX, REG_GPR, "b", "b", "b", 0, 0, 0}, {REG_GPR, X8_IDX, REG_GPR, "x8", "x8", "xreg", 0, 0, 0}, {REG_GPR, X9_IDX, REG_GPR, "x9", "x9", "xreg", 1, 0, 0}, {REG_GPR, X10_IDX, REG_GPR, "x10", "x10", "xreg", 2, 0, 0}, {REG_GPR, X11_IDX, REG_GPR, "x11", "x11", "xreg", 3, 0, 0}, {REG_GPR, X12_IDX, REG_GPR, "x12", "x12", "xreg", 4, 0, 0}, {REG_CND, CND_IDX, REG_GPR, "C", "C", "xreg", 0, 0, 0}, - {REG_GPR, DPL_IDX, REG_GPR, "dpl", "dpl", "dpl", 0, 0, 0}, - {REG_GPR, DPH_IDX, REG_GPR, "dph", "dph", "dph", 0, 0, 0}, - {REG_GPR, DPX_IDX, REG_GPR, "dpx", "dpx", "dpx", 0, 0, 0}, - {REG_GPR, B_IDX, REG_GPR, "b", "b", "b", 0, 0, 0}, }; int ds390_nRegs = 13; static void spillThis (symbol *); @@ -2702,7 +2702,7 @@ ds390_assignRegisters (eBBlock ** ebbs, int count) setToNull ((void *) &_G.totRegAssigned); setToNull ((void *) &_G.funcrUsed); ds390_ptrRegReq = _G.stackExtend = _G.dataExtend = 0; - ds390_nRegs = 18; + ds390_nRegs = 12; if (options.model != MODEL_FLAT24) options.stack10bit = 0; /* change assignments this will remove some live ranges reducing some register pressure */ @@ -2722,7 +2722,7 @@ ds390_assignRegisters (eBBlock ** ebbs, int count) ds390_nRegs = 8; freeAllRegs (); fillGaps(); - ds390_nRegs = 18; + ds390_nRegs = 12; /* if stack was extended then tell the user */ if (_G.stackExtend) diff --git a/src/ds390/ralloc.h b/src/ds390/ralloc.h index a2206fa6..4e6116c3 100644 --- a/src/ds390/ralloc.h +++ b/src/ds390/ralloc.h @@ -31,10 +31,10 @@ enum { R2_IDX = 0, R3_IDX, R4_IDX, R5_IDX, R6_IDX, R7_IDX, - R0_IDX, R1_IDX, X8_IDX, + R0_IDX, R1_IDX, DPL_IDX, + DPH_IDX, DPX_IDX, B_IDX, X8_IDX, X9_IDX, X10_IDX, X11_IDX, - X12_IDX, CND_IDX, DPL_IDX, - DPH_IDX, DPX_IDX, B_IDX + X12_IDX, CND_IDX };