Floating-point Options for IA-32 and IntelŪ EM64T

The following table lists options that enable you to control the compiler optimizations for floating-point computations on IA-32 and IntelŪ EM64T systems. The options listed here are not valid for ItaniumŪ-based systems.

Windows*

Linux*

Effect

/Qprec-div

-prec-div

With some optimizations, the IntelŪ Compiler changes floating-point division computations into multiplication by the reciprocal of the denominator. For example, A/B is computed as A x (1/B) to improve the speed of the computation. This behavior can result in a loss of range and precision in the result of A/B. Additionally,  the IntelŪ compiler may use a fast but less accurate implementation of single precision floating-point divide. In cases where it is important to maintain the value of B, use this option to disable the divide optimizations. Using this option results in greater accuracy with some loss of performance. When using -fp-model precise (Linux*) or /fp:precise (Windows*) the division-to-multiplication optimization is disabled. Use -no-prec-dev (Linux) or /Qprec-div- (Windows) to enable the division-to-multiplication optimization.

For more information, see the following topic:

/Qpc

-pc

This option enables floating-point significand precision control, and it allows full optimization. Some floating-point algorithms are sensitive to the accuracy of the significand or fractional part of the floating-point value. For example, operations like division or finding the square root can run faster if you lower the precision using this option.

This option causes the compiler to change the floating point precision control when the main() function is compiled. The program that uses this option must use main() as its entry point, and the file containing main() must be compiled using this option.

Note

This option only has effect when the module being compiled contains the main program.

A change of the default precision control or rounding mode (for example, by using the -pc32 (Linux) or /Qpc32 (Windows) flag or by user intervention) may affect the results returned by some of the mathematical functions. Some flags are not compatible with specific -fp-model (Linux) or /fp (Windows) settings, which use expression evaluation following C99 FLT_EVAL_METHOD=1 or FLT_EVAL_METHOD=2:

  • For -pc32 (Linux) or /Qpc32 (Windows), the non-compatible options are -fp-model precise, -fp-model double, -fp-model extended, and -fp-model strict (Linux) or /fp:precise, /fp:double, /fp:extended, and /fp:strict (Windows).

  • For -pc64 (Linux) or /Qpc64 (Windows), the non-compatible option is -fp-model extended (Linux) or /fp:extended (Windows).

For more information, see the following topic:

  • -pc compiler option

/Qrcd

-rcd

Disables changing of rounding mode for floating-point-to-integer conversions. Use for rounding control.

The system default floating point rounding mode is round-to-nearest. This means that values are rounded during floating point calculations.

This option disables the change to truncation of the rounding mode for all floating point calculations, including floating-point-to-integer conversions. This means that all floating point calculations must use the default round-to-nearest, including floating point-to-integer conversions.

For more information, see the following topic:

  • -rcd compiler option

/Qfp-port

-fp-port

Provides a rounding control of the results of the floating-point data operations. Use for rounding control. May cause some speed impact, but also makes sure that rounding to the user-declared precision at assignments is always done.

  • Linux: -fp-port is supported on both IA-32 and IntelŪ EM64T systems.

  • Windows: /Qfp-port is not supported on IA-32 only.

The -prec-div (Linux) or /Qprec-div (Windows) option implies this option.

The -fp-model precise (Linux) or /fp:precise (Windows) option implies this option; however, -fp-model fast (Linux) or /fp:fast (Windows) disables this option.

For more information, see the following topic:

/Qprec-sqrt

-prec-sqrt

Improves precision of square root implementations, but using the option might impact speed.

The IntelŪ compiler uses a fast but less accurate implementation of single precision floating-point square root. In cases where it is important to maintain full accuracy for square root calculations, use this option to disable the square root optimization.

When using -fp-model precise (Linux) or /fp:precise (Windows) the square root optimization is disabled. Use -no-prec-dev (Linux) or /Qprec-div- (Windows) to enable the square root optimization.

For more information, see the following topic: