Documente Academic
Documente Profesional
Documente Cultură
Branch Prediction - 1
Arvind
Computer Science & Artificial Intelligence Lab.
Massachusetts Institute of Technology
Can we do better?
1 1 Strongly taken
On taken
On taken
1 0 Weakly taken
0 1 Weakly taken
0 0 Strongly taken
k 2k-entry
I-Cache BHT Index BHT,
2 bits/entry
Instruction
Opcode offset
P Reg
Decode Execute
C Read
PC
target BP
Assume a
128-entry 1028 Add .....
NAP target BPb
236 take
Instruction
What will be fetched after the instruction at 1028? Memory
NAP prediction = 236
Correct target = 1032
=
match valid target
Keep the (pc, predicted pc) in the BTB
pc+4 is predicted if no pc match is found
BTB is updated only for branches and jumps
Permits nextPC to be determined before instruction is decoded
April 9, 2012 http://csg.csail.mit.edu/6.S078 L16-13
Consulting BTB Before
Decoding
132 Jump 100
nextPC
Fetch Execute
ir
<instructions,
pc, epoch>
Bypass
eEpoch
fEpoch
FIFO
Register File
nextPC
+4
PC ir Decode Execute
Pipeline
FIFO
Inst Data
Memory Memory
eEpoch
fEpoch
Register File
nextPC
ir
PC + Decode Execute
Branch ppc
Predictor
Data
Inst
Memory
Memory