Out-of-order instruction execution: is commit order preserved?

TL:DR: memory ordering is not the same thing as out of order execution. It happens even on in-order pipelined CPUs. In-order commit is necessary1 for precise exceptions that can roll-back to exactly the instruction that faulted, without any instructions after that having already retired. The cardinal rule of out-of-order execution is don’t break single-threaded code. … Read more

Difference between core and processor

A core is usually the basic computation unit of the CPU – it can run a single program context (or multiple ones if it supports hardware threads such as hyperthreading on Intel CPUs), maintaining the correct program state, registers, and correct execution order, and performing the operations through ALUs. For optimization purposes, a core can … Read more

Can a speculatively executed CPU branch contain opcodes that access RAM?

The cardinal rules of speculative out-of-order (OoO) execution are: Preserve the illusion of instructions running sequentially, in program order Make sure speculation is contained to things that can be rolled back if mis-speculation is detected, and that can’t be observed by other cores to be holding a wrong value. Physical registers, the back-end itself that … Read more