Compaq Fortran
Release Notes for Compaq Tru64
UNIX Systems
2.2 New Features in Version 4.0
The following
f90
command options were added for DIGITAL Fortran 90 Version 4.0:
- Specify the
-assume byterecl
option to::
- Indicate that the OPEN statement RECL unit for unformatted files
is in byte units. If you omit
-assume byterecl
, Compaq Fortran expects the OPEN statement RECL value for unformatted
files to be in longword (four-byte) units.
- Return the record length value for an INQUIRE by output list
(unformatted files) in byte units. If you omit
-assume byterecl
, Compaq Fortran returns the RECL value for an INQUIRE by output list in
longword (four-byte) units.
- The
-check nopower
option allows arithmetic calculations that result in 0**0 or a negative
number raised to an integer power of type real (such as --3**3.0) to be
calculated, rather than stop the program. If you omit
-check nopower
for such calculations, an exception occurs and the program stops
(default is
-check:power
).
For example, if you specified
-check:nopower
, the calculation of the expression 0**0 results in 1 and the
expression --3**3.0 results in --9.
- Specify
-hpf_matmul
to use matrix multiplication from the HPF library. Omitting the
-hpf_matmul
option uses inlined intrinsic code that is faster for small matrices.
For nonparallel compilations, specifying
-hpf_matmul
to use the HPF library routine is faster for large matrices.
- The
-names keyword
option controls how DIGITAL Fortran 90 handles the case-sensitivity of
letters in source code identifiers and external names:
- Using
-names as_is
requests that Compaq Fortran distinguish between uppercase and lowercase
letters in source code identifiers (treats uppercase and lowercase
letters as different) and distinguish between uppercase and lowercase
letters in external names.
- Using
-names lowercase
(default) requests that Compaq Fortran not distinguish between
uppercase and lowercase letters in source code identifiers (treats
lowercase and uppercase letters as equivalent) and force all letters to
be lowercase in external names.
- Using
-names uppercase
requests that Compaq Fortran not distinguish between uppercase
and lowercase letters in source code identifiers (treats lowercase and
uppercase letters as equivalent) and force all letters to be
uppercase in external names.
- The
-noinclude
option prevents searching for include files in the
/usr/include
directory. This option does not apply to the directories
searched for module files or
cpp
files.
- The
-O5
option activates both the software pipelining optimization (
-pipeline
) and the loop transform optimizations (
-transform_loops
). You can also specify
-notransform_loops
or
-nopipeline
with
-O5
.
If you also specify the
-wsf
option to request parallel processing, you cannot use the
-O5
option.
- The
-pipeline
option activates the only software pipelining optimization (previously
done only by
-O5
). The software pipelining optimization applies instruction scheduling
to certain innermost loops, allowing instructions within a loop to
"wrap around" and execute in a different iteration of the loop. This
can reduce the impact of long-latency operations, resulting in faster
loop execution.
Software pipelining also enables the prefetching of
data to reduce the impact of cache misses. In certain cases, software
pipelining improves run-time performance (separate timings are
suggested).
- The following
-reentrancy keyword
options specify the level of thread-safe reentrant run-time library
support needed:
Option Name |
Description |
-reentrancy none
|
Informs the Compaq Fortran RTL that the program will not be relying on
threaded or asynchronous reentrancy. Therefore the RTL need not guard
against such interrupts inside the RTL. This is the default.
|
-reentrancy asynch
|
Informs the Compaq Fortran RTL that the program may contain
asynchronous handlers that could call the RTL. Therefore the RTL will
guard against asynchronous interrupts inside its own critical regions.
|
-reentrancy threaded
|
Informs the Compaq Fortran RTL that the program is multithreaded, such
as those using the DECthreads library. Therefore the RTL will use
thread locking to guard its own critical regions. To use the threaded
libraries, also specify
-threads
.
|
-noreentrancy
|
The same as
-reentrancy none
.
|
- The
-S
option generates a .s file, which can be assembled. This option is
intended for systems running Compaq Tru64 UNIX (DIGITAL UNIX) Version
4.0 or later, which has certain new Assembler features.
Certain
complex programs that use modules or common blocks compiled with
-S
may not generate code completely acceptable to the Assembler.
- The
-speculate keyword
option supports the speculative execution optimization:
- Use
-speculate all
to perform the speculative execution optimization on all routines in
the program. All exceptions within the entire program will be quietly
dismissed without calling any user-mode signal handler.
- Use
-speculate by_routine
to perform the speculative execution optimization on all routines in
the current compilation unit (set of routines being compiled), but
speculative execution will not be performed for routines in other
compilation units in the program.
- Use
-speculate none
or
-nospeculate
to suppress the speculative execution optimization. This is the default.
The speculative execution optimization reduces instruction latency
stalls to improve run-time performance for certain programs or
routines. This optimization evaluates conditional code (including
exceptions) and moves instructions that would otherwise be executed
conditionally to a position before the test, so they are executed
unconditionally.
Speculative execution does not support some
run-time error checking, since exception and signal processing
(including SIGSEGV, SIGBUS, and SIGFPE) is conditional. When the
program needs debugging or while testing for errors, use
-speculate none
(default).
- Specifying
-threads
requests that the linker use threaded libraries. This is usually used
with
-reentrancy threaded
.
- The
-transform_loops
option supports a group of optimizations that improve the performance
of the memory system and can apply to multiple nested loops. The loops
chosen for loop transformation optimizations are always counted
loops (counted loops include DO or IF loops, but not uncounted
DO WHILE loops). In certain cases, loop transformation improves
run-time performance (separate timings are suggested).
- Specify
-nowsf_main
to indicate that the HPF global routine being compiled will be linked
with a main program that was not compiled with
-wsf
.
For more information on
f90
command options, see the Compaq Fortran User Manual for Tru64 UNIX and Linux Alpha Systems, Chapter 3, or f90(1).
In addition to the
f90
command-line options, the following new or changed features were added
for Version 4.0:
- The random_number intrinsic (as of Version 4.0) uses two separate
congruential generators together to produce a period of approximately
10**18, and produces real pseudorandom results with a uniform
distribution in (0,1). It accepts two integer seeds, the first of which
is reduced to the range [1, 2147483562]. The second seed is reduced to
the range [1, 2147483398]. This means that the generator effectively
uses two 31-bit seeds.
The new algorithm behaves differently from
one provided prior to Version 4.0 in the following ways:
- Both seeds are active and contribute to the random number being
produced.
- If the given seeds are not in the ranges given above, they will be
reduced to be in those ranges.
- The sequences of random numbers produced by the new generator will
be different from the sequences produced by the old generator.
For more information on the algorithm, see:
- Communications of the ACM vol 31 num 6 June 1988, entitled
Efficient and Portable Combined Random Number Generators by
Pierre L'ecuyer
- Springer-Verlag New York, N. Y. 2nd ed. 1987, entitled
A Guide to Simulation by Bratley, P., Fox, B. L., and Schrage,
L. E.
For an example program, see Section 1.11.4.
- The implementation of the MATMUL intrinsic procedure was changed
for this release. Previously the compiler called a routine in the
scalar HPF library to perform the operation. As of this release, the
compiler generates optimized inline code for the MATMUL intrinsic with
a significant increase in the performance when the size of the array
arguments are small.
To use previous implementation of the MATMUL
intrinsic (routine in the scalar HPF library), specify
-hpf_matmul
.
- The cDEC$ ALIAS directive
The cDEC$ ALIAS directive is now
supported in the same manner as in Compaq Fortran 77. This directive
provides the ability to specify that the external name of an external
subprogram is different than the name by which it is referenced in the
calling subprogram.
This feature can be useful when porting code
between OpenVMS and UNIX systems where different routine naming
conventions are in use.
For more information on the cDEC$ ALIAS
directive, see the Compaq Fortran User Manual for Tru64 UNIX and Linux Alpha Systems.
- The cDEC$ ATTRIBUTES directive
The cDEC$ ATTRIBUTES directive
lets you specify properties for data objects and procedures. These
properties let you specify how data is passed and the rules for
invoking procedures. This directive is intended to simplify mixed
language calls with Compaq Fortran routines written in C or Assembler.
For more information on the cDEC$ ATTRIBUTES directive, see
Compaq Fortran User Manual for Tru64 UNIX and Linux Alpha Systems.
- An additional math library allows use of optimizations for a series
of square root calculations.
The library file
libm_4sqrt
ships on the DIGITAL Fortran 90 Version 4.0 kit (and DIGITAL Fortran 77
Version 4.0). These optimizations improve run-time performance when a
series of square root calculations occur within a counted loop.
- Enhanced support for the FORALL statement and construct
The
FORALL construct now allows the following statements in the forall body:
- Pointer assignment statement
- FORALL statement or construct (nested FORALL)
- WHERE statement or construct
Please note that each statement in the FORALL body is executed
completely before execution begins on the next FORALL body statement.
The compiler now correctly defines the scope of a FORALL subscript
name to be the scope of the FORALL construct. That is, the subscript
name is valid only within the scope of the FORALL. Its value is
undefined on completion of the FORALL construct.
- OPTIONS statement options can now be abbreviated (for compatibility
with DIGITAL Fortran 77).
- The
-vms
option now supports use of /LIST or /NOLIST in an INCLUDE statement
(for compatibility with DIGITAL Fortran 77).
- To improve run-time performance, new optimizations are now
available and certain improvements have been made, including:
- Certain intrinsic procedures specific to Fortran 90 (not available
in FORTRAN-77)
- Subprogram calls with array arguments
- New command-line options that activate new optimizations, including
the loop transformation optimizations (
-transform_loops
or
-O5
) and the speculative execution optimization (
-speculate keyword
). The software pipelining optimization is now activated by using
-pipeline
or
-O5
.
- Variable formats expressions (VFEs) are now allowed in quoted
strings.
- Invalid formats in quoted strings are now detected at compile-time
rather than run-time.
For more information on compatibility with DIGITAL Fortran 77, see the
revised Compaq Fortran User Manual for Tru64 UNIX and Linux Alpha Systems, Appendix A.
2.3 New Features in Version 2.0
New features for Version 2.0 include the LOC intrinsic function. LOC
returns the internal address of its argument (same as the built-in
function %LOC).
In addition, the Compaq Ladebug debugger has added support for Compaq
Fortran language features (see Section 1.11.8.1).
2.4 New Features in Version 1.3
New features for Version 1.3 include the f90 command options
that support the Compaq Parallel Software Environment.
To request parallel execution, specify the
-wsf
or
-wsf nn
option . This compiles the program to run in parallel using the
Compaq Parallel Software Environment product. The optional nn parameter specifies the
number of processors on which the program is intended to execute. If
not specified, the program will be compiled to execute on any number of
processors. More efficient code is generated when nn is
specified.
If you specify the
-wsf
or
-wsf nn
option to request parallel execution, you can also use the following
related options:
- The
-assume nozsize
option assumes there are no zero-sized array sections.
- The
-nearest_neighbor
or
-nearest_neighbor nn
option enables or disables the nearest neighbor parallel optimization.
The optional nn parameter specifies the width of the shadow
edge to use. If you omit nn, it is set to 1.
- The
-pprof string
option allows parallel profiling of an application. Valid characters
for string are s for sampling or i for interval. This option
must be used with the
-non_shared
option (as well as
-wsf
or
-wsf nn
). This option must not be used with the
-p1
option.
- The
-show wsfinfo
option includes information about statements which cause interprocessor
communication to be generated or are serialized in the listing file.
Other Version 1.3 new features include the following:
- Support for the DIGITAL Fortran 77 pointers (CRAY® style). This
is an extension to the Fortran 95/90 and FORTRAN-77 standards. For more
information, see the DEC Fortran Language Reference Manual and Section 1.11.5.
- Bit constants with a trailing B or Z or leading X (a Compaq Fortran
extension) are now supported for compatibility with Compaq Fortran 77:
i = '001'B
k = '0ff'Z
j = X'00f'
|
- The SYSTEM_CLOCK intrinsic procedure has been extended to allow
integer arguments of any KIND rather than the default integer KIND .
This allows the use of INTEGER*8 arguments to obtain a higher degree of
magnitude and accuracy in timings (1,000,000 counts per second). For
example:
integer*8 count,count_max,count_rate
call system_clock(count,count_rate,count_max)
|
- When it is passed an INTEGER (KIND=4) value, the SYSTEM_CLOCK
intrinsic procedure now returns a value in terms of 10,000 instead of
1,000,000 counts per second.
- Debugging support has been enhanced to allow breakpoints on
CONTINUE, GOTO, and RETURN statements. Before Version 1.3, breakpoints
could not be set on a CONTINUE statement and only on certain GOTO and
RETURN statements.
- The following DIGITAL Fortran 90 cDEC$ directives are now supported:
- cDEC$ IDENT specifies a string that identifies the object file.
- cDEC$ OPTIONS and cDEC$ END_OPTIONS controls alignment of fields in
common blocks, record structures, and most derived-type structures.
- cDEC$ PSECT modifies certain attributes of a common block,
including the [NO]MULTILANGUAGE attribute for compatibility with
DIGITAL Fortran 77.
- cDEC$ TITLE and cDEC$ SUBTITLE specifies strings for the title and
subtitle of a listing file header.
- Any number raised to a floating point 2.0 (x ** 2.0) is now
transformed to (x ** 2) for compatibility with DIGITAL Fortran 77.
- The Bessel function 3f library (jacket) routines are now supported
(see bessel(3f))
- The following
f90
command options were added for Version 1.3:
- The
-fuse_xref
option requests that DIGITAL Fortran 90 generate a data file that the
DEC FUSE Database Manager uses to create a cross-reference database
file. This improves the performance of the DEC FUSE Call Graph Browser
and Cross-Referencer that use the database file for their operations.
- The
-inline speed
and
-inline size
options have been added in place of
-inline automatic
to provide more control over procedure inlining:
Use
-inline size
(same as
-inline space
) to inline procedures that will likely improve run-time performance
where inlining will not significantly increase program size. This
option is meaningful only at optimization levels
-O1
and higher.
Use
-inline speed
to inline procedures that will likely improve run-time performance
where inlining may significantly increase program size. Using
-inline speed
often results in larger executable program sizes (than
-inline size
). This type of inlining occurs automatically with the
-O4
or
-O5
optimization levels. This option is meaningful only at optimization
levels
-O1
and higher.
Other
-inline xxxx
options include
-inline none
,
-inline manual
, and
-inline all
(see Section 2.5).
- The
-ladebug
option includes additional symbolic information in the object file for
the DIGITAL Ladebug debugger (see ladebug(1). This option enables Ladebug to
print and assign to dynamic arrays using standard Fortran syntax,
including array sections.
- The
-show map
option includes a symbol map in the listing file (also specify
-V
).
- The
-version
option displays DIGITAL Fortran 90 version number information.
For more complete product information, see the Compaq Fortran
documentation and the f90(1) reference
(man) page.
2.5 New Features in Version 1.2
DIGITAL Fortran 90 Version 1.2 contains the following changes since
Version 1.1:
- Support for REAL (KIND=16) (or REAL*16) X_float (extended
precision) data type and its associated intrinsics (a DIGITAL Fortran
extension). For more information see Section 1.11.
- Support for variable format expressions (VFEs), a DIGITAL Fortran
extension (see Section 1.11).
- Support for OPTIONS statements, which allow you to specify
command-line options in your source files. The OPTIONS statement is a
DIGITAL Fortran extension.
- Intrinsic procedures FP_CLASS and IMAG (a DIGITAL Fortran
extension).
- STATIC and AUTOMATIC declaration attributes and statements (a
DIGITAL Fortran extension).
- The following
f90
command options were added for Version 1.2:
- The
-convert fgx
and
-convert fdx
options allow conversion of unformatted OpenVMS Alpha DIGITAL Fortran
77 data files. Similarly, the FDX and FGX keywords are recognized for
the OPEN statement CONVERT keyword and the FORT_CONVERTn
environment variable names.
Specifying
-convert fdx
indicates the data contains::
- Little endian integer format (INTEGER declarations of the
appropriate size)
- REAL*4 and COMPLEX*8 data in VAX F_float format
- REAL*8 and COMPLEX*16 data in VAX D_float format
- REAL*16 data in native X_float format
Specifying
-convert fgx
indicates the data contains:
- Little endian integer format (INTEGER declarations of the
appropriate size)
- REAL*4 and COMPLEX*8 data in VAX F_float format
- REAL*8 and COMPLEX*16 data in VAX G_float format
- REAL*16 data in native X_float format
- The
-double_size 128
option specifies that DOUBLE PRECISION declarations are implemented as
extended precision REAL (KIND=16) data rather than double precision
REAL (KIND=8) data.
- The
-real_size 128
and
-r16
options allow a REAL declaration to be interpreted using the REAL
(KIND=16) data type.
- The
-inline xxxxx
options can be used to specify the type of inlining done independent of
the
-On
option (optimization level) specified:
- To prevent inlining of procedures (except statement functions), use
-inline none
or
-inline manual
.
This is the type of inlining done with
-O0
,
-O1
,
-O2
, or
-O3
.
- The
-inline automatic
option was replaced at Version 1.3 with
-inline size
and
-inline speed
(see Section 2.4), allowing more control over inlining.
- To inline every call that can possibly be inlined while generating
correct code, including: statement functions, procedures that
Compaq Fortran thinks will improve run-time performance, and any other
procedures that can possibly be inlined while generating correct code
(certain recursive routines cannot be inlined), use
-inline all
. This option is meaningful only at optimization levels
-O1
and higher.
- The
-gen_feedback
option requests additional profiling information needed for feedback
file use. You can use
-gen_feedback
with any optimization level up to
-O3
(to avoid inlining procedures). If you omit a
-On
option, the
-gen_feedback
option changes the default optimization level to
-O0
.
A typical command-line sequence to create a feedback file (
profsample.feedback
) follows:
% f90 -gen_feedback -o profsample -O3 profsample.f90
% pixie profsample
% profsample.pixie
% prof -pixie -feedback profsample.feedback profsample
|
- The
-feedback
option now works with
-cord
or separately without
-cord
to specify a previously-created feedback file. For example:
% f90 -feedback profsample.feedback -o profsample -O3 profsample.f90
|
The feedback file provides the compiler with actual execution
information, which the compiler can use to perform such optimizations
as inlining function calls.
The same optimization level (
-On
option) must be specified for the
f90
command with the
-gen_feedback
option and the
f90
command with the
-feedback name
option.
You can use the feedback file as input to the
f90
compiler and
cord
, as follows:
% f90 -cord -feedback profsample.feedback -o profsample -O3 profsample.f90
|
- The
-tune keyword
option selects processor-specific instruction tuning for
implementations of the Alpha architecture. Regardless of the setting of
-tune keyword
, the generated code will run correctly on all implementations of the
Alpha architecture. Tuning for a specific implementation can improve
run-time performance; it is also possible that code tuned for a
specific target may run slower on another target.
Choose one of the
following:
- To generate and schedule code that will execute well for both types
of chips, use
-tune generic
. This provides generally efficient code for those cases where both
types of chips are likely to be used. If you do not specify any
-tune keyword
option,
-tune generic
is used (default).
- To generate and schedule code optimized for the type of chip in use
on the system being used for compilation, use
-tune host
.
- To generate and schedule code optimized for the 21064, 20164A,
21066, and 21068 implementations of the Alpha chip, use
-tune ev4
.
- To generate and schedule code optimized for the 21164
implementation of the Alpha chip, use
-tune ev5
.
- The
-check noformat
option disables the run-time message (number 61) associated with format
mismatches. It also requests that the data item be formatted using the
specified descriptor, unless the length of the item cannot accommodate
the descriptor (for example, it is still an error to pass an INTEGER
(KIND=2) item to an E edit descriptor). Using
-check noformat
allows such format mismatches as a REAL (KIND=4) item formatted with an
I edit descriptor.
If you omit the
-vms
option, the default is
-check noformat
.
If you specify
-vms
and omit
-check noformat
,
-check format
is used.
- The
-check output_conversion
option disables the run-time message (number 63) associated with format
truncation. The data item is printed with asterisks. Error number 63
occurs when a number could not be output in the specified format field
length without loss of significant digits (format truncation).
If
you omit the
-vms
option, the default is
-check nooutput_conversion
.
If you specify
-vms
and omit
-check nooutput_conversion
,
-check output_conversion
is used.
- The
-vms
option now sets defaults for
-check output_conversion
and
-check format
.
For more complete product information, see the Compaq Fortran
documentation and the f90(1) reference
(man) page.
2.6 New Features in Version 1.1
DIGITAL Fortran 90 Version 1.1 contains the following changes since
Version 1.0:
- The following
f90
command options were added for Version 1.1:
- The
-check bounds
option generates additional code to detect out-of-bounds subscripts for
array operations and character substring expressions at run-time. Use
this option for debugging purposes.
- The
-idir
option specifies an additional directory to be searched for files
specified with an INCLUDE statement or module files. For Version 1.0,
this option specified an additional directory searched for module files
only.
- The
-warn argument_checking
option issues a warning message about argument mismatches between the
calling and the called procedure when both program units are compiled
together.
- The
fsplit
command now accepts DIGITAL Fortran 90 free-form source files (see
fsplit(1)). For example:
% fsplit -f90 -free bigfile.f90
|
For more complete product information, see the Compaq Fortran
documentation and the f90(1) reference
(man) page.