Instruction
VSTMXCSR
Stores the MXCSR register, the SSE control and status bits, to memory; the VEX form of STMXCSR.
- Extensions
- Forms
- 1 (1 VEX)
- Data
- Intel XED v2026.08.23
VSTMXCSR is the VEX form of STMXCSR, whose page covers what the stored doubleword holds and how code reads the exception flags from it. It stores MXCSR exactly as STMXCSR does; the encoding only adds two #UD conditions, VEX.L set and VEX.vvvv other than 1111b, as for its partner VLDMXCSR. It needs AVX, and there is no EVEX form. Zen 5’s two recorded cases stored 1F80H and FFFFH as 00001F80H and 0000FFFFH, changed none of the twelve bytes around the doubleword and left MXCSR as it was.
In compiled code
In our builds at -O2 with -mavx, -march=x86-64-v3 or x86-64-v4,
GCC 14 and Clang 23 compile _mm_getcsr() to VSTMXCSR into the red zone
below RSP and a MOV of the doubleword into EAX. Clearing the exception
flags, _mm_setcsr(_mm_getcsr() & ~0x3fu), is VSTMXCSR, an AND and
VLDMXCSR: GCC ANDs the stack slot in place, Clang goes through EAX and a
second slot.
A function that saves MXCSR, sets rounding toward zero, divides two
floats and restores the saved value shows that the intrinsics do not pin
arithmetic in place. Clang keeps the VDIVSS between the two VLDMXCSRs;
GCC moves it after the second, so the division runs in the restored
mode, with -frounding-math as well: GCC treats the division as
independent of the register that controls its rounding.
AMD’s latency spreadsheet for Zen 5 gives VSTMXCSR two macro-ops, on pipe FP1 and on FP4 or FP5, at 0.06 to 0.07 per cycle, the cells of STMXCSR: about one every 15 cycles, where VLDMXCSR is listed at one per cycle.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
VSTMXCSR m32
VSTMXCSR_MEMd | VEX.LZ.NP.0F.WIG AE /3 | AVX |
Latency and throughput
| Model | m32 |
|---|---|
| Sandy Bridge | 5 / 1p05 |
| Haswell, Broadwell, Skylake, Skylake-SP, Ice Lake | 2 / 1p5 |
| Alder Lake, Sapphire Rapids | 12 / 1p06 |
| Lunar Lake | 100 / 3V0 V1 p0 p2 p4 |
| Piledriver | 1 / 18AGLU01 Store |
| Zen, Zen 2 | 100 / 0.25 |
| Zen 3, Zen 4 | 2 / 15ALU0 ALU1 ALU2 ALU3 |
| Jaguar | 1 / 1SAGU |
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
dest.write(mxcsr) # the bits it lacks as zeros
Run on AMD Zen 5 (EPYC 9645): 2 cases.
Operands
| Operand | Kind | Action |
|---|---|---|
VSTMXCSR m32 | ||
m32 | explicit | write |
MXCSR | implicit | read |
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-5
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
- VPTEST
- VPUNPCKHBW
- VPUNPCKHDQ
- VPUNPCKHQDQ
- VPUNPCKHWD
- VPUNPCKLBW
- VPUNPCKLDQ
- VPUNPCKLQDQ
- VPUNPCKLWD
- VPXOR
- VRCPPS
- VRCPSS
- VROUNDPD
- VROUNDPS
- VROUNDSD
- VROUNDSS
- VRSQRTPS
- VRSQRTSS
- VSHUFPD
- VSHUFPS
- VSQRTPD
- VSQRTPS
- VSQRTSD
- VSQRTSS
- VSUBPD
- VSUBPS
- VSUBSD
- VSUBSS
- VTESTPD
- VTESTPS
- VUCOMISD
- VUCOMISS
- VUNPCKHPD
- VUNPCKHPS
- VUNPCKLPD
- VUNPCKLPS
- VXORPD
- VXORPS
- VZEROALL
- VZEROUPPER
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-676 (STMXCSR)
- 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.