unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* ritcher rtl arguments
@ 2012-10-22 15:01 Stefan Israelsson Tampe
  0 siblings, 0 replies; only message in thread
From: Stefan Israelsson Tampe @ 2012-10-22 15:01 UTC (permalink / raw)
  To: guile-devel, Andy Wingo

[-- Attachment #1: Type: text/plain, Size: 2156 bytes --]

Hi,

I'm wondering if we should allow for a more verbose interface to the rtl
language consider for example
y = closure variable

(+ x 16)
(+ x y)
(f  x y), f local function


and so on. Now we must store constants and closure variables in a variable
slot first and then transfer them
to the operations. We do the same in guile-2.0. But I would like you to
consider the possibility to include
these transfers more directly to a more effective byte-code. Maybe the
opportunities is not that great but I suspect
that in certain paradigms of programming like logic programming wich
juggles a lot with closures can benefit from such
a rich interface. Also hints on types could mean that we can reduce the
number of checks especially in native compilation
meaning less bloated native code and faster execution.

An idea would be to have an interface to most operations like

(op flags arg1 ...)
if flags are all zero just use the old version, else go to a version where
we dispatch the lookup of argument according to the flags.
The overhead on the first path is a lookup and a check, maybe not too heavy
(I do not know) But certainly for consts and closure arguments it will be
faster. The native translation will be best of both worlds.
Another solution would be to use two versions of most codes, one complex
with flags or one simple.

Anyhow this is something to think about and play with.

Another question is how we should handle large functions with register
locations larger then 1 byte. A lot of the instructions can only use
1 byte sizes, so we need to do some kind of mov operation. Another
possibility is to add an extra instruction "capture-args" e.g. we use

(capture-args-24bit 2 x y)
(add flag1 flag2)
This will capture the 2 args and then dispatch on the next instruction e.g.
(add x y). E.g. we consider having an instruction that works
like a modifier again this will make large functions a bit heavy but it's
makes the register allocation simple. Consider in stead of implementing
this with the move instruction. That will probably be more complex and
costly to implement.

Anyway I will hack along on the rtl generation, have fun!

/Stefan

[-- Attachment #2: Type: text/html, Size: 2312 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-10-22 15:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-22 15:01 ritcher rtl arguments Stefan Israelsson Tampe

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