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

XSETBV writes EDX:EAX into the extended control register that ECX selects; bits 63:32 of RCX, RAX and RDX are ignored. The only register it writes is XCR0, the set of state components that the operating system manages with the XSAVE instructions and lets programs use. The operating system sets it after CR4.OSXSAVE, and programs read the result with XGETBV. XCR1, which XGETBV can read, is read-only here: XSETBV with ECX = 1 raises #GP(0), as does any other ECX but 0.

The rules for XCR0

A bit may be set only if CPUID leaf 0DH, sub-leaf 0, reports it in EAX (or EDX for the upper half); anything else is a reserved bit and raises #GP(0). The components must also come in usable sets, or XSETBV raises #GP(0):

  • bit 0, x87, must always be set;
  • bit 2, AVX, needs bit 1, SSE;
  • bits 3 and 4, MPX, go together;
  • bits 5 to 7, AVX-512, go together and need bits 1 and 2;
  • bits 17 and 18, AMX tile configuration and data, go together.

Setting a bit is what lets programs run the instructions of that state: with XCR0 bit 2 clear, AVX instructions raise #UD even where CPUID reports AVX, and the same holds for AVX-512 and AMX, whereas SSE instructions run whatever bit 1 says. Clearing a bit keeps the state in the registers but, in Intel’s manual, may slow SSE and AVX instructions if that state is not in its initial configuration. AMD’s manual adds bit 62, through which an operating system makes its LWP extension available.

Privilege and virtualization

XSETBV runs at CPL 0 or in real mode, and raises #GP(0) elsewhere; it raises #UD while CR4.OSXSAVE is clear, on a processor without XSAVE, and with a LOCK prefix. In a guest under Intel’s VMX it always causes a VM exit, reason 55, so that the hypervisor decides which components the guest may enable; AMD’s SVM has an intercept bit for it. The probe does not run it, being a CPL 3 program; the XGETBV page shows the XCR0 that the probe’s Linux guest set on Zen 5. GCC 14 and Clang 23 offer _xsetbv(0, v) with -mxsave or a -march that has XSAVE, compiling it to a split of v into EDX:EAX, ECX cleared and XSETBV. AMD’s Zen 5 guide lists XSETBV as microcoded.

Forms

Every encoding of XSETBV that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
XSETBV XSETBVNP 0F 01 D1XSAVE + OSXSAVE

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.
ModelXSETBV
Sandy Bridge100 / 0.33p015
Haswell, Broadwell, Skylake, Skylake-SP, Ice Lake5 / 1.25p0156
Alder Lake, Sapphire Rapids5 / 10.8p0 p1 p5 p6 p11
Lunar Lake5 / 8.67V0 V1 V2 V3 p0 p1 p2 p3 p4 p5
Piledriver100 / 0.5EX0 EX1
Zen, Zen 2100 / 0.25
Zen 3, Zen 4100 / 25ALU0 ALU1 ALU2 ALU3
Jaguar100 / 0.5ALU0 ALU1

Operation

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

if CPL > 0 or ecx != 0:              # XCR0 is the only one it writes
    fault(GP, 0)
v = edx << 32 | eax
r = cpuid_leaf(0xD, 0)               # the user components there are
if v & ~(r[3] << 32 | r[0]):
    fault(GP, 0)
if not v & 1 or v & 6 == 4:          # x87 always; AVX only with SSE
    fault(GP, 0)
if v & 0x18 not in (0, 0x18):        # MPX's two together
    fault(GP, 0)
if v & 0xE0 and v & 0xE6 != 0xE6:    # AVX-512's three together, with
    fault(GP, 0)                     # AVX and SSE
if v >> 17 & 1 != v >> 18 & 1:       # AMX's two together
    fault(GP, 0)
xcr0 = v

Not run on a processor: XSETBV runs at CPL 0 only.

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
XSETBV
ECXimplicitread
EDXimplicitread
EAXimplicitread
XCR0implicitwrite

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
privileged: CPL 0 only; 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
XSAVE

XSAVE + OSXSAVE
CPUID.01H:ECX[26] XSAVE
CPUID.01H:ECX[27] OSXSAVE

XED and Intel’s SDM differ: XED also asks for the OSXSAVE bit, CPUID.01H:ECX[27], besides XSAVE, CPUID.01H:ECX[26], for XSAVE, XRSTOR, XGETBV and XSETBV. The opcode tables of revision 093 of Intel’s SDM name XSAVE alone for XSAVE and XRSTOR and give XGETBV and XSETBV no CPUID column, but the exception lists of all four raise #UD when CR4.OSXSAVE is clear, and its Volume 1 says that the OSXSAVE bit returns CR4.OSXSAVE, so in effect the two agree.

Sources: Intel XED v2026.08.23, datafiles/cpuid.xed.txt; Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026), XSAVE, XRSTOR, XGETBV and XSETBV: the opcode tables and the exception lists, from pages 6-58, 6-49, 6-36 and 6-70; Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 1 (253665-093, September 2026), section 13.3, Enabling the XSAVE Feature Set and XSAVE-Enabled Features, page 13-6.

Sandy Bridge, Ivy Bridge, Haswell, Broadwell, Skylake, Comet Lake, Cannon Lake, Ice Lake (client), Tiger Lake, Alder Lake, Arrow Lake, Panther Lake, Nova Lake, Skylake-SP, Cascade Lake, Cooper Lake, Ice Lake (server), Sapphire Rapids, Emerald Rapids, Granite Rapids, Diamond Rapids, Goldmont, Goldmont Plus, Tremont, Snow Ridge, Lakefield, Sierra Forest, Clearwater Forest, Knights Landing, Knights Mill, Bulldozer, Piledriver, Zen, Zen+, Zen 2, Zen 3, Zen 4, Zen 5, Zen 6

More XSAVE instructions

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 2D, page 6-70 (XSETBV)
  5. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 1 (253665-093, September 2026)
  6. Linux kernel documentation: Using XSTATE features in user space applications
  7. Intel Advanced Performance Extensions (Intel APX) Architecture Specification, revision 9.0 (355828-009, August 2026)
  8. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 3 (325384-093, September 2026)
  9. AMD64 Architecture Programmer's Manual, Volume 2: System Programming (24593, rev. 3.46, October 2026)
  10. 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.