[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Lightning] [Fwd: Re: lightning for x86-64???]
From: |
Matthew Flatt |
Subject: |
Re: [Lightning] [Fwd: Re: lightning for x86-64???] |
Date: |
Thu, 26 Oct 2006 06:10:28 0800 |
> On Oct 26, Paolo Bonzini wrote:
> > Hopefully, in the end we'll be running lightning's test suite...
> > However, I see that the port is incomplete right now.
Yes. I ported just the things that MzScheme needs. Also, I didn't do a
good job; this port was my introduction to x86 machine code, and I only
barely grasp how the macros manage the x86's elaborate instruction
encodings.
You probably saw the "README" file in mzscheme/src/lightning. The
addition of "short jump" mode versus "big jump" mode is probably a bad
idea; it's probably better to have different lightning opcodes. Also,
the room for three locals left by PPC jit_prolog() is completely
MzScheme-specific.
Some x86_64 notes at the top of MzScheme's "jit.c" actually belong in
the "README" file, now that I think about it:
3) Immediate operands must be 32-bit values on x86_64, except with
jit_movi, jit_sti, jit_ld, jit_bXi, jit_calli, and jit_finishi.
4) Function calls are limited to 3 arguments (i.e., jit_prepare()
must never be called with a number greater than 3). This limit
is related to the way the x86_64 port shuffles arguments into
temporary registers.
5) On x86_64, arguments are delivered in JIT_V2, JIT_V3, and JIT_R2,
in that order. So don't set JIT_R2 before getting the third
argument, etc.
> > BTW, is it still true that lightning beats mzc?
>
> Yes -- but I think that this is due to the fact that mzc was not
> generating good C code.
I think the reasons are deeper than that, but I'm not enough of a
compiler expert to make much of an argument.
Matthew