Instruction
VLDMXCSR
Loads the MXCSR register, the SSE control and status bits, from memory; the VEX form of LDMXCSR.
- Extensions
- Forms
- 1 (1 VEX)
- Data
- Intel XED v2026.08.23
VLDMXCSR is the VEX form of LDMXCSR, whose page describes MXCSR’s fields, the #GP for reserved bits and why a newly unmasked exception waits for the next instruction that reports it. It loads MXCSR from a doubleword in memory exactly as LDMXCSR does; the encoding only adds two #UD conditions, VEX.L set and VEX.vvvv other than 1111b. It needs AVX, and there is no EVEX form, so code built for AVX-512 loads MXCSR with this one. VSTMXCSR is the store.
Zen 5’s recorded cases:
- Over MXCSR 9FC0H, with FTZ and DAZ set, it loaded 1F80H, the value after reset.
- Over FFFFH it loaded 0, which unmasks every exception, without a fault, the flags being cleared by the same load.
- It loaded 2FFFFH, with bit 17, AMD’s misaligned-exception mask, set, and raised #GP for 11F80H, leaving MXCSR at 1F80H, as LDMXCSR’s cases do.
In compiled code
In our builds at -O2 with -mavx, -march=x86-64-v3 or x86-64-v4,
GCC 14 and Clang 23 store the argument of _mm_setcsr(v) to the stack
and load it with VLDMXCSR. For _MM_SET_FLUSH_ZERO_MODE both store
MXCSR with VSTMXCSR, set bit 15 and load it back: GCC ORs 8000h into the
stack slot itself, while Clang ORs in EAX and stores to a second slot
before loading. _MM_SET_ROUNDING_MODE follows the same pattern,
clearing bits 14:13 and setting the new mode in between.
AMD’s latency spreadsheet for Zen 5 gives VLDMXCSR one macro-op on pipe FP1, one per cycle and no latency, the cells of LDMXCSR. VSTMXCSR, two macro-ops, is listed at 0.06 to 0.07 per cycle: of the two halves of a change to MXCSR, the store has by far the lower throughput.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
VLDMXCSR m32
VLDMXCSR_MEMd | VEX.LZ.NP.0F.WIG AE /2 | AVX |
Latency and throughput
| Model | m32 |
|---|---|
| Sandy Bridge | 5 / 1p05 |
| Haswell, Broadwell, Skylake, Skylake-SP, Ice Lake | 7 / 1p0156 |
| Alder Lake, Sapphire Rapids | 7 / 1p06 |
| Lunar Lake | 7 / 0.5V0 V1 p0 p2 p4 |
| Piledriver | 5 / 0.5AGLU01 Load |
| Zen, Zen 2 | 100 / 0.25 |
| Zen 3, Zen 4 | 5 / 1.5ALU0 ALU1 ALU2 ALU3 |
| Jaguar | 3 / 1LAGU |
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
v = src.read()
if v & ~mxcsr_mask: # a bit the processor does not have
fault(GP, 0)
mxcsr = v # a flag set with its mask clear
# raises nothing here, nor later:
# an instruction raises only what
# it reports itself
Run on AMD Zen 5 (EPYC 9645): 4 cases.
Operands
| Operand | Kind | Action |
|---|---|---|
VLDMXCSR m32 | ||
m32 | explicit | read |
MXCSR | implicit | write |
Flags
None: XED records no flag that the forms test or change.
Exceptions
The exception class is XED's name for the set of exception conditions that a form follows. How to read.
- All forms
avx-type-5L
Attributes
What else XED records about the forms. How to read.
- All forms
- follows MXCSR
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 |
|---|---|---|
AVX | AVX | 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, Sierra Forest, Clearwater Forest, Knights Landing, Knights Mill, Bulldozer, Piledriver, Zen, Zen+, Zen 2, Zen 3, Zen 4, Zen 5, Zen 6 |
More AVX instructions
- VCVTSS2SI
- VCVTTPD2DQ
- VCVTTPS2DQ
- VCVTTSD2SI
- VCVTTSS2SI
- VDIVPD
- VDIVPS
- VDIVSD
- VDIVSS
- VDPPD
- VDPPS
- VEXTRACTF128
- VEXTRACTPS
- VHADDPD
- VHADDPS
- VHSUBPD
- VHSUBPS
- VINSERTF128
- VINSERTPS
- VLDDQU
- VMASKMOVDQU
- VMASKMOVPD
- VMASKMOVPS
- VMAXPD
- VMAXPS
- VMAXSD
- VMAXSS
- VMINPD
- VMINPS
- VMINSD
- VMINSS
- VMOVAPD
- VMOVAPS
- VMOVD
- VMOVDDUP
- VMOVDQA
- VMOVDQU
- VMOVHLPS
- VMOVHPD
- VMOVHPS
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 2A, page 3-539 (LDMXCSR)
- Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 1 (253665-093, September 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.