Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Floating-Point Guide: HP 9000 Computers > Chapter 5 Manipulating the Floating-Point Status Register

Command-Line Mode Control: The +FP Compiler Option

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

The compiler and linker option +FP allows you to specify what traps to enable for your program and can also enable or disable flush-to-zero mode. This option is available with the HP Fortran, C, and Pascal compilers. It has the following syntax:

+FPflags

where flags is a series of uppercase or lowercase letters from the set [VvZzOoUuIiDd] with no spaces, tabs, or other characters between them. If the uppercase letter is selected, that behavior is enabled. If the lowercase letter is selected or if the letter is not present in the flags, the behavior is disabled. By default, all traps are disabled.

Table 5-3 “+FP Option Arguments” describes the behavior specified by each argument.

For example, the following command line sets traps for overflow, divide by zero, and invalid operations, and enables fast underflow mode:

f77 +FPOZVD program_name.f

The linker (ld) also accepts the +FP option. If you specify this option to a separately invoked ld command, the option is effective only if you link in one of the supported startup files (/opt/langtools/lib/*crt0.o).

The +FP option affects the various floating-point mode settings at program startup. Subsequent calls to fesettrapenable, fesetflushtozero, ­or fesetenv may override some or all of the values set by +FP.

NOTE: If you use Fortran, you may also use the +fp_exception (Fortran 90) or +T (HP FORTRAN/9000) option to set traps at compile time. (If your HP FORTRAN/9000 program contains an ON statement, you must use +T.) These options enable traps for invalid operation, overflow, underflow, and division by zero exceptions. If you specify both +FP and +fp_exception (or +T), the +fp_exception (or +T) option is always processed after +FP. It does not turn off any bits set by +FP, however.

See “Using the +FP Compiler Option” for more information on using the +FP option.

Table 5-3 +FP Option Arguments

Value

Behavior

V

Enable traps on invalid floating-point operations.

v

Disable traps on invalid floating-point operations.

Z

Enable traps on divide by zero.

z

Disable traps on divide by zero.

O

Enable traps on floating-point overflow.

o

Disable traps on floating-point overflow.

U

Enable traps on floating-point underflow.

u

Disable traps on floating-point underflow.

I

Enable traps on floating-point operations that produce inexact results.

i

Disable traps on floating-point operations that produce inexact results.

D

Enable flush-to-zero (fast underflow) mode for denormalized values. (Selecting this value enables flush-to-zero mode only if it is available on the processor that is used at run time.)

d

Disable flush-to-zero (fast underflow) mode for denormalized values.

 

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1997 Hewlett-Packard Development Company, L.P.