HP-UX Floating-Point Guide

82 Chapter 3
Factors that Affect the Results of Floating-Point Computations
Other System-Related Factors that Affect Application Results
Values of Certain Modifiable Hardware Status
Register Fields
All HP 9000 systems have a modifiable floating-point status register.
Figure 5-1 on page 128 illustrates this register. Two of the fields in the
status register can be modified in ways that may change the results of an
application:
The rounding-mode field
The D bit, which affects underflow mode
The rounding-mode field is a two-bit field that specifies which of the four
rounding modes defined by the IEEE-754 standard is in force. The
default setting for this field is round to nearest. Changing this field
changes the rounding errors developed during computations and thus
changes the results yielded by an application.
Most HP 9000 systems have a D bit in the floating-point status register.
When this bit is set to 0 (the default), the system is fully IEEE-754
conforming. When this bit is set to 1, the system operates on
denormalized operands as if they were zeros, and results that underflow
are flushed to 0 instead of denormalized. The purpose of this bit is to
improve the performance of applications that encounter denormalized
values often, since operations on denormalized values degrade system
performance. Changes to the D bit, by virtue of its effect, can obviously
have the effect of altering application results.
You may modify the floating-point status register by using either a
compiler option or any of several library functions. For more information,
see Chapter 5.