|Register optimizations ArielMars@aol.com (1995-03-02)|
|Re: Register optimizations firstname.lastname@example.org (1995-03-05)|
|Re: Register optimizations email@example.com (1995-03-08)|
|Re: Register optimizations firstname.lastname@example.org (1995-03-09)|
|Re: Register optimizations email@example.com (1995-03-12)|
|Re: Register optimizations firstname.lastname@example.org (1995-03-16)|
|Re: Register optimizations email@example.com.OZ.AU (1995-03-18)|
|Keywords:||registers, optimize, question|
|Date:||Thu, 2 Mar 1995 19:40:07 GMT|
I've been looking at a number of methods of using registers to speed up
expression execution. It seems that great use could be made of registers,
especially on RISC machines with lots of them available.
Perhaps some of you with some experience could help me answer this one. As
compared to a system in which all local variables are held on the stack,
and where a single register is used to store the current value being
operated on and intermediate expression results are pushed on the stack,
is it more efficient to:
1) remap commonly used variables into registers, just use the one register
for expressions, and use stack space for intermediate values; or,
2) leave the local variables on the stack, and use registers for all
intermediate expression values?
The problem I see with approach #1 is that it can't be used for any
variable that could ever be referenced by address; the register obviously
has no address, and thus that variable would have to be left in main
memory. However #2 seems like it wouldn't be as effective an optimization,
as loading a value from a register offset is slower than a simple push/pop.
Or, is there some other, better approach I haven't yet run across?
Suggestions welcome, and thank you for your time.
Red Planet Software
Return to the
Search the comp.compilers archives again.