Compiling for specific architectures

You can use -qarch and -qtune to instruct the compiler to generate and tune code for a particular architecture. This allows the compiler to take advantage of machine-specific instructions that can improve performance. The -qarch option determines the architectures on which the resulting programs can run. The -qtune and -qcache options refine the degree of platform-specific optimization performed.

By default, the -qarch setting produces code using only instructions common to all supported architectures, with resultant settings of -qtune and -qcache that are relatively general. To tune performance for a particular processor set or architecture, you may need to specify different settings for one or more of these options. The natural progression to try is to use -qarch, and then add -qtune, and then add -qcache. Because the defaults for -qarch also affect the defaults for -qtune and -qcache, the -qarch option is often all that is needed.

If the compiling machine is also the target architecture, -qarch=auto will automatically detect the setting for the compiling machine. For more information on this compiler option setting, see -qarch and also -O4 and -O5 under the -O option.

If your programs are intended for execution mostly on particular architectures, you may want to add one or more of these options to the configuration file so that they become the default for all compilations.