[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1


fp_any_enable, fp_is_enabled, fp_enable_all, fp_enable, fp_disable_all, or fp_disable Subroutine

Purpose

These subroutines allow operations on the floating-point trap control.

Library

Standard C Library (libc.a)

Syntax

#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;

Description

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

Parameters


Mask A 32-bit pattern that identifies floating-point traps.

Return Values

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.

Implementation Specifics

These subroutines are part of Base Operating System (BOS) Runtime.

Related Information

The fp_clr_flag, fp_set_flag, fp_read_flag, fp_swap_flag (fp_clr_flag, fp_set_flag, fp_read_flag, or fp_swap_flag Subroutine)subroutine, fp_invalid_op, fp_divbyzero, fp_overflow, fp_underflow, fp_inexact, fp_any_xcp (fp_invalid_op, fp_divbyzero, fp_overflow, fp_underflow, fp_inexact, fp_any_xcp Subroutine) subroutines, fp_iop_snan, fp_iop_infsinf, fp_iop_infdinf, fp_iop_zrdzr, fp_iop_infmzr, fp_iop_invcmp (fp_iop_snan, fp_iop_infsinf, fp_iop_infdinf, fp_iop_zrdzr, fp_iop_infmzr, fp_iop_invcmp, fp_iop_sqrt, fp_iop_convert, or fp_iop_vxsoft Subroutines) subroutines, fp_read_rnd, and fp_swap_rnd (fp_read_rnd or fp_swap_rnd Subroutine) subroutines, fp_trap (fp_trap Subroutine) subroutine.

Floating-Point Processor Overview in POWERstation and POWERserver Hardware Technical Information-General Architectures.

Subroutines Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]