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

* Re: compile-rtl, II
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Wingo @ 2013-01-21 17:39 UTC (permalink / raw)
  To: Stefan Israelsson Tampe; +Cc: guile-devel

On Mon 15 Oct 2012 16:05, Stefan Israelsson Tampe <stefan.itampe@gmail.com> writes:

> (arg1, return-address, old-frame, program, arg2 ...)
>
> This way we do not need to copy the program field at a tail call

What would you do for 0 arguments?

> Also another kind of difficulty will arise, many instructions only
> take a value of 256 register positions

Do you have examples?  I think the idea I had in mind was to reserve the
last two or three of the 8-bit-addressable registers as temporaries, and
emit long-mov shuffles to handle those cases.

Andy
-- 
http://wingolog.org/



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

* Re: compile-rtl, II
  2013-01-21 17:39 ` Andy Wingo
@ 2013-01-21 19:08   ` Stefan Israelsson Tampe
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Israelsson Tampe @ 2013-01-21 19:08 UTC (permalink / raw)
  To: Andy Wingo; +Cc: guile-devel

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

On Mon, Jan 21, 2013 at 6:39 PM, Andy Wingo <wingo@pobox.com> wrote:

> On Mon 15 Oct 2012 16:05, Stefan Israelsson Tampe <stefan.itampe@gmail.com>
> writes:
>
> > (arg1, return-address, old-frame, program, arg2 ...)
> >
> > This way we do not need to copy the program field at a tail call
>
> What would you do for 0 arguments?
>
> I would just fill in the first argument with SCM_UNSPECIFIED or such and
send information to the call that
0 argumnets is filled in, then the compiled code would work smartly and use
this field for normal rtl registers.
Ayway I did not pursue this at date more than adding some flags to the
compiler so that we can turn on this
feature and try it out later.


> > Also another kind of difficulty will arise, many instructions only
> > take a value of 256 register positions
>
> Do you have examples?  I think the idea I had in mind was to reserve the
> last two or three of the 8-bit-addressable registers as temporaries, and
> emit long-mov shuffles to handle those cases.
>
> To be frank it looks like 95% of the code will never need to think about
this issue, so your approach seams sane.


> Andy
> --
> http://wingolog.org/
>

[-- Attachment #2: Type: text/html, Size: 2186 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).