Optimizing code for Intel Redwood Cove
What Intel’s Redwood Cove core, the P-core of Meteor Lake and the core of Granite Rapids, does differently from Golden Cove, from Intel’s optimization manual and LLVM’s models, with the places where they disagree; for everything the manual leaves unchanged, the Golden Cove page holds the numbers.
- Microarchitectures
- Intel Meteor Lake, Intel Granite Rapids
- Claims
- 25, 4 with a source that differs
The core in numbers
- Processors
- The cores of the 6th generation Xeon Scalable processors (Granite Rapids), under whose heading Intel’s manual describes Redwood Cove, and the P-cores of the 1st generation Core Ultra (Meteor Lake), the client part the manual lists beside them. Linux’s table of Intel models names Redwood Cove as the core of both, with Crestmont as Meteor Lake’s E-core, another design, which has its own page. [Linux 7.2 x86, include/asm/intel-family.h, line 127; Linux 7.2 x86, include/asm/intel-family.h, line 145; Intel 248966, Chapter 1, Table 1-1, page 1-3; Intel 248966, Sections 2.1 and 2.1.1, pages 2-1 and 2-2; Intel 248966, Section 4.1, page 4-1]
- Sources
- Intel’s manual describes Redwood Cove only by a list of what it changes from Golden Cove; widths, ports, buffers and latencies it does not name are known only for Golden Cove. Agner Fog’s manual stops at Alder Lake among Intel’s big cores. [Intel 248966, Section 2.1.1, pages 2-1 and 2-2; Agner Fog, Contents and Chapter 13, page 173]
- Compiler models
- LLVM schedules
-march=meteorlakewith its Alder Lake P-core model and-march=graniterapidswith its Sapphire Rapids model, the two Golden Cove models, so what it says of Redwood Cove is what it says of Golden Cove. [LLVM 23.1.2, X86.td, line 2123; LLVM 23.1.2, X86.td, line 2144] - L1 instruction cache
- 64 KB per core, twice Golden Cove’s 32 KB, one of several changes Intel made for programs with a large code footprint. [Intel 248966, Section 2.1.1, page 2-1]
- L2 cache
- 2 MB per core on the client parts, against 1.25 MB on Alder Lake. [Intel 248966, Section 2.1.1, page 2-2]
- L2 misses in flight
- 64, against 48 on Golden Cove. [Intel 248966, Sections 2.1.1 and 2.1.1.4, pages 2-2 and 2-4]
- Branch misprediction
- Intel says the core predicts branches better and recovers from a misprediction sooner on average, without numbers. [Intel 248966, Section 2.1.1, page 2-1]
Front end
The micro-op queue in front of allocation holds 192 micro-ops for one thread or 96 for each of two, up from 144 and 72, so the loop stream detector can replay larger loops without the decoders or the micro-op cache. The front-end chapter compares the sizes of other cores. [Intel 248966, Section 2.1.1, page 2-1]
Granite Rapids, not Meteor Lake, adds PREFETCHIT0 and PREFETCHIT1, which fetch code ahead of a jump to it: the first into every cache level, the second into all but the L1. They take only a RIP-relative address, best one where an instruction starts, and are no-ops in any other form and on processors without them (CPUID leaf 7, subleaf 1, EDX bit 14). [Intel 248966, Section 2.1.1, page 2-1; Intel 325383, Chapter 4, PREFETCHh, pages 4-414 and 4-415; LLVM 23.1.2, X86.td, line 1270]
A register-to-register mov followed by an operation that overwrites the moved-to register, as mov rax, rbx then sub rax, rcx, becomes one micro-op computing rbx - rcx into RAX: the three-operand form the instruction set lacks, with one slot from the queue to retirement. It works only for code delivered by the micro-op cache, never for the decoders. Zen 5 fuses such pairs too. [Intel 248966, Section 2.1.1.3, Table 2-1, page 2-3]
A load into a register followed by an operation on that register and another one fuses likewise into a single load-and-operate micro-op, even where no instruction encodes the pair, as with mov eax, [mem] then sub eax, ebx. Again only code from the micro-op cache fuses. [Intel 248966, Section 2.1.1.3, Table 2-2, page 2-3]
The fused load must be a plain mov of 32 or 64 bits (opcode 8Bh, no sign extension) or a legacy SSE movaps, movapd, movups, movupd, movdqa or movdqu; its address may have no index register and may not be RIP-relative. The operation must be an integer one of that width or a 128-bit packed one, and its other source must be a register other than the destination, not an immediate. Nothing with a VEX or EVEX prefix fuses, so the pair fuses in SSE code and not in the same code compiled for AVX. [Intel 248966, Section 2.1.1.3, page 2-4]
Branches
A conditional jump with a 3Eh prefix is a taken hint: when the predictor holds nothing on the branch, the decoder turns its default not-taken guess into taken and fetches from the target. A taken branch then costs a redirection at decode instead of a misprediction found at execution; a branch that is not taken pays both. Golden Cove ignores the prefix. [Intel 248966, Section 2.1.1.1, page 2-2]
The hint applies to Jcc only, not to jrcxz or loop. A 2Eh not-taken prefix is decoded and ignored, and an instruction that has a 3Eh prefix is hinted taken whatever other prefixes it carries, 2Eh included. [Intel 248966, Section 2.1.1.1, page 2-2]
Hints pay on branches that run rarely and are mostly taken, where the predictor has likely forgotten them, as in programs with more branches than the predictor holds; on a hot branch it only makes the code longer. Intel leaves their placement to profile-guided compilers, and LLVM emits them only on request and for Granite Rapids. [Intel 248966, Section 2.1.1.1, page 2-2; LLVM 23.1.2, X86.td, line 1273]
New events find candidates: FRONTEND_RETIRED.ANY_ANT counts retired conditional branches that were predicted not taken for want of history, FRONTEND_RETIRED.MISP_ANT those of them that were mispredicted, against BR_INST_RETIRED.COND for all of them; branch records sampled with the first two tell which way each branch usually goes. [Intel 248966, Section 2.1.1.2, page 2-3]
Execution, vectors and AMX
Floating-point multiplication takes three cycles, one fewer than on Golden Cove, where an addition takes three but can feed another in two. Intel says nothing of FMA. [Intel 248966, Section 2.1.1, page 2-2]
Meteor Lake, in LLVM’s -march=meteorlake, has the instruction set of Alder Lake: AVX2 and AVX-VNNI, without AVX-512 or AMX. Granite Rapids has Sapphire Rapids’, AVX-512 and AMX included, plus AMX-FP16 and the code prefetches; its D parts add AMX-COMPLEX. [LLVM 23.1.2, X86.td, line 2123; LLVM 23.1.2, X86.td, line 1269; LLVM 23.1.2, X86.td, line 1277]
On Granite Rapids, AMX also multiplies tiles of half-precision values, with TDPFP16PS; Intel’s manual gives its rates only for the older tile operations. [Intel 248966, Section 2.1.1, page 2-2]
Intel says locked instructions got faster, and two threads on one core run better together, without numbers for either. [Intel 248966, Section 2.1.1, page 2-2]
Loads, stores and prefetchers
A core can draw more memory bandwidth than Golden Cove, from the deeper L2 miss queue and new prefetchers: one for arrays of pointers, and one that fills the L3 with whole pages ahead of a stream. [Intel 248966, Section 2.1.1.4, page 2-4]
The array-of-pointers prefetcher watches a load that steps through memory with a constant stride, takes each value it loads as an address, and prefetches the data there, as for p[i]->field in a loop over i. [Intel 248966, Section 2.1.1.5, Figure 2-1, page 2-4]
It follows only a 64-bit integer load aligned to 8 bytes, whose result is the base register of the second load, with no index register. It prefetches the line the pointer points to, ignoring the offset of the second load, and does nothing for an offset over 32 bytes, so a small offset or none works best. Bit 7 of MSR 1A4h turns it off. [Intel 248966, Section 2.1.1.5, page 2-5]
The L3 page prefetcher sees a stream near the end of a 4 KB page, in either direction, and brings the page two pages ahead into the L3, all of it, without using L1 or L2 buffers. It helps streams over more than 8 KB and may waste bandwidth on shorter ones; bit 6 of MSR 1A4h turns it off. [Intel 248966, Section 2.1.1.6, page 2-5]
Measuring
Like Golden Cove, each core has eight general-purpose counters, but it counts 11 architectural events, against 8 on Golden Cove: the measuring chapter says how to use them. [Intel 325384, Section 22.3.11.1, Table 22-57, pages 22-81 and 22-82]
Sources
- The Linux kernel developers: Linux: the kernel's x86 architecture code, commit 8d3ae59288f1 of 16 August 2026 (github.com/torvalds/linux,
arch/x86). The release of linux-docs (v7.2). include/asm/intel-family.h names the cores of each Intel processor model and the core types of CPUID leaf 1Ah, include/asm/cpufeatures.h the hybrid bit of CPUID leaf 7. GPL-2.0; facts only. - Intel: Intel 64 and IA-32 Architectures Optimization Reference Manual, Volume 1, 248966, revision 051, October 2026. Chapter 2 describes Golden Cove and its Sapphire Rapids and Alder Lake parts and, in Sections 2.6 and 2.7, the Skylake server and client cores; Chapter 3 gives the general rules with the cases specific to them, Chapters 15 and 17 AVX and AVX-512, Chapter 20 AMX. Citations give the printed page and link the physical page of the PDF.
SHA-256
284783f5f6541a60; no derivatives; facts only. - Agner Fog: The microarchitecture of Intel, AMD, and VIA CPUs: An optimization guide for assembly programmers and compiler makers, 23 May 2026. Agner Fog’s measurements and descriptions, cited one fact at a time. Its URL always serves the latest version, so citations give the section and the page of the version of the date above as text instead of linking to the page.
SHA-256
75bcd395680df474; no redistribution; facts only. - The LLVM Project: LLVM: the X86 target's processor definitions and scheduling models, commit 85ac56026243 of 20 September 2026 (github.com/llvm/llvm-project,
llvm/lib/Target/X86). The release pinned in docker/Dockerfile, whose Clang the instruction reference uses. X86.td names the scheduling model of each -march, and X86Sched*.td hold the models. Apache-2.0 WITH LLVM-exception. - Intel: Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2, 325383, revision 093, September 2026. The instruction reference: what RDTSC, RDTSCP, RDPMC and CPUID wait for and how to order them. Citations give the printed page and link the physical page of the PDF.
SHA-256
d137a7887787bbb0; no derivatives; facts only. - Intel: Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 3, 325384, revision 093, September 2026. The system programming guide: the time-stamp counter (Section 20.17), performance monitoring (Chapter 22), APERF and MPERF (Chapter 17) and the TSC of virtual machines (Chapters 27 and 28). Citations give the printed page and link the physical page of the PDF.
SHA-256
77919be320f35da2; no derivatives; facts only.