SPARC: Enables/disables the SPARC nonstandard floating-point mode.
-fns=yes (or -fns) causes the nonstandard floating point mode to be enabled when a program begins execution.
This option provides a way of toggling the use of nonstandard or standard floating-point mode following some other macro option that includes –fns, such as –fast.
On some SPARC devices, the nonstandard floating-point mode disables “gradual underflow,” causing tiny results to be flushed to zero rather than to produce subnormal numbers. It also causes subnormal operands to be silently replaced by zero.
On those SPARC devices that do not support gradual underflow and subnormal numbers in hardware, -fns=yes (or -fns) can significantly improve the performance of some programs.
(x86) Selects SSE flush-to-zero mode and, where available, denormals-are-zero mode.
This option causes subnormal results to be flushed to zero. Where available, this option also causes subnormal operands to be treated as zero.
This option has no effect on traditional x86 floating-point operations that do not utilize the SSE or SSE2 instruction set.
The -fns option can have the following values.
Table A–10 The -fns Values
Value |
Meaning |
---|---|
yes |
Selects nonstandard floating-point mode |
no |
Selects standard floating-point mode |
If -fns is not specified, the nonstandard floating point mode is not enabled automatically. Standard IEEE 754 floating-point computation takes place, that is, underflows are gradual.
If only –fns is specified, –fns=yes is assumed.
In the following example, -fast expands to several options, one of which is -fns=yes which selects nonstandard floating-point mode. The subsequent -fns=no option overrides the initial setting and selects floating-point mode.
example% CC foo.cc -fast -fns=no |
When nonstandard mode is enabled, floating-point arithmetic can produce results that do not conform to the requirements of the IEEE 754 standard.
If you compile one routine with the -fns option, then compile all routines of the program with the –fns option; otherwise, you might get unexpected results.
This option is effective only on SPARC devices, and only if used when compiling the main program. On x86 devices, the option is ignored.
Use of the –fns=yes (or -fns) option might generate the following message if your program experiences a floating-point error normally managed by the IEEE floating-point trap handlers:
Numerical Computation Guide, ieee_sun(3M)