On Fri, 2002-10-11 at 01:41, Ulrich Weigand wrote:
> Indeed.  It still won't be trivial I guess; even on first glance I can
> see a couple of iffy issues:
>
> - Getting up and running.  The 'let's start JITing the return from a
>   constructor all through ld.so' is cute, but won't work cross-platform.
>   We'll need a real cross-ELF loader.

You only need enough code to load the x86 ld.so and run it.

> - EFlags.  Those are always a bitch to emulate, and the S/390 notion
>   of condition code is not quite a close match to x86 flags ...
>   Complete synthesis of flags for every instruction would increase
>   costs by about an order of magnitude; so we'll have to optimize
>   by some sort of data-flow analysis (which bits are actually used?).

That one is actually doable within limits very cheaply indeed. When you
generate the virtual instruction sequence you give each instruction a
set of flag bits it must set properly. When you set the bits on a new
instruction you clear them on the previous one which set it up unless
they were actually used. jump instructions "use" all flags.

I'm not sure how critical a lot of that is since the code is really
being translated into the new virtual machine and then jitted from that
rather than just modifying the original code.

> - FPU instructions.  Those won't be completely compatible in rounding
>   and corner case behaviour; does it matter?  80-bit mode is tough.
>   Exact emulation in software is really slow ...

And the i386 fpu emulation code doesnt get them exact either but still
works 8)

Im sure there are plenty of hard problems lurking somewhere

Alan

Reply via email to