[kaffe] mipsel JIT3

Kevin D. Kissell kevink at mips.com
Fri Mar 5 16:01:02 PST 2004


But...but...the "rreg_ideal" variants are just invocations of slotRegister
(in kaffevm/jit3/registers.c) with a non-NOREG value in the idealreg
parameter.  While having the NOREG value (i.e. using rreg_int() in
the examples below) will make it more likely that there's no need to
realocate and clobber a register, it doesn't guarantee it.  And if there
*is* a need to reallocate, the same path will be taken for both the
ideal and non-ideal cases, the only difference being that in the
non-ideal case it will reallocate and clobber the least-recently-used,
rather than the specifically requested register.  I could believe that
the hack below may have helped some bug that PPC was seeing,
and it might help MIPS as well, but if rreg_ideal_int() can be fatal, 
I would think that rreg_int() could be as well.

> /*
> * can't use rreg_ideal_int because of brokeness.  its possible
> * for this to create a move between a callee saved register
> * and a caller saved regsiter.  And, since the pushargs are
> * run after the function_sync that does the spill, we can lose
> * the data in the register.
> */
> r = rreg_int(1);
> if( r != w )
> {
>     clobberRegister(w);
>     LOUT = ppc_op_mr(w, r);
> }
> register_reserve(w);
> #endif
> 
> 
> And, here is the analogous section of the mips jitter:
> 
> if (arg_idx < NR_ARGUMENTS) {
> o = REG_i4 + arg_idx;
> r = rreg_ideal_int(1, o);
> 
> /* We might not get the ideal register (if the slot is global)
> * so handle this.
> */
> if (r != o) {
> clobberRegister(o);
> insn_RRR(_ADDU, o, r, REG_i0);
> debug((" mov %s,%s\n", regname(o), regname(r)));
> r = o;
> }
> 
> register_reserve(r);
> resreg[res_idx++] = r;
> 
> 
> Perhaps you should try without the rreg_ideal_int()?






More information about the kaffe mailing list