ftz, Qftz

Flushes denormal results to zero.

IDE Equivalent

Windows: Floating-Point > Flush Denormal Results to Zero
Linux: None
Mac OS: None

Architectures

IA-32, IntelŪ EM64T, IntelŪ ItaniumŪ architecture

Syntax

Linux and Mac OS: -ftz
-no-ftz
Windows:  /Qftz
/Qftz-

Arguments

None

Default

OFF The compiler lets results gradually underflow.

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. Intel Itanium systems have FTZ but not DAZ. Intel EM64T systems have both FTZ and DAZ. FTZ and DAZ are not supported on all IA-32 architectures.

When -ftz (Linux and Mac OS) or /Qftz (Windows) is used in combination with an SSE-enabling option on IA-32 systems (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 (this processor check fails for non-Intel machines). -no-ftz (Linux and Mac OS) 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.

Options -fpe0 and -fpe1 (Linux and Mac OS) or /fpe:0 and /fpe:1 (Windows) set -ftz or /Qftz. On ItaniumŪ-based systems, optimization option O3 sets this option. Optimization option O2 sets the -no-ftz or /Qftz- option.

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

When SSE instructions are used on IA-32 systems, options -no-ftz and /Qftz- are ignored. However, you can enable gradual underflow by calling a function in C in the main program that clears the FTZ and DAZ bits in the MXCSR or by calling the function for_set_fpe in the main program to clear those bits. Be aware that denormal processing can significantly slow down computation.

Alternate Options

None

See Also

x, Qx compiler option

Building Applications: Using the Floating-Point Exception Handling (/fpe) Compiler Option