1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
<div class="subsection-level-extent" id="LoongArch-Options"> <div class="nav-panel"> <p> Next: <a href="m32c-options" accesskey="n" rel="next">M32C Options</a>, Previous: <a href="lm32-options" accesskey="p" rel="prev">LM32 Options</a>, Up: <a href="submodel-options" accesskey="u" rel="up">Machine-Dependent Options</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div> <h1 class="subsection" id="LoongArch-Options-1"><span>3.19.22 LoongArch Options<a class="copiable-link" href="#LoongArch-Options-1"> ¶</a></span></h1> <p>These command-line options are defined for LoongArch targets: </p> <dl class="table"> <dt>
<span><code class="code">-march=<var class="var">cpu-type</var></code><a class="copiable-link" href="#index-march-7"> ¶</a></span>
</dt> <dd>
<p>Generate instructions for the machine type <var class="var">cpu-type</var>. In contrast to <samp class="option">-mtune=<var class="var">cpu-type</var></samp>, which merely tunes the generated code for the specified <var class="var">cpu-type</var>, <samp class="option">-march=<var class="var">cpu-type</var></samp> allows GCC to generate code that may not run at all on processors other than the one indicated. Specifying <samp class="option">-march=<var class="var">cpu-type</var></samp> implies <samp class="option">-mtune=<var class="var">cpu-type</var></samp>, except where noted otherwise. </p> <p>The choices for <var class="var">cpu-type</var> are: </p> <dl class="table"> <dt>‘<samp class="samp">native</samp>’</dt> <dd><p>This selects the CPU to generate code for at compilation time by determining the processor type of the compiling machine. Using <samp class="option">-march=native</samp> enables all instruction subsets supported by the local machine (hence the result might not run on different machines). Using <samp class="option">-mtune=native</samp> produces code optimized for the local machine under the constraints of the selected instruction set. </p></dd> <dt>‘<samp class="samp">loongarch64</samp>’</dt> <dd><p>A generic CPU with 64-bit extensions. </p></dd> <dt>‘<samp class="samp">la464</samp>’</dt> <dd><p>LoongArch LA464 CPU with LBT, LSX, LASX, LVZ. </p></dd> </dl> </dd> <dt>
<span><code class="code">-mtune=<var class="var">cpu-type</var></code><a class="copiable-link" href="#index-mtune-8"> ¶</a></span>
</dt> <dd>
<p>Optimize the output for the given processor, specified by microarchitecture name. </p> </dd> <dt>
<span><code class="code">-mabi=<var class="var">base-abi-type</var></code><a class="copiable-link" href="#index-mabi-2"> ¶</a></span>
</dt> <dd>
<p>Generate code for the specified calling convention. <var class="var">base-abi-type</var> can be one of: </p>
<dl class="table"> <dt>‘<samp class="samp">lp64d</samp>’</dt> <dd><p>Uses 64-bit general purpose registers and 32/64-bit floating-point registers for parameter passing. Data model is LP64, where ‘<samp class="samp">int</samp>’ is 32 bits, while ‘<samp class="samp">long int</samp>’ and pointers are 64 bits. </p></dd> <dt>‘<samp class="samp">lp64f</samp>’</dt> <dd><p>Uses 64-bit general purpose registers and 32-bit floating-point registers for parameter passing. Data model is LP64, where ‘<samp class="samp">int</samp>’ is 32 bits, while ‘<samp class="samp">long int</samp>’ and pointers are 64 bits. </p></dd> <dt>‘<samp class="samp">lp64s</samp>’</dt> <dd><p>Uses 64-bit general purpose registers and no floating-point registers for parameter passing. Data model is LP64, where ‘<samp class="samp">int</samp>’ is 32 bits, while ‘<samp class="samp">long int</samp>’ and pointers are 64 bits. </p></dd> </dl> </dd> <dt>
<span><code class="code">-mfpu=<var class="var">fpu-type</var></code><a class="copiable-link" href="#index-mfpu-2"> ¶</a></span>
</dt> <dd>
<p>Generate code for the specified FPU type, which can be one of: </p>
<dl class="table"> <dt>‘<samp class="samp">64</samp>’</dt> <dd><p>Allow the use of hardware floating-point instructions for 32-bit and 64-bit operations. </p></dd> <dt>‘<samp class="samp">32</samp>’</dt> <dd><p>Allow the use of hardware floating-point instructions for 32-bit operations. </p></dd> <dt>‘<samp class="samp">none</samp>’</dt> <dt>‘<samp class="samp">0</samp>’</dt> <dd><p>Prevent the use of hardware floating-point instructions. </p></dd> </dl> </dd> <dt>
<span><code class="code">-msoft-float</code><a class="copiable-link" href="#index-msoft-float-5"> ¶</a></span>
</dt> <dd>
<p>Force <samp class="option">-mfpu=none</samp> and prevents the use of floating-point registers for parameter passing. This option may change the target ABI. </p> </dd> <dt>
<span><code class="code">-msingle-float</code><a class="copiable-link" href="#index-msingle-float"> ¶</a></span>
</dt> <dd>
<p>Force <samp class="option">-mfpu=32</samp> and allow the use of 32-bit floating-point registers for parameter passing. This option may change the target ABI. </p> </dd> <dt>
<span><code class="code">-mdouble-float</code><a class="copiable-link" href="#index-mdouble-float-1"> ¶</a></span>
</dt> <dd>
<p>Force <samp class="option">-mfpu=64</samp> and allow the use of 32/64-bit floating-point registers for parameter passing. This option may change the target ABI. </p> </dd> <dt>
<span><code class="code">-mbranch-cost=<var class="var">n</var></code><a class="copiable-link" href="#index-mbranch-cost-2"> ¶</a></span>
</dt> <dd>
<p>Set the cost of branches to roughly <var class="var">n</var> instructions. </p> </dd> <dt>
<span><code class="code">-mcheck-zero-division</code><a class="copiable-link" href="#index-mcheck-zero-division"> ¶</a></span>
</dt> <dt><code class="code">-mno-check-zero-divison</code></dt> <dd>
<p>Trap (do not trap) on integer division by zero. The default is <samp class="option">-mcheck-zero-division</samp> for <samp class="option">-O0</samp> or <samp class="option">-Og</samp>, and <samp class="option">-mno-check-zero-division</samp> for other optimization levels. </p> </dd> <dt>
<span><code class="code">-mcond-move-int</code><a class="copiable-link" href="#index-mcond-move-int"> ¶</a></span>
</dt> <dt><code class="code">-mno-cond-move-int</code></dt> <dd>
<p>Conditional moves for integral data in general-purpose registers are enabled (disabled). The default is <samp class="option">-mcond-move-int</samp>. </p> </dd> <dt>
<span><code class="code">-mcond-move-float</code><a class="copiable-link" href="#index-mcond-move-float"> ¶</a></span>
</dt> <dt><code class="code">-mno-cond-move-float</code></dt> <dd>
<p>Conditional moves for floating-point registers are enabled (disabled). The default is <samp class="option">-mcond-move-float</samp>. </p> </dd> <dt>
<span><code class="code">-mmemcpy</code><a class="copiable-link" href="#index-mmemcpy"> ¶</a></span>
</dt> <dt><code class="code">-mno-memcpy</code></dt> <dd>
<p>Force (do not force) the use of <code class="code">memcpy</code> for non-trivial block moves. The default is <samp class="option">-mno-memcpy</samp>, which allows GCC to inline most constant-sized copies. Setting optimization level to <samp class="option">-Os</samp> also forces the use of <code class="code">memcpy</code>, but <samp class="option">-mno-memcpy</samp> may override this behavior if explicitly specified, regardless of the order these options on the command line. </p> </dd> <dt>
<span><code class="code">-mstrict-align</code><a class="copiable-link" href="#index-mstrict-align-1"> ¶</a></span>
</dt> <dt><code class="code">-mno-strict-align</code></dt> <dd>
<p>Avoid or allow generating memory accesses that may not be aligned on a natural object boundary as described in the architecture specification. The default is <samp class="option">-mno-strict-align</samp>. </p> </dd> <dt>
<span><code class="code">-msmall-data-limit=<var class="var">number</var></code><a class="copiable-link" href="#index-msmall-data-limit"> ¶</a></span>
</dt> <dd>
<p>Put global and static data smaller than <var class="var">number</var> bytes into a special section (on some targets). The default value is 0. </p> </dd> <dt>
<span><code class="code">-mmax-inline-memcpy-size=<var class="var">n</var></code><a class="copiable-link" href="#index-mmax-inline-memcpy-size"> ¶</a></span>
</dt> <dd>
<p>Inline all block moves (such as calls to <code class="code">memcpy</code> or structure copies) less than or equal to <var class="var">n</var> bytes. The default value of <var class="var">n</var> is 1024. </p> </dd> <dt><code class="code">-mcmodel=<var class="var">code-model</var></code></dt> <dd>
<p>Set the code model to one of: </p>
<dl class="table"> <dt>‘<samp class="samp">tiny-static (Not implemented yet)</samp>’</dt> <dt>‘<samp class="samp">tiny (Not implemented yet)</samp>’</dt> <dt>‘<samp class="samp">normal</samp>’</dt> <dd>
<p>The text segment must be within 128MB addressing space. The data segment must be within 2GB addressing space. </p> </dd> <dt>‘<samp class="samp">medium</samp>’</dt> <dd>
<p>The text segment and data segment must be within 2GB addressing space. </p> </dd> <dt>‘<samp class="samp">large (Not implemented yet)</samp>’</dt> <dt>‘<samp class="samp">extreme</samp>’</dt> <dd><p>This mode does not limit the size of the code segment and data segment. The <samp class="option">-mcmodel=extreme</samp> option is incompatible with <samp class="option">-fplt</samp> and <samp class="option">-mno-explicit-relocs</samp>. </p></dd> </dl> <p>The default code model is <code class="code">normal</code>. </p> </dd> <dt>
<span><code class="code">-mexplicit-relocs</code><a class="copiable-link" href="#index-mexplicit-relocs-1"> ¶</a></span>
</dt> <dt><code class="code">-mno-explicit-relocs</code></dt> <dd>
<p>Use or do not use assembler relocation operators when dealing with symbolic addresses. The alternative is to use assembler macros instead, which may limit optimization. The default value for the option is determined during GCC build-time by detecting corresponding assembler support: <code class="code">-mexplicit-relocs</code> if said support is present, <code class="code">-mno-explicit-relocs</code> otherwise. This option is mostly useful for debugging, or interoperation with assemblers different from the build-time one. </p> </dd> <dt>
<span><code class="code">-mdirect-extern-access</code><a class="copiable-link" href="#index-mdirect-extern-access"> ¶</a></span>
</dt> <dt><code class="code">-mno-direct-extern-access</code></dt> <dd>
<p>Do not use or use GOT to access external symbols. The default is <samp class="option">-mno-direct-extern-access</samp>: GOT is used for external symbols with default visibility, but not used for other external symbols. </p> <p>With <samp class="option">-mdirect-extern-access</samp>, GOT is not used and all external symbols are PC-relatively addressed. It is <strong class="strong">only</strong> suitable for environments where no dynamic link is performed, like firmwares, OS kernels, executables linked with <samp class="option">-static</samp> or <samp class="option">-static-pie</samp>. <samp class="option">-mdirect-extern-access</samp> is not compatible with <samp class="option">-fPIC</samp> or <samp class="option">-fpic</samp>. </p>
</dd> </dl> </div> <div class="nav-panel"> <p> Next: <a href="m32c-options">M32C Options</a>, Previous: <a href="lm32-options">LM32 Options</a>, Up: <a href="submodel-options">Machine-Dependent Options</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div><div class="_attribution">
<p class="_attribution-p">
© Free Software Foundation<br>Licensed under the GNU Free Documentation License, Version 1.3.<br>
<a href="https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/LoongArch-Options.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/LoongArch-Options.html</a>
</p>
</div>
|