Instruction
PREFETCHT2
Hints that the cache line holding a byte of memory should be fetched into the third-level cache and higher.
- Extensions
- Forms
- 1 (1 Legacy)
- Data
- Intel XED v2026.08.23
PREFETCHT2 asks the processor to bring the cache line holding a byte into the cache, but only as close as the level 3 cache, or wherever the processor chooses: Intel’s entry gives T2 both. It is the T2 hint of the instruction that PREFETCHT0 describes, 0F 18 with 3 in the ModRM reg field, a hint that changes no register, flag or memory and never faults. On Zen 5 it ran without an exception for the probe’s buffer, for an unmapped address near 0 and for a kernel address. PREFETCHT1 covers the T1 hint, and the encoding table in Appendix B of Intel’s Volume 2 shifts T2 by a level in the same way, calling it a prefetch to the second level cache.
Two vendors, two meanings
Intel’s optimization manual tables the hints per processor family (Tables 9-1 to 9-3): T2 fills the level 2 cache and not level 1 on the Core Duo, the Core 2, the Atoms and Skylake, and levels 2 and 3 on the Xeon Scalable processors, and a note says that T1 and T2 are implemented alike on every Intel microarchitecture. AMD’s guide for Zen 5 gives T2 a level of its own: the line goes into the L3 cache and nowhere closer, while T1 also fills the L2 (Table 8). So on Zen 5 the hint keeps a line out of the L1 and L2 caches, which no hint does in Intel’s tables.
From C
GCC 14 and Clang 23 at -O2 emit PREFETCHT2 for
_mm_prefetch(p, _MM_HINT_T2) and for __builtin_prefetch(p, 0, 1),
locality 1; with rw set to 1 they emit PREFETCHT2 as well, unless
PREFETCHW is enabled. In a loop that prefetches a fixed distance ahead,
Clang unrolls and keeps one PREFETCHT2 per element, as it does for T1;
GCC keeps one per pass.
In the optimization guide
What the optimization guide says about PREFETCHT2, a line per claim. Each links to the claim in the guide, with its sources and where they differ.
Memory
- Software prefetch: A prefetch instruction asks for the 64-byte line holding its address and changes nothing a program can see.
- Software prefetch: Each core decides which caches each prefetch hint fills, and Intel’s and AMD’s cores differ.
- Software prefetch: Software prefetch pays where the hardware cannot see the pattern and the data is not in the cache already.
Zen 5
- Loads, stores and caches: PREFETCHT0 fills every data cache level, PREFETCHT1 all but the L1, and PREFETCHT2 all but the L1 and L2.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
PREFETCHT2 m8
PREFETCHT2_MEMmprefetch | 0F 18 /3 | Base instruction set |
Latency and throughput
| Model | m8 |
|---|---|
| Sandy Bridge, Haswell, Broadwell, Skylake, Skylake-SP, Ice Lake | 5 / 0.5p23 |
| Alder Lake, Sapphire Rapids | 0 / 0.33p2 p3 p10 |
| Lunar Lake | 0 / 0.33p20 p21 p22 |
| Bonnell | 1 / 1p0 |
| Silvermont | 3 / 1MEC |
| Piledriver | 5 / 1AGLU01 Load |
| Zen | 4 / 0.5AGU0 AGU1 |
| Zen 2 | 4 / 0.33AGU0 AGU1 AGU2 |
| Zen 3, Zen 4 | 5 / 0.33AGU0 AGU1 AGU2 LSU Load |
| Jaguar | 3 / 1LAGU |
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
pass # T2: into the third level and up, or
# as the processor chooses; AMD's
# processors take it as T0
# no fault for any addressRun on AMD Zen 5 (EPYC 9645): 3 cases.
Operands
| Operand | Kind | Action |
|---|---|---|
PREFETCHT2 m8 | ||
m8 | explicit | read |
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
- memory operand only names cache lines
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 |
|---|---|---|
SSE_PREFETCH | No CPUID bit: part of the base instruction set. | Every x86-64 processor in XED’s model and Zen 3 to Zen 6 |
More SSE 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-414 (PREFETCHh)
- Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 1 (253665-093, September 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.