📄 i386-and-x86-64-options.html
字号:
boundary. Aligning <code>double</code> variables on a two word boundary willproduce code that runs somewhat faster on a <code>Pentium</code> at theexpense of more memory. <p><strong>Warning:</strong> if you use the <code>-malign-double</code> switch,structures containing the above types will be aligned differently thanthe published application binary interface specifications for the 386and will not be binary compatible with structures in code compiledwithout that switch. <br><dt><code>-m96bit-long-double</code> <dd><dt><code>-m128bit-long-double</code> <dd>These switches control the size of <code>long double</code> type. The i386application binary interface specifies the size to be 96 bits,so <code>-m96bit-long-double</code> is the default in 32 bit mode. <p>Modern architectures (Pentium and newer) would prefer <code>long double</code>to be aligned to an 8 or 16 byte boundary. In arrays or structuresconforming to the ABI, this would not be possible. So specifying a<code>-m128bit-long-double</code> will align <code>long double</code>to a 16 byte boundary by padding the <code>long double</code> with an additional32 bit zero. <p>In the x86-64 compiler, <code>-m128bit-long-double</code> is the default choice asits ABI specifies that <code>long double</code> is to be aligned on 16 byte boundary. <p>Notice that neither of these options enable any extra precision over the x87standard of 80 bits for a <code>long double</code>. <p><strong>Warning:</strong> if you override the default value for your target ABI, thestructures and arrays containing <code>long double</code> variables will changetheir size as well as function calling convention for function taking<code>long double</code> will be modified. Hence they will not be binarycompatible with arrays or structures in code compiled without that switch. <br><dt><code>-msvr3-shlib</code> <dd><dt><code>-mno-svr3-shlib</code> <dd>Control whether GCC places uninitialized local variables into the<code>bss</code> or <code>data</code> segments. <code>-msvr3-shlib</code> places theminto <code>bss</code>. These options are meaningful only on System V Release 3. <br><dt><code>-mrtd</code> <dd>Use a different function-calling convention, in which functions thattake a fixed number of arguments return with the <code>ret</code> <var>num</var>instruction, which pops their arguments while returning. This saves oneinstruction in the caller since there is no need to pop the argumentsthere. <p>You can specify that an individual function is called with this callingsequence with the function attribute <code>stdcall</code>. You can alsooverride the <code>-mrtd</code> option by using the function attribute<code>cdecl</code>. See <a href="Function-Attributes.html#Function%20Attributes">Function Attributes</a>. <p><strong>Warning:</strong> this calling convention is incompatible with the onenormally used on Unix, so you cannot use it if you need to calllibraries compiled with the Unix compiler. <p>Also, you must provide function prototypes for all functions thattake variable numbers of arguments (including <code>printf</code>);otherwise incorrect code will be generated for calls to thosefunctions. <p>In addition, seriously incorrect code will result if you call afunction with too many arguments. (Normally, extra arguments areharmlessly ignored.) <br><dt><code>-mregparm=</code><var>num</var><code></code> <dd>Control how many registers are used to pass integer arguments. Bydefault, no registers are used to pass arguments, and at most 3registers can be used. You can control this behavior for a specificfunction by using the function attribute <code>regparm</code>. See <a href="Function-Attributes.html#Function%20Attributes">Function Attributes</a>. <p><strong>Warning:</strong> if you use this switch, and<var>num</var> is nonzero, then you must build all modules with the samevalue, including any libraries. This includes the system libraries andstartup modules. <br><dt><code>-mpreferred-stack-boundary=</code><var>num</var><code></code> <dd>Attempt to keep the stack boundary aligned to a 2 raised to <var>num</var>byte boundary. If <code>-mpreferred-stack-boundary</code> is not specified,the default is 4 (16 bytes or 128 bits), except when optimizing for codesize (<code>-Os</code>), in which case the default is the minimum correctalignment (4 bytes for x86, and 8 bytes for x86-64). <p>On Pentium and PentiumPro, <code>double</code> and <code>long double</code> valuesshould be aligned to an 8 byte boundary (see <code>-malign-double</code>) orsuffer significant run time performance penalties. On Pentium III, theStreaming SIMD Extension (SSE) data type <code>__m128</code> suffers similarpenalties if it is not 16 byte aligned. <p>To ensure proper alignment of this values on the stack, the stack boundarymust be as aligned as that required by any value stored on the stack. Further, every function must be generated such that it keeps the stackaligned. Thus calling a function compiled with a higher preferredstack boundary from a function compiled with a lower preferred stackboundary will most likely misalign the stack. It is recommended thatlibraries that use callbacks always use the default setting. <p>This extra alignment does consume extra stack space, and generallyincreases code size. Code that is sensitive to stack space usage, suchas embedded systems and operating system kernels, may want to reduce thepreferred alignment to <code>-mpreferred-stack-boundary=2</code>. <br><dt><code>-mmmx</code> <dd><dt><code>-mno-mmx</code> <dd><br><dt><code>-msse</code> <dd><dt><code>-mno-sse</code> <dd><br><dt><code>-msse2</code> <dd><dt><code>-mno-sse2</code> <dd><br><dt><code>-msse3</code> <dd><dt><code>-mno-sse3</code> <dd><br><dt><code>-m3dnow</code> <dd><dt><code>-mno-3dnow</code> <dd>These switches enable or disable the use of built-in functions that allowdirect access to the MMX, SSE, SSE2, SSE3 and 3Dnow extensions of theinstruction set. <p>See <a href="X86-Built-in-Functions.html#X86%20Built-in%20Functions">X86 Built-in Functions</a>, for details of the functions enabledand disabled by these switches. <p>To have SSE/SSE2 instructions generated automatically from floating-pointcode, see <code>-mfpmath=sse</code>. <br><dt><code>-mpush-args</code> <dd><dt><code>-mno-push-args</code> <dd>Use PUSH operations to store outgoing parameters. This method is shorterand usually equally fast as method using SUB/MOV operations and is enabledby default. In some cases disabling it may improve performance because ofimproved scheduling and reduced dependencies. <br><dt><code>-maccumulate-outgoing-args</code> <dd>If enabled, the maximum amount of space required for outgoing arguments will becomputed in the function prologue. This is faster on most modern CPUsbecause of reduced dependencies, improved scheduling and reduced stack usagewhen preferred stack boundary is not equal to 2. The drawback is a notableincrease in code size. This switch implies <code>-mno-push-args</code>. <br><dt><code>-mthreads</code> <dd>Support thread-safe exception handling on <code>Mingw32</code>. Code that relieson thread-safe exception handling must compile and link all code with the<code>-mthreads</code> option. When compiling, <code>-mthreads</code> defines<code>-D_MT</code>; when linking, it links in a special thread helper library<code>-lmingwthrd</code> which cleans up per thread exception handling data. <br><dt><code>-mno-align-stringops</code> <dd>Do not align destination of inlined string operations. This switch reducescode size and improves performance in case the destination is already aligned,but GCC doesn't know about it. <br><dt><code>-minline-all-stringops</code> <dd>By default GCC inlines string operations only when destination is known to bealigned at least to 4 byte boundary. This enables more inlining, increase codesize, but may improve performance of code that depends on fast memcpy, strlenand memset for short lengths. <br><dt><code>-momit-leaf-frame-pointer</code> <dd>Don't keep the frame pointer in a register for leaf functions. Thisavoids the instructions to save, set up and restore frame pointers andmakes an extra register available in leaf functions. The option<code>-fomit-frame-pointer</code> removes the frame pointer for all functionswhich might make debugging harder. <br><dt><code>-mtls-direct-seg-refs</code> <dd><dt><code>-mno-tls-direct-seg-refs</code> <dd>Controls whether TLS variables may be accessed with offsets from theTLS segment register (<code>%gs</code> for 32-bit, <code>%fs</code> for 64-bit),or whether the thread base pointer must be added. Whether or not thisis legal depends on the operating system, and whether it maps thesegment to cover the entire TLS area. <p>For systems that use GNU libc, the default is on. </dl> <p>These <code>-m</code> switches are supported in addition to the aboveon AMD x86-64 processors in 64-bit environments. <dl><dt><code>-m32</code> <dd><dt><code>-m64</code> <dd>Generate code for a 32-bit or 64-bit environment. The 32-bit environment sets int, long and pointer to 32 bits andgenerates code that runs on any i386 system. The 64-bit environment sets int to 32 bits and long and pointerto 64 bits and generates code for AMD's x86-64 architecture. <br><dt><code>-mno-red-zone</code> <dd>Do not use a so called red zone for x86-64 code. The red zone is mandatedby the x86-64 ABI, it is a 128-byte area beyond the location of thestack pointer that will not be modified by signal or interrupt handlersand therefore can be used for temporary data without adjusting the stackpointer. The flag <code>-mno-red-zone</code> disables this red zone. <br><dt><code>-mcmodel=small</code> <dd>Generate code for the small code model: the program and its symbols mustbe linked in the lower 2 GB of the address space. Pointers are 64 bits. Programs can be statically or dynamically linked. This is the defaultcode model. <br><dt><code>-mcmodel=kernel</code> <dd>Generate code for the kernel code model. The kernel runs in thenegative 2 GB of the address space. This model has to be used for Linux kernel code. <br><dt><code>-mcmodel=medium</code> <dd>Generate code for the medium model: The program is linked in the lower 2GB of the address space but symbols can be located anywhere in theaddress space. Programs can be statically or dynamically linked, butbuilding of shared libraries are not supported with the medium model. <br><dt><code>-mcmodel=large</code> <dd>Generate code for the large model: This model makes no assumptionsabout addresses and sizes of sections. Currently GCC does not implementthis model. </dl> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -