-qsimd

Category

Optimization and tuning

@PROCESS

None.

Purpose

Controls whether the compiler can automatically take advantage of vector instructions for processors that support them.

These instructions can offer higher performance when used with algorithmic-intensive tasks such as multimedia applications.

Syntax

Read syntax diagramSkip visual syntax diagram
                   .-auto---.     
>>- -q--simd--=----+-noauto-+----------------------------------><

Defaults

  • Not specifying -qsimd is equivalent to specifying -qsimd=noauto.
  • If -qsimd is specified, the default option is -qsimd=noauto at the O2 or lower optimization level, or -qsimd=auto at the O3 -qhot or higher optimization level.

Usage

The -qsimd=auto option enables automatic generation of vector instructions for processors that support them. It replaces the -qenablevmx option, which has been deprecated.

The -qsimd=auto option controls the autosimdization, which was performed by the deprecated -qhot=simd option. If you specify -qhot=simd, the compiler ignores it and does not issue any warning message.

When -qsimd=auto is in effect, the compiler converts certain operations that are performed in a loop on successive elements of an array into vector instructions. These instructions calculate several results at one time, which is faster than calculating each result sequentially. Applying this option is useful for applications with significant image processing demands.

The -qsimd=noauto option disables the conversion of loop array operations into vector instructions. Finer control can be achieved by using -qstrict=ieeefp, -qstrict=operationprecision, and -qstrict=vectorprecision. For details, see -qstrict.

Note: Using vector instructions to calculate several results at one time might delay or even miss detection of floating-point exceptions on some architectures. If detecting exceptions is important, do not use -qsimd=auto.

Rules

The following rules apply when you use the -qsimd option:
  • Specifying optimization level -O3 -qhot or higher on the POWER7® or higher processors implies -qsimd=auto. In order for the -qsimd=auto option to be effective, you must enable one of the -O3 or -qhot options.
  • Specifying the deprecated -qenablevmx option has the same effect as specifying -qsimd=auto. The compiler does not issue any warning for this.
  • Specifying -qsimd without any suboption has the same effect as -qsimd=auto.
  • -qsimd=auto is valid only on the platforms that support simd instruction set. You can specify -qsimd=auto only on the POWER6® processors or higher, and any future platform with simd support.
  • This option is available only when you set -qarch to a target architecture that supports vector instructions.
  • If you enable IPA and specify -qsimd=auto at the IPA compile step, but specify -qsimd=noauto at the IPA link step, the compiler automatically sets -qsimd=auto at the IPA link step. It also sets an appropriate value for -qarch to match the architecture that is specified at the compile time. Similarly, if you enable IPA and specify -qsimd=noauto at the IPA compile step, but specify -qsimd=auto at the IPA link step, the compiler automatically sets -qsimd=auto at the compile step.

Related information