fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

UNWIND MARKED LOOPS

Syntax:

UNWIND ALL LOOPS UNWIND MARKED LOOPS UNWIND LOOPS [AS] MARKED DO NOT UNWIND LOOPS

Function:

The command UNWIND ALL LOOPS unwinds all DO loops with constant bounds and strides in the code.

The command UNWIND MARKED LOOPS or UNWIND LOOPS AS MARKED instructs fpt to unwind DO loops marked in the program text by the command UNWIND. This command is written in a comment immediately before the DO statement which begins the loop.

Loops may be unwound, starting from the outer loops and working inwards, or starting from the inner loops and working outwards. This is important for two reasons. If the bounds or stride of an inner loop depend on a DO loop index in the outer loop, the outer loop must be unwound first so that the value of the index is available. If loop unwinding is limited by specifying a maximum number of statements, more efficient code is generated if the inner loops are unwound first. The order of unwinding is specified by the commands UNWIND INNER LOOPS FIRST and UNWIND OUTER LOOPS FIRST.

Loop unwinding is suppressed by the command DO NOT UNWIND LOOPS.

Note that unwinding of marked loops is also suppressed by the command IGNORE COMMANDS IN THE CODE.

Where to Use this Command

Operating system command line Yes
Configuration file, config.fsp Yes
Specification (fsp) files, *.fsp Yes
Interactively, to FPT> prompt Yes
Interactive command files Yes
Embedded in the Fortran code No

Default

UNWIND MARKED LOOPS

(Note that defaults may be changed in the configuration file)

See Also

IGNORE COMMANDS IN THE CODE

UNWIND

UNWIND INNER LOOPS FIRST

UNWIND OUTER LOOPS FIRST

Copyright ©1995 to 2025 Software Validation Ltd. All rights reserved.