summaryrefslogtreecommitdiff
path: root/gcc/config/riscv/riscv.opt
blob: 617000975bf7f7f1785a992bc9b4521a201b3146 (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
; Options for the RISC-V port of the compiler
;
; Copyright (C) 2011-2021 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/riscv/riscv-opts.h

mbig-endian
Target RejectNegative Mask(BIG_ENDIAN)
Assume target CPU is configured as big endian.

mlittle-endian
Target RejectNegative InverseMask(BIG_ENDIAN)
Assume target CPU is configured as little endian.

mbranch-cost=
Target RejectNegative Joined UInteger Var(riscv_branch_cost)
-mbranch-cost=N	Set the cost of branches to roughly N instructions.

mplt
Target Var(TARGET_PLT) Init(1)
When generating -fpic code, allow the use of PLTs. Ignored for fno-pic.

mabi=
Target RejectNegative Joined Enum(abi_type) Var(riscv_abi) Init(ABI_ILP32) Negative(mabi=)
Specify integer and floating-point calling convention.

mpreferred-stack-boundary=
Target RejectNegative Joined UInteger Var(riscv_preferred_stack_boundary_arg)
Attempt to keep stack aligned to this power of 2.

Enum
Name(abi_type) Type(enum riscv_abi_type)
Supported ABIs (for use with the -mabi= option):

EnumValue
Enum(abi_type) String(ilp32) Value(ABI_ILP32)

EnumValue
Enum(abi_type) String(ilp32e) Value(ABI_ILP32E)

EnumValue
Enum(abi_type) String(ilp32f) Value(ABI_ILP32F)

EnumValue
Enum(abi_type) String(ilp32d) Value(ABI_ILP32D)

EnumValue
Enum(abi_type) String(lp64) Value(ABI_LP64)

EnumValue
Enum(abi_type) String(lp64f) Value(ABI_LP64F)

EnumValue
Enum(abi_type) String(lp64d) Value(ABI_LP64D)

mfdiv
Target Mask(FDIV)
Use hardware floating-point divide and square root instructions.

mdiv
Target Mask(DIV)
Use hardware instructions for integer division.

march=
Target RejectNegative Joined Negative(march=)
-march=	Generate code for given RISC-V ISA (e.g. RV64IM).  ISA strings must be
lower-case.

mtune=
Target RejectNegative Joined Var(riscv_tune_string)
-mtune=PROCESSOR	Optimize the output for PROCESSOR.

mcpu=
Target RejectNegative Joined Var(riscv_cpu_string)
-mcpu=PROCESSOR	Use architecture of and optimize the output for PROCESSOR.

msmall-data-limit=
Target Joined Separate UInteger Var(g_switch_value) Init(8)
-msmall-data-limit=N	Put global and static data smaller than <number> bytes into a special section (on some targets).

msave-restore
Target Mask(SAVE_RESTORE)
Use smaller but slower prologue and epilogue code.

mshorten-memrefs
Target Bool Var(riscv_mshorten_memrefs) Init(1)
Convert BASE + LARGE_OFFSET addresses to NEW_BASE + SMALL_OFFSET to allow more
memory accesses to be generated as compressed instructions.  Currently targets
32-bit integer load/stores.

mcmodel=
Target RejectNegative Joined Enum(code_model) Var(riscv_cmodel) Init(TARGET_DEFAULT_CMODEL)
Specify the code model.

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

Enum
Name(code_model) Type(enum riscv_code_model)
Known code models (for use with the -mcmodel= option):

EnumValue
Enum(code_model) String(medlow) Value(CM_MEDLOW)

EnumValue
Enum(code_model) String(medany) Value(CM_MEDANY)

mexplicit-relocs
Target Mask(EXPLICIT_RELOCS)
Use %reloc() operators, rather than assembly macros, to load addresses.

mrelax
Target Bool Var(riscv_mrelax) Init(1)
Take advantage of linker relaxations to reduce the number of instructions
required to materialize symbol addresses.

Mask(64BIT)

Mask(MUL)

Mask(ATOMIC)

Mask(HARD_FLOAT)

Mask(DOUBLE_FLOAT)

Mask(RVC)

Mask(RVE)

mriscv-attribute
Target Var(riscv_emit_attribute_p) Init(-1)
Emit RISC-V ELF attribute.

malign-data=
Target RejectNegative Joined Var(riscv_align_data_type) Enum(riscv_align_data) Init(riscv_align_data_type_xlen)
Use the given data alignment.

Enum
Name(riscv_align_data) Type(enum riscv_align_data)
Known data alignment choices (for use with the -malign-data= option):

EnumValue
Enum(riscv_align_data) String(xlen) Value(riscv_align_data_type_xlen)

EnumValue
Enum(riscv_align_data) String(natural) Value(riscv_align_data_type_natural)

mstack-protector-guard=
Target RejectNegative Joined Enum(stack_protector_guard) Var(riscv_stack_protector_guard) Init(SSP_GLOBAL)
Use given stack-protector guard.

Enum
Name(stack_protector_guard) Type(enum stack_protector_guard)
Valid arguments to -mstack-protector-guard=:

EnumValue
Enum(stack_protector_guard) String(tls) Value(SSP_TLS)

EnumValue
Enum(stack_protector_guard) String(global) Value(SSP_GLOBAL)

mstack-protector-guard-reg=
Target RejectNegative Joined Var(riscv_stack_protector_guard_reg_str)
Use the given base register for addressing the stack-protector guard.

TargetVariable
int riscv_stack_protector_guard_reg = 0

mstack-protector-guard-offset=
Target RejectNegative Joined Integer Var(riscv_stack_protector_guard_offset_str)
Use the given offset for addressing the stack-protector guard.

TargetVariable
long riscv_stack_protector_guard_offset = 0

TargetVariable
int riscv_zi_subext

TargetVariable
int riscv_zb_subext

TargetVariable
int riscv_zk_subext

Enum
Name(isa_spec_class) Type(enum riscv_isa_spec_class)
Supported ISA specs (for use with the -misa-spec= option):

EnumValue
Enum(isa_spec_class) String(2.2) Value(ISA_SPEC_CLASS_2P2)

EnumValue
Enum(isa_spec_class) String(20190608) Value(ISA_SPEC_CLASS_20190608)

EnumValue
Enum(isa_spec_class) String(20191213) Value(ISA_SPEC_CLASS_20191213)

misa-spec=
Target RejectNegative Joined Enum(isa_spec_class) Var(riscv_isa_spec) Init(TARGET_DEFAULT_ISA_SPEC)
Set the version of RISC-V ISA spec.