Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #4494 > unrolled thread

register count

Started bybob smith <bob@coolfone.net63.net>
First post2014-06-04 17:55 -0700
Last post2014-06-08 10:54 +0100
Articles 3 — 3 participants

Back to article view | Back to comp.programming


Contents

  register count bob smith <bob@coolfone.net63.net> - 2014-06-04 17:55 -0700
    Re: register count "BartC" <bc@freeuk.com> - 2014-06-07 19:28 +0100
    Re: register count "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2014-06-08 10:54 +0100

#4494 — register count

Frombob smith <bob@coolfone.net63.net>
Date2014-06-04 17:55 -0700
Subjectregister count
Message-ID<428b3a94-4ea5-4545-b1ab-9a65c44230a5@googlegroups.com>
Let's say you are creating your own Virtual Machine.

For instance, it might be like the Java VM.

How do you decide how many registers to put in it?

[toc] | [next] | [standalone]


#4506

From"BartC" <bc@freeuk.com>
Date2014-06-07 19:28 +0100
Message-ID<7SIkv.4949$O61.1772@fx27.am4>
In reply to#4494
"bob smith" <bob@coolfone.net63.net> wrote in message 
news:428b3a94-4ea5-4545-b1ab-9a65c44230a5@googlegroups.com...
> Let's say you are creating your own Virtual Machine.
>
> For instance, it might be like the Java VM.
>
> How do you decide how many registers to put in it?

As many as you like? 

[toc] | [prev] | [next] | [standalone]


#4518

From"Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org>
Date2014-06-08 10:54 +0100
Message-ID<JdWdnSWj7JUJrgnOnZ2dnUVZ8lOdnZ2d@bt.com>
In reply to#4494
bob smith wrote:

> Let's say you are creating your own Virtual Machine.

OK, I'm writing my own VM

> For instance, it might be like the Java VM.

Could be...

> How do you decide how many registers to put in it?

Depends on why I'm writing it, and what architecture I've chosen.

If I'm emulating a real machine, then the decision is out of my hands.

If I'm writing it as a tool to explore register architectures then there is no 
decision to make.

If I'm writing an interpreted VM but still want the thing to be reasonably 
quick then I'll want the VM to do as much work in each step as possible (to 
minimise instruction dispatch overhead (which is a big drain in most 
interpreted VMs), in which case I may want to use an "infinite register" model 
(just use as many registers as you want, let the VM look after it).  One 
possible downside of that is that it probably requires the virtual machine code 
to identify functions (methods, frames, whatever) separately.  Another is that 
it doesn't work so well if I'm targeting Forth ;-)

If I'm writing a VM that I intend to be JITed (or other approaches where the VM 
code is the /input/ to a more-or-less traditional compilation stage), then I 
will design the VM code to make that as easy as possible.  I might even bake 
SSA into the VM code design.  I'm not aware of any work comparing different VM 
code architectures on how well they can be compiled -- after all, writing a JIT 
isn't something you do everyday -- but from what I've seen people generally 
seem to go for the infinite-register model too.  (Certainly the stack model is 
considered "difficult").

    -- chris 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.programming


csiph-web