Question: 3 - Consider the following code segment within a loop body: i f ( d = = 0 ) d = 1 ; i f
Consider the following code segment within a loop body:
;
Here is the equivalent MIPS code assuming is assigned to registers R
bnez R L ; branch b
addi #; so
L: suiot R R #
bnez ; branch b
L:
Assume that the following list of values of is to be processed:
a Suppose bit BPBs are used to predict the execution of the two branches in this loop. bit BPBs consists
of four states: strongly not taken sNT weakly not taken wNT strongly taken sT and weakly taken
wT Show the trace of predictions and the actual outcomes of branches b and b Assume initial values
of the bit predictors are sNT What are the prediction accuracies for b and b What is the overall
prediction accuracy?
b Suppose twolevel branch prediction is used predict the execution of the two branches in this loop.
That is in addition to the bit predictor, a bit global register g is used. Assume the bit predictors are
initialized to SNT and is initialized to NT Show the trace of predictions and the actual outcomes of
branches and What are the prediction accuracies for and What is the overall prediction
accuracy?
c Suppose a twolevel branch prediction is used predict the execution of the two branches in this loop.
That is in addition to the bit predictor, a bit global register g is used. Assume the bit predictors are
all initialized to SNT and is initialized to NT NT with the LSB representing the most recent branch
outcome. Therefore, initial predictions, and their meaning are given below:
Show the trace of predictions and updated values for branches and in the table shown below. What
are the prediction accuracies for and What is the overall prediction accuracy?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
