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:

Item Description
TRP_INVALID Invalid Operation Summary
TRP_DIV_BY_ZERO Divide by Zero
TRP_OVERFLOW Overflow
TRP_UNDERFLOW Underflow
TRP_INEXACT Inexact Result

Parameters

Item Description
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.