IBM Power7 Optimization And Tuning Manual page 61

Table of Contents

Advertisement

– The IBM XL C/C++ Compiler, release 9 or later for AIX and Linux, includes native DFP
language support. Here is a list of compiler options for IBM XL compilers that are
related to DFP:
• -qdfp: Enables DFP support. This option makes the compiler recognize DFP literal
suffixes, and the _Decimal32, _Decimal64, and _Decimal128 keywords.
• -qfloat=dfpemulate: Instructs the compiler to use calls to library functions to
handle DFP computation, regardless of the architecture level. You might experience
performance degradation when you use software emulation.
• -qfloat=nodfpemulate (the default when the -qarch flag specifies POWER6 or
POWER7): Instructs the compiler to use DFP hardware instructions.
• -D__STDC_WANT_DEC_FP__: Enables the referencing of DFP-defined symbols.
• -ldfp: Enables the DFP functionality that is provided by the Advance Toolchain
on Linux.
For hardware supported DFP, with -qarch=pwr6 or -qarch=pwr7, use the
following command:
cc -qdfp
For software emulation of DFP (on earlier processor chips), use the
following command:
cc -qdfp -qfloat=dfpemulate
– The GCC compilers for Power Systems also include native DFP language support.
As of SLES/11/SP1, and RHEL6, IEEE 754R, DFP is fully integrated with compiler and
run time (printf and DFP math) support. For older Linux distribution releases
(RHEL5/SLES10 and earlier), you can use the freely available Advance Toolchain
compiler and run time. The Advance Toolchain runtime libraries can also be integrated
with recent XL (V9+) compilers for DFP exploitation.
The latest Advance Toolchain compiler and run times can be downloaded from the
following website:
http://linuxpatch.ncsa.uiuc.edu/toolchain/at/
Advance Toolchain is a self-contained toolchain that does not rely on the base system
toolchain for operability. In fact, it is designed to coexist with the toolchain shipped with
the operating system. You do not have to uninstall the regular GCC compilers that
come with your Linux distribution to use the Advance Toolchain.
The latest Enterprise distributions and Advance Toolchain run time use the Linux CPU
tune library capability to automatically select hardware DFP or software
implementation library variants, which are based on the hardware platform.
Here is a list of GCC compiler options for Advance Toolchain that are related to DFP:
• -mhard-dfp (the default when -mcpu=power6 or -mcpu=power7 is specified): Instructs
the compiler to directly take advantage of DFP hardware instructions for
decimal arithmetic.
• -mno-hard-dfp: Instructs the compiler to use calls to library functions to handle DFP
computation, regardless of the architecture level. If your application is dynamically
linked to the libdfp variant and running on POWER6 or POWER7 processors, then
the run time automatically binds to the libdfp variant implemented with hardware
DFP instructions. Otherwise, the software DFP library is used. You might
experience performance degradation when you use software emulation.
Chapter 2. The POWER7 processor
45

Advertisement

Table of Contents
loading

This manual is also suitable for:

Power7+

Table of Contents