|Caller allocates space for callee-save registers email@example.com (1992-05-21)|
|Register + Offset vs. Register Indirect firstname.lastname@example.org (1992-06-07)|
|Re: Register + Offset vs. Register Indirect igor!davidm@uunet.UU.NET (1992-06-08)|
|Re: Register + Offset vs. Register Indirect email@example.com (Dave Berry) (1992-06-09)|
|From:||igor!davidm@uunet.UU.NET (David Moore)|
|Date:||Mon, 8 Jun 1992 17:45:33 GMT|
firstname.lastname@example.org (Jonathan Eifrig) writes:
> The biggest advantage of the (register + short immediate)
>addressing mode is that the _loading_ of the offset is essentially free.
>Since (if my memory is serving me) something like half of all memory
>references (of compiled C programs) use the (stack-pointer + offset)
>addressing mode, the advantage of the free load usually offsets the
>penalty of the possible pipeline stall.
The chief advantage of register+short immediate addressing is to avoid
having to increment large numbers of induction variables in loops. On the
AM29000, every address produces a separate induction variable.
On a machine like the Sparc with a small register window, having to do
this would be catastrophic to loop performance. On the 29000 familly, you
have plenty of registers, so that running out of registers for all these
induction variables is not a problem. On the other hand, you have to
explicitly increment them. My 29000 Fortran compiler makes some effort to
hide these increments in the dead time after loads/stores so that most of
them happen "for free". If you don't do this, you end up with a pile of
adds at the end of every loop. (unless, of course, you have a very good
instruction scheduler which can schedule across basic blocks)
There is no load overhead for short offsets. The 29000 has add and
subtract immediate (and a subtract reverse immediate) instructions which
allow offsets in the range -256..255 to be added directly.
Return to the
Search the comp.compilers archives again.