Grant Report - MoarVM JIT Compiler Expression Backend - December 2018
Sat, 29-Dec-2018 by
Mark A Jensen
Brrt (Bart Wiegmans) has hit the ground running on his
[MoarVM JIT Compiler grant](http://news.perlfoundation.org/2018/10/grant-proposal-moarvm-jit-comp.html).
Here is his interim report:
> I wanted to start with floating point support, which has two subtasks:
> * Ensure that DynASM encodes SSE instructions with variadic registers
> * Ensure that the JIT itself accepts and works with floating point registers.
> I finished the first two of those tasks. For some context, x86-64
> instruction encoding rules require an extra byte to be prefixed if an
> instruction uses registers 8-15 (because the original x86 only has 8
> registers, addressed with a 3-bit number). So the extra byte prefix
> adds the 4th byte for up to 3 operands; it needs to be placed in the
> right place. Well, long story short, I originally extended DynASM to
> add this byte as needed. But (as I learned) I made a mistake in that
> which made certain long instruction templates not really work. I fixed
> that bug and now DynASM (or at least our fork of it) can address all
> registers correctly.
> I then started with adding floating point support to the JIT, and
> found out that it was somewhat more complicated than anticipated. The
> reason for that is perhaps a bit ironic - in order to reduce the
> number of programming errors in JIT templates, I added a fairly strict
> type checking system to the JIT template processors. And that type
> checking currently rejects numeric registers. Designwise, this isn't
> necessarily very complicated, but it is slightly hairy.
He expects to be finished soon with FP support.
Brrt will occasionally update the community on his [blog](https://brrt-to-the-future.blogspot.com/).