Guardian Programmer's Guide

Table Of Contents
Using Floating-Point Formats
Guardian Programmer’s Guide 421922-014
28 - 2
Building and Running IEEE Floating-Point Programs
IEEE floating-point directed roundings and “sticky” flags are useful debugging tools
for investigating calculations that might go wrong because of rounding problems,
division by zero, or other problems. Unlike conditional flags, once sticky flags are
set, they stay set until explicitly reset by the user. This capability allows the user to
check a chain of computations.
IEEE floating-point denormalized numbers avoid computational problems that arise
from very small numbers as intermediate results in computations.
IEEE floating-point format is available only on NonStop S7000 and S72000 CPUs
running on NonStop operating system G07 or a later product version.
IEEE floating-point format is the default floating-point format for TNS/E programs.
Building and Running IEEE Floating-Point Programs
If you want to build and execute programs using IEEE floating-point, make sure that
the required software and hardware are available.
IEEE floating-point format runs on S7000 and S72000 CPUs. It does not run on
S70000 CPUs. For maximum application availability of IEEE floating-point
programs, make sure that systems composed of S70000 and S72000 CPUs
contain enough S72000 CPUs, depending on the architecture of your application.
NonStop operating system RVU G07 or later product version.
G06.06 or later product versions of native C and C++ compilers for compiling
floating-point programs.
G06.06 or later release of the nld utility for linking.
Compiling and Linking Floating-Point Programs
To use the Tandem floating-point option, set the TANDEM_FLOAT pragma (also the
default) on the compiler command line. For the IEEE floating-point option, specify
IEEE_FLOAT. The compiler sets the floating-point format type in the generated object
file. For compiling C++ programs that use IEEE floating-point format, you must also
specify the VERSION2 pragma (see the C/C++ Programmer’s Guide for more
information).
When linking object files, if the -set FLOATTYPE flag is not specified, the nld utility
derives the floating-point state from the states of the input files (see the Link-Time
Consistency Checking section for more information about the -set FLOATTYPE
flag). If one of the three floating-point types for an object file (TANDEM_FLOAT,
IEEE_FLOAT, or NEUTRAL_FLOAT) is specified in the -set FLOATTYPE flag, nld
sets the state of the output object file as specified by the flag.
When modifying an existing object file, nld sets the state as specified by the -change
FLOATTYPE flag, which also uses one of the three floating-point types for an object
file. The following is an example of compiling a program that uses IEEE floating-point
format.