Intel 386 Options
-----------------
These `-m' options are defined for the i386 family of computers:
`-mcpu=CPU-TYPE'
Assume the defaults for the machine type CPU-TYPE when scheduling
instructions. The choices for CPU-TYPE are `i386', `i486',
`i586', `i686', `pentium', `pentiumpro', `k6', and `athlon'
While picking a specific CPU-TYPE will schedule things
appropriately for that particular chip, the compiler will not
generate any code that does not run on the i386 without the
`-march=CPU-TYPE' option being used. `i586' is equivalent to
`pentium' and `i686' is equivalent to `pentiumpro'. `k6' is the
AMD chip as opposed to the Intel ones.
`-march=CPU-TYPE'
Generate instructions for the machine type CPU-TYPE. The choices
for CPU-TYPE are the same as for `-mcpu'. Moreover, specifying
`-march=CPU-TYPE' implies `-mcpu=CPU-TYPE'.
`-m386'
`-m486'
`-mpentium'
`-mpentiumpro'
Synonyms for `-mcpu=i386', `-mcpu=i486', `-mcpu=pentium', and
`-mcpu=pentiumpro' respectively. These synonyms are deprecated.
`-mintel-syntax'
Emit assembly using Intel syntax opcodes instead of AT&T syntax.
`-mieee-fp'
`-mno-ieee-fp'
Control whether or not the compiler uses IEEE floating point
comparisons. These handle correctly the case where the result of a
comparison is unordered.
`-msoft-float'
Generate output containing library calls for floating point.
*Warning:* the requisite libraries are not part of GCC. Normally
the facilities of the machine's usual C compiler are used, but
this can't be done directly in cross-compilation. You must make
your own arrangements to provide suitable library functions for
cross-compilation.
On machines where a function returns floating point results in the
80387 register stack, some floating point opcodes may be emitted
even if `-msoft-float' is used.
`-mno-fp-ret-in-387'
Do not use the FPU registers for return values of functions.
The usual calling convention has functions return values of types
`float' and `double' in an FPU register, even if there is no FPU.
The idea is that the operating system should emulate an FPU.
The option `-mno-fp-ret-in-387' causes such values to be returned
in ordinary CPU registers instead.
`-mno-fancy-math-387'
Some 387 emulators do not support the `sin', `cos' and `sqrt'
instructions for the 387. Specify this option to avoid generating
those instructions. This option is the default on FreeBSD. As of
revision 2.6.1, these instructions are not generated unless you
also use the `-ffast-math' switch.
`-malign-double'
`-mno-align-double'
Control whether GCC aligns `double', `long double', and `long
long' variables on a two word boundary or a one word boundary.
Aligning `double' variables on a two word boundary will produce
code that runs somewhat faster on a `Pentium' at the expense of
more memory.
`-m128bit-long-double'
Control the size of `long double' type. i386 application binary
interface specify the size to be 12 bytes, while modern
architectures (Pentium and newer) prefer `long double' aligned to
8 or 16 byte boundary. This is impossible to reach with 12 byte
long doubles in the array accesses.
*Warning:* if you use the `-m128bit-long-double' switch, the
structures and arrays containing `long double' will change their
size as well as function calling convention for function taking
`long double' will be modified.
`-m96bit-long-double'
Set the size of `long double' to 96 bits as required by the i386
application binary interface. This is the default.
`-msvr3-shlib'
`-mno-svr3-shlib'
Control whether GCC places uninitialized locals into `bss' or
`data'. `-msvr3-shlib' places these locals into `bss'. These
options are meaningful only on System V Release 3.
`-mrtd'
Use a different function-calling convention, in which functions
that take a fixed number of arguments return with the `ret' NUM
instruction, which pops their arguments while returning. This
saves one instruction in the caller since there is no need to pop
the arguments there.
You can specify that an individual function is called with this
calling sequence with the function attribute `stdcall'. You can
also override the `-mrtd' option by using the function attribute
`cdecl'. Note:Function Attributes.
*Warning:* this calling convention is incompatible with the one
normally used on Unix, so you cannot use it if you need to call
libraries compiled with the Unix compiler.
Also, you must provide function prototypes for all functions that
take variable numbers of arguments (including `printf'); otherwise
incorrect code will be generated for calls to those functions.
In addition, seriously incorrect code will result if you call a
function with too many arguments. (Normally, extra arguments are
harmlessly ignored.)
`-mreg-alloc=REGS'
Control the default allocation order of integer registers. The
string REGS is a series of letters specifying a register. The
supported letters are: `a' allocate EAX; `b' allocate EBX; `c'
allocate ECX; `d' allocate EDX; `S' allocate ESI; `D' allocate
EDI; `B' allocate EBP. This option is deprecated and will not be
supported by future releases of gcc.
`-mregparm=NUM'
Control how many registers are used to pass integer arguments. By
default, no registers are used to pass arguments, and at most 3
registers can be used. You can control this behavior for a
specific function by using the function attribute `regparm'.
Note:Function Attributes.
*Warning:* if you use this switch, and NUM is nonzero, then you
must build all modules with the same value, including any
libraries. This includes the system libraries and startup modules.
`-malign-loops=NUM'
Align loops to a 2 raised to a NUM byte boundary. If
`-malign-loops' is not specified, the default is 2 unless gas 2.8
(or later) is being used in which case the default is to align the
loop on a 16 byte boundary if it is less than 8 bytes away.
`-malign-jumps=NUM'
Align instructions that are only jumped to to a 2 raised to a NUM
byte boundary. If `-malign-jumps' is not specified, the default is
2 if optimizing for a 386, and 4 if optimizing for a 486 unless
gas 2.8 (or later) is being used in which case the default is to
align the instruction on a 16 byte boundary if it is less than 8
bytes away.
`-malign-functions=NUM'
Align the start of functions to a 2 raised to NUM byte boundary.
If `-malign-functions' is not specified, the default is 2 if
optimizing for a 386, and 4 if optimizing for a 486.
`-mpreferred-stack-boundary=NUM'
Attempt to keep the stack boundary aligned to a 2 raised to NUM
byte boundary. If `-mpreferred-stack-boundary' is not specified,
the default is 4 (16 bytes or 128 bits).
The stack is required to be aligned on a 4 byte boundary. On
Pentium and PentiumPro, `double' and `long double' values should be
aligned to an 8 byte boundary (see `-malign-double') or suffer
significant run time performance penalties. On Pentium III, the
Streaming SIMD Extension (SSE) data type `__m128' suffers similar
penalties if it is not 16 byte aligned.
To ensure proper alignment of this values on the stack, the stack
boundary must be as aligned as that required by any value stored
on the stack. Further, every function must be generated such that
it keeps the stack aligned. Thus calling a function compiled with
a higher preferred stack boundary from a function compiled with a
lower preferred stack boundary will most likely misalign the
stack. It is recommended that libraries that use callbacks always
use the default setting.
This extra alignment does consume extra stack space. Code that is
sensitive to stack space usage, such as embedded systems and
operating system kernels, may want to reduce the preferred
alignment to `-mpreferred-stack-boundary=2'.
`-mpush-args'
`-mno-push-args'
Use PUSH operations to store outgoing parameters. This method is
shorter and usually equally fast as method using SUB/MOV
operations and is enabled by default. In some cases disabling it
may improve performance because of improved scheduling and reduced
dependencies.
`-maccumulate-outgoing-args'
If enabled, the maximum amount of space required for outgoing
arguments will be computed in the function prologue. This is
faster on most modern CPUs because of reduced dependencies,
improved scheduling and reduced stack usage when preferred stack
boundary is not equal to 2. The drawback is a notable increase in
code size. This switch implies `-mno-push-args'.
`-mthreads'
Support thread-safe exception handling on `Mingw32'. Code that
relies on thread-safe exception handling must compile and link all
code with the `-mthreads' option. When compiling, `-mthreads'
defines `-D_MT'; when linking, it links in a special thread helper
library `-lmingwthrd' which cleans up per thread exception
handling data.
`-mno-align-stringops'
Do not align destination of inlined string operations. This
switch reduces code size and improves performance in case the
destination is already aligned, but gcc don't know about it.
`-minline-all-stringops'
By default GCC inlines string operations only when destination is
known to be aligned at least to 4 byte boundary. This enables
more inlining, increase code size, but may improve performance of
code that depends on fast memcpy, strlen and memset for short
lengths.
`-momit-leaf-frame-pointer'
Don't keep the frame pointer in a register for leaf functions.
This avoids the instructions to save, set up and restore frame
pointers and makes an extra register available in leaf functions.
The option `-fomit-frame-pointer' removes the frame pointer for
all functions which might make debugging harder.