-qautodbl

Category

Floating-point and integer control

Purpose

Provides an automatic means of converting single-precision floating-point calculations to double-precision and of converting double-precision calculations to extended-precision.

Syntax

Read syntax diagramSkip visual syntax diagram
                    .-none----.   
>>- -q--autodbl--=--+-dbl4----+--------------------------------><
                    +-dbl8----+   
                    +-dbl-----+   
                    +-dblpad4-+   
                    +-dblpad8-+   
                    '-dblpad--'   

@PROCESS:

@PROCESS AUTODBL(setting)

Defaults

-qautodbl=none

Parameters

The -qautodbl suboptions offer different strategies to preserve storage relationships between objects that are promoted or padded and those that are not.

The settings you can use are as follows:
none
Does not promote or pad any objects that share storage. This setting is the default.
dbl4
Promotes floating-point objects that are single-precision (4 bytes in size) or that are composed of such objects (for example, COMPLEX or array objects):
  • REAL(4) is promoted to REAL(8).
  • COMPLEX(4) is promoted to COMPLEX(8).

This suboption requires the libxlfpmt4.a library during linking.

dbl8
Promotes floating-point objects that are double-precision (8 bytes in size) or that are composed of such objects:
  • REAL(8) is promoted to REAL(16).
  • COMPLEX(8) is promoted to COMPLEX(16).

This suboption requires the libxlfpmt8.a library during linking.

dbl
Combines the promotions that dbl4 and dbl8 perform.

This suboption requires the libxlfpmt4.a and libxlfpmt8.a libraries during linking.

dblpad4
Performs the same promotions as dbl4 and pads objects of other types (except CHARACTER) if they could possibly share storage with promoted objects.

This suboption requires the libxlfpmt4.a and libxlfpad.a libraries during linking.

dblpad8
Performs the same promotions as dbl8 and pads objects of other types (except CHARACTER) if they could possibly share storage with promoted objects.

This suboption requires the libxlfpmt8.a and libxlfpad.a libraries during linking.

dblpad
Combines the promotions done by dbl4 and dbl8 and pads objects of other types (except CHARACTER) if they could possibly share storage with promoted objects.

This suboption requires the libxlfpmt4.a, libxlfpmt8.a, and libxlfpad.a libraries during linking.

Usage

You might find this option helpful in porting code where storage relationships are significant and different from the XL Fortran defaults. For example, programs that are written for the IBM® VS FORTRAN compiler may rely on that compiler's equivalent option.

If the appropriate -qautodbl option is specified during linking, the program is automatically linked with the necessary extra libraries. Otherwise, you must link them in manually.

When you have both REAL(4) and REAL(8) calculations in the same program and want to speed up the REAL(4) operations without slowing down the REAL(8) ones, use dbl4. If you need to maintain storage relationships for promoted objects, use dblpad4. If you have few or no REAL(8) calculations, you could also use dblpad.

If you want maximum precision of all results, you can use dbl or dblpad. dbl4, dblpad4, dbl8, and dblpad8 select a subset of real types that have their precision increased.

By using dbl4 or dblpad4, you can increase the size of REAL(4) objects without turning REAL(8) objects into REAL(16)s. REAL(16) is less efficient in calculations than REAL(8) is.

The -qautodbl option handles calls to intrinsics with arguments that are promoted; when necessary, the correct higher-precision intrinsic function is substituted. For example, if single-precision items are being promoted, a call in your program to SIN automatically becomes a call to DSIN.

You must not specify the -qautodbl option if your program contains vector types.

Restrictions

  • Because character data is not promoted or padded, its relationship with storage-associated items that are promoted or padded may not be maintained.
  • If the storage space for a pointee is acquired through the system routine malloc, the size specified to malloc should take into account the extra space needed to represent the pointee if it is promoted or padded.
  • If an intrinsic function cannot be promoted because there is no higher-precision specific name, the original intrinsic function is used, and the compiler displays a warning message.
  • You must compile every compilation unit in a program with the same -qautodbl setting. To detect inconsistent -qautodbl settings, use the -qextchk option when compiling the source file.

Related information

For background information on promotion, padding, and storage/value relationships and for some source examples, see Implementation details for -qautodbl promotion and padding.

-qrealsize describes another option that works like -qautodbl, but it only affects items that are of default kind type and does not do any padding. If you specify both the -qrealsize and the -qautodbl options, only -qautodbl takes effect. Also, -qautodbl overrides the -qdpc option.

Linking 32–bit non-SMP object files using the ld command explains how to manually link additional libraries with object files that you compiled with -qautodbl.