XL Fortran for AIX 8.1

User's Guide

Chapter 7. XL Fortran Floating-Point Processing

Partial Table-of-Contents

  • IEEE Floating-Point Overview
  • Compiling for Strict IEEE Conformance
  • IEEE Single- and Double-Precision Values
  • IEEE Extended-Precision Values
  • Infinities and NaNs
  • Exception-Handling Model
  • Hardware-Specific Floating-Point Overview
  • Single- and Double-Precision Values
  • Extended-Precision Values
  • How XL Fortran Rounds Floating-Point Calculations
  • Selecting the Rounding Mode
  • Minimizing Rounding Errors
  • Minimizing Overall Rounding
  • Delaying Rounding until Run Time
  • Ensuring that the Rounding Mode is Consistent
  • Duplicating the Floating-Point Results of Other Systems
  • Maximizing Floating-Point Performance
  • Detecting and Trapping Floating-Point Exceptions
  • Compiler Features for Trapping Floating-Point Exceptions
  • Operating System Features for Trapping Floating-Point Exceptions
  • Installing an Exception Handler
  • Producing a Core File
  • Controlling the Floating-Point Status and Control Register
  • xlf_fp_util Procedures
  • fpgets and fpsets Subroutines
  • Sample Programs for Exception Handling
  • Causing Exceptions for Particular Variables
  • Minimizing the Performance Impact of Floating-Point Exception Trapping
  • Floating-Point Processing on the POWER and POWER2 Architectures
  • Precision of Computations
  • Invalid Operation Exceptions for SQRT Operations on POWER Processors
  • This chapter answers some common questions about floating-point processing, such as:

    Related Information:
    This chapter makes frequent reference to the compiler options that are grouped together in Options for Floating-Point Processing, especially -qfloat Option. The XL Fortran compiler also provides three intrinsic modules for exception handling and IEEE arithmetic support to help you write IEEE module-compliant code that can be more portable. See IEEE Modules and Support in the XL Fortran for AIX Language Reference for details.

    The use of the compiler options for floating-point calculations affects the accuracy, performance, and possibly the correctness of floating-point calculations. Although the default values for the options were chosen to provide efficient and correct execution of most programs, you may need to specify nondefault options for your applications to work the way you want. We strongly advise you to read this chapter before using these options.

    The discussions of single-, double-, and extended-precision calculations in this chapter all refer to the default situation, with -qrealsize=4 and no -qautodbl specified. If you change these settings, keep in mind that the size of a Fortran REAL, DOUBLE PRECISION, and so on may change, but single precision, double precision, and extended precision (in lowercase) still refer to 4-, 8-, and 16-byte entities respectively.

    Most of the information in this chapter relates to floating-point processing on the PowerPC family of processors. The section Floating-Point Processing on the POWER and POWER2 Architectures describes the differences between floating-point processing on the PowerPC processors and floating-point processing on the POWER and POWER2 processors.

    [ Top of Page | Previous Page | Next Page | Table of Contents | Index ]