aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/loongarch/genopts/loongarch.opt.in
blob: 50ea47a161f2d5f726a8e491e29039f7f1c3abcc (plain)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
; Copyright (C) 2021-2024 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
; GCC is free software; you can redistribute it and/or modify it under
; the terms of the GNU General Public License as published by the Free
; Software Foundation; either version 3, or (at your option) any later
; version.
;
; GCC is distributed in the hope that it will be useful, but WITHOUT
; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
; License for more details.
;
; You should have received a copy of the GNU General Public License
; along with GCC; see the file COPYING3.  If not see
; <http://www.gnu.org/licenses/>.
;

HeaderInclude
config/loongarch/loongarch-opts.h

HeaderInclude
config/loongarch/loongarch-str.h

TargetVariable
unsigned int recip_mask = 0

; ISA related options
;; Base ISA
Enum
Name(isa_base) Type(int)
Basic ISAs of LoongArch:

EnumValue
Enum(isa_base) String(@@STR_ISA_BASE_LA64@@) Value(ISA_BASE_LA64)

;; ISA extensions / adjustments
Enum
Name(isa_ext_fpu) Type(int)
FPU types of LoongArch:

EnumValue
Enum(isa_ext_fpu) String(@@STR_NONE@@) Value(ISA_EXT_NONE)

EnumValue
Enum(isa_ext_fpu) String(@@STR_ISA_EXT_FPU32@@) Value(ISA_EXT_FPU32)

EnumValue
Enum(isa_ext_fpu) String(@@STR_ISA_EXT_FPU64@@) Value(ISA_EXT_FPU64)

m@@OPTSTR_ISA_EXT_FPU@@=
Target RejectNegative Joined ToLower Enum(isa_ext_fpu) Var(la_opt_fpu) Init(M_OPT_UNSET) Save
-m@@OPTSTR_ISA_EXT_FPU@@=FPU	Generate code for the given FPU.

m@@OPTSTR_ISA_EXT_FPU@@=@@STR_ISA_EXT_FPU0@@
Target RejectNegative Alias(m@@OPTSTR_ISA_EXT_FPU@@=,@@STR_NONE@@)

m@@OPTSTR_SOFT_FLOAT@@
Target Driver Defer Var(la_deferred_options) RejectNegative Negative(m@@OPTSTR_SINGLE_FLOAT@@)
Prevent the use of all hardware floating-point instructions.

m@@OPTSTR_SINGLE_FLOAT@@
Target Driver Defer Var(la_deferred_options) RejectNegative Negative(m@@OPTSTR_DOUBLE_FLOAT@@)
Restrict the use of hardware floating-point instructions to 32-bit operations.

m@@OPTSTR_DOUBLE_FLOAT@@
Target Driver Defer Var(la_deferred_options) RejectNegative Negative(m@@OPTSTR_SOFT_FLOAT@@)
Allow hardware floating-point instructions to cover both 32-bit and 64-bit operations.

Enum
Name(isa_ext_simd) Type(int)
SIMD extension levels of LoongArch:

EnumValue
Enum(isa_ext_simd) String(@@STR_NONE@@) Value(ISA_EXT_NONE)

EnumValue
Enum(isa_ext_simd) String(@@STR_ISA_EXT_LSX@@) Value(ISA_EXT_SIMD_LSX)

EnumValue
Enum(isa_ext_simd) String(@@STR_ISA_EXT_LASX@@) Value(ISA_EXT_SIMD_LASX)

m@@OPTSTR_ISA_EXT_SIMD@@=
Target RejectNegative Joined ToLower Enum(isa_ext_simd) Var(la_opt_simd) Init(M_OPT_UNSET) Save
-m@@OPTSTR_ISA_EXT_SIMD@@=SIMD	Generate code for the given SIMD extension.

m@@STR_ISA_EXT_LSX@@
Target Driver Defer Var(la_deferred_options)
Enable LoongArch SIMD Extension (LSX, 128-bit).

m@@STR_ISA_EXT_LASX@@
Target Driver Defer Var(la_deferred_options)
Enable LoongArch Advanced SIMD Extension (LASX, 256-bit).

;; Base target models (implies ISA & tune parameters)
Enum
Name(cpu_type) Type(int)
LoongArch CPU types:

EnumValue
Enum(cpu_type) String(@@STR_CPU_NATIVE@@) Value(CPU_NATIVE)

EnumValue
Enum(cpu_type) String(@@STR_CPU_ABI_DEFAULT@@) Value(CPU_ABI_DEFAULT)

EnumValue
Enum(cpu_type) String(@@STR_CPU_LOONGARCH64@@) Value(CPU_LOONGARCH64)

EnumValue
Enum(cpu_type) String(@@STR_CPU_LA464@@) Value(CPU_LA464)

EnumValue
Enum(cpu_type) String(@@STR_CPU_LA664@@) Value(CPU_LA664)

m@@OPTSTR_ARCH@@=
Target RejectNegative Joined Enum(cpu_type) Var(la_opt_cpu_arch) Init(M_OPT_UNSET) Save
-m@@OPTSTR_ARCH@@=PROCESSOR	Generate code for the given PROCESSOR ISA.

m@@OPTSTR_TUNE@@=
Target RejectNegative Joined Enum(cpu_type) Var(la_opt_cpu_tune) Init(M_OPT_UNSET) Save
-m@@OPTSTR_TUNE@@=PROCESSOR	Generate optimized code for PROCESSOR.


; ABI related options
; (ISA constraints on ABI are handled dynamically)

;; Base ABI
Enum
Name(abi_base) Type(int)
Base ABI types for LoongArch:

EnumValue
Enum(abi_base) String(@@STR_ABI_BASE_LP64D@@) Value(ABI_BASE_LP64D)

EnumValue
Enum(abi_base) String(@@STR_ABI_BASE_LP64F@@) Value(ABI_BASE_LP64F)

EnumValue
Enum(abi_base) String(@@STR_ABI_BASE_LP64S@@) Value(ABI_BASE_LP64S)

m@@OPTSTR_ABI_BASE@@=
Target RejectNegative Joined ToLower Enum(abi_base) Var(la_opt_abi_base) Init(M_OPT_UNSET)
-m@@OPTSTR_ABI_BASE@@=BASEABI	Generate code that conforms to the given BASEABI.


;; ABI Extension
Variable
int la_opt_abi_ext = M_OPT_UNSET

mbranch-cost=
Target RejectNegative Joined UInteger Var(la_branch_cost) Save
-mbranch-cost=COST	Set the cost of branches to roughly COST instructions.

mcheck-zero-division
Target Mask(CHECK_ZERO_DIV) Save
Trap on integer divide by zero.

mcond-move-int
Target Mask(COND_MOVE_INT) Save
Conditional moves for integral are enabled.

mcond-move-float
Target Mask(COND_MOVE_FLOAT) Save
Conditional moves for float are enabled.

mmemcpy
Target Mask(MEMCPY) Save
Prevent optimizing block moves, which is also the default behavior of -Os.

mstrict-align
Target Mask(STRICT_ALIGN) Save
Do not generate unaligned memory accesses.

mmax-inline-memcpy-size=
Target Joined RejectNegative UInteger Var(la_max_inline_memcpy_size) Init(1024) Save
-mmax-inline-memcpy-size=SIZE	Set the max size of memcpy to inline, default is 1024.

Enum
Name(explicit_relocs) Type(int)
The code model option names for -mexplicit-relocs:

EnumValue
Enum(explicit_relocs) String(auto) Value(EXPLICIT_RELOCS_AUTO)

EnumValue
Enum(explicit_relocs) String(none) Value(EXPLICIT_RELOCS_NONE)

EnumValue
Enum(explicit_relocs) String(always) Value(EXPLICIT_RELOCS_ALWAYS)

mexplicit-relocs=
Target RejectNegative Joined Enum(explicit_relocs) Var(la_opt_explicit_relocs) Init(M_OPT_UNSET)
Use %reloc() assembly operators.

mexplicit-relocs
Target Alias(mexplicit-relocs=, always, none)
Use %reloc() assembly operators (for backward compatibility).

mrecip=
Target RejectNegative Joined Var(la_recip_name) Save
Control generation of reciprocal estimates.

mrecip
Target Alias(mrecip=, all, none)
Generate approximate reciprocal divide and square root for better throughput.

; The code model option names for -mcmodel.
Enum
Name(cmodel) Type(int)
The code model option names for -mcmodel:

EnumValue
Enum(cmodel) String(@@STR_CMODEL_NORMAL@@) Value(CMODEL_NORMAL)

EnumValue
Enum(cmodel) String(@@STR_CMODEL_TINY@@) Value(CMODEL_TINY)

EnumValue
Enum(cmodel) String(@@STR_CMODEL_TS@@) Value(CMODEL_TINY_STATIC)

EnumValue
Enum(cmodel) String(@@STR_CMODEL_MEDIUM@@) Value(CMODEL_MEDIUM)

EnumValue
Enum(cmodel) String(@@STR_CMODEL_LARGE@@) Value(CMODEL_LARGE)

EnumValue
Enum(cmodel) String(@@STR_CMODEL_EXTREME@@) Value(CMODEL_EXTREME)

mcmodel=
Target RejectNegative Joined Enum(cmodel) Var(la_opt_cmodel) Init(M_OPT_UNSET) Save
Specify the code model.

mdirect-extern-access
Target Mask(DIRECT_EXTERN_ACCESS) Save
Avoid using the GOT to access external symbols.

mrelax
Target Mask(LINKER_RELAXATION)
Take advantage of linker relaxations to reduce the number of instructions
required to materialize symbol addresses.

mpass-mrelax-to-as
Driver Var(la_pass_mrelax_to_as) Init(HAVE_AS_MRELAX_OPTION)
Pass -mrelax or -mno-relax option to the assembler.

Enum
Name(tls_type) Type(int)
The possible TLS dialects:

EnumValue
Enum(tls_type) String(trad) Value(TLS_TRADITIONAL)

EnumValue
Enum(tls_type) String(desc) Value(TLS_DESCRIPTORS)

mtls-dialect=
Target RejectNegative Joined Enum(tls_type) Var(la_opt_tls_dialect) Init(M_OPT_UNSET) Save
Specify TLS dialect.

-param=loongarch-vect-unroll-limit=
Target Joined UInteger Var(la_vect_unroll_limit) Init(6) IntegerRange(1, 64) Param
Used to limit unroll factor which indicates how much the autovectorizer may
unroll a loop.  The default value is 6.

-param=loongarch-vect-issue-info=
Target Undocumented Joined UInteger Var(la_vect_issue_info) Init(4) IntegerRange(1, 64) Param
Indicate how many non memory access vector instructions can be issued per
cycle, it's used in unroll factor determination for autovectorizer.  The
default value is 4.

; Features added during ISA evolution.  This concept is different from ISA
; extension, read Section 1.5 of LoongArch v1.10 Volume 1 for the
; explanation.  These features may be implemented and enumerated with
; CPUCFG independently, so we use bit flags to specify them.
TargetVariable
HOST_WIDE_INT la_isa_evolution = 0