Question: 1. For the following code segment: a) Determine the number of branch mispredictions that occurs during the execution if we use one-bit predictor with 8

 1. For the following code segment: a) Determine the number of

1. For the following code segment: a) Determine the number of branch mispredictions that occurs during the execution if we use one-bit predictor with 8 entries. Assume all predictors are initialized with O values. j=0 Ox110 li R2,0 ; v=0 Ox114 I R3,16 Loop bound for Loop! Ox118 li R4,0 ; i=0 Loop: Ox11C beq R4, R3, EndLoopl ; Exit Loopl if i==16 0x120 II R5,0 Loop: 0x124 beq R5, R3,EndLoopJ; Exit LoopJ ifj==16 0x128 add R6, R5 R4 ijti Ox12C andi R6, R6,3 : (+1)%4 0x130 bne R6,RO,Endif : Skip if (+1)%41=0 Ox134 add R2, R2,R5 :v+=j | Endlf: Ox138 addi R5, R5,1 Ox13C beq RO,RO,LoopJ ; Go back to LoopJ EndLoopJ: Ox140 addi R4, R4,1 0x144 beq RO, RO,Loop! Go back to Loop! EndLoop: b) Repeat part (a) using a 2-bit local history predictor and 4, 2-bit counters with 8 entries. Assume all predictors are initialized at the 00 state (strongly not taken) and the history predictor initialized at 00. 1. For the following code segment: a) Determine the number of branch mispredictions that occurs during the execution if we use one-bit predictor with 8 entries. Assume all predictors are initialized with O values. j=0 Ox110 li R2,0 ; v=0 Ox114 I R3,16 Loop bound for Loop! Ox118 li R4,0 ; i=0 Loop: Ox11C beq R4, R3, EndLoopl ; Exit Loopl if i==16 0x120 II R5,0 Loop: 0x124 beq R5, R3,EndLoopJ; Exit LoopJ ifj==16 0x128 add R6, R5 R4 ijti Ox12C andi R6, R6,3 : (+1)%4 0x130 bne R6,RO,Endif : Skip if (+1)%41=0 Ox134 add R2, R2,R5 :v+=j | Endlf: Ox138 addi R5, R5,1 Ox13C beq RO,RO,LoopJ ; Go back to LoopJ EndLoopJ: Ox140 addi R4, R4,1 0x144 beq RO, RO,Loop! Go back to Loop! EndLoop: b) Repeat part (a) using a 2-bit local history predictor and 4, 2-bit counters with 8 entries. Assume all predictors are initialized at the 00 state (strongly not taken) and the history predictor initialized at 00

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!