Controls the semantics of floating-point calculations.
Windows: Floating Point > Floating Point Model
Floating Point > Reliable Floating Point Exceptions Model
Linux: None
Mac OS X: Floating Point > Floating Point Model
Floating Point > Reliable Floating Point Exceptions Model
keyword |
Specifies the semantics to be used. Possible values are:
|
-fp-model fast=1 |
The compiler uses more aggressive optimizations on floating-point calculations. |
This option controls the semantics of floating-point calculations.
The keywords can be considered in groups:
Group A: precise, fast, strict
Group B: source
Group C: except (or the negative form)
You can use more than one keyword. However, the following rules apply:
You cannot specify fast and except together in the same compilation. You can specify any other combination of group A, group B, and group C.
Since fast is the default, you must not specify except without a group A or group B keyword.
You should specify only one keyword from group A and only one keyword from group B. If you try to specify more than one keyword from either group A or group B, the last (rightmost) one takes effect.
If you specify except more than once, the last (rightmost) one takes effect.
Option |
Description |
---|---|
-fp-model precise or /fp:precise |
Tells the compiler to strictly adhere to value-safe optimizations when implementing floating-point calculations. It disables optimizations that can change the result of floating-point calculations. These semantics ensure the accuracy of floating-point computations, but they may slow performance. The compiler assumes the default floating-point environment; you are not allowed to modify it. Floating-point exception semantics are disabled by default. To enable these semantics, you must also specify -fp-model except or /fp:except. |
-fp-model fast[=1|2] or /fp:fast[=1|2] |
Tells the compiler to use more aggressive optimizations when implementing floating-point calculations. These optimizations increase speed, but may alter the accuracy of floating-point computations. Specifying fast is the same as specifying fast=1. fast=2 may produce faster and less accurate results. Floating-point exception semantics are disabled by default and they cannot be enabled because you cannot specify fast and except together in the same compilation. To enable exception semantics, you must explicitly specify another keyword (see other keyword descriptions for details). |
-fp-model strict or /fp:strict |
Tells the compiler to strictly adhere to value-safe optimizations when implementing floating-point calculations and enables floating-point exception semantics. This is the strictest floating-point model. The compiler does not assume the default floating-point environment; you are allowed to modify it. Floating-point exception semantics can be disabled by explicitly specifying -fp-model no-except or /fp:except-. |
-fp-model source or /fp:source |
This option causes intermediate results to be rounded to the precision defined in the source code. It also implies keyword precise unless it is overridden by a keyword from Group A. The compiler assumes the default floating-point environment; you are not allowed to modify it. |
This option determines the setting for the maximum allowable relative error for math library function results (max-error) if none of the following options are specified:
-fimf-accuracy-bits (Linux* OS and Mac OS* X) or /Qimf-accuracy-bits (Windows* OS)
-fimf-max-error (Linux OS and Mac OS X) or /Qimf-max-error (Windows OS)
-fimf-precision (Linux OS and Mac OS X) or /Qimf-precision (Windows OS)
-[no-]fast-transcendentals (Linux OS and Mac OS X) or /Qfast-transcendentals[-] (Windows OS)
This option cannot be used to change the default (source) precision for the calculation of intermediate results.
On Windows and Linux operating systems on IA-32 architecture, the compiler, by default, implements floating-point (FP) arithmetic using SSE2 and SSE instructions. This can cause differences in floating-point results when compared to previous x87 implementations.
This option enables extra optimization that only applies to Intel® processors.
Optimization Notice |
---|
Intel® Compiler includes compiler options that optimize for instruction sets that are available in both Intel® and non-Intel microprocessors (for example SIMD instruction sets), but do not optimize equally for non-Intel microprocessors. In addition, certain compiler options for Intel® Compiler are reserved for Intel microprocessors. For a detailed description of these compiler options, including the instruction sets they implicate, please refer to "Intel® Compiler User and Reference Guides > Compiler Options". Many library routines that are part of Intel® Compiler are more highly optimized for Intel microprocessors than for other microprocessors. While the compilers and libraries in Intel® Compiler offer optimizations for both Intel and Intel-compatible microprocessors, depending on the options you select, your code and other factors, you likely will get extra performance on Intel microprocessors. While the paragraph above describes the basic optimization approach for Intel® Compiler, with respect to Intel's compilers and associated libraries as a whole, Intel® Compiler may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include Intel® Streaming SIMD Extensions 2 (Intel® SSE2), Intel® Streaming SIMD Extensions 3 (Intel® SSE3), and Supplemental Streaming SIMD Extensions 3 (Intel® SSSE3) instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Intel recommends that you evaluate other compilers to determine which best meet your requirements. |
The MSDN article Microsoft Visual C++ Floating-Point Optimization, which discusses concepts that apply to this option.
Copyright © 1996-2010, Intel Corporation. All rights reserved.