[net.arch] registers vs. caches

baskett@decwrl.UUCP (Forest Baskett) (12/11/83)

Caches are great devices and they make good supplements to registers.
There are a couple of reasons why they don't make good substitues for
registers, however.  A cache reference can be thought of as an indirect
reference.  Indirection is a powerful tool but there is a price.  For
caches, the price is usually time and additional complexity over the
direct reference to a register.  With the same technology and the same
effort, registers tend to be faster and cheaper.  A good rule of thumb
is that if a register reference takes one cycle, a cache reference will
take two.  In addition, a register address tends to be small while a
cache reference address tends to be large.  The smaller address can
have some additional speed advantages on several fronts.  And a good
compiler can do an impressive job of correctly guessing at some of the
important locality of your program.  There are a variety of ways in
which you can blur the distinction between registers and caches but
there doesn't appear to be any free lunch.

jlw@ariel.UUCP (J.WOOD) (12/13/83)

decwrl!baskett has a good point that a cache reference is a more complex
one than  a register reference.  What I meant when I said that some
processors had put their registers in memory was that there is an
on-chip pointer to the base of an area in memory that is referenced with
a register type instruction.  The register base pointer is added to
the register number in the instruction shifted over to the left to
account for its being wider than a byte and the result is used as a
main memory reference (virtual of course).



					Joseph L. Wood, III
					AT&T Information Systems
					Laboratories, Holmdel
					(201) 834-3759
					ariel!jlw