Next | Prev | Up | Top | Contents | Index

Fortran

The MIPSpro Fortran 77 compilers support 32-bit, 64-bit and N32 compiler modes. The components of the two systems are described in the section that follows.


Fortran 32-Bit System

The 32-bit (ucode) Fortran compiler systems contain the following components:

f77

Fortran driver: Executes the appropriate components below.

cpp

C preprocessor: Handles #include statements and other cpp constructs such as #define, #ifdef, and so on, in the source file.

fopt

Special scalar optimizer: Performs scalar optimization on the Fortran source.

pfa

Power Fortran Accelerator(TM): Automatically parallelizes Fortran source code and performs scalar optimizations. Available with the Power Fortran product.

fcom

Fortran front end: Parses the source file into intermediate code (ucode).

uopt

Optimizer: Performs optimizations on the intermediate file.

ugen

Code generator: Generates binary assembly code from the intermediate file.

as1

Binary assembler: Assembles the binasm code into an object file.

ld

Linker: Links the object file(s) with any libraries.
When you run simple examples through the ucode Fortran compilers, the following components are executed by the compiler driver:

%f77 -32 foo.f
    cpp --> fcom --> ugen --> as1 --> ld
The command

%f77 -32 -O foo.f
    cpp --> fcom --> uopt --> ugen --> as1 --> ld
also invokes the ucode optimizer, uopt. The command

%f77 -32 -sopt foo.f
    cpp --> fopt --> fcom --> ugen --> as1 --> ld
invokes the scalar optimizer but does not invoke the ucode optimizer.

The -mp option signals fcom to recognize inserted parallelization directives:

%f77 -32 -mp foo.f
    cpp --> fcom --> ugen --> as1 --> ld
The Power Fortran option, -pfa:

%f77 -32 -pfa foo.f
    cpp --> pfa --> fcom --> ugen --> as1 --> ld
invokes the Power Fortran Accelerator to convert programs to parallel code automatically.


Fortran 64-Bit and N32 System

The 64-bit Fortran compiler consists of the following components:

f77

Fortran driver: Executes the appropriate components below.

cpp

K&R C preprocessor: Handles #include statements in the source file.

fef77

Fortran 77 front end: Parses the source file into an intermediate representation. It also performs scalar optimization and automatic parallelization. A special version of fef77, fef77p, is available with the Power Fortran product.

fef77p

Power Fortran front end: Parses the source file into an intermediate representation. It also performs scalar optimization and automatic parallelization.

be

Back end: Generates code and assembles it into an object file. It also performs a variety of optimizations which are described in Chapter Four of this book, ''Compilation Issues''.

ld64

Linker: Links the object file(s) with any libraries. When you run the examples from this section on the 64-bit compiler, the following components are executed:
%f77 -64 foo.f
%f77 -64 -O foo.f
%f77 -64 -sopt foo.f
%f77 -64 -mp foo.f
       cpp --> fef77 --> be --> ld64
%f77 -64 -pfa foo.f
       cpp --> fef77p --> be --> ld64
Under the MIPSpro 64-bit compiler, scalar optimizations are performed in fef77. Further optimizations are performed in the back end.

Note that when -O is used under the 64-bit compiler, as opposed to ucode, both scalar and back end optimizations are performed.

Note also that -O3 is available with -c. Unlike the ucode compilers, -O3 does not result in interprocedural optimizations being performed.

The -sopt switch is supported on the 64-bit compiler and causes fef77 to perform the desired scalar optimizations.

The -mp switch is supported on the 64-bit compiler and causes fef77 to recognize inserted parallelization directives.

The -pfa switch is supported on the 64-bit compiler and causes fef77p to perform automatic parallelization.


Next | Prev | Up | Top | Contents | Index