lect6 -controlhaz

lect6 -controlhaz - Control Dependence Just as an...

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

View Full Document Right Arrow Icon
CSE 141 Dean Tullsen Branch Hazards or “Which way did he go?” CSE 141 Dean Tullsen Control Dependence Just as an instruction will be dependent on other instructions to provide its operands ( data dependence ), it will also be dependent on other instructions to determine whether it gets executed or not ( branch dependence or control dependence ). Control dependences are particularly critical with conditional branches. add $5, $3, $2 sub $6, $5, $2 beq $6, $7, somewhere and $9, $6, $1 ... somewhere: or $10, $5, $2 add $12, $11, $9 ... CSE 141 Dean Tullsen Branch Hazards Branch dependences can result in branch hazards (when they are too close to be handled correctly in the pipeline). CSE 141 Dean Tullsen Branch Hazards IM Reg ALU DM Reg IM Reg DM IM Reg DM Reg IM Reg DM Reg IM Reg DM Reg CC1 CC2 CC3 CC4 CC5 CC6 CC7 CC8 beq $2, $1, here here: lw . .. sub . .. lw . .. add . ..
Background image of page 1

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

View Full DocumentRight Arrow Icon
CSE 141 Dean Tullsen Dealing With Branch Hazards Hardware until you know which direction – reduce hazard through of branch direction which direction ± assume not taken (easiest) ± more educated guess based on history (requires that you know it is a branch before it is even decoded!) Hardware/Software – nops, or instructions that get executed either way (delayed branch). CSE 141 Dean Tullsen Stalling for Branch Hazards beq $4, $0, there and $12, $2, $5 or . .. add . .. sw . .. IM Reg DM Reg IM Reg IM Reg DM IM Reg DM Reg IM Reg DM Reg CC1 CC2 CC3 CC4 CC5 CC6 CC7 CC8 Bubble Bubble Bubble CSE 141 Dean Tullsen Stalling for Branch Hazards Seems wasteful, particularly when the branch isn’t taken. Makes all branches cost 4 cycles. CSE 141 Dean Tullsen Assume Branch Not Taken beq $4, $0, there and $12, $2, $5 or . .. add . .. sw . .. IM Reg DM Reg IM Reg IM Reg DM IM Reg DM Reg IM Reg DM Reg CC1 CC2 CC3 CC4 CC5 CC6 CC7 CC8 works pretty well when you’re right
Background image of page 2
CSE 141 Dean Tullsen Assume Branch Not Taken beq $4, $0, there and $12, $2, $5 or . .. add .
Background image of page 3

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

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

This note was uploaded on 02/14/2008 for the course CSE 141 taught by Professor Tullsen during the Fall '06 term at UCSD.

Page1 / 9

lect6 -controlhaz - Control Dependence Just as an...

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

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