Processor-specific Run-time Checks for IA-32 Systems

Specific optimizations can take effect at run-time. On IA-32 systems the compiler enhances processor-specific optimizations by inserting in the main routine a code segment that performs run-time checks, as described below.

Check for Supported Processor

To prevent from execution errors, the compiler inserts code in the main routine of the program to check for proper processor usage.

Programs compiled with the options -xN, -xB, or -xP (Linux*) or /QxK, /QxW, /QxN, /QxB or /QxP (Windows*) check at run-time whether they are being executed on the associated processor or a compatible Intel processor. If the program is not executed on one of these processors, the program terminates with an error.

On Mac OS* systems, P is the only valid value for the -x and -ax options.

The following example demonstrates how to optimize a program for run-time checking on an IntelŪ PentiumŪ 4 processor with Streaming SIMD Extensions 3 (SSE3) instruction support.

Platform

Example

Linux

ifort -xP prog.f90 -o foo.exe

Windows

ifort /QxP prog.f90 /exe:foo.exe

The resulting program will abort if it is executed on a processor that is not validated to support the IntelŪ PentiumŪ 4 processor with Streaming SIMD Extensions 3 (SSE3) instruction support.

If you intend to run your programs on multiple IA-32 processors, do not use the -x (Linux) or /Qx (Windows) options; consider using the -ax (Linux) or /Qax (Windows) option to attain processor-specific performance and portability among different processors.

Setting FTZ and DAZ Flags

In earlier versions of the compiler, the values of the flags flush-to-zero (FTZ) and denormals-as-zero (DAZ) for IA-32 processors were set to off by default; however, even at the cost of losing IEEE compliance, turning these flags on can significantly increase the performance of programs with denormal floating-point values in the gradual underflow mode run on the most recent IA-32 processors.

By default, the -O3 (Linux) or /O3 (Windows) option enables FTZ mode; in contrast, the -O2 (Linux) or /O2 (Windows) option disables it. Alternately, you can use -no-ftz (Linux) or /Qftz- (Windows) to disable flushing denormal results to zero.

When SSE instructions are used, options -no-ftz (Linux) and /Qftz- (Windows) are ignored. However, you can enable gradual underflow with code in the main program that clears the FTZ and DAZ bits in the MXCSR.

The compiler inserts code in the program to perform a run-time check for the processor on which the program runs to verify it is one of the previously mentioned Intel processors.

These flags are enabled only on by Intel processors that have been validated to support them.

For non-Intel processors, the flags can be set manually by calling the following Intel Fortran intrinsic:

Example

RESULT = FOR_SET_FPE (FOR_M_ABRUPT_UND)