44
POWER7 and Optimization and Tuning Guide
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.
57
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.
58
How to take advantage of DFP unit on POWER
You can take advantage of the DFP unit on POWER with the following features:
59
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
7 decimal digits of accuracy
_Decimal64
16 decimal digits of accuracy
_Decimal128
34 decimal digits of accuracy
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+LFloating-Point+un
it+on+for+Linux
59
How to compile DFPAL?, available at:
http://speleotrove.com/decimal/dfpal/compile.html
Note: The
printf()
function uses new options to print these new data types:
_Decimal32
uses
%Hf
_Decimal64
uses
%Df
_Decimal128
uses
%DDf
Содержание Power System POWER7 Series
Страница 2: ......
Страница 36: ...20 POWER7 and POWER7 Optimization and Tuning Guide...
Страница 70: ...54 POWER7 and POWER7 Optimization and Tuning Guide...
Страница 112: ...96 POWER7 and POWER7 Optimization and Tuning Guide...
Страница 140: ...124 POWER7 and POWER7 Optimization and Tuning Guide...
Страница 162: ...146 POWER7 and POWER7 Optimization and Tuning Guide...
Страница 170: ...154 POWER7 and POWER7 Optimization and Tuning Guide...
Страница 222: ...POWER7 and POWER7 Optimization and Tuning Guide POWER7 and POWER7 Optimization and Tuning Guide...
Страница 223: ......