Queries or changes the trapping mode in the Machine Status register (MSR).
Note: This subroutine replaces the fp_cpusync subroutine. The fp_cpusync subroutine is supported for compatibility, but the fp_trapstate subroutine should be used for development.
#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 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 or fp_enable_all subroutine or the fp_sh_info or fp_sh_set_stat subroutine, you must use the fp_trap subroutine to change the process' trapping mode.
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_TRAP_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.
This subroutine is part of Base Operating System (BOS) Runtime.
The fp_any_enable, fp_disable_all, fp_disable, fp_enable_all, fp_enable, or fp_is_enabled subroutine, fp_clr_flag, fp_read_flag, fpset_flag, or fp_swap_flag subroutine, sigaction, signal, or sigvec subroutine.
The Floating-Point Processor Overview in POWERstation and POWERserver Hardware Technical Information-General Architectures.
Floating-Point Exceptions Overview in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.