Grant Report - MoarVM JIT Compiler Expression Backend - December 2018

No Comments

Brrt (Bart Wiegmans) has hit the ground running on his MoarVM JIT Compiler grant.

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 correctly.

  • 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.


Leave a comment

About TPF

The Perl Foundation - supporting the Perl community since 2000. Find out more at

About this Entry

This page contains a single entry by Mark A Jensen published on December 29, 2018 6:49 PM.

Maintaining the Perl 5 Core (Dave Mitchell): Grant Report for November 2018 was the previous entry in this blog.

2019 DC-Baltimore Perl Workshop CFP is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.


OpenID accepted here Learn more about OpenID
Powered by Movable Type 6.2.2