0

At the university, we were told that the processor can change instructions in places to speed up work. For example, if he already has all the data to compute, this can happen.

What kind of operations can the processor swap? Download and write data only? Do different comparisons for conditions or loops fall here?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Ta3ik
  • 13
  • 1
  • 2
  • 1
    It sounds like you're talking about out-of-order execution. See [Modern Microprocessors A 90-Minute Guide!](http://www.lighterra.com/papers/modernmicroprocessors/). Yes, modern CPUs run the oldest instruction whose operands are ready, so parallelism is only possible when instructions are independent. As in [Difference between In-oder and Out-of-order execution in ARM architecture](https://stackoverflow.com/q/24786922) / [How are x86 uops scheduled, exactly?](https://stackoverflow.com/q/40681331) – Peter Cordes Dec 03 '21 at 09:37
  • [Understanding the impact of lfence on a loop with two long dependency chains, for increasing lengths](https://stackoverflow.com/q/51986046) is a specific experiment showing OoO exec of two long dep chains, but the Q&A is very technical and assumes readers already know OoO exec basics. See also [What considerations go into predicting latency for operations on modern superscalar processors and how can I calculate them by hand?](https://stackoverflow.com/q/51607391) and especially for an introductions, **[this answer](https://softwareengineering.stackexchange.com/a/350024/165079)** – Peter Cordes Dec 03 '21 at 09:48
  • [Are loads and stores the only instructions that gets reordered?](https://stackoverflow.com/q/50494658) is probably a good duplicate; it explains OoO exec and has a specific example of the benefit. – Peter Cordes Dec 03 '21 at 09:50

0 Answers0