Hardware Reference
In-Depth Information
Thus, all the aspects of handling branches—prediction accuracy, latency of misprediction de-
tection, and misprediction recovery time—increase in importance.
Exceptions are handled by not recognizing the exception until it is ready to commit. If a
speculated instruction raises an exception, the exception is recorded in the ROB. If a branch
misprediction arises and the instruction should not have been executed, the exception is
lushed along with the instruction when the ROB is cleared. If the instruction reaches the head
of the ROB, then we know it is no longer speculative and the exception should really be taken.
We can also try to handle exceptions as soon as they arise and all earlier branches are resolved,
but this is more challenging in the case of exceptions than for branch mispredict and, because
it occurs less frequently, not as critical.
Figure 3.14 shows the steps of execution for an instruction, as well as the conditions that
must be satisfied to proceed to the step and the actions taken. We show the case where mis-
predicted branches are not resolved until commit. Although speculation seems like a simple
addition to dynamic scheduling, a comparison of Figure 3.14 with the comparable figure for
Tomasulo's algorithm in Figure 3.9 shows that speculation adds significant complications to
the control. In addition, remember that branch mispredictions are somewhat more complex as
well.
Search WWH ::




Custom Search