Instruction
NOP
Does nothing: 90 and the multi-byte 0F 1F forms pad code for alignment, and other opcodes of 0F 18 to 0F 1F are reserved to decode as NOPs.
- Extensions
- Forms
- 28 (28 Legacy)
- Data
- Intel XED v2026.08.23
A NOP takes up bytes and does nothing else. Compiled code is full of them, almost never executed: they pad the space before a function or a loop that the compiler aligns to 16 bytes, and they reserve bytes that a tool may patch later. The single byte 90 does for one byte; for longer gaps, the multi-byte form 0F 1F /0 takes a ModRM operand whose addressing bytes make the length, and it neither reads nor writes memory, by Intel’s manual.
Long NOPs
AMD’s Zen 5 guide advises fewer, longer NOPs rather than many short
ones, since every NOP still passes through decode and retirement.
Intel’s manual and optimization manual list sequences from 2 to 9 bytes
(66 90, 0F 1F 00, up to 66 0F 1F 84 00 00 00 00 00), and AMD’s Zen
5 guide continues to 15 bytes by adding 66 prefixes, while warning that
only the first of Zen 5’s four decoders takes instructions longer than
10 bytes. The assemblers our builds used fill longer gaps with a
CS-prefixed form: GCC’s (GNU as) wrote 66 66 2E 0F 1F 84 00 ...,
Clang’s added up to five 66 prefixes.
For patching, -fpatchable-function-entry=5 reserves 5 bytes at each
function’s start: GCC 14 emits five 90s, Clang 23 one 5-byte NOP, 0F 1F 44 00 08.
90 is a true NOP
90 was once XCHG EAX, EAX. In 64-bit mode that would clear bits 63:32 of RAX, so both vendors make plain 90 a real no-operation, as Zen 5 recorded; with REX.B it is still an exchange: 41 90 is XCHG R8D, EAX, which on Zen 5 cleared bits 63:32 of both (49 90 is XCHG R8, RAX). The ModRM form XCHG EAX, EAX (87 C0) does clear the upper half. F3 90 is PAUSE.
Hint space
0F 18 to 0F 1F are reserved NOPs that new features take over: the prefetches (0F 18), MPX’s bound instructions (0F 1A, 0F 1B), CLDEMOTE (0F 1C /0) and CET’s ENDBR64 (F3 0F 1E FA). Code that uses them runs unchanged, as NOPs, on processors without the feature. XED also decodes 0F 0D with a register operand as a NOP, but Zen 5 raised #UD for it: 0F 0D is AMD’s PREFETCH group, which takes memory.
By Intel’s optimization manual, only the one-byte NOP is specially handled, and a multi-byte NOP’s register operands count as inputs, so a NOP can wait for the instruction that last wrote them.
In the optimization guide
What the optimization guide says about NOP, a line per claim. Each links to the claim in the guide, with its sources and where they differ.
Front end
- Code alignment and padding: Padding that runs is not free: a NOP uses no execution unit but still passes through decode and the retire queue, so a few long NOPs cost less than many short ones, and only a very long stretch of padding is better jumped over.
- Code alignment and padding: How long a NOP may be depends on the core: up to 15 bytes, made by adding 66h prefixes to the 8-byte form, on Zen 3 to Zen 5 (Zen 5), while AMD’s Family 15h slows down with more than three 66h prefixes, so code for every AMD processor stops at 11 bytes.
- Code alignment and padding: Zen 4 fuses a NOP with the instruction next to it, or two NOPs together, which makes padding that runs cheaper there; Zen 5 fuses no NOPs.
Bulldozer to Excavator
- Front end: An instruction with more than three prefixes decodes over ten times slower, so padding is best made of long NOPs (0F 1F) with at most three 66h prefixes, 11 bytes each at most, as LLVM pads for these cores.
Crestmont and Gracemont
- Front end: LLVM pads code for these cores with NOPs of up to 15 bytes, which it expects them to decode quickly; its Tremont tuning does not.
Jaguar and Puma
- Front end: Unlike some older AMD cores, such as the Bulldozer family, Jaguar decodes a NOP with more than three 66h prefixes at full speed, so padding is best a run of 15-byte NOPs and then a shorter one, as LLVM pads for it.
Sandy Bridge and Ivy Bridge
- What Ivy Bridge changed: Sandy Bridge decodes the multi-byte NOP (0F 1F) only on the first of its four decoders, while a NOP padded with 66H prefixes decodes on any of them; Ivy Bridge removes that limit, decoding either form on all four at up to four a cycle.
Silvermont to Goldmont Plus
- Front end: Goldmont drops NOPs before the reservation stations; LLVM pads Silvermont code with NOPs of up to 7 bytes.
Tremont
- Front end: LLVM pads code for Tremont with NOPs of up to 10 bytes, its default when a processor’s tuning names no other length; it uses 7 for Silvermont and 15 for the later E-cores.
Zen and Zen+
- Front end: Padding costs least as a few long NOPs: Zen decodes NOPs of up to 15 bytes, the 8-byte form with 66h prefixes in front, without a penalty, while code that may also run on Family 15h processors should stop at 11 bytes.
Zen 2
- Front end: Padding is cheapest in a few long NOPs: Zen 2 decodes a NOP of up to 15 bytes, the 8-byte form with 66h prefixes added, without a penalty, while code that also runs on Family 15h processors stops at 11 bytes.
Zen 3
- Front end: Padding is cheapest in a few long NOPs: Zen 3 decodes a NOP of up to 15 bytes, the 8-byte form with 66h prefixes added, without a penalty, while code that also runs on earlier AMD processors such as Family 15h stops at 11 bytes.
Zen 4
- Front end: Padding is cheapest in a few long NOPs: Zen 4 decodes a NOP of up to 15 bytes, the 8-byte form with 66h prefixes added, without a penalty, while code that also runs on earlier AMD processors such as Family 15h stops at 11 bytes.
- Front end: A NOP and the integer instruction next to it, or two NOPs, fuse into one macro-op when together at most 15 bytes long, so padding costs less than on earlier cores. sources differ
Zen 5
- Front end: For padding, fewer and longer NOPs are better than many short ones.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
NOP r16/32/64
NOP_GPRv_0F18r0 | 0F 18 /0 | Base instruction set |
NOP r16/32/64
NOP_GPRv_0F18r1 | 0F 18 /1 | Base instruction set |
NOP r16/32/64
NOP_GPRv_0F18r2 | 0F 18 /2 | Base instruction set |
NOP r16/32/64
NOP_GPRv_0F18r3 | 0F 18 /3 | Base instruction set |
NOP r16/32/64
NOP_GPRv_0F18r4 | 0F 18 /4 | Base instruction set |
NOP m16/32/64
NOP_MEMv_0F18r5 | 0F 18 /5 | Base instruction set |
NOP r16/32/64
NOP_GPRv_0F18r5 | 0F 18 /5 | Base instruction set |
NOP r16/32/64
NOP_GPRv_0F18r6 | 0F 18 /6 | Base instruction set |
NOP r16/32/64
NOP_GPRv_0F18r7 | 0F 18 /7 | Base instruction set |
NOP m16/32/64
NOP_MEMv_0F18r4 | 0F 18 /4 (without MOVRS) | Base instruction set |
NOP m16/32/64
NOP_MEMv_0F18r6 | 0F 18 /6 (without PREFETCHI) | Base instruction set |
NOP m16/32/64
NOP_MEMv_0F18r7 | 0F 18 /7 (without PREFETCHI) | Base instruction set |
NOP m16/32/64, r16/32/64
NOP_MEMv_GPRv_0F19 | 0F 19 /r | Base instruction set |
NOP r16/32/64, r16/32/64
NOP_GPRv_GPRv_0F19 | 0F 19 /r | Base instruction set |
NOP m16/32/64, r16/32/64
NOP_MEMv_GPRv_0F1D | 0F 1D /r | Base instruction set |
NOP r16/32/64, r16/32/64
NOP_GPRv_GPRv_0F1D | 0F 1D /r | Base instruction set |
NOP m16/32/64
NOP_MEMv_0F1F | 0F 1F /r | Base instruction set |
NOP r16/32/64
NOP_GPRv_0F1F | 0F 1F /r | Base instruction set |
NOP
NOP_90 | 90 | Base instruction set |
NOP r16/32/64, r16/32/64
NOP_GPRv_GPRv_0F0D | 0F 0D /r | 3DNowPrefetch |
NOP m16/32/64, r16/32/64
NOP_MEMv_GPRv_0F1C | F2 0F 1C /066 0F 1C /066 0F 1C /rF3 0F 1C /0F2 0F 1C /rF3 0F 1C /rNP 0F 1C /rNP 0F 1C /0 (without CLDEMOTE) | Base instruction set |
NOP r16/32/64, r16/32/64
NOP_GPRv_GPRv_0F1C | 0F 1C /r | Base instruction set |
NOP r16/32/64, r16/32/64
NOP_GPRv_GPRv_0F1A | NP 0F 1A /r0F 1A /r (without MPX) | Base instruction set |
NOP r16/32/64, r16/32/64
NOP_GPRv_GPRv_0F1B | NP 0F 1B /rF3 0F 1B /r0F 1B /r (without MPX) | Base instruction set |
NOP r16/32/64, m16/32/64
NOP_GPRv_MEMv_0F1A | 0F 1A /r (without MPX) | Base instruction set |
NOP r16/32/64, m16/32/64
NOP_GPRv_MEM_0F1B | 0F 1B /r (without MPX) | Base instruction set |
NOP m16/32/64, r16/32/64
NOP_MEMv_GPRv_0F1E | 0F 1E /r | Base instruction set |
NOP r16/32/64, r16/32/64
NOP_GPRv_GPRv_0F1E | NP 0F 1E /r66 0F 1E /rF2 0F 1E /rF3 0F 1E /0F3 0F 1E /2F3 0F 1E /3F3 0F 1E /4F3 0F 1E /5F3 0F 1E F9F3 0F 1E FDF3 0F 1E FEF3 0F 1E FFF3 0F 1E /6F3 0F 1E FCF3 0F 1E F8F3 0F 1E FA (without CET)F3 0F 1E FB (without CET)F3 0F 1E /1 (without CET)F3 REX.W 0F 1E /1 (without CET)F3 REX.W 0F 1E F8 (without IBHF) | Base instruction set |
Latency and throughput
| Model | m16m32m64 | r16r32r64NOP |
|---|---|---|
| Sandy Bridge, Haswell, Broadwell, Zen, Zen 2 | 1 / 0.25 | 1 / 0.25 |
| Skylake, Skylake-SP, Ice Lake | 1 / 0.17 | 1 / 0.17 |
| Alder Lake, Sapphire Rapids, Lunar Lake | 1 / 0 | 1 / 0 |
| Bonnell | 1 / 0.5p1 | 1 / 0.5p01 |
| Silvermont | 1 / 0.5 | 1 / 0.5 |
| Piledriver | 1 / 1EX0 EX1 | 1 / 1EX0 EX1 |
| Zen 3, Zen 4 | 0 / 0.25ALU0 ALU1 ALU2 ALU3 | 0 / 0.25ALU0 ALU1 ALU2 ALU3 |
| Jaguar | 1 / 0.5ALU0 ALU1 | 1 / 0.5ALU0 ALU1 |
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
NOPpass # nothing changes: 90 is not XCHG EAX, EAX,
# which would clear bits 63:32 of RAX
Run on AMD Zen 5 (EPYC 9645): 6 cases.
NOP r/m16/32/64pass # no register, flag or memory changes
# 0F 1F /0 is the documented multi-byte NOP. 0F 18 is hint space:
# on processors with PREFETCHRST2 and PREFETCHI, /4, /6 and /7 in
# memory are those prefetchesRun on AMD Zen 5 (EPYC 9645): 84 cases.
NOP r/m16/32/64, r16/32/64 NOP r16/32/64, r/m16/32/64pass # no register, flag or memory changes
# 0F 19 to 0F 1E are hint space: on a processor with MPX, CLDEMOTE
# or CET enabled, some of these encodings are those instructions
# insteadRun on AMD Zen 5 (EPYC 9645): 72 cases.
NOP r16/32/64, r16/32/64fault(UD) # 0F 0D is PREFETCH and PREFETCHW: with a
# register operand, #UD (APM Volume 3,
# PREFETCH, rev. 3.36; Zen 5). XED
# decodes a NOP; Intel's manual
# gives 0F 0D with memory only
Run on AMD Zen 5 (EPYC 9645): 6 cases. Every one raised an exception, at CPL 3, where the probe runs.
Operands
| Operand | Kind | Action |
|---|---|---|
NOP r/m16/32/64 | ||
r/m16/32/64 | explicit | read |
NOP r/m16/32/64, r16/32/64 | ||
r/m16/32/64 | explicit | read |
r16/32/64 | explicit | read |
NOP | ||
| No operands in XED | ||
NOP r16/32/64, r/m16/32/64 | ||
r16/32/64 | explicit | read |
r/m16/32/64 | explicit | read |
Flags
None: XED records no flag that the forms test or change.
CPUID and processors
Each form belongs to an XED ISA set. A form can be used when the processor reports every CPUID bit of one of its ISA set's alternatives.
| ISA set | CPUID | Processors |
|---|---|---|
FAT_NOP | No CPUID bit: part of the base instruction set. | Every x86-64 processor in XED’s model and Zen 3 to Zen 6 |
I86 | No CPUID bit: part of the base instruction set. | Every x86-64 processor in XED’s model and Zen 3 to Zen 6 |
PREFETCH_NOP | 3DNowPrefetch | Every x86-64 processor in XED’s model and Zen 3 to Zen 6 |
PPRO | No CPUID bit: part of the base instruction set. | Every x86-64 processor in XED’s model and Zen 3 to Zen 6 |
More General-purpose instructions
- JMP
- JRCXZ
- LDS
- LEA
- LEAVE
- LES
- LFS
- LGS
- LODS
- LOOP
- LOOPE
- LOOPNE
- LSS
- MOV
- MOVS
- MOVSX
- MOVSXD
- MOVZX
- MUL
- NEG
- NOT
- OR
- OUT
- OUTS
- PAUSE
- POP
- POPA
- POPF
- PUSH
- PUSHA
- PUSHF
- RCL
- RCR
- RET
- ROL
- ROR
- SALC
- SAR
- SBB
- SCAS
All 109 General-purpose instructions
More PREFETCHW instructions
Sources
- Intel XED v2026.08.23 (commit
0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model. - The CPU data of x86-64.net: Zen 3 to Zen 6, from GCC’s
-marchfeature sets and AMD’s Processor Programming References, which the page of each processor cites. - LLVM 23.1.2's x86 scheduling models (commit
85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them. - Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2B, page 4-160 (NOP)
- AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and System Instructions (24594, rev. 3.39, October 2026)
- Intel 64 and IA-32 Architectures Optimization Reference Manual, Volume 1 (248966-051, October 2026)
- Software Optimization Guide for the AMD Zen5 Microarchitecture (58455, rev. 1.00, August 2024), Wayback Machine copy of AMD's ZIP
The tables are derived from Intel XED, Copyright Intel Corporation, licensed under the Apache License 2.0; x86-64.net converted and reformatted them. The timings come from LLVM's scheduling models, part of the LLVM Project, licensed under the Apache License 2.0 with LLVM Exceptions. The text is our own.