top of page
Girl with Tablet

Drawbacks of out of order execution

As we saw in the last tutorial, out-of-order execution improves performance, but it also poses several difficulties and issues. The following are some typical issues brought on by out-of-order execution:

​

Data dependencies:

Independent instructions must be found and carried out concurrently for out-of-order execution to work. To provide accurate results, the execution order must be preserved if there are dependencies between instructions, such as data dependencies. Incorrect results may result from out-of-order execution if the dependencies are not adequately managed.

For example let's look at following instructions:

1:  ADD R1, R2, R3
2:  SUB R4, R1, R5
3:  MUL R6, R1, R7

The result of instruction 3 (MUL), which depends on the result of instruction 2 (SUB), would be wrong if the processor carried out instruction 3 before instruction 2 as a result of out-of-order execution.

​

Branch Instructions:

Branch instructions introduce control flow requirements, such as conditional branches or jumps. Based on a condition, these instructions choose the subsequent instruction to be executed. Branch instructions present difficulties for out-of-order execution since the processor must forecast the branch conclusion in order to continue fetching and executing instructions.
If the CPU had executed instructions speculatively (on the assumption that a particular branch outcome will occur), wasteful computation would have occurred, and the incorrect results would have had to be discarded.

Resource Requirements: In order to execute instructions concurrently, out-of-order execution requires enough hardware resources, such as execution units, register files, and cache. The amount of parallelism that may be accomplished at the instruction level may be constrained by resource constraints that act as a bottleneck.

​

The CPU must prioritize and schedule instructions if there are more ready-to-execute instructions than resources, which could result in delays and lower performance as a whole.

Instruction Synchronization:

When out-of-order execution comes across instructions that have side effects, including memory access or input/output activities, instruction synchronization becomes a problem. To guarantee correctness, the processor must make sure that these instructions are carried out in the original program order.
Incorrect values may be saved in memory if, for instance, two instructions that write to the same location in memory are executed out of sequence.

Out-of-order execution necessitates complex hardware methods, such as register renaming, dependency tracking, branch prediction, and memory ordering protocols, to solve these issues. These mechanisms increase design complexity and burden.

To understand about these methods, let's look into next tutorial. 

​

bottom of page