These subroutines allow operations on the floating-point trap control.
#include <fptrap.h>
int fp_any_enable() int fp_is_enabled(Mask) fptrap_t Mask;
void fp_enable_all() void fp_enable(Mask) fptrap_t Mask;
void fp_disable_all() void fp_disable(Mask) fptrap_t Mask;
Floating point traps must be enabled before traps can be generated. These subroutines aid in manipulating floating-point traps and identifying the trap state and type.
In order to take traps on floating point exceptions, the fp_trap subroutine must first be called to put the process in serialized state, and the fp_enable subroutine or fp_enable_all subroutine must be called to enable the appropriate traps.
The header file fptrap.h defines the following names for the individual bits in the floating-point trap control:
TRP_INVALID | Invalid Operation Summary |
TRP_DIV_BY_ZERO | Divide by Zero |
TRP_OVERFLOW | Overflow |
TRP_UNDERFLOW | Underflow |
TRP_INEXACT | Inexact Result |
Mask | A 32-bit pattern that identifies floating-point traps. |
The fp_any_enable subroutine returns 1 if any floating-point traps are enabled. Otherwise, 0 is returned.
The fp_is_enabled subroutine returns 1 if the floating-point traps specified by the Mask parameter are enabled. Otherwise, 0 is returned.
The fp_enable_all subroutine enables all floating-point traps.
The fp_enable subroutine enables all floating-point traps specified by the Mask parameter.
The fp_disable_all subroutine disables all floating-point traps.
The fp_disable subroutine disables all floating-point traps specified by the Mask parameter.
These subroutines are part of Base Operating System (BOS) Runtime.
The fp_clr_flag, fp_set_flag, fp_read_flag, fp_swap_flag subroutine, fp_invalid_op, fp_divbyzero, fp_overflow, fp_underflow, fp_inexact, fp_any_xcp subroutines, fp_iop_snan, fp_iop_infsinf, fp_iop_infdinf, fp_iop_zrdzr, fp_iop_infmzr, fp_iop_invcmp subroutines, fp_read_rnd, and fp_swap_rnd subroutines, fp_trap subroutine.
Floating-Point Processor Overview in POWERstation and POWERserver Hardware Technical Information-General Architectures.
The IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Standards 754-1985 and 854-1987).
Subroutines Overview in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.