-qsimd
Category
Pragma equivalent
#pragma nosimd
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.
Defaults
Whether -qsimd is specified or not, -qsimd=auto is implied at the -O3 or higher optimization level; -qsimd=noauto is implied at the -O2 or lower optimization level.
Usage
The -qsimd=auto option enables automatic generation of vector instructions for processors that support them.
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.
Rules
The following rules apply when you use the -qsimd option:
- -qsimd=auto takes effect only when the optimization level is -O3 or higher. When the optimization level is -O2 or lower, the compiler ignores -qsimd=auto if it is specified.
- 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. 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.
Predefined macros
None.
Example
...
#pragma nosimd
for (i=1; i<1000; i++) {
/* program code */
}