Speculative Execution Flashcards

1
Q

Define speculative execution

A

A performance technique where the processor busses the outcome of condition operations, such as branch instructions and begins excepting instructions ahead of time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the goal of speculative execution

A

Goal is to keep the processor’s pipeline filled with instructions, improving efficiency and mining idle time while waiting for decisions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How does Speculative work

A
  • Processor keeps track of the state of registers, memory, and other resources
  • If the speculative is correct, the results are committed to the processor’s architectural state (i.e. the final state visible to software)
  • If the speculative is incorrect, the speculative instructions are discarded, the pipeline is flushed, and the processor rolls back to the correct state before the branch, restating execution from the correct path
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is speculative execution based off

A

previous branch executions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does speculative execution improve CPU performance

A

By executing instructions ahead of time based on branch predictions, speculative execution minimizes idle cycles and increases throughput, allowing the CPU to work on multiple tasks simultaneously

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What role does branch prediction play in speculative execution?

A

Branch prediction estimates which path a conditional branch will take. The CPU then speculatively executes instructions along the predicted path and later discards the results if the prediction was incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a rollback in the context of speculative execution?

A

A rollback is the process by which the CPU discards the results of speculatively executed instructions when it turns out the branch prediction was wrong, ensuring that no incorrect data affects the program’s state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is in-order execution

A

Instructions are executed in the exact sequence they appear in the program.
If one instruction is delayed (e.g. waiting for a memory load), the entire pipeline can stall, waiting for an instruction to complete

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is out-of-order execution

A

the processor does not have to wait fro earlier instructions to complete if later instructions are ready to execute
It can bypass stalled instructions and execute other that have necessary resources and data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly