What is Micro-operation?

A simple internal operation into which a CPU decodes an instruction, also written μop. x86 CPUs split complex instructions into μops and execute them with RISC-like fast techniques.

Field: ISA & Assembly

Japanese name: マイクロオペレーション

Why instructions are split

x86 instructions range from 1 to 15 bytes in length and vary widely in what they do. A single instruction may read a value from memory, compute, and write the result back to memory. Handling such instructions as they are makes it hard to build a pipeline and the machinery for executing instructions out of order. When decoding, therefore, the processor splits instructions into simple operations of uniform shape. An instruction that adds a register to a memory value and writes it back is split into a read, an addition and a write.

Related mechanisms

Decoding takes effort, so the micro-operations produced by decoding are kept in a dedicated cache and decoding is skipped when the same instructions repeat. Very complex instructions are replaced by a long sequence of operations held in an internal ROM. There are also techniques that combine. A compare instruction and the branch that depends on its result often appear together, so the two are treated as one operation. The sizes of resources inside the processor are counted in micro-operations, not instructions.

In RISC processors too

High-performance Arm and RISC-V processors also split some instructions into several operations or fuse two instructions into one. Their internal execution machinery closely resembles that of x86 processors. The remaining difference is mainly the effort of decoding instructions. The ISA, which is the contract visible to programs, and the microarchitecture, which is the internal construction, need to be considered separately.

Try it: questions about Micro-operation

Which statement is correct about designs like x86, where an arithmetic instruction such as "add eax, [rbx]" can use a memory value directly?

  1. AFewer instructions are needed, but one instruction includes both a memory read and an operation
  2. BIt is called a load-store architecture
  3. COperations on memory values always take the same time as register-to-register ones
Show answer and explanation

Answer: A. Fewer instructions are needed, but one instruction includes both a memory read and an operation

x86 can "load from memory and add" in one instruction, whereas RISC-V needs two, lw and add. Instruction counts and code tend to be smaller, but the amount of work per instruction varies widely, which makes pipelining harder. So high-performance x86 CPUs internally split such instructions into simple operations (micro-operations), such as a load and an add, and execute those.

How do high-performance x86 CPUs execute complex instructions internally?

  1. AThey execute every instruction one at a time in a software emulator
  2. BThey decode instructions into simple, RISC-like micro-operations and execute those in a pipeline
  3. CThey cannot run complex instructions, so the OS stops them with an error
Show answer and explanation

Answer: B. They decode instructions into simple, RISC-like micro-operations and execute those in a pipeline

x86 CPUs break variable-length, complex instructions into simple operations called micro-operations (μops) in the front-end decoder, and the back end executes them out of order. Some CPUs keep a μop cache so decoded μops can be reused without decoding again. This lets them keep compatibility with existing software while using the same fast execution techniques as RISC designs.

FAQ

Is microcode the same thing?

No. Microcode is the sequences of operations, recorded inside the processor, that implement complex instructions. A micro-operation is one of those individual operations.

Are micro-operations visible to a program?

Not directly. The number executed can, however, be examined with the counters that measure processor performance.

Books on ISA & Assembly Ad

As an Amazon Associate I earn from qualifying purchases.

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary