unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: David Kastrup <dak@gnu.org>
To: guile-devel@gnu.org
Subject: Re: Register VM WIP
Date: Wed, 16 May 2012 16:00:37 +0200	[thread overview]
Message-ID: <87y5osp6nu.fsf@fencepost.gnu.org> (raw)
In-Reply-To: 87sjf09r5v.fsf@netris.org

Mark H Weaver <mhw@netris.org> writes:

> I certainly agree that we should have a generous number of registers,
> but I suspect that the sweet spot for a VM is 256, because it enables
> more compact dispatching code in the VM, and yet is more than enough to
> allow a decent register allocator to generate good code.
>
> That's my educated guess anyway.  Feel free to prove me wrong :)

The counterproof will usually be done by benchmarking, and will even
differ between different processors sharing the same instruction set.

I see two ways out:
a) pick the register size individually for each function, as small as
possible without spillage.  Which makes the whole indistinguishable from
a stack-based VM.
b) don't generate the final bytecode until the code is actually being run.

That means that _if_ code is precompiled, it will be precompiled into
either stack-based VM or some other representation better suited to
compile into code for a certain amount of registers.  Of course, the
threshold to picking actual registers of the available processor and
compiling native code is then not all too large.

-- 
David Kastrup




  reply	other threads:[~2012-05-16 14:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-11 16:19 Register VM WIP Andy Wingo
2012-05-11 20:29 ` Stefan Israelsson Tampe
2012-05-16 15:01   ` Andy Wingo
2012-05-14 21:09 ` Ludovic Courtès
2012-05-14 21:28   ` Andrew Gwozdziewycz
2012-05-15 18:45     ` Andy Wingo
2012-05-16  0:39       ` Noah Lavine
2012-05-16  4:23         ` Mark H Weaver
2012-05-16  7:15           ` Andy Wingo
2012-05-16 13:44             ` Mark H Weaver
2012-05-16 14:00               ` David Kastrup [this message]
2012-05-16 14:54               ` Noah Lavine
2012-05-16 15:05                 ` Andy Wingo
2012-05-16 20:39                 ` Ludovic Courtès
2012-05-16 14:58               ` Andy Wingo
2012-05-16 16:27                 ` Mark H Weaver
2012-05-16 16:39                   ` Andy Wingo
2012-05-16 18:23                     ` Noah Lavine
2012-05-16  7:10         ` Andy Wingo
2012-05-15 18:49   ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y5osp6nu.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).