JCP 寫:其實我不會用compiler,只會用人家寫好的Makefile,等intel compiler裝好後要來好好研究compiler怎麼用。
以下是我節錄SPEC的文件中有關Intel C的使用方法!
----------------------------------------------------------
Description of compiler flags for Intel C++ Compiler 7.0 and 7.1
----------------------------------------------------------------
-O1 optimize for speed, but disable some optimizations which increase
code size for a small speed benefit. Includes inline expansion
except for intrinsic functions, global optimizations, string
pooling optimizations.
-O2 This is the default level of optimization.
Optimizes for speed. The -O2 option includes O1 optimizations
and in addition enables inlining of intrinsics and more speed
optimizations.
-O3: Builds on -01 and -02 optimizations by enabling high-level
optimization. This level does not guarantee higher performance
unless loop and memory access transformation take place. In
conjunction with -QaxK/-QxK and QaxW/QxW, this switch causes the
compiler to perform more aggressive data dependency analysis than
for -O2. This may result in longer compilation times.
-Oa[-] assume [do not assume] no aliasing in program
-Qax<codes> generate code specialized for processor extensions
specified by <codes> while also generating generic IA-32 code.
<codes> includes one or more of the following characters:
i Pentium Pro and Pentium II processor instructions
M MMX(TM) instructions
K streaming SIMD extensions (implies i and M above)
W Pentium 4 processor with Streaming SIMD Extensions 2
(implies i, M and K)
-Qx<codes> generate specialized code to run exclusively on processors
supporting the extensions indicated by <codes> as
described above.
-Ob{0|1|2} Controls the compiler's inline expansion.
0: disable inlining.
1: disables inlining unless -Qip or -Ob2 are specified.
2: enables inlining of any function. However, the
compiler decides which functions are inlined. This
option enables interprocedural optimizations and has
the same effect as specifying the -Qip option.
-Qip enable single-file IP optimizations
(within files, same as -Ob2)
-Qipo multi-file ip optimizations that includes:
- inline function expansion
- interprocedural constant propogation
- dead code elimination
- propagation of function characteristics
- passing arguments in registers
- loop-invariant code motion
-Qwp_ipo no longer supported by the compiler; used to mean - inter-procedural
optimization making a "whole-program" assumption.
-Qprof_gen instrument program for profiling for the first phase of
two-phase profile guided otimization
-Qprof_use Instructs the compiler to produce a profile-optimized
executable and merges available dynamic information (.dyn)
files into a pgopti.dpi file. If you perform multiple
executions of the instrumented program, -Qprof_use merges
the dynamic information files again and overwrites the
previous pgopti.dpi file.
Without any other options, the current directory is
searched for .dyn files
-Qrcd The Intel compiler uses the -Qrcd option to improve the
performance of code that requires floating-point-to-integer
conversions.
The system default floating point rounding mode is
round-to-nearest. This means that values are rounded during
floating point calculations. However, the C language requires
floating point values to be truncated when a conversion to an
integer is involved. To do this, the compiler must change the
rounding mode to truncation before each floating
point-to-integer conversion and change it back afterwards.
The -Qrcd option disables the change to truncation of the
rounding mode for all floating point calculations, including
floating point-to-integer conversions. Turning on this option
can improve performance, but floating point conversions to
integer will not conform to C semantics.
-Qunroll[n] Specifies the maximum number of times to unroll a loop. Omit n to
let the compiler decide whether to perform unrolling or not. Use
n = 0 to disable unroller.
If n is not specified, the compiler automatically chooses the maximum
number of times to unroll a loop.
-GX Enables the full C++ Exception Handling unwind semantics.
-GR Enables C++ Runtime Type Information (RTTI).
-Zp{1|2|4|8|16} Specifies the strictest alignment constraint for structure and union
types as one of the following: 1, 2, 4, 8, or 16 (default) bytes.
shlW32M.lib: MicroQuill SmartHeap Library 5.0 available from
http://www.microquill.com/