Re: Is register stack compilers' friend?

hbaker@netcom.com (Henry Baker)
Sat, 4 Nov 1995 18:29:22 GMT

          From comp.compilers

Related articles
Is register stack compilers' friend? jaidi@technet.sg (1995-10-31)
Re: Is register stack compilers' friend? hbaker@netcom.com (1995-11-04)
Re: Is register stack compilers' friend? cliffc@ami.sps.mot.com (1995-11-05)
Re: Is register stack compilers' friend? stevec@pact.srf.ac.uk (1995-11-06)
Is register stack compilers' friend? dave@occl-cam.demon.co.uk (Dave Lloyd) (1995-11-06)
Re: Is register stack compilers' friend? paulb@pablo.taligent.com (1995-11-09)
Re: Is register stack compilers' friend? jeremy@suede.sw.oz.au (1995-11-13)
| List of all articles for this month |

Newsgroups: comp.compilers
From: hbaker@netcom.com (Henry Baker)
Keywords: optimize, architecture
Organization: nil organization
References: 95-11-026
Date: Sat, 4 Nov 1995 18:29:22 GMT

jaidi@technet.sg (Nor Jaidi) wrote:


> [It's easy to generate straightforward code for a stack machine, since it's
> basically just RPN. Optimizing is hard, since reusing values on a stack is
> a lot trickier than reusing values in registers. -John]


Well, this depends upon the instruction set for the stack machine.
There's _nothing_ intrinsic in the idea of a stack machine
architecture to prohibit the same kinds of optimizations that are
used in register machines. In particular, reusing certain values
requires mechanisms for permuting the stack values in some coherent
way, which many stack architectures never really figured out or got
right, because they were still stuck in the 'stack machines don't
need hairy compilers' phase of computer development.


Phil Koopman, who was at CMU and now at United Technologies, did some
studies on high performance implementations of C on a stack machine.
Unfortunately, I don't recall the exact reference. He wrote a book
on this subject:


Koopman, P. Stack Computers, the New Wave. Ellis Horwood, 1989.


I also have a paper that goes into some of these issues:


ftp://ftp.netcom.com/pub/hb/hbaker/ForthStack.html (also .ps.Z)


--
www/ftp directory:
ftp://ftp.netcom.com/pub/hb/hbaker/home.html
--


Post a followup to this message

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