Hardware Reference
In-Depth Information
FIGURE A.16 The major methods for evaluating branch conditions, their advantages,
and their disadvantages . Although condition codes can be set by ALU operations that are
needed for other purposes, measurements on programs show that this rarely happens. The
major implementation problems with condition codes arise when the condition code is set by a
large or haphazardly chosen subset of the instructions, rather than being controlled by a bit in
the instruction. Computers with compare and branch often limit the set of compares and use a
condition register for more complex compares. Often, different techniques are used for
branches based on floating-point comparison versus those based on integer comparison. This
dichotomy is reasonable since the number of branches that depend on floating-point compar-
isons is much smaller than the number depending on integer comparisons.
One of the most noticeable properties of branches is that a large number of the comparisons
are simple tests, and a large number are comparisons with zero. Thus, some architectures
choose to treat these comparisons as special cases, especially if a compare and branch instruction
is being used. Figure A.17 shows the frequency of different comparisons used for conditional
branching.
 
Search WWH ::




Custom Search