|Is register stack compilers' friend? firstname.lastname@example.org (1995-10-31)|
|Re: Is register stack compilers' friend? email@example.com (1995-11-04)|
|Re: Is register stack compilers' friend? firstname.lastname@example.org (1995-11-05)|
|Re: Is register stack compilers' friend? email@example.com (1995-11-06)|
|Is register stack compilers' friend? firstname.lastname@example.org (Dave Lloyd) (1995-11-06)|
|Re: Is register stack compilers' friend? email@example.com (1995-11-09)|
|Re: Is register stack compilers' friend? firstname.lastname@example.org (1995-11-13)|
|From:||email@example.com (Henry Baker)|
|Date:||Sat, 4 Nov 1995 18:29:22 GMT|
firstname.lastname@example.org (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)
Return to the
Search the comp.compilers archives again.