From 6a9cb87ec0d5af46a082bc454b49f94c2ded2f12 Mon Sep 17 00:00:00 2001 From: christian Date: Thu, 23 Jun 2005 14:19:18 +0000 Subject: [PATCH] Register Packing macros moved to md-abi.h No more *_SECOND_* and *_FIRST_*, all this macros operate now only on high and low part, according to the machine architecture. --- src/vm/jit/powerpc/codegen.c | 40 ++++--- src/vm/jit/powerpc/codegen.h | 78 +++++++------- src/vm/jit/powerpc/darwin/md-abi.c | 30 ++++-- src/vm/jit/powerpc/darwin/md-abi.h | 17 ++- src/vm/jit/reg.inc | 166 ++++++++++++++++++----------- src/vm/jit/stack.c | 14 +-- 6 files changed, 214 insertions(+), 131 deletions(-) diff --git a/src/vm/jit/powerpc/codegen.c b/src/vm/jit/powerpc/codegen.c index 891a75820..ed8a715c1 100644 --- a/src/vm/jit/powerpc/codegen.c +++ b/src/vm/jit/powerpc/codegen.c @@ -28,9 +28,9 @@ Stefan Ring Changes: Christian Thalinger - Christian Ullrich + Christian Ullrich - $Id: codegen.c 2774 2005-06-22 09:47:44Z christian $ + $Id: codegen.c 2811 2005-06-23 14:19:18Z christian $ */ @@ -205,9 +205,11 @@ void codegen(methodinfo *m, codegendata *cd, registerdata *rd) continue; s1 = md->params[p].regoff; if (IS_INT_LNG_TYPE(t)) { /* integer args */ - s2 = rd->argintregs[s1]; if (IS_2_WORD_TYPE(t)) - SET_LOW_REG(s2, rd->argintregs[s1 + 1]); + s2 = PACK_REGS(rd->argintregs[GET_LOW_REG(s1)], + rd->argintregs[GET_HIGH_REG(s1)]); + else + s2 = rd->argintregs[s1]; if (!md->params[p].inmemory) { /* register arguments */ if (!(var->flags & INMEMORY)) { /* reg arg -> register */ M_TINTMOVE(t, s2, var->regoff); @@ -2602,15 +2604,18 @@ gen_method: continue; if (IS_INT_LNG_TYPE(src->type)) { if (!md->params[s3].inmemory) { - s1 = rd->argintregs[md->params[s3].regoff]; if (IS_2_WORD_TYPE(src->type)) - SET_LOW_REG( s1, - rd->argintregs[md->params[s3].regoff + 1]); + s1 = PACK_REGS( + rd->argintregs[GET_LOW_REG(md->params[s3].regoff)], + rd->argintregs[GET_HIGH_REG(md->params[s3].regoff)]); + else + s1 = rd->argintregs[md->params[s3].regoff]; var_to_reg_int(d, src, s1); M_TINTMOVE(src->type, d, s1); } else { var_to_reg_int(d, src, PACK_REGS(REG_ITMP3, REG_ITMP1)); - M_IST(GET_HIGH_REG(d), REG_SP, md->params[s3].regoff * 4); + M_IST(GET_HIGH_REG(d), REG_SP, + md->params[s3].regoff * 4); if (IS_2_WORD_TYPE(src->type)) M_IST(GET_LOW_REG(d), REG_SP, md->params[s3].regoff * 4 + 4); @@ -3684,7 +3689,8 @@ functionptr createnativestub(functionptr f, methodinfo *m, codegendata *cd, if (IS_INT_LNG_TYPE(t)) { /* overlapping u8's are on the stack */ - if ((i + longargs + dblargs) < (INT_ARG_CNT - IS_2_WORD_TYPE(t))) { + if ((i + longargs + dblargs) < + (INT_ARG_CNT - IS_2_WORD_TYPE(t))) { s1 = rd->argintregs[i + longargs + dblargs]; if (!IS_2_WORD_TYPE(t)) { @@ -3794,15 +3800,19 @@ functionptr createnativestub(functionptr f, methodinfo *m, codegendata *cd, if (IS_INT_LNG_TYPE(t)) { if (!md->params[i].inmemory) { - s1 = rd->argintregs[md->params[i].regoff]; if (IS_2_WORD_TYPE(t)) - SET_LOW_REG(s1, - rd->argintregs[md->params[i].regoff + 1]); + s1 = PACK_REGS( + rd->argintregs[GET_LOW_REG(md->params[i].regoff)], + rd->argintregs[GET_HIGH_REG(md->params[i].regoff)]); + else + s1 = rd->argintregs[md->params[i].regoff]; if (!nmd->params[j].inmemory) { - s2 = rd->argintregs[nmd->params[j].regoff]; if (IS_2_WORD_TYPE(t)) - SET_LOW_REG(s2, - rd->argintregs[nmd->params[j].regoff + 1]); + s2 = PACK_REGS( + rd->argintregs[GET_LOW_REG(nmd->params[j].regoff)], + rd->argintregs[GET_HIGH_REG(nmd->params[j].regoff)]); + else + s2 = rd->argintregs[nmd->params[j].regoff]; M_TINTMOVE(t, s1, s2); } else { diff --git a/src/vm/jit/powerpc/codegen.h b/src/vm/jit/powerpc/codegen.h index 1b3fa310e..0f59952ef 100644 --- a/src/vm/jit/powerpc/codegen.h +++ b/src/vm/jit/powerpc/codegen.h @@ -29,8 +29,9 @@ Stefan Ring Changes: Christian Thalinger + Christian Ullrich - $Id: codegen.h 2723 2005-06-16 11:56:01Z twisti $ + $Id: codegen.h 2811 2005-06-23 14:19:18Z christian $ */ @@ -46,25 +47,6 @@ /* additional functions and macros to generate code ***************************/ -/* PowerPC is Big Endian -> High Reg == second reg */ -/* Low Reg == first ("normal") reg */ -#define GET_FIRST_REG(a) ((a) & 0x0000ffff) -#define GET_SECOND_REG(a) (((a) & 0xffff0000) >> 16) - -#define SET_FIRST_REG(regoff,b) \ - do { (regoff) &= 0xffff0000; (regoff) |= (b) & 0x0000ffff; } while(0) -#define SET_SECOND_REG(regoff,b) \ -do { \ - (regoff) &= 0x0000ffff; (regoff) |= ((b) & 0x0000ffff) << 16; \ -} while(0) - -#define GET_LOW_REG(a) GET_SECOND_REG(a) -#define GET_HIGH_REG(a) GET_FIRST_REG(a) - -#define PACK_REGS(low,high) \ - ( ((high) & 0x0000ffff) | (((low) & 0x0000ffff) << 16) ) -#define SET_HIGH_REG(regoff,b) SET_FIRST_REG(regoff, b) -#define SET_LOW_REG(regoff,b) SET_SECOND_REG(regoff, b) #if defined(STATISTICS) #define COUNT_SPILLS count_spills++ @@ -139,25 +121,49 @@ do { \ fetching (this wil be either tempregnum or the register number allready given to v) */ -#define var_to_reg_int0(regnr,v,tempnr,a,b) { \ - if ((v)->flags & INMEMORY) { \ - COUNT_SPILLS; \ - if ((a)) M_ILD(GET_HIGH_REG((tempnr)), REG_SP, 4 * (v)->regoff); \ - regnr = tempnr; \ - if ((b) && IS_2_WORD_TYPE((v)->type)) \ - M_ILD((a) ? GET_LOW_REG((tempnr)) : GET_HIGH_REG((tempnr)), REG_SP, 4 * (v)->regoff + 4); \ - } else { \ - if ((a) && (b)) { \ - regnr = (v)->regoff; \ + +#define var_to_reg_int(regnr,v,tempnr) \ + do { \ \ + if ((v)->flags & INMEMORY) { \ + COUNT_SPILLS; \ + M_ILD(GET_HIGH_REG((tempnr)), REG_SP, 4 * (v)->regoff); \ + regnr = tempnr; \ + if (IS_2_WORD_TYPE((v)->type)) { \ + M_ILD(GET_HIGH_REG((tempnr)), REG_SP, 4 * (v)->regoff); \ + M_ILD(GET_LOW_REG((tempnr)), REG_SP, 4 * (v)->regoff + 4); \ + } else \ + M_ILD((tempnr), REG_SP, 4 * (v)->regoff); \ } else { \ - regnr = (b) ? GET_LOW_REG((v)->regoff) : GET_HIGH_REG((v)->regoff); \ + regnr = (v)->regoff; \ } \ - } \ -} + } while(0) \ + + +/* fetch only the low part of v, regnr hast to be a single register */ +#define var_to_reg_int_low(regnr,v,tempnr) \ + do { \ + if ((v)->flags & INMEMORY) { \ + COUNT_SPILLS; \ + regnr = tempnr; \ + M_ILD((tempnr), REG_SP, 4 * (v)->regoff + 4); \ + } else { \ + regnr = GET_LOW_REG((v)->regoff); \ + } \ + } while(0) \ + + +/* fetch only the high part of v, regnr hast to be a single register */ +#define var_to_reg_int_high(regnr,v,tempnr) \ + do { \ + if ((v)->flags & INMEMORY) { \ + COUNT_SPILLS; \ + M_ILD((tempnr), REG_SP, 4 * (v)->regoff); \ + regnr = tempnr; \ + } else { \ + regnr = GET_HIGH_REG((v)->regoff); \ + } \ + } while(0) \ -#define var_to_reg_int(regnr,v,tempnr) var_to_reg_int0(regnr,v,tempnr,1,1) -#define var_to_reg_int_low(regnr,v,tempnr) var_to_reg_int0(regnr,v,tempnr,0,1) -#define var_to_reg_int_high(regnr,v,tempnr) var_to_reg_int0(regnr,v,tempnr,1,0) #define var_to_reg_flt(regnr,v,tempnr) { \ diff --git a/src/vm/jit/powerpc/darwin/md-abi.c b/src/vm/jit/powerpc/darwin/md-abi.c index fdb816435..b7e47c898 100644 --- a/src/vm/jit/powerpc/darwin/md-abi.c +++ b/src/vm/jit/powerpc/darwin/md-abi.c @@ -26,9 +26,9 @@ Authors: Christian Thalinger - Changes: + Changes: Christian Ullrich - $Id: md-abi.c 2722 2005-06-16 11:55:22Z twisti $ + $Id: md-abi.c 2811 2005-06-23 14:19:18Z christian $ */ @@ -42,7 +42,18 @@ /* md_param_alloc ************************************************************** - XXX + Allocate Arguments to Stackslots according the Calling Conventions + +--- in +md->paramcount: Number of arguments for this method +md->paramtypes[].type: Argument types + +--- out +md->params[].inmemory: Argument spilled on stack +md->params[].regoff: Stack offset or rd->arg[int|flt]regs index +md->memuse: Stackslots needed for argument spilling +md->argintreguse: max number of integer arguments used +md->argfltreguse: max number of float arguments used *******************************************************************************/ @@ -70,7 +81,7 @@ void md_param_alloc(methoddesc *md) case TYPE_ADR: if (iarg < INT_ARG_CNT) { pd->inmemory = false; - pd->regoff = iarg; + pd->regoff = iarg; /* rd->arg[int|flt]regs index !! */ iarg++; } else { pd->inmemory = true; @@ -81,7 +92,8 @@ void md_param_alloc(methoddesc *md) case TYPE_LNG: if (iarg < INT_ARG_CNT - 1) { pd->inmemory = false; - pd->regoff = iarg; + /* rd->arg[int|flt]regs index !! */ + pd->regoff = PACK_REGS(iarg + 1, iarg); iarg += 2; } else { pd->inmemory = true; @@ -93,7 +105,7 @@ void md_param_alloc(methoddesc *md) case TYPE_FLT: if (farg < FLT_ARG_CNT) { pd->inmemory = false; - pd->regoff = farg; + pd->regoff = farg; /* rd->arg[int|flt]regs index !! */ iarg++; /* skip 1 integer argument register */ farg++; } else { @@ -105,7 +117,7 @@ void md_param_alloc(methoddesc *md) case TYPE_DBL: if (farg < FLT_ARG_CNT) { pd->inmemory = false; - pd->regoff = farg; + pd->regoff = farg; /* rd->arg[int|flt]regs index !! */ iarg += 2; /* skip 2 integer argument registers */ farg++; } else { @@ -117,12 +129,14 @@ void md_param_alloc(methoddesc *md) } } - /* fill register and stack usage */ + /* Since R3/R4 (==A0/A1) are used for passing return values, this */ + /* argument register usage has to be regarded, too */ if (IS_INT_LNG_TYPE(md->returntype.type)) if (iarg < (IS_2_WORD_TYPE(md->returntype.type) ? 2 : 1)) iarg = IS_2_WORD_TYPE(md->returntype.type) ? 2 : 1; + /* fill register and stack usage */ md->argintreguse = iarg; md->argfltreguse = farg; md->memuse = stacksize; diff --git a/src/vm/jit/powerpc/darwin/md-abi.h b/src/vm/jit/powerpc/darwin/md-abi.h index 6e07e459e..a01769c91 100644 --- a/src/vm/jit/powerpc/darwin/md-abi.h +++ b/src/vm/jit/powerpc/darwin/md-abi.h @@ -28,7 +28,7 @@ Changes: Christian Ullrich - $Id: md-abi.h 2777 2005-06-22 09:51:11Z christian $ + $Id: md-abi.h 2811 2005-06-23 14:19:18Z christian $ */ @@ -91,6 +91,21 @@ /* #define ALIGN_FRAME_SIZE(sp) (sp) */ +/* Register Pack/Unpack Macros ************************************************/ +/* PowerPC is Big Endian -> High Reg == second reg */ +/* Low Reg == first ("normal") reg */ + +#define GET_LOW_REG(a) (((a) & 0xffff0000) >> 16) +#define GET_HIGH_REG(a) ((a) & 0x0000ffff) + +#define PACK_REGS(low,high) \ + ( ((high) & 0x0000ffff) | (((low) & 0x0000ffff) << 16) ) +#define SET_HIGH_REG(regoff,b) \ + do { (regoff) &= 0xffff0000; (regoff) |= (b) & 0x0000ffff; } while(0) +#define SET_LOW_REG(regoff,b) \ + do { (regoff) &= 0x0000ffff; (regoff) |= ((b) & 0x0000ffff) << 16; } \ + while(0) + #endif /* _MD_ABI_H */ diff --git a/src/vm/jit/reg.inc b/src/vm/jit/reg.inc index d57b1c823..f623e38ff 100644 --- a/src/vm/jit/reg.inc +++ b/src/vm/jit/reg.inc @@ -28,9 +28,9 @@ Changes: Stefan Ring Christian Thalinger - Christian Ullrich + Christian Ullrich - $Id: reg.inc 2778 2005-06-22 10:02:54Z christian $ + $Id: reg.inc 2811 2005-06-23 14:19:18Z christian $ */ @@ -390,8 +390,9 @@ static void interface_regalloc(methodinfo *m, codegendata *cd, registerdata *rd) rd->interfaces[s][intalloc].flags & INMEMORY; #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) - if (!(v->flags & INMEMORY)) - v->regoff = GET_FIRST_REG( + if (!(v->flags & INMEMORY) + && IS_2_WORD_TYPE(intalloc)) + v->regoff = GET_LOW_REG( rd->interfaces[s][intalloc].regoff); else #endif @@ -400,25 +401,30 @@ static void interface_regalloc(methodinfo *m, codegendata *cd, registerdata *rd) } else /* #endif *//* !defined(HAS_4BYTE_STACKSLOT) */ if (!m->isleafmethod && - (rd->argintreguse + intregsneeded < INT_ARG_CNT)) { - v->regoff = - rd->argintregs[rd->argintreguse]; + (rd->argintreguse + + intregsneeded < INT_ARG_CNT)) { #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) if (intregsneeded) - SET_SECOND_REG( v->regoff, + v->regoff=PACK_REGS( + rd->argintregs[rd->argintreguse], rd->argintregs[rd->argintreguse + 1]); + else #endif + v->regoff = + rd->argintregs[rd->argintreguse]; rd->argintreguse += intregsneeded + 1; } else if (rd->tmpintreguse > intregsneeded) { rd->tmpintreguse -= intregsneeded + 1; - v->regoff = - rd->tmpintregs[rd->tmpintreguse]; #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) if (intregsneeded) - SET_SECOND_REG( v->regoff, + v->regoff=PACK_REGS( + rd->tmpintregs[rd->tmpintreguse], rd->tmpintregs[rd->tmpintreguse + 1]); + else #endif + v->regoff = + rd->tmpintregs[rd->tmpintreguse]; } else if (rd->savintreguse > intregsneeded) { rd->savintreguse -= intregsneeded + 1; @@ -426,9 +432,13 @@ static void interface_regalloc(methodinfo *m, codegendata *cd, registerdata *rd) rd->savintregs[rd->savintreguse]; #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) if (intregsneeded) - SET_SECOND_REG( v->regoff, - rd->savintregs[rd->savintreguse + 1]); + v->regoff=PACK_REGS( + rd->savintregs[rd->savintreguse], + rd->savintregs[rd->savintreguse + 1]); + else #endif + v->regoff = + rd->savintregs[rd->savintreguse]; } else { v->flags |= INMEMORY; @@ -483,12 +493,14 @@ static void interface_regalloc(methodinfo *m, codegendata *cd, registerdata *rd) { /* #if !defined(HAS_4BYTE_STACKSLOT) */ if (intalloc >= 0) { - v->flags |= rd->interfaces[s][intalloc].flags - & INMEMORY; + v->flags |= + rd->interfaces[s][intalloc].flags & INMEMORY; #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) - if (!(v->flags & INMEMORY)) + if (!(v->flags & INMEMORY) + && IS_2_WORD_TYPE(intalloc)) v->regoff = - GET_FIRST_REG(rd->interfaces[s][intalloc].regoff); + GET_LOW_REG( + rd->interfaces[s][intalloc].regoff); else #endif v->regoff = @@ -498,13 +510,15 @@ static void interface_regalloc(methodinfo *m, codegendata *cd, registerdata *rd) { if (rd->savintreguse > intregsneeded) { rd->savintreguse -= intregsneeded + 1; - v->regoff = - rd->savintregs[rd->savintreguse]; #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) if (intregsneeded) - SET_SECOND_REG( v->regoff, - rd->savintregs[rd->savintreguse + 1]); + v->regoff = PACK_REGS( + rd->savintregs[rd->savintreguse], + rd->savintregs[rd->savintreguse + 1]); + else #endif + v->regoff = + rd->savintregs[rd->savintreguse]; } else { v->flags |= INMEMORY; v->regoff = rd->memuse; @@ -650,14 +664,15 @@ static void local_regalloc(methodinfo *m, codegendata *cd, registerdata *rd) v->flags = INMEMORY; v->regoff = rd->memuse; rd->memuse += memneeded + 1; - } else { + } else #endif + { if (intalloc >= 0) { v->flags = rd->locals[s][intalloc].flags; #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) - if (!(v->flags & INMEMORY)) - v->regoff = - GET_FIRST_REG( + if (!(v->flags & INMEMORY) + && IS_2_WORD_TYPE(intalloc)) + v->regoff = GET_LOW_REG( rd->locals[s][intalloc].regoff); else #endif @@ -666,35 +681,42 @@ static void local_regalloc(methodinfo *m, codegendata *cd, registerdata *rd) else if ((p < md->paramcount) && !md->params[p].inmemory) { v->flags = 0; - v->regoff = - rd->argintregs[md->params[p].regoff]; #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) if (IS_2_WORD_TYPE(t)) -/* For ARM: - if md->params[p].regoff == R4, prevent here that SECOND_REG */ -/* tries to set R5 */ - SET_SECOND_REG( v->regoff, rd->argintregs[ - md->params[p].regoff + 1]); +/* For ARM: - if GET_LOW_REG(md->params[p].regoff) == R4, prevent here that */ +/* rd->argintregs[GET_HIGH_REG(md->...)) is used! */ + v->regoff = PACK_REGS( + rd->argintregs[GET_LOW_REG(md->params[p].regoff)], + rd->argintregs[GET_HIGH_REG(md->params[p].regoff)]); + else #endif + v->regoff = + rd->argintregs[md->params[p].regoff]; } else if (rd->tmpintreguse > intregsneeded) { rd->tmpintreguse -= intregsneeded + 1; v->flags = 0; - v->regoff = rd->tmpintregs[rd->tmpintreguse]; #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) if (intregsneeded) - SET_SECOND_REG( v->regoff, - rd->tmpintregs[rd->tmpintreguse + 1]); + v->regoff = PACK_REGS( + rd->tmpintregs[rd->tmpintreguse], + rd->tmpintregs[rd->tmpintreguse + 1]); + else #endif + v->regoff = + rd->tmpintregs[rd->tmpintreguse]; } else if (rd->savintreguse > intregsneeded) { rd->savintreguse -= intregsneeded + 1; v->flags = 0; - v->regoff = rd->savintregs[rd->savintreguse]; #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) if (intregsneeded) - SET_SECOND_REG( v->regoff, - rd->savintregs[rd->savintreguse + 1]); + v->regoff = PACK_REGS( + rd->savintregs[rd->savintreguse], + rd->savintregs[rd->savintreguse + 1]); + else #endif + v->regoff =rd->savintregs[rd->savintreguse]; } /* * use unused argument registers as local registers @@ -710,9 +732,7 @@ static void local_regalloc(methodinfo *m, codegendata *cd, registerdata *rd) v->regoff = rd->memuse; rd->memuse += memneeded + 1; } -#if defined(__I386__) } -#endif intalloc = t; } #ifdef HAS_ADDRESS_REGISTER_FILE @@ -788,9 +808,9 @@ static void local_regalloc(methodinfo *m, codegendata *cd, registerdata *rd) if (intalloc >= 0) { v->flags = rd->locals[s][intalloc].flags; #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) - if (!(v->flags & INMEMORY)) - v->regoff = - GET_FIRST_REG( + if (!(v->flags & INMEMORY) + && IS_2_WORD_TYPE(intalloc)) + v->regoff = GET_LOW_REG( rd->locals[s][intalloc].regoff); else #endif @@ -799,12 +819,14 @@ static void local_regalloc(methodinfo *m, codegendata *cd, registerdata *rd) else if (rd->savintreguse > intregsneeded) { rd->savintreguse -= intregsneeded+1; v->flags = 0; - v->regoff = rd->savintregs[rd->savintreguse]; #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) if (intregsneeded) - SET_SECOND_REG( v->regoff, - rd->savintregs[rd->savintreguse + 1]); + v->regoff = PACK_REGS( + rd->savintregs[rd->savintreguse], + rd->savintregs[rd->savintreguse + 1]); + else #endif + v->regoff =rd->savintregs[rd->savintreguse]; } else { v->flags = INMEMORY; @@ -920,21 +942,26 @@ static void reg_new_temp_func(registerdata *rd, stackptr s) { if (rd->freesavinttop > intregsneeded) { rd->freesavinttop -= intregsneeded + 1; - s->regoff = rd->freesavintregs[rd->freesavinttop]; #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) - if (intregsneeded) - SET_SECOND_REG( s->regoff, + if (intregsneeded) + s->regoff = PACK_REGS( + rd->freesavintregs[rd->freesavinttop], rd->freesavintregs[rd->freesavinttop + 1]); + else #endif + s->regoff = + rd->freesavintregs[rd->freesavinttop]; return; } else if (rd->savintreguse > intregsneeded) { rd->savintreguse -= intregsneeded + 1; - s->regoff = rd->savintregs[rd->savintreguse]; #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) - if (intregsneeded) - SET_SECOND_REG( s->regoff, + if (intregsneeded) + s->regoff = PACK_REGS( + rd->savintregs[rd->savintreguse], rd->savintregs[rd->savintreguse + 1]); + else #endif + s->regoff = rd->savintregs[rd->savintreguse]; return; } } @@ -980,42 +1007,51 @@ static void reg_new_temp_func(registerdata *rd, stackptr s) { if (rd->freearginttop > intregsneeded) { rd->freearginttop -= intregsneeded + 1; - s->regoff = rd->freeargintregs[rd->freearginttop]; s->flags |= TMPARG; #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) if (intregsneeded) - SET_SECOND_REG( s->regoff, + s->regoff = PACK_REGS( + rd->freeargintregs[rd->freearginttop], rd->freeargintregs[rd->freearginttop + 1]); + else #endif + s->regoff = + rd->freeargintregs[rd->freearginttop]; return; } else if (rd->argintreguse < INT_ARG_CNT - intregsneeded) { - s->regoff = rd->argintregs[rd->argintreguse]; #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) if (intregsneeded) - SET_SECOND_REG( s->regoff, + s->regoff = PACK_REGS( + rd->argintregs[rd->argintreguse], rd->argintregs[rd->argintreguse + 1]); + else #endif + s->regoff = rd->argintregs[rd->argintreguse]; s->flags |= TMPARG; rd->argintreguse += intregsneeded + 1; return; } else if (rd->freetmpinttop > intregsneeded) { rd->freetmpinttop -= intregsneeded + 1; - s->regoff = rd->freetmpintregs[rd->freetmpinttop]; #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) if (intregsneeded) - SET_SECOND_REG( s->regoff, + s->regoff = PACK_REGS( + rd->freetmpintregs[rd->freetmpinttop], rd->freetmpintregs[rd->freetmpinttop + 1]); + else #endif + s->regoff = rd->freetmpintregs[rd->freetmpinttop]; return; } else if (rd->tmpintreguse > intregsneeded) { rd->tmpintreguse -= intregsneeded + 1; - s->regoff = rd->tmpintregs[rd->tmpintreguse]; #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) if (intregsneeded) - SET_SECOND_REG( s->regoff, + s->regoff = PACK_REGS( + rd->tmpintregs[rd->tmpintreguse], rd->tmpintregs[rd->tmpintreguse + 1]); + else #endif + s->regoff = rd->tmpintregs[rd->tmpintreguse]; return; } } /* if (!IS_2_WORD_TYPE(s->type)) */ @@ -1103,9 +1139,9 @@ static void reg_free_temp_func(registerdata *rd, stackptr s) #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) if (intregsneeded) { rd->freesavintregs[rd->freesavinttop] = - GET_FIRST_REG(s->regoff); + GET_LOW_REG(s->regoff); rd->freesavintregs[rd->freesavinttop + 1] = - GET_SECOND_REG(s->regoff); + GET_HIGH_REG(s->regoff); } else #endif rd->freesavintregs[rd->freesavinttop] = s->regoff; @@ -1116,9 +1152,9 @@ static void reg_free_temp_func(registerdata *rd, stackptr s) #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) if (intregsneeded) { rd->freeargintregs[rd->freearginttop] = - GET_FIRST_REG(s->regoff); + GET_LOW_REG(s->regoff); rd->freeargintregs[rd->freearginttop + 1] = - GET_SECOND_REG(s->regoff); + GET_HIGH_REG(s->regoff); } else #endif rd->freesavintregs[rd->freearginttop] = s->regoff; @@ -1127,9 +1163,9 @@ static void reg_free_temp_func(registerdata *rd, stackptr s) #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) if (intregsneeded) { rd->freetmpintregs[rd->freetmpinttop] = - GET_FIRST_REG(s->regoff); + GET_LOW_REG(s->regoff); rd->freetmpintregs[rd->freetmpinttop + 1] = - GET_SECOND_REG(s->regoff); + GET_HIGH_REG(s->regoff); } else #endif rd->freetmpintregs[rd->freetmpinttop] = s->regoff; diff --git a/src/vm/jit/stack.c b/src/vm/jit/stack.c index 8208bbc7a..3a39a138d 100644 --- a/src/vm/jit/stack.c +++ b/src/vm/jit/stack.c @@ -28,9 +28,9 @@ Changes: Edwin Steiner Christian Thalinger - Christian Ullrich + Christian Ullrich - $Id: stack.c 2774 2005-06-22 09:47:44Z christian $ + $Id: stack.c 2811 2005-06-23 14:19:18Z christian $ */ @@ -1885,13 +1885,15 @@ methodinfo *analyse_stack(methodinfo *m, codegendata *cd, registerdata *rd) copy->regoff = rd->argfltregs[md->params[i].regoff]; else { - copy->regoff = - rd->argintregs[md->params[i].regoff]; #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS) if (IS_2_WORD_TYPE(copy->type)) - SET_SECOND_REG( copy->regoff, - rd->argintregs[md->params[i].regoff + 1]); + copy->regoff = PACK_REGS( + rd->argintregs[GET_LOW_REG(md->params[i].regoff)], + rd->argintregs[GET_HIGH_REG(md->params[i].regoff)]); + else #endif + copy->regoff = + rd->argintregs[md->params[i].regoff]; } } } -- 2.25.1