# ftz, Qftz

Flushes subnormal results to zero.

## Syntax

Linux: | -ftz -no-ftz

macOS: | -ftz -no-ftz

Windows: | /Qftz /Qftz-

## Arguments

None

## Default

-ftz or /Qftz | Subnormal results are flushed to zero. Every optimization option O level, except O0, sets [Q]ftz. Value 0 for the [Q]fpe option sets [Q]ftz.

## Description

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

The [Q]ftz option has no effect during compile-time optimization.

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

When the [Q]ftz option is used in combination with an SSE-enabling option on systems using IA-32 architecture (for example, the [Q]xSSE2 option), the compiler will insert code in the main routine to set FTZ and DAZ. When [Q]ftz is used without such an option, the compiler will insert code to conditionally set FTZ/DAZ based on a run-time processor check.

If you specify option -no-ftz (Linux and macOS) or option /Qftz- (Windows), it prevents the compiler from inserting any code that might set FTZ or DAZ.

Option [Q]ftz 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.

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

### Note

Option [Q]ftz is a performance option. Setting this option does not guarantee that all subnormals in a program are flushed to zero. The option only causes subnormals generated at run time to be flushed to zero.

## IDE Equivalent

Visual Studio: IA-32 architecture: Floating Point > Flush Subnormal Results to Zero

Intel® 64 architecture: None

## Alternate Options

None

Parent topic: Floating-Point Options

## See Also

x, Qx compiler option
Setting the FTZ and DAZ Flags