The last discussion was productive, so let's have another...

There are often situations where we want to discard the result of a
computation.  For instance, a CMP instruction is just a special case of
SUB, where we somehow just ignore the difference and only pay attention to
the processor flags.

Some architectures have what we call a "bit bucket", where register zero
always reads back zero.  So if you write to it, you're throwing away the
result.  This is useful for informing the interlock mechanism in your CPU
that there are no dependencies on a given result, avoiding stalls.

Some other alternatives:
- Write-back flag in the instruction that skips writeback if false
- Provide some non-orthogonal subset of the instructions that have "don't
write back" alternative opcodes (as CMP is for SUB in many CPUs)
- Don't bother having any of these mechanisms, thereby requiring the
compiler to avoid reusing a register that's been written to for ${pipeline
length} cycles.

I'm sure you can think of others.  The main debate here is, given that we
do indeed have some use for throwing away the result, which option is best?


Right now, my "reference ISA" (which is intended to represent an EXAMPLE
and is also a subset of what the simulator is to support) has a flag
reserved to indicate writeback.  But we could just as well reserve R0 as a
bitbucket.  (Slightly less a matter of debate is that we have another flag
to control writeback to the PSW, because there are many cases where we do
not want to create a dependency through this bottleneck.)


-- 
Timothy Normand Miller, PhD
Assistant Professor of Computer Science, Binghamton University
http://www.cs.binghamton.edu/~millerti/
Open Graphics Project
_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)

Reply via email to