Re: Caller/Callee saved Registers

paulb@travis.csd.harris.com (Paul Beusterien)
Tue, 22 Mar 1994 19:02:16 GMT

          From comp.compilers

Related articles
Caller/Callee saved Registers pmagun@iiic.ethz.ch (1994-03-14)
Re: Caller/Callee saved Registers preston@noel.cs.rice.edu (1994-03-21)
Re: Caller/Callee saved Registers pardo@cs.washington.edu (1994-03-22)
Re: Caller/Callee saved Registers hbaker@netcom.com (1994-03-22)
Caller/Callee saved Registers ssimmons@convex.com (1994-03-22)
Re: Caller/Callee saved Registers paulb@travis.csd.harris.com (1994-03-22)
Re: Caller/Callee saved Registers cliffc@noel.cs.rice.edu (1994-03-22)
Re: Caller/Callee saved Registers alk@et.msc.edu (1994-03-23)
Re: Caller/Callee saved Registers bart@cs.uoregon.edu (1994-03-23)
Re: Caller/Callee saved Registers robertsw@agcs.com (1994-03-23)
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)
[24 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers
From: paulb@travis.csd.harris.com (Paul Beusterien)
Keywords: registers, design
Organization: Harris Computer Systems Division
References: 94-03-054
Date: Tue, 22 Mar 1994 19:02:16 GMT

pmagun@iiic.ethz.ch (Paul Jakob Magun) writes:
> What would happen if all registers were saved by the called procedure
> (callee saved) ?
>
> Why are there no callee saved parameter registers ?


Saving all registers would negate some of the advantages gained by passing
parameters in register. There's often no reason to save parameter
registers since the values can often be used right where they are.




> The kind (caller saved/callee saved) of register used for a variable is
> determined locally. Won't this a suboptimal global allocation ?


It's impossible to be optimal unless you are looking at all of the callers
and callees at once. Register saving conventions are designed to do as
well as possible most of the time for only being able to consider a single
routine at once. Typically the biggest win from a good convention is very
cheap leaf routines. If they are not too big, they typically won't have
to save any registers and may not need to do any stack adjustments at all.




> How did the designers of the architecture decide on the relative number of
> caller/callee saved registers ? Should the division be chosen differently
> for different high level languages ?


This isn't an architecture issue. If you're designing a register
allocator, you can design your own conventions. However, if you have to
be able to call or be called by code generated by other compilers, you
need to know what their conventions are.


Different divisions may be better for different languages, but then you
have problems with calls between languages. Coding style is probably an
even bigger determinant than language on what makes a good division.
--
Paul Beusterien paulb@travis.csd.harris.com
M.S. #161
Harris Computer Systems (305) 973 5270
2101 W. Cypress Creek Road
Ft. Lauderdale, FL 33309
--


Post a followup to this message

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