1 ; Generated by "genstr" from the template "loongarch.opt.in"
2 ; and definitions from "loongarch-strings" and "isa-evolution.in".
4 ; Please do not edit this file directly.
5 ; It will be automatically updated during a gcc build
6 ; if you change "loongarch.opt.in", "loongarch-strings", or
9 ; Copyright (C) 2021-2024 Free Software Foundation, Inc.
11 ; This file is part of GCC.
13 ; GCC is free software; you can redistribute it and/or modify it under
14 ; the terms of the GNU General Public License as published by the Free
15 ; Software Foundation; either version 3, or (at your option) any later
18 ; GCC is distributed in the hope that it will be useful, but WITHOUT
19 ; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 ; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
21 ; License for more details.
23 ; You should have received a copy of the GNU General Public License
24 ; along with GCC; see the file COPYING3. If not see
25 ; <http://www.gnu.org/licenses/>.
29 config/loongarch/loongarch-opts.h
32 config/loongarch/loongarch-str.h
35 unsigned int recip_mask = 0
40 Name(isa_base) Type(int)
41 Basic ISAs of LoongArch:
44 Enum(isa_base) String(la64) Value(ISA_BASE_LA64)
46 ;; ISA extensions / adjustments
48 Name(isa_ext_fpu) Type(int)
49 FPU types of LoongArch:
52 Enum(isa_ext_fpu) String(none) Value(ISA_EXT_NONE)
55 Enum(isa_ext_fpu) String(32) Value(ISA_EXT_FPU32)
58 Enum(isa_ext_fpu) String(64) Value(ISA_EXT_FPU64)
61 Target RejectNegative Joined ToLower Enum(isa_ext_fpu) Var(la_opt_fpu) Init(M_OPT_UNSET) Save
62 -mfpu=FPU Generate code for the given FPU.
65 Target RejectNegative Alias(mfpu=,none)
68 Target Driver Defer Var(la_deferred_options) RejectNegative Negative(msingle-float)
69 Prevent the use of all hardware floating-point instructions.
72 Target Driver Defer Var(la_deferred_options) RejectNegative Negative(mdouble-float)
73 Restrict the use of hardware floating-point instructions to 32-bit operations.
76 Target Driver Defer Var(la_deferred_options) RejectNegative Negative(msoft-float)
77 Allow hardware floating-point instructions to cover both 32-bit and 64-bit operations.
80 Name(isa_ext_simd) Type(int)
81 SIMD extension levels of LoongArch:
84 Enum(isa_ext_simd) String(none) Value(ISA_EXT_NONE)
87 Enum(isa_ext_simd) String(lsx) Value(ISA_EXT_SIMD_LSX)
90 Enum(isa_ext_simd) String(lasx) Value(ISA_EXT_SIMD_LASX)
93 Target RejectNegative Joined ToLower Enum(isa_ext_simd) Var(la_opt_simd) Init(M_OPT_UNSET) Save
94 -msimd=SIMD Generate code for the given SIMD extension.
97 Target Driver Defer Var(la_deferred_options)
98 Enable LoongArch SIMD Extension (LSX, 128-bit).
101 Target Driver Defer Var(la_deferred_options)
102 Enable LoongArch Advanced SIMD Extension (LASX, 256-bit).
104 ;; Base target models (implies ISA & tune parameters)
106 Name(arch_type) Type(int)
107 LoongArch ARCH presets:
110 Enum(arch_type) String(native) Value(ARCH_NATIVE)
113 Enum(arch_type) String(abi-default) Value(ARCH_ABI_DEFAULT)
116 Enum(arch_type) String(loongarch64) Value(ARCH_LOONGARCH64)
119 Enum(arch_type) String(la464) Value(ARCH_LA464)
122 Enum(arch_type) String(la664) Value(ARCH_LA664)
125 Enum(arch_type) String(la64v1.0) Value(ARCH_LA64V1_0)
128 Enum(arch_type) String(la64v1.1) Value(ARCH_LA64V1_1)
131 Target RejectNegative Joined Enum(arch_type) Var(la_opt_cpu_arch) Init(M_OPT_UNSET) Save
132 -march=PROCESSOR Generate code for the given PROCESSOR ISA.
135 Name(tune_type) Type(int)
136 LoongArch TUNE presets:
139 Enum(tune_type) String(native) Value(TUNE_NATIVE)
142 Enum(tune_type) String(generic) Value(TUNE_GENERIC)
145 Enum(tune_type) String(loongarch64) Value(TUNE_LOONGARCH64)
148 Enum(tune_type) String(la464) Value(TUNE_LA464)
151 Enum(tune_type) String(la664) Value(TUNE_LA664)
154 Target RejectNegative Joined Enum(tune_type) Var(la_opt_cpu_tune) Init(M_OPT_UNSET) Save
155 -mtune=PROCESSOR Generate optimized code for PROCESSOR.
158 ; ABI related options
159 ; (ISA constraints on ABI are handled dynamically)
163 Name(abi_base) Type(int)
164 Base ABI types for LoongArch:
167 Enum(abi_base) String(lp64d) Value(ABI_BASE_LP64D)
170 Enum(abi_base) String(lp64f) Value(ABI_BASE_LP64F)
173 Enum(abi_base) String(lp64s) Value(ABI_BASE_LP64S)
176 Target RejectNegative Joined ToLower Enum(abi_base) Var(la_opt_abi_base) Init(M_OPT_UNSET)
177 -mabi=BASEABI Generate code that conforms to the given BASEABI.
182 int la_opt_abi_ext = M_OPT_UNSET
185 Target RejectNegative Joined UInteger Var(la_branch_cost) Save
186 -mbranch-cost=COST Set the cost of branches to roughly COST instructions.
189 Target Mask(CHECK_ZERO_DIV) Save
190 Trap on integer divide by zero.
193 Target Mask(COND_MOVE_INT) Save
194 Conditional moves for integral are enabled.
197 Target Mask(COND_MOVE_FLOAT) Save
198 Conditional moves for float are enabled.
201 Target Mask(MEMCPY) Save
202 Prevent optimizing block moves, which is also the default behavior of -Os.
205 Target Mask(STRICT_ALIGN) Save
206 Do not generate unaligned memory accesses.
208 mmax-inline-memcpy-size=
209 Target Joined RejectNegative UInteger Var(la_max_inline_memcpy_size) Init(1024) Save
210 -mmax-inline-memcpy-size=SIZE Set the max size of memcpy to inline, default is 1024.
213 Name(explicit_relocs) Type(int)
214 The code model option names for -mexplicit-relocs:
217 Enum(explicit_relocs) String(auto) Value(EXPLICIT_RELOCS_AUTO)
220 Enum(explicit_relocs) String(none) Value(EXPLICIT_RELOCS_NONE)
223 Enum(explicit_relocs) String(always) Value(EXPLICIT_RELOCS_ALWAYS)
226 Target RejectNegative Joined Enum(explicit_relocs) Var(la_opt_explicit_relocs) Init(M_OPT_UNSET)
227 Use %reloc() assembly operators.
230 Target Alias(mexplicit-relocs=, always, none)
231 Use %reloc() assembly operators (for backward compatibility).
234 Target RejectNegative Joined Var(la_recip_name) Save
235 Control generation of reciprocal estimates.
238 Target Alias(mrecip=, all, none)
239 Generate approximate reciprocal divide and square root for better throughput.
241 ; The code model option names for -mcmodel.
243 Name(cmodel) Type(int)
244 The code model option names for -mcmodel:
247 Enum(cmodel) String(normal) Value(CMODEL_NORMAL)
250 Enum(cmodel) String(tiny) Value(CMODEL_TINY)
253 Enum(cmodel) String(tiny-static) Value(CMODEL_TINY_STATIC)
256 Enum(cmodel) String(medium) Value(CMODEL_MEDIUM)
259 Enum(cmodel) String(large) Value(CMODEL_LARGE)
262 Enum(cmodel) String(extreme) Value(CMODEL_EXTREME)
265 Target RejectNegative Joined Enum(cmodel) Var(la_opt_cmodel) Init(M_OPT_UNSET) Save
266 Specify the code model.
268 mdirect-extern-access
269 Target Mask(DIRECT_EXTERN_ACCESS) Save
270 Avoid using the GOT to access external symbols.
273 Target Mask(LINKER_RELAXATION)
274 Take advantage of linker relaxations to reduce the number of instructions
275 required to materialize symbol addresses.
278 Driver Var(la_pass_mrelax_to_as) Init(HAVE_AS_MRELAX_OPTION)
279 Pass -mrelax or -mno-relax option to the assembler.
282 Name(tls_type) Type(int)
283 The possible TLS dialects:
286 Enum(tls_type) String(trad) Value(TLS_TRADITIONAL)
289 Enum(tls_type) String(desc) Value(TLS_DESCRIPTORS)
292 Target RejectNegative Joined Enum(tls_type) Var(la_opt_tls_dialect) Init(M_OPT_UNSET) Save
295 -param=loongarch-vect-unroll-limit=
296 Target Joined UInteger Var(la_vect_unroll_limit) Init(6) IntegerRange(1, 64) Param
297 Used to limit unroll factor which indicates how much the autovectorizer may
298 unroll a loop. The default value is 6.
300 -param=loongarch-vect-issue-info=
301 Target Undocumented Joined UInteger Var(la_vect_issue_info) Init(4) IntegerRange(1, 64) Param
302 Indicate how many non memory access vector instructions can be issued per
303 cycle, it's used in unroll factor determination for autovectorizer. The
306 ; Features added during ISA evolution. This concept is different from ISA
307 ; extension, read Section 1.5 of LoongArch v1.10 Volume 1 for the
308 ; explanation. These features may be implemented and enumerated with
309 ; CPUCFG independently, so we use bit flags to specify them.
311 HOST_WIDE_INT la_isa_evolution = 0
314 Target Mask(ANNOTATE_TABLEJUMP) Save
315 Annotate table jump instruction (jr {reg}) to correlate it with the jump table.
318 Target Mask(ISA_FRECIPE) Var(la_isa_evolution)
319 Support frecipe.{s/d} and frsqrte.{s/d} instructions.
322 Target Mask(ISA_DIV32) Var(la_isa_evolution)
323 Support div.w[u] and mod.w[u] instructions with inputs not sign-extended.
326 Target Mask(ISA_LAM_BH) Var(la_isa_evolution)
327 Support am{swap/add}[_db].{b/h} instructions.
330 Target Mask(ISA_LAMCAS) Var(la_isa_evolution)
331 Support amcas[_db].{b/h/w/d} instructions.
334 Target Mask(ISA_LD_SEQ_SA) Var(la_isa_evolution)
335 Do not need load-load barriers (dbar 0x700).