ftz, Qftz

Flushes denormal results to zero.

IDE Equivalent

Windows: Optimization > Flush Denormal Results to Zero

Linux: Floating-Point > Flush Denormal Results to Zero

Mac OS X: Floating-Point > Flush Denormal Results to Zero

Architectures

IA-32, Intel® 64, IA-64 architectures

Syntax

Linux and Mac OS X:

-ftz

-no-ftz

Windows:

/Qftz

/Qftz-

Arguments

None

Default

Systems using IA-64 architecture: -no-ftz or /Qftz-
Systems using IA-32 architecture and Intel® 64 architecture: -ftz or /Qftz

On systems using IA-64 architecture, the compiler lets results gradually underflow. On systems using IA-32 architecture and Intel® 64 architecture, denormal results are flushed to zero.

Description

This option flushes denormal results to zero when the application is in the gradual underflow mode. It may improve performance if the denormal values are not critical to your application's behavior.

This option sets or resets the FTZ and the DAZ hardware flags. If FTZ is ON, denormal results from floating-point calculations will be set to the value zero. If FTZ is OFF, denormal results remain as is. If DAZ is ON, denormal values used as input to floating-point instructions will be treated as zero. If DAZ is OFF, denormal instruction inputs remain as is. Systems using IA-64 architecture have FTZ but not DAZ. Systems using Intel® 64 architecture have both FTZ and DAZ. FTZ and DAZ are not supported on all IA-32 architectures.

When -ftz (Linux and Mac OS X) or /Qftz (Windows) is used in combination with an SSE-enabling option on systems using IA-32 architecture (for example, xN or QxN), the compiler will insert code in the main routine to set FTZ and DAZ. When -ftz or /Qftz is used without such an option, the compiler will insert code to conditionally set FTZ/DAZ based on a run-time processor check. -no-ftz (Linux and Mac OS X) or /Qftz- (Windows) will prevent the compiler from inserting any code that might set FTZ or DAZ.

This option only has an effect when the main program is being compiled. It sets the FTZ/DAZ mode for the process. The initial thread and any threads subsequently created by that process will operate in FTZ/DAZ mode.

On systems using IA-64 architecture, optimization option O3 sets -ftz and /Qftz; optimization option O2 sets -no-ftz (Linux) and /Qftz- (Windows). On systems using IA-32 architecture and Intel® 64 architecture, every optimization option O level, except O0, sets -ftz and /Qftz.

If this option produces undesirable results of the numerical behavior of your program, you can turn the FTZ/DAZ mode off by using -no-ftz or /Qftz- in the command line while still benefiting from the O3 optimizations.

Note iconNote

Options -ftz and /Qftz are performance options. Setting these options does not guarantee that all denormals in a program are flushed to zero. They only cause denormals generated at run time to be flushed to zero.

Alternate Options

None

Example

To see sample code showing the state of the FTZ and DAZ flags, see Reading the FTZ and DAZ Flags.

See Also