Re: When/why did function calls get cheap?

"Glen Herrmannsfeldt" <gah@ugcs.caltech.edu>
24 Feb 2003 14:25:40 -0500

          From comp.compilers

Related articles
[5 earlier articles]
Re: When/why did function calls get cheap? marcov@toad.stack.nl (Marco van de Voort) (2003-02-21)
Re: When/why did function calls get cheap? firefly@diku.dk (Peter Finderup Lund) (2003-02-21)
Re: When/why did function calls get cheap? firefly@diku.dk (Peter Finderup Lund) (2003-02-21)
Re: When/why did function calls get cheap? anton@mips.complang.tuwien.ac.at (2003-02-21)
Re: When/why did function calls get cheap? jplevyak@yahoo.com (John Plevyak) (2003-02-21)
Re: When/why did function calls get cheap? {spamtrap}@qeng-ho.org (Arthur Chance) (2003-02-24)
Re: When/why did function calls get cheap? gah@ugcs.caltech.edu (Glen Herrmannsfeldt) (2003-02-24)
Re: When/why did function calls get cheap? alexc@std.com (Alex Colvin) (2003-02-24)
Re: When/why did function calls get cheap? vbdis@aol.com (2003-02-24)
Re: When/why did function calls get cheap? firefly@diku.dk (Peter Finderup Lund) (2003-03-09)
Re: When/why did function calls get cheap? joachim_d@gmx.de (Joachim Durchholz) (2003-03-09)
Re: When/why did function calls get cheap? klimas@klimas-consulting.com (Andreas Klimas) (2003-03-09)
Re: When/why did function calls get cheap? bonzini@gnu.org (2003-03-14)
[5 later articles]
| List of all articles for this month |

From: "Glen Herrmannsfeldt" <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: 24 Feb 2003 14:25:40 -0500
Organization: AT&T Broadband
References: 03-02-073 03-02-087 03-02-097
Keywords: architecture, performance
Posted-Date: 24 Feb 2003 14:25:40 EST

"Ben Elliston" <bje@redhat.com> wrote in message
> >>>>> "Glen" == Glen Herrmannsfeldt <gah@ugcs.caltech.edu> writes:
>
> Glen> As far as I know, the main thing that changed is computers got
> Glen> faster.
>
> I think the answer is a bit more detailed. It has also been due to
> architectural improvements like larger register files in RISC machines
> and register windows on SPARC that have led to reduced overheads in
> function calls.


Probably you are right, but what is the cost when the register stack
overflows, and must be written to memory?


I remember discussions around the time the Cray-1 came out, when the
tradition was to save registers on function calls (or else to assume
they lose their value). With all the vector registers, that was
pretty hard to do on the Cray. One suggestion was that they would be
allocated at link time, when the linker would know how many (of which
type) register each routine would need. I don't know if that is what
happened, though.


-- glen
[My impression of SPARC register windows is that they were a very
clever solution to the wrong problem. They were using the old PCC
compiler that made no attempt to optimize register saves, so they
added hardware to make saves cheap. At the same time IBM was working
on the 801 with the very aggressive PL.8 compiler and they got the
register saves down to a level that didn't merit anything beyond the
traditional save and load multiple instructions. I note that IA-64
has register windows back in a barococo implementation, so I presume
the tradeoffs have changed again. -John]



Post a followup to this message

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