next up previous contents index
Next: Conditional Compilation Directives Up: RATTY Previous: Language Extensions

Optimization Directives

Vector computers occasionally need directives to help optimize some loops. The needed directives, however, vary between manufacturers. RATTY takes optimization directives in a standard form and converts them to the form recognized by the target compiler. A directive is introduced by either a `c#' or a `#' starting a line (i.e. starting in column 1), for example:

  c#directive
or
  #directive
Either form can be used, but the `c#' form is preferable, as the directive will be seen as a comment to a standard compiler. The directives are:
ivdep
This instructs the compiler to ignore any apparent vector dependencies in the immediately following loop. This is modestly commonly used.
maxloop nn
This indicates that the loop count of the immediately following loop will not exceed `nn'. This enables the compiler to optimize some short loops. For example
  c#maxloop 32
      do i=1,n
         .
         .
      enddo
indicates that the do loop will not execute more than 32 times.
nooptimize
This directive appears just before a do-loop that should not be optimized.


Last generated by rsault@atnf.csiro.au on 14 Mar 1996