# New Ticket Created by Leopold Toetsch
# Please include the string: [perl #27200]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=27200 >
Stephane Peiry wrote:
> On Mon, Feb 23, 2004 at 11:07:48AM +0100, Leopold Toetsch wrote:
>
>>jit/i386/jit_emit.h implements all the necessary bits.
>>s. jit_emit_jcc, fixup->skip and load_size.
>>
> with such a good hint solving this was actually trivial :)
Trivial, if you know what you are doing, great :)
> Attached is the patch.
Thanks, applied
> Thanks again,
Welcome
> StÃphane
> 0x00269d14 <jit_func+52>: dec %l1
> 0x00269d18 <jit_func+56>: cmp %l1, %g0
> 0x00269d1c <jit_func+60>: bne 0x269d14 <jit_func+52>
BTW *if* "dec %l1" sets the zero flag (as on i386) you can optimize away
the "cmp" instruction: s. P_ARITH in jit/i386/core.jit. OTOH this *is* a
bit broken:
loop:
dec I1
inc I2
if I1, loop
will use the zero flag of the "inc I2" instruction, which is not what is
intended. But that's mainly a problem of a better test in P_ARITH, if
the same register is used.
leo