On Fri, Feb 13, 2004 at 10:48:09AM +0100, Leopold Toetsch wrote:
> I don't know suns JIT code nor the assembler syntax, but it seems that
> the two subcc lines are broken:
> 
>       emitm_subcc_r(NATIVECODE, MAP[1], emitm_g(0), emitm_g(0));
> 
> If I understand that correctly it should read:
> 
>       emitm_subcc_r(NATIVECODE, MAP[1], MAP[1], emitm_g(0));

This would actually compare, say I1, to itself,  and would then always be equal.
So as I understand it, the line is ok: the subcc_r lines build these "synthetic"
instructions where a compare is

    cmp  reg, reg_or_imm  <-->  subcc reg, reg_or_imm, %g0

Since <if> compares reg to 0 (as the not jitted core does), it uses register %g0
(for reg_or_imm) which contains 0 (%g0 is actually a  special register  in sparc
always containing 0 no matter how - its just "constant 0"). Hence we have

    subcc reg, %g0, %g0

and in parrot(jit) terms:

    emitm_subcc_r(NATIVECODE, MAP[1], emitm_g(0), emitm_g(0));

Somehow I thaught that the problem could lie in the "optimize" section? Is there
any simple way to disable that for jit?  (it seems quite hardwired atm).  Also,
whats a good way to debug jit?  meanning, I'm able to step through and see what
is going on with gdb while still in "parrot itself" so to speak, but as soon as
it jumps in jit.. its just a sort of blackbox.

> > PS.: placing a 'print I1' within the loop resolves the problem,
> 
> That could clear g(0) ...
As said %g0 is just always 0, the only thing is that this one kind of "jumps
out of jit"?

> 
> leo

Thanks,
Stephane

Reply via email to