Three Wasted Cycles
This Y86-64 sequence runs on the CS:APP PIPE processor: five stages (F, D, E, M, W), full forwarding, and a branch predictor that always predicts taken.
1 mrmovq 8(%rbx), %rax
2 addq %rax, %rdx
3 subq %rdx, %rcx
4 jne L1 # predicted taken; at run time it is NOT taken
5 irmovq $1, %rsi # the instruction after the jne
How many bubble cycles does the pipeline inject while these instructions flow through?
Sign in to answer questions and track your progress
Sign In