FloatingPointDoc.tioga
Russ Atkinson (RRA) July 5, 1989 11:16:02 pm PDT
Weiser, January 28, 1991 11:29 pm PST
FLOATINGPOINT
PCEDAR 2.0 %
FloatingPoint
-- support for REAL and DREAL
Russ Atkinson
Ó Copyright 1989 Xerox Corporation. All rights reserved.
Abstract: The FloatingPoint package provides basic support for the Mesa types REAL and DREAL. The current support is based on the IEEE standard.
Created by: Russ Atkinson
Maintained by: Russ Atkinson <Atkinson.pa>
Keywords: floating point, REAL, DREAL, math, IEEE
XEROX Xerox Corporation
Palo Alto Research Center
3333 Coyote Hill Road
Palo Alto, California 94304
1. Interfaces
FloatingPointCommon
This interface defines the common error (Error), the common exception type (Exception), and other common fetures shared between REAL and DREAL types.
FloatingPointPrivate
This interface provides access to some implementation details. It is likely to change on short notice, and its use is discouraged.
RealSupport & RealFns
These interfaces provide support for REAL. The basic support is in RealSupport and the mathematical functions are in RealFns.
NOTE: for compatibility reasons, RealFns is the same interface that was supported in the Real package for PCedar1.2 and PCedar2.0. However, this interface should be imported via the FloatingPoint package, and the use of the Real interface is discouraged.
DRealSupport & DRealFns
These interfaces provide support for DREAL. The basic support is in DRealSupport and the mathematical functions are in DRealFns.
The implementation depends on the double support provided by SunOS and the Sparc hardware.
RealConvert
Some functions to convert to and from BCPL REAL format to IEEE (PCedar) format. This is not included in any package.
2. Configurations
FloatingPointHelp.pack
This file must be loaded first if using dynamic loading. It provides the primitive connection to PCR to support floating point exceptions. This implementation is not complete (see the Shortfalls section).
FloatingPointPackage (.config, .c2c.o)
This configuration supports both REAL and DREAL, as well as the common functions. It exports FloatingPointCommon, FloatingPointPrivate, RealSupport, RealFns, DRealSupport, DRealFns interfaces.
FloatingPointSinglePackage (.config, .c2c.o)
This configuration supports REAL operations, as well as the common functions. It exports FloatingPointCommon, FloatingPointPrivate, RealSupport, RealFns interfaces.
FloatingPointSoftPackage (.config, .c2c.o)
This configuration supports REAL operations, as well as the common functions. It exports FloatingPointCommon, FloatingPointPrivate, RealSupport, RealFns interfaces. This package does NOT require FloatingPointHelp.pack to be loaded first, and is suitable for use on the Softcard.
3. Implementation notes
Hardware vs. software
All of the basic operations for REAL and DREAL numbers are treated by default as procedure calls. If the f switch is used in the compiler, REAL operations use whatever the target C compiler uses (in the Sun4 case, floating point instructions). DREAL operations always use procedure calls.
The system is prepared to use completely software implementations of the REAL operations, so that fast, non-trapping, implementations can be had for embedded applications that do not need floating point hardware.
Exceptions
The current default behavior is that exceptions are turned off. Exceptions can be turned on using the FloatingPointPrivate interface. This interface is not monitored, so that concurrent attempts to set the state may produce inconsistent results.
4. Shortfalls
Exceptions
Not properly implemented yet. Some changes to PCR may be necessary. See Alan Demers for more details.
FloatingPointSoftPackage
Not tested. Probably does not handle exceptions properly.