#pragma options float
Selects different strategies for speeding up or improving the accuracy of floating-point calculations.
.-:----------------. | .-nospnans-----. | | +-single-------+ | | +-norsqrt------+ | | +-norrm--------+ | | +-rngchk-------+ | | +-rndsngl------+ | | +-norelax------+ | | +-nonans-------+ | | +-maf----------+ | | +-nohssngl-----+ | | +-nohsflt------+ | | +-nohscmplx----+ | | +-fold---------+ | | +-nofltint-----+ | | +-nofenv-------+ | V +-dfpemulate---+ | >>- -q--float--=----+-nodfpemulate-+-+------------------------->< +-fenv---------+ +-fltint-------+ +-nofold-------+ +-hscmplx------+ +-hsflt--------+ +-hssngl-------+ +-nomaf--------+ +-nans---------+ +-relax--------+ +-norndsngl----+ +-norngchk-----+ +-rrm----------+ +-rsqrt--------+ +-nosingle-----+ '-spnans-------'
maf:nonans:norelax:rndsngl:rngchk:norrm:norsqrt:single:nospnans
Note that -qdfp must also be enabled for either suboption to have any effect. Otherwise, nodfpemulate is set.
Certain floating-point operations rely on the status of Floating-Point Status and Control Register (FPSCR), for example, to control the rounding mode or to detect underflow. In particular, many compiler built-in functions read values directly from the FPSCR.
When nofenv is in effect, the compiler assumes that the program does not depend on the hardware environment, and that aggressive compiler optimizations that change the sequence of floating-point operations are allowed. When fenv is in effect, such optimizations are suppressed.
You should use fenv for any code containing statements that read or set the hardware floating-point environment, to guard against optimizations that could cause unexpected behavior.
Any directives specified in the source code (such as the standard C FENV_ACCESS pragma) take precedence over the option setting.
If -qarch is set to a processor that has an instruction to convert from floating point to integer, that instruction will be used regardless of the [no]fltint setting. This conversion also applies to all Power® processors in 64-bit mode.
If you compile with the -O3 or higher optimization level, fltint is enabled automatically. To disable it, also specify -qstrict, -qstrict=operationprecision, or -qstrict=exceptions.
The -qfloat=[no]fold option replaces the deprecated -q[no]fold option. Use -qfloat=[no]fold in your new applications.
The hsflt suboption overrides the nans and spnans suboptions.
Specifies that single-precision expressions are rounded only when the results are stored into memory locations, but not after expression evaluation. Using hssngl can improve runtime performance and is safer than using hsflt.
This option only affects double-precision (double) expressions cast to single-precision (float) and used in an assignment operator for which a store instruction is generated, when -qfloat=nosingle is in effect. Do not use this option if you are compiling with the default -qfloat=single.
The -qfloat=[no]maf option replaces the deprecated -q[no]maf option. Use -qfloat=[no]maf in your new applications.
The hsflt option overrides the nans option.
The -qfloat=[no]nans option replaces the deprecated -qfloat=[no]spnans option and the -q[no]spnans option. Use -qfloat=[no]nans in your new applications.
This option only affects double-precision expressions cast to single-precision. You can only specify norndsngl when -qfloat=nosingle is in effect.
The hsflt suboption overrides the rndsngl option.
norngchk is only allowed when -qnostrict is in effect. If -qstrict, -qstrict=infinities, -qstrict=operationprecision, or -qstrict=exceptions is in effect, norngchk is ignored.
The -qfloat=[no]rrm option replaces the deprecated -q[no]rrm option. Use -qfloat=[no]rrm in your new applications.
rsqrt has no effect unless -qignerrno is also specified; errno will not be set for any sqrt function calls.
If you compile with the -O3 or higher optimization level, rsqrt is enabled automatically. To disable it, also specify -qstrict, -qstrict=nans, -qstrict=infinities, -qstrict=zerosigns, or -qstrict=exceptions.
The hsflt suboption overrides the spnans suboption.
Using -qfloat suboptions other than the default settings may produce incorrect results in floating-point computations if not all required conditions for a given suboption are met. For this reason, 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. See also Handling floating-point operations for more information.
If the -qstrict | -qnostrict and float suboptions conflict, the last setting specified is used.
__IBM_DFP_SW_EMULATION__ is predefined to a value of 1 when -qfloat=dfpemulate is in effect; otherwise it is undefined.
xlc myprogram.c -qfloat=fold:nomaf