Re: Caller/Callee saved Registers

hbaker@netcom.com (Henry G. Baker)
Fri, 25 Mar 1994 02:23:23 GMT

          From comp.compilers

Related articles
[10 earlier articles]
Re: Caller/Callee saved Registers Peter-Lawrence.Montgomery@cwi.nl (1994-03-24)
Re: Caller/Callee saved Registers pdp8@ai.mit.edu (1994-03-24)
Re: Caller/Callee saved Registers ghiya@flo.cs.mcgill.ca (1994-03-24)
Re: Caller/Callee saved Registers paulb@travis.csd.harris.com (1994-03-24)
Re: Caller/Callee saved Registers hbaker@netcom.com (1994-03-24)
Re: Caller/Callee saved Registers bart@cs.uoregon.edu (1994-03-25)
Re: Caller/Callee saved Registers hbaker@netcom.com (1994-03-25)
Re: Caller/Callee saved Registers pardo@cs.washington.edu (1994-03-25)
Re: Caller/Callee saved Registers zsh@cs.princeton.edu (1994-03-25)
Re: Caller/Callee saved Registers law@fast.cs.utah.edu (1994-03-26)
Re: Caller/Callee saved Registers hbaker@netcom.com (1994-03-26)
Re: Caller/Callee saved Registers hbaker@netcom.com (1994-03-26)
Re: Caller/Callee saved Registers hbaker@netcom.com (1994-03-26)
[13 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: hbaker@netcom.com (Henry G. Baker)
Keywords: registers
Organization: nil
References: 94-03-054 94-03-123
Date: Fri, 25 Mar 1994 02:23:23 GMT

robertsw@agcs.com (Ye Wilde Ryder) writes:
>A call instruction that indicates which regs need saving in a
>bitmask could be combined with a stack-frame-creation instruction
>more efficient in hardware.


Peter-Lawrence.Montgomery@cwi.nl (Peter L. Montgomery) writes:
> Suppose A calls B, which calls C in a loop.
> A needs registers 1 and 2 and 5 saved past the call to B.
> B uses 2 and 3, but needs nothing saved past the call to C.
> C uses 1 and 3 and 4, calls nobody.
>Who saves register 1? More precisely, what mask does B pass to C? [etc.]


Another approach not often used in hardware architectures anymore is that
of what I might term a 'self-cleaning' register. Once you read its
value, it is set to 'empty'. (Before the peanut gallery erupts, yes, I
know this is like data flow/Tera/...) The pdp-8 accumulator worked like
this--when you stored it, the accumulator was set to 0. If you believe
that most _values_ stored in registers (not _variables_, mind you) are
referenced 1,2,3,... times according to something like Zipf's law, then it
is worth going to some trouble to make the '1 ref' case efficient. Thus,
if the compiler knows that the value will be used only once, it can either
load the register in such a way that the following read will launder it,
or perhaps the compiler can reference the register in a way that cleans it
(or both). The object of this exercise, of course, is that any save of a
'clean' register will be ignored. It may be useful to gather the 'clean'
bits into a single register which may want to be saved/restored.


A slightly different approach using a 'self-cleaning cache' is described
in Baker, H.G. "Linear Logic and Permutation Stacks", ACM Sigarch Computer
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.