100 POWER7 and POWER7+ Optimization and Tuning Guide
These techniques are not restricted to systems libraries, and can be easily applied to
application shared library components. The dynamic code path and processor tuned libraries
are good starting points. With this method, the compiler and dynamic linker do most of the
work. You need only some additional build time and extra media for the multiple
library images.
In this example, the following conditions apply:
Your product is implemented in your own shared library, such as libmyapp.so.
You want to support Linux running on POWER5, POWER6, and POWER7 Systems.
DFP and Vector considerations:
– Your oldest supported platform is POWER5, which does not have a DFP or the
Vector unit.
– POWER6 has DFP and a Vector Unit implementing the older VMX (vector float but no
vector double) instructions.
– POWER7 has DPF and the new Vector Scalar Extended (VSX) Unit (the original VMX
instructions plus Vector Double and more).
– Your application benefits greatly from both Hardware Decimal and high performance
vector, but if you compile your application with -mcpu=power7 -O3, it does not run on
POWER5 (no hardware DFP instructions) or POWER6 (no vector double
instructions) machines.
You can optimize all three Power platforms if you build and install your application and
libraries correctly by completing the following steps:
1. Build the main application binary file and the default version of libmyapp.so for the oldest
supported platform (in this case, use -mcpu=power5 -O3). You can still use decimal data
because the Advance Toolchain and the newest SLES11 and RHEL6 include a DFP
emulation library and run time.
2. Install the application (myapp) into the appropriate ./bin directory and libmyapp.so into
the appropriate ./lib64 directory. The following paths provide the application main and
default run time for your product:.
– /opt/ibm/myapp1.0/bin/myapp
– /opt/ibm/myapp1.0/lib64/libmyapp.so
3. Compile and link libmyapp.so with -mcpu=power6 -O3, which enables the compiler to
generate DFP and VMX instructions for POWER6 machines.
4. Install this version of libmyapp.so into the appropriate ./lib64/power6 directory.
For example:
/opt/ibm/myapp1.0/lib64/power6/libmyapp.so
5. Compile and link the fully optimized version of libmyapp.so for POWER7 with
-mcpu=power7 -O3, which enables the compiler to generate DFP and all the VSX
instructions. Install this version of libmyapp.so into the appropriate ./lib64/power7
directory. For example:
/opt/ibm/myapp1.0/lib64/power7/libmyapp.so