Intel® oneAPI DPC++/C++ Compiler Developer Guide and Reference

ID 767253
Date 9/08/2022
Public

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

Document Table of Contents

Set the FTZ and DAZ Flags

In Intel® processors, the flush-to-zero (FTZ) and denormals-are-zero (DAZ) flags in the MXCSR register are used to control floating-point calculations. Intel® Streaming SIMD Extensions (Intel® SSE) and Intel® Advanced Vector Extensions (Intel® AVX) instructions, including scalar and vector instructions, benefit from enabling the FTZ and DAZ flags. Floating-point computations using the Intel® SSE and Intel® AVX instructions are accelerated when the FTZ and DAZ flags are enabled. This improves the application's performance.

Manually set the FTZ flags with the following macros:

_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON)

Manually set the DAZ flags with the following macros:

_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON)

The prototypes for these macros are in xmmintrin.h (FTZ) and pmmintrin.h (DAZ).