unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* compile-rtl, II
@ 2012-10-15 14:05 Stefan Israelsson Tampe
  2013-01-21 17:39 ` Andy Wingo
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Israelsson Tampe @ 2012-10-15 14:05 UTC (permalink / raw)
  To: guile-devel

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

Hi all, Let me suggest another layout of function frames

(arg1, return-address, old-frame, program, arg2 ...)

And the layout of the return is

(ret1, return-address, old-frame, program, ret2 ,....)

and let the local registers be occupied by

fr[0] = arg1
fr[1] = return-address
fr[2] = old-frame
fr[3] = program
fr[4] = arg2
...

This way we do not need to copy the program field at a tail call and also,
we do not need to
move the return value when we do a call e.g.

(f (g x))

can minimally be described by sp = 10

(s-move 10 x)
(f-move 13 g L1)
(call    10 1)
L1:
(f-move 13 f L2:)
(call    10 1)
L2:
(return 10)

f-moves  : makes sure to prepare a function header
s-moves : adjust the stack to the target of the move

This looks minimally, but the f-move and s-move
variants together with ordinary moves is a flavor for every
value producing instruction, in some way we would need to
add flags to many of the instructions or triple the number of
them. I need to play with this further to understand how to solve this
issue.


Also another kind of difficulty will arise, many instructions only take a
value of 256 register positions, we would somehow need to handle the larger
instructions by moving things and this is complicated. Don't know what to
do about this yet
either.

Regards
Stefan

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-01-21 19:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-15 14:05 compile-rtl, II Stefan Israelsson Tampe
2013-01-21 17:39 ` Andy Wingo
2013-01-21 19:08   ` 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).