guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

compile-rtl, II


From: Stefan Israelsson Tampe
Subject: compile-rtl, II
Date: Mon, 15 Oct 2012 16:05:40 +0200

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]