Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Building an incomplete code generator into Parrot

3 views
Skip to first unread message

ro...@adampreble.com

unread,
Apr 24, 2005, 1:19:34 AM4/24/05
to perl6-i...@perl.org
Well I started the AMD64 code generator. I don't have much available yet --
just enough for what seems to be necessary to run anything at all.
Parrot_jit_begin makes calls to MOV instructions that are implemented, and I
have a NOP implemented. Is this the bare minimum?

I was hoping for some insights into how I can incorporate this into a build and
get the VM to recognize my code generator for trivial test programs I want to
send it. I haven't been able to test if any of this works yet.

As of right now, I still have the i386 code.jit file, and I don't know how that
works when I don't have all the requisite instructions implemented. Can the
core.jit only list the opcodes I currently support? Do I need stubs for all
the opcodes?

Leopold Toetsch

unread,
Apr 24, 2005, 3:44:52 AM4/24/05
to ro...@adampreble.com, perl6-i...@perl.org
ro...@adampreble.com <ro...@adampreble.com> wrote:
> Well I started the AMD64 code generator. I don't have much available yet --
> just enough for what seems to be necessary to run anything at all.
> Parrot_jit_begin makes calls to MOV instructions that are implemented, and I
> have a NOP implemented. Is this the bare minimum?

In jit_emit.h you need at least Parrot_jit_normal_op() to create
function wrappers for non-JIIted opcodes. Parrot_jit_begin() of course
and an implementation for C<end> to leave the JIT core that is clean up
the stack frame, you've created in Parrot_jit_begin.

For any non-trivial program you need Parrot_jit_cpcf_op and
Parrot_jit_restart_op for branches including the handling of call
offsets in Parrot_jit_fixup().

> I was hoping for some insights into how I can incorporate this into a
> build and get the VM to recognize my code generator for trivial test
> programs I want to send it. I haven't been able to test if any of
> this works yet.

Have a look at config/auto/jit.pl line 72. Presumed the $cpuarch eq
'x86_64' (or 'amd64') then you'd have to create that directory under
'jit' and drop your core.jit and jit_emit.h there. You can verifiy that
step with:

$ perl Configure.pl --verbose-step=JIT

which (during make) should create src/jit_src.c from your files.

> ... Can the core.jit only list the opcodes I currently
> support?

Yep, just put into it what's implemented.

leo

0 new messages