112
POWER7 and Optimization and Tuning Guide
6.2.3 GCC compiler family
The information in this section applies specifically to the GCC compiler family.
Prerequisites
The GCC compiler assists with identifying certain programming errors that are outlined in
6.2.1, “Common prerequisites” on page 109:
Static analysis and warnings. The
-pedantic
and
-pedantic-errors
options warn of
violations of ISO C or ISO C++ standards.
The language standard to enforce and the aliasing compliance requirements are specified
by the
-std
,
-ansi
, and
-fno-strict-aliasing
options. For example:
– ISO C 1990 level:
-std=c89
,
-std=iso9899:1990
, and
-ansi
– ISO C 1998 level:
-std=c99
and
-std=iso9899:1999
– Do not assume strict aliasing rules for the language level:
–fno-strict-aliasing
The GCC compiler documentation contains more details about these options.
1,
2,
3
High-order transformations
The GCC compilers have sophisticated additional optimizations beyond
-O3
to improve the
performance of numeric applications. These applications often contain regular loops that
process large amounts of data. These optimizations, when enabled, analyze these loops,
identify opportunities for restructuring them to improve cache usage, improve data reuse, and
expose more instruction-level parallelism to the hardware. For these types of applications, the
performance impact of this option can be substantial. The key compiler options include:
-fpeel-loops
-funroll-loops
-ftree-vectorize
-fvect-cost-model
-mcmodel=medium
Specifying the
-mveclibabi=mass
option and linking to the MASS libraries enables more loops
for
-ftree-vectorize
. The MASS libraries support only static archives for linking, and so they
require explicit naming and library search order for each platform/mode:
POWER7 32-bit:
-L<MASS-dir>/lib -lmassvp -lmass_simdp7 -lmass -lm
POWER7 64-bit:
-L<
MASS-dir
>/lib64 -lmassvp_64 -lmass_simdp7_64 -lmass_64 -lm
POWER6 32-bit:
-L<
MASS-dir
>/lib -lmassvp6 -lmass -lm
POWER6 64-bit:
-L<
MASS-dir
>/lib64 -lmassvp6_64 -lmass_64 -lm
ABI improvements
The
-mcmodel={medium|large}
option implements important ABI improvements that are
further optimized in hardware for future generations of the POWER processor. This
optimization extends the TOC to 2 GB and eliminates the previous requirement for
-mminimal-toc
or multi-TOC switching within a single a program or library. The default for
newer GCC compilers (including Advance Toolchain 4.0 and later) is
-mcmodel=medium
. This
model logically extends the TOC to include local static data and constants and allows direct
data access relative to the TOC pointer.
1
Language Standards Supported by GCC, available at:
http://gcc.gnu.org/onlinedocs/gcc-3.4.2/gcc/Standards.html#Standards
2
Options Controlling C Dialect, available at:
http://gcc.gnu.org/onlinedocs/gcc-3.4.2/gcc/C-Dialect-Options.html#C-Dialect-Options
3
Options That Control Optimization, and specifically the discussion of -fstrict-aliasing, available at:
http://gcc.gnu.org/onlinedocs/gcc-3.4.2/gcc/Optimize-Options.html#Optimize-Options
Содержание 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: ......