



































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




































































(^) data hazards are a big enough problem that lots of resources have been devoted to over coming them but unfortunately, the real obstacle and limiting factor in maintaining a good rate of execution in a pipeline are control dependencies (^) branches are 1 out of every 5 or 6 inst. (^) In an n-issue processor, they’ll arrive n times faster (^) A “control dependence” determines the ordering of an instruction with respect to a branch instruction so that the non-branch instruction is executed only when it should be
(^) Instructions normally fetched and executed from sequential memory locations (^) PC is the address of the current instruction, and nPC is the address of the next instruction (nPC = PC + 4) (^) Branches and control transfer instructions change nPC to something else (^) Branches modify, conditionally or unconditionally, the value of the PC.
1c 20 24 28 2c 30 34
add r1, r2, r3 // r1<- r2 + r beq zero // test for result equals to zero and,if // ‘yes’ branch to location zero div r5, r4, r1 // r5 <- r4 / r . . . zero: // processing the case if divisor equals to // zero
teq r1 // test for (r1)=0 and update result state // accordingly beq zero // test for results equals to zero and, if yes, // branch to the location zero div r5, r4, r1 // r5 <- r4/ r . . . zero: // processing the case if divisor equals to // zero
add r1, r2, r3; // r1<- r2 + r cmpeq r7, r1; // r7 <- true, if (r1)=0, else NOP bt r7,zero // branch to ‘zero’:if (r7)=true, else NOP div r5, r4, r1 // r5 <- r4 / r . . . zero:
add r1, r2, r3 // r1<- r2 + r beq r1, zero // test for (r1)=0 and branch if true div r5, r4, r1 // r5 <- r4 / r . . . zero:
(^) In order to evaluate compare branch processing a performance measure branch penalty is used (^) branch penalty (^) the number of additional delay cycles occurring until the target instruction is fetched over the natural 1-cycle delay (^) consider effective branch penalty P for taken and not taken branches is: P = ft * Pt + fnt * Pnt