C++ User's Guide

-fns[=(yes|no)]

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. (See "Examples.")

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.

Values

yes

 

no

Selects nonstandard floating-point mode 

 

Selects standard floating-point mode 

Defaults

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.

Examples

To use the -fns option following some other macro option that includes -fns, such as -fast:

demo% CC foo.cc -fast -fns=no

Warnings

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:

Note: Nonstandard floating-point mode enabled See the Numerical Computation Guide, ieee_sun(3M)

See also

Numerical Computation Guide