Optimizes for speed of execution using a selection of options.
This option is a macro that selects a combination of compilation options for optimum execution speed.
The criteria for the -fast option vary with the C, C++, FORTRAN 77, and Pascal compilers. See the appropriate compiler documentation for specifics.
This option provides near maximum performance for many applications by expanding to the following compilation options:
Option |
SPARC |
x86 |
|
---|---|---|---|
-dalign |
X |
- |
|
-fns |
X |
- |
|
-fsimple |
X |
- |
|
-ftrap=%none |
X |
X |
|
-nofstore |
- |
X |
|
-xlibmil |
X |
X |
|
-xlibmopt |
X |
X |
|
-xO4 |
X |
X |
|
-xtarget=native |
X |
X |
|
The -fast option expands into options that may affect options that are specified after -fast.
The code generation option, optimization level, and use of inline template files can be overridden by subsequent options. The optimization level that you specify overrides a previously set optimization level.
The -fast option includes -fns -ftrap=%none; that is, this option turns off all trapping.
The following compiler command results in an optimization level of -xO3:
demo% CC -fast -xO3
The following compiler command results in an optimization level of -xO4:
demo% CC -xO3 -fast
Do not use this option for programs that depend on IEEE standard floating-point arithmetic; different numerical results, premature program termination, or unexpected SIGFPE signals can occur.
In previous SPARC releases, the -fast macro option included -fnonstd; now it does not. Nonstandard floating-point mode is not initialized by -fast. See the Numerical Computation Guide, ieee_sun(3M).
-dalign, -fns, -fsimple, -ftrap=%none, -libmil, -nofstore, -xO4, -xlibmopt, -xtarget=native