Extensions
Forms
1 (1 Legacy)
Data
Intel XED v2026.08.23

CLFLUSH removes the cache line holding a byte from every cache in the system, writing it back to memory first if a cache holds it modified. Memory keeps its value; what changes is where the data lives, which matters to code that shares memory with devices that do not snoop the caches, and to code that must make data durable in persistent memory, for which Intel’s optimization manual recommends CLFLUSHOPT, or CLWB where the data will be used again (Section 12.4). CLFLUSHOPT and CLWB are the faster and the non-evicting variants.

Not a hint

Unlike a prefetch, CLFLUSH is checked like a 1-byte load: user code may run it, but only on memory it can read. On Zen 5 it ran without a fault on a mapped line, and raised #PF for an unmapped address near 0 and for a kernel address, where PREFETCHT0 went on without a fault. Like a load, it sets the page’s accessed bit but not its dirty bit. The size of a line is in CPUID leaf 1, EBX bits 15:8, in units of 8 bytes, typically 64 bytes. A buffer is flushed line by line; _mm_clflush(p) in a loop that steps by 64 compiles to one CLFLUSH per line in GCC 14 and Clang 23.

Ordering differs between vendors

Intel’s manual orders CLFLUSH with every write, every other CLFLUSH, locked instructions and fences, but not with CLFLUSHOPT or CLWB; its optimization manual adds that the MFENCE older manuals required after CLFLUSH is no longer needed (Section 9.4.6). AMD’s manual is weaker: on processors with CLFLUSHOPT, such as Zen 5, CLFLUSH is ordered with writes, CLFLUSH and CLFLUSHOPT only for the same line, and with fences and locked instructions; on older ones it is weakly ordered and needs MFENCE before and after. Loads and prefetches can bring a line back at any time on both. Code meant for either vendor therefore puts MFENCE after a flush loop, as both compilers emit for _mm_mfence().

Speed

Intel’s manual finds CLFLUSHOPT with a final SFENCE much faster than CLFLUSH for buffers larger than a few KB, and advises CLFLUSH in smaller chunks where only it is available (Section 9.4.7). The instruction table of AMD’s Zen 5 guide lists CLFLUSH as microcoded and CLFLUSHOPT as one macro-op.

CLFLUSH has its own CPUID bit, CLFSH (leaf 1, EDX bit 19), which every x86-64 processor sets.

In the optimization guide

What the optimization guide says about CLFLUSH, a line per claim. Each links to the claim in the guide, with its sources and where they differ.

Memory

Forms

Every encoding of CLFLUSH that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
CLFLUSH m8 CLFLUSH_MEMmprefetchNP 0F AE /7CLFSH

Latency and throughput

What the scheduling models of LLVM 23.1.2 give for each form, not measurements: latency / reciprocal throughput in cycles, the ports under them. A row is a model, or models that agree; a dash, a form that its processors lack. Memory forms: latency from the address, ports without the load and store units. Which processors each model covers.
Modelm8
Sandy Bridge5 / 1p015
Haswell, Broadwell, Skylake, Skylake-SP, Ice Lake2 / 1p0156
Alder Lake, Sapphire Rapids2 / 0.5p0 p1 p5 p6 p11
Lunar Lake2 / 0.5p012345
Bonnell1 / 1p0
Silvermont3 / 1MEC
Piledriver5 / 1AGLU01 Load
Zen4 / 0.5AGU0 AGU1
Zen 24 / 0.33AGU0 AGU1 AGU2
Zen 3, Zen 45 / 0.33AGU0 AGU1 AGU2 LSU Load
Jaguar3 / 1LAGU

Operation

What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.

a = src.address                  # DS:, or a segment prefix's base
if not canonical(a):
    fault(GP, 0)                 # #SS(0) through RSP or RBP
if not readable(a):
    fault(PF)                    # the checks of a 1-byte read, which
                                 # an execute-only segment passes; the
                                 # A bit of the page is set, not D
# the line leaves every cache of the coherence domain, written back
# to memory first where a cache holds it modified; memory keeps its
# value. Ordered with writes, fences, locked instructions and other
# CLFLUSHes, not with CLFLUSHOPT or CLWB (Intel's manual). AMD's
# orders it with writes, CLFLUSHes and CLFLUSHOPTs only to the same
# line where CLFLUSHOPT exists, and weakly where it does not

Run on AMD Zen 5 (EPYC 9645): 3 cases.

Operands

What each form reads and writes, as Intel XED records it: the operands of its syntax, in order, and the implicit ones that the syntax does not name. How to read.
OperandKindAction
CLFLUSH m8
m8explicitread

Flags

None: XED records no flag that the forms test or change.

Attributes

What else XED records about the forms. How to read.

All forms
may abort a TSX transaction

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.

CPUID requirements and processors of the XED ISA sets above. Alternatives are separated by “or”; processors follow XED’s chip model, whose AMD processors end with Zen 2, and the CPU data of this site for Zen 3 to Zen 6.
ISA setCPUIDProcessors
CLFSH

CLFSH
CPUID.01H:EDX[19] CLFSH

Every x86-64 processor in XED’s model and Zen 3 to Zen 6

Sources

  1. Intel XED v2026.08.23 (commit 0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model.
  2. The CPU data of x86-64.net: Zen 3 to Zen 6, from GCC’s -march feature sets and AMD’s Processor Programming References, which the page of each processor cites.
  3. LLVM 23.1.2's x86 scheduling models (commit 85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them.
  4. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2A, page 3-144 (CLFLUSH)
  5. AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and System Instructions (24594, rev. 3.39, October 2026)
  6. Intel 64 and IA-32 Architectures Optimization Reference Manual, Volume 1 (248966-051, October 2026)
  7. 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.