Sun Studio 12: Fortran User's Guide

3.4.33 –fns[={yes|no}]

Select nonstandard floating–point mode.

The default is the standard floating–point mode (–fns=no). (See the “Floating–Point Arithmetic” chapter of the Fortran Programming Guide.)

Optional use of =yes or =no provides a way of toggling the -fns flag following some other macro flag that includes it, such as -fast. -fns without a value is the same as -fns=yes.

This option flag enables nonstandard floating-point mode when the program begins execution. On SPARC platforms, specifying nonstandard floating-point mode disables “gradual underflow”, causing tiny results to be flushed to zero rather than producing subnormal numbers. It also causes subnormal operands to be silently replaced by zero. On those SPARC systems that do not support gradual underflow and subnormal numbers in hardware, use of this option can significantly improve the performance of some programs.

Where x does not cause total underflow, x is a subnormal number if and only if |x| is in one of the ranges indicated:

Table 3–8 Subnormal REAL and DOUBLE

Data Type  

Range  

REAL

0.0 < |x| < 1.17549435e–38 

DOUBLE PRECISION

0.0 < |x| < 2.22507385072014e–308 

See the Numerical Computation Guide for details on subnormal numbers, and the Fortran Programming Guide chapter “Floating–Point Arithmetic” for more information about this and similar options. (Some arithmeticians use the term denormalized number for subnormal number.)

The standard initialization of floating–point preferences is the default:

On x86 platforms, this option is enabled only for Pentium III and Pentium 4 processors (sse or sse2 instruction sets).

On x86, -fns selects SSE flush-to-zero mode and where available, denormals-are-zero mode. This flag causes subnormal results to be flushed to zero. Where available, this flag also causes subnormal operands to be treated as zero. This flag has no effect on traditional x87 floating-point operations not utilizing the SSE or SSE2 instruction set.

To be effective, the main program must be compiled with this option.