Decimal Floating Point (Dfp) - IBM Power7 Optimization And Tuning Manual

Table of Contents

Advertisement

The alignment of the default malloc(), realloc(), and calloc() allocations can also be
controlled at run time. This task can be done externally to any program by using the
MALLOCALIGN environment variable, or internally to a program by using the mallopt() interface
command option.
For more information about this topic, see 2.4, "Related publications" on page 51.

2.3.6 Decimal floating point (DFP)

Decimal (base 10) data is widely used in commercial and financial applications. However,
most computer systems have only binary (base two) arithmetic. There are two binary number
systems in computers: integer (fixed-point) and floating point. Unfortunately, decimal
calculations cannot be directly implemented with binary floating point. For example, the value
0.1 needs an infinitely recurring binary fraction, while a decimal number system can
represent it exactly, as one tenth. So, using binary floating point cannot ensure that results
are the same as those results using decimal arithmetic.
In general, DFP operations are emulated with binary fixed-point integers. Decimal numbers
are traditionally held in a binary-coded decimal (BCD) format. Although BCD provides
sufficient accuracy for decimal calculation, it imposes a heavy cost in performance, because it
is usually implemented in software.
IBM POWER6 and POWER7 processor-based systems provide hardware support for DFP
arithmetic. The POWER6 and POWER7 microprocessor cores include a DFP unit that
provides acceleration for the DFP arithmetic. The IBM Power instruction set is expanded:
54 new instructions were added to support the DFP unit architecture. DFP can provide a
performance boost for applications that are using BCD calculations.
How to take advantage of DFP unit on POWER
You can take advantage of the DFP unit on POWER with the following features:
Native DFP language support with a compiler
The C draft standard includes the following new data types (these are native data types,
as are int, long, float, double, and so on):
_Decimal32
_Decimal64
_Decimal128
Note: The printf() function uses new options to print these new data types:
57
AIX Vector Programming, available at:
http://publib.boulder.ibm.com/infocenter/aix/v7r1/index.jsp?topic=/com.ibm.aix.genprogc/doc/genprogc
/vector_prog.htm
58
How to Leverage Decimal Floating-Point unit on POWER6 for Linux, available at:
http://www.ibm.com/developerworks/wikis/display/hpccentral/How+to+Leverage+Decimal+Floating-Point+un
it+on+POWER6+for+Linux
59
How to compile DFPAL?, available at:
44
POWER7 and POWER7+ Optimization and Tuning Guide
57
7 decimal digits of accuracy
16 decimal digits of accuracy
34 decimal digits of accuracy
_Decimal32 uses %Hf
_Decimal64 uses %Df
_Decimal128 uses %DDf
http://speleotrove.com/decimal/dfpal/compile.html
58
59

Advertisement

Table of Contents
loading

This manual is also suitable for:

Power7+

Table of Contents