Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 12/16/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Intrinsics for Managing Extended Processor States and Registers

The Intel® C++ Compiler Classic provides twelve intrinsics for managing the extended processor states and extended registers. These intrinsics are available for IA-32 and Intel® 64 architectures running on supported operating systems.

To use these intrinsics, include the immintrin.h file as follows:

#include <immintrin.h>

The intrinsics map directly to the hardware system instructions described in "Intel® 64 and IA-32 Architectures Software Developer's Manual, volumes 1, 2a, and 2b" and "Intel® Advanced Vector Extensions Programming Reference".

Functional Overview

The intrinsics for managing the extended processor states and extended registers include:

  • Two intrinsics to read from and write to the specified extended control register. These intrinsics map to XGETBV and XSETBV instructions.

  • Four intrinsics to save and restore the current state of the x87 FPU, MMX, XMM, and MXCSR registers. These intrinsics map to FXSAVE, FXSAVE64, FXRSTOR, and FXRSTOR64 instructions.

  • Six intrinsics to save and restore the current state of the x87 FPU, MMX, XMM, YMM, and MXCSR registers. These intrinsics map to XSAVE, XSAVE64, XSAVEOPT, XSAVEOPT64, XRSTOR, and XRSTOR64 instructions.