Let be given a 4-step pipeline with the steps "Get command, get operands, Execute command, Write back result" and an Assembler Code:

1 movl $1 , %eax
2 movl $2 , %ecx
3 movl $3 , %edx
4 addl %edx , %ecx
5 addl %ecx , %eax

The line 4 addl command is forced to wait until command 3 completely walked through the pipeline. After line 3 is done, results are written back, line 4 addl command proceeds. However what does the addl command of line 5 do? Does it wait or does it immediately follow line 4 addl command?

There is no Forwarding, jump forshadowing and in the beginning pipepline is empty.

  • 1
    $\begingroup$ Wrong. Command 4 doesn't wait until command 3 went through the pipeline completely. In fast implementations, command 4 will pick up "move $3" result directly without having to wait until it is written to edx. Writeback will be a separate stage. $\endgroup$ – gnasher729 Aug 21 '16 at 13:11
  • $\begingroup$ Making additional assumptions to be able to tell another person is wrong is a none sensical. Also you didn't answer my question. If you are however completely convinced you are right, than you are always allowed to prove my lecturer wrong. $\endgroup$ – Imago Aug 21 '16 at 14:06
  • $\begingroup$ Of course I didn't answer your question. It's a comment. Not an answer. Had I wanted to post an answer, I would have posted an answer. $\endgroup$ – gnasher729 Aug 21 '16 at 21:29
  • $\begingroup$ I can't say whether gnasher729 is right or wrong, but there's nothing non-constructive, nonsensical, or unhelpful about telling someone that the question is based on faulty premises / a misunderstanding. gnasher729's comment isn't claimed to be an answer to your question. Comments are intended, for example, to leave constructive criticism to help improve the post or leave information that may relevant to anyone answering or anyone else coming across this question. See cs.stackexchange.com/help/privileges/comment. $\endgroup$ – D.W. Aug 21 '16 at 22:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.