EE557_2_level_branch

EE557_2_level_branch - 1 Computer Systems Architecture...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 Computer Systems Architecture EE557 - 2-level Branch Predictors Code Example ADDI R1, R0, 1000 ADD R2, R0, R0 LOOP: BNEZ R2, LAB1 ; branch #1 ADDI R2, R0, #1 BEQZ R0, LAB2 ; branch #2 LAB1: ADD R2, R0, R0 LAB2: SUBI R1, R1, #1 BNEZ R1, LOOP ; branch #3 2 Program Flow • Outer loop runs for 1000 iterations (R1 decrement) • When R2 = 0: • Branch #1 → Branch #2 → Branch #3 → Branch #1 NT T T / NT • R2 ← 1 • When R2 = 1: • Branch #1 → Branch #3 → Branch #1 T T / NT • R2 ← • Assume 3-bit branch pattern detector, 2-bit branch predictors • For per-address prediction, assume: • 10-bits of PC used to map to predictor tables (A11 – A2) • Branch #1 → Address 002\h of history/predictor tables • Branch #2 → Address 004\h of history/predictor tables • Branch #3 → Address 007\h of history/predictor tables • Assume bits of all predictors are initially clear GAg Predictor • Iteration #1, Branch #1 • Prediction: NT • Result: NT • Write 0 3 GAg Predictor • Iteration #1, Branch #2 • Prediction: NT • Result: T • Write 1 GAg Predictor 1 • Iteration #1, Branch #3 • Prediction: NT • Result: T • Write 1 1 4 GAg Predictor 1 1 • Iteration #2, Branch #1 • Prediction: NT • Result: T • Write 1 1 1 GAg Predictor 1 1 1 • Iteration #2, Branch #3 • Prediction: NT • Result: T • Write 1 1 1 1 5 GAg Predictor 1 1 1 • Iteration #3, Branch #1 • Prediction: NT • Result: NT • Write 0 1 1 1 1 GAg Predictor 1 1 • Iteration #3, Branch #2 • Prediction: NT • Result: T • Write 1 1 1 1 6 GAg Predictor 1 1 • Iteration #3, Branch #3 • Prediction: NT • Result: T • Write 1 1 1 1 1 GAg Predictor 1 1 • Iteration #4, Branch #1 • Prediction: NT • Result: T • Write 1 1 1 1 1 1 7 GAg Predictor 1 1 1 • Iteration #4, Branch #3 • Prediction: NT • Result: T • Write 1 1 1 1 1 1 1 GAg Predictor 1 1 1 • Iteration #5, Branch #1 • Prediction: NT • Result: NT • Write 0 1 1 1 1 1 1 1 8 GAg Predictor 1 1 • Iteration #5, Branch #2 • Prediction: NT • Result: T • Write 1 1 1 1 1 1 1 GAg Predictor 1 1 • Iteration #5, Branch #3 • Prediction: NT • Result: T • Write 1 1 1 1 1 1 1 1 9 GAg Predictor 1 1 • Iteration #6, Branch #1 • Prediction: T • Result: T • Write 1 1 1...
View Full Document

This note was uploaded on 06/27/2008 for the course EE 457x taught by Professor Puvvada during the Fall '07 term at USC.

Page1 / 21

EE557_2_level_branch - 1 Computer Systems Architecture...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online