Caller/Callee saved Registers

ssimmons@convex.com (Steve Simmons)
Tue, 22 Mar 1994 13:32:53 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)
[25 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers
From: ssimmons@convex.com (Steve Simmons)
Keywords: registers, design
Organization: CONVEX News Network, Engineering (cnn.eng), Richardson, Tx USA
References: 94-03-054
Date: Tue, 22 Mar 1994 13:32:53 GMT

These are more likely calling conventions than architecture issues;
however, many architectures do impose restrictions on which registers to
use. These conventions are defined so that inter-module calls in any
language can be done, regardless of the compiler used. Each compiler in
that environment must be compliant with those calling conventions.


Callee saved registers are those registers that the called routine must
save before it may use them. The VAX is one big proponent of this.


Caller saved registers are registers that must be saved by the calling
routine before a call can be made. Otherwise, the contents of the
register may be destroyed across the call.


It is a religous war as to which is more correct. Caller saved registers
places the smarts in the calling routine. It knows what values are live
across the call. Callee saved registers places the smarts in the called
routine. It knows which values to save.


If you wish to minimize registers spills, a hybrid approach may be the
best... When scheduling registers, use the caller saved registers first
because your caller has already saved the information if it was needed.
If you need a value across a subroutine call, move it into a callee saved
register and let the called routine decide whether or not to spill its
value into memory. If your requirements exceed the number of either
register set, you must start spilling.


Thank you.
Steve Simmons
--


Post a followup to this message

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