Specifies various floating-point options. These options provide different strategies for speeding up or improving the accuracy of floating-point calculations.
.-:----------------. | .-nospnans-----. | | +-norsqrt------+ | | +-norrm--------+ | | +-nonans-------+ | | +-maf----------+ | | +-fold---------+ | | +-nofltint-----+ | V +-complexgcc---+ | >>- -qfloat--=----+-nocomplexgcc-+-+--------------------------->< +-fltint-------+ +-nofold-------+ +-nomaf--------+ +-nans---------+ +-rrm----------+ +-rsqrt--------+ '-spnans-------'
Option selections are described in the Notes section below. See also #pragma options.
Using float suboptions other than the default settings may produce varying results in floating point computations. Incorrect computational results may be produced if not all required conditions for a given suboption are met. For these reasons, you should only use this option if you are experienced with floating-point calculations involving IEEE floating-point values and can properly assess the possibility of introducing errors in your program.
You can specify one or more of the following float suboptions.
complexgcc
nocomplexgccEnables compatibility with GCC passing and returning of _complex. The default is float=complexgcc when compiling in 32-bit mode, and float=nocomplexgcc when compiling in 64-bit mode. fltint
nofltintSpeeds up floating-point-to-integer conversions by using faster inline code that does not check for overflows. The default is float=nofltint, which checks floating-point-to-integer conversions for out-of-range values. This suboption must only be used with an optimization option.
- With -O2 in effect, -qfloat=nofltint is the implied setting.
- With -O3 and greater in effect, -qfloat=fltint is implied.
To include range checking in floating-point-to-integer conversions with the -O3 option, specify -qfloat=nofltint.
- -qnostrict sets -qfloat=fltint
Changing the optimization level will not change the setting of the fltint suboption if fltint has already been specified.
If the -qstrict | -qnostrict and -qfloat= options conflict, the last setting is used.
fold
nofoldSpecifies that constant floating-point expressions are to be evaluated at compile time rather than at run time. maf
nomafMakes floating-point calculations faster and more accurate by using floating-point multiply-add instructions where appropriate. The results may not be exactly equivalent to those from similar calculations performed at compile time or on other types of computers. Negative zero results may be produced. This option may affect the precision of floating-point intermediate results. nans
nonansGenerates extra instructions to detect signalling NaN (Not-a-Number) when converting from single-precision to double-precision at run time. The option nonans specifies that this conversion need not be detected. -qfloat=nans is required for full compliance to the IEEE 754 standard. When used with the -qflttrap or -qflttrap=invalid option, the compiler detects invalid operation exceptions in comparison operations that occur when one of the operands is a signalling NaN.
rrm
norrmPrevents floating-point optimizations that are incompatible with runtime rounding to plus and minus infinity modes. Informs the compiler that the floating-point rounding mode may change at run time or that the floating-point rounding mode is not round to nearest at run time. -qfloat=rrm must be specified if the Floating Point Status and Control register is changed at run time (as well as for initializing exception trapping).
rsqrt
norsqrtSpecifies whether a sequence of code that involves division by the result of a square root can be replaced by calculating the reciprocal of the square root and multiplying. Allowing this replacement produces code that runs faster.
- For -O2, the default is -qfloat=norsqrt.
- For -O3, the default is -qfloat=rsqrt. Use -qfloat=norsqrt to override this default.
- -qnostrict sets -qfloat=rsqrt. (Note that -qfloat=rsqrt means that errno will not be set for any sqrt function calls.)
- -qfloat=rsqrt has no effect unless -qignerrno is also specified.
Changing the optimization level will not change the setting of the rsqrt option if rsqrt has already been specified. If the -qstrict | -qnostrict and -qfloat= options conflict, the last setting is used.
spnans
nospnansGenerates extra instructions to detect signalling NaN on conversion from single-precision to double-precision. The option nospnans specifies that this conversion need not be detected.
To compile myprogram.C so that constant floating point expressions are evaluated at compile time and multiply-add instructions are not generated, enter:
xlc++ myprogram.C -qfloat=fold:nomaf
Related references