lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Rob Kendrick wrote:
> Out of interest, what sort of engineering effort is required to get
> this working natively on AMD64?  From what I've read of your
> descriptions of it in the past, it sounds like it'll be even harder
> than with LuaJIT 1.

Umm, no, I think it will be easier. The code base and the internal
structures of LJ2 have already been designed with a 64 bit port in

The backend code generator is already pretty close to supporting x64.
It's mainly missing support for the different calling conventions and
stack frame setup. The disassembler included with the debug modules
can already read x64 code.

The real biggie is the interpreter, because it's written in assembler
with the help of DynASM. So one needs to port DynASM to x64 first
(eeek), redesign the C stack layout and then it's mainly cut'n'paste
from the x86 interpreter, modulo x87 vs. SSE2 differences.

There are some general open issues for a 64 bit VM, like where and how
to allocate the machine code and the heap (it needs to be in certain
address ranges). But I already have some ideas for this.

Ok, now, that sounds probably simpler than it is. But it's more a
mechanical translation, not in need of some cutting edge research.
It's still a lot of work, for sure.

> If it's a matter of sponsorship and paying for your time, I wonder if
> it might be worth starting a bounty pot.

I'm not sure if it's a good idea to collect lots of small donations
from individuals. This would cost me too much time (I have to write a
proper invoice, put it into accounting etc.). Well, ok, if there's
some way to shield me from this (e.g. a proxy) ...

But I have no objections to corporate sponsorship. Since I'm an
independent consultant, you'll get a proper bill/invoice/tax receipt
or whatever it's called in your country. Companies should be able to
deduct this as expenses.

Some financial support for the rest of this year would be nice, so I
can offer more of my time to bring LuaJIT 2.0 x86 out of beta status
as soon as possible. The x64 port is only step #2, after all.