Queries or changes the trapping mode in the Machine Status register (MSR).
Standard C Library (libc.a)
#include <fptrap.h>
int fp_trapstate (int)
The fp_trapstate subroutine is a service routine used to query or set the trapping mode. The trapping mode determines whether floating-point exceptions can generate traps, and can affect execution speed. See Floating-Point Exceptions Overview in AIX® Version 7.1 General Programming Concepts: Writing and Debugging Programs for a description of precise and imprecise trapping modes. Floating-point traps can be generated by the hardware only when the processor is in a traps-enabled mode.
The fp_trapstate subroutine changes only the trapping mode. It is a service routine for use in developing custom floating-point exception-handling software. If you are using the fp_enable (fp_any_enable, fp_is_enabled, fp_enable_all, fp_enable, fp_disable_all, or fp_disable Subroutine) or fp_enable_all subroutine or the fp_sh_info (fp_sh_info, fp_sh_trap_info, or fp_sh_set_stat Subroutine) or fp_sh_set_stat subroutine, you must use the fp_trap (fp_trap Subroutine) subroutine to change the process' trapping mode.
Item | Description |
---|---|
flag | Specifies
a query of, or change in, the trap mode:
Note: Some hardware models do not support all modes.
If an unsupported mode is requested, the fp_trapstate subroutine
returns FP_TRAP_UNIMPL and the trapping mode is not changed.
|
If called with the FP_TRAPSTATE_OFF, FP_TRAPSTATE_IMP, FP_TRAPSTATE_IMP_REC, or FP_TRAPSTATE_PRECISE flag, the fp_trapstate subroutine returns a value indicating the previous mode of the process. The value may be FP_TRAPSTATE_OFF, FP_TRAPSTATE_IMP, FP_TRAPSTATE_IMP_REC, or FP_TRAPSTATE_PRECISE. If the hardware does not support the requested mode, the fp_trapstate subroutine returns FP_TRAP_UNIMPL.
If called with the FP_TRAPSTATE_QUERY flag, the fp_trapstate subroutine returns a value indicating the current mode of the process. The value may be FP_TRAPSTATE_OFF, FP_TRAPSTATE_IMP, FP_TRAPSTATE_IMP_REC, or FP_TRAPSTATE_PRECISE.
If called with the FP_TRAPSTATE_FASTMODE flag, the fp_trapstate subroutine returns a value indicating which mode was selected. The value may be FP_TRAPSTATE_OFF, FP_TRAPSTATE_IMP, FP_TRAPSTATE_IMP_REC, or FP_TRAPSTATE_PRECISE.