Developer Guide and Reference

Contents

Intrinsics for Saving and Restoring the Extended Processor States

To use any of these intrinsics, include the
immintrin.h
file as follows:
#include <immintrin.h>

Intrinsics that map to
FXSAVE[64]
and
FXRSTOR[64]
instructions

This group of intrinsics includes four intrinsics to save and restore the current state of the
x87 FPU
,
MMX
,
XMM
, and
MXCSR
registers.
These intrinsics accept a memory reference to a 16-byte aligned 512-byte memory chunk. The layout of the memory is shown below in Table 1.
Table 1 -
FXSAVE
save area layout.

Intrinsics that map to
XSAVE[64]
,
XSAVEOPT[64]
, and
XRSTOR[64]
instructions

This group of intrinsics includes six intrinsics to fully or partially save and restore the current state of the
x87 FPU
,
MMX
,
XMM
,
YMM
, and
MXCSR
registers.
These intrinsics accept a memory reference to a 64-byte aligned memory. The layout of the register fields for the first 512 bytes is the same as the
FXSAVE
save area layout. The intrinsics saving the states do not write to bytes
464:511
. The save area layout is shown in Tables 2a and 2b below.
The second operand is a save/restore mask specifying the saved/restored extended states. The value of the mask is
AND
ed with
XFEATURE_ENABLED_MASK(XCR0)
. A particular extended state is saved/restored only if the corresponding bit of both save/restore mask and
XFEATURE_ENABLED_MASK
is set to '
1
'.
Table 2a -
XSAVE
save area layout (first 512 bytes)