Daily bump.
[official-gcc.git] / gcc / config / riscv / riscv.opt
blob15bf89e17c2516b89b1f119d2eb6438d08ab4866
1 ; Options for the RISC-V port of the compiler
3 ; Copyright (C) 2011-2021 Free Software Foundation, Inc.
5 ; This file is part of GCC.
7 ; GCC is free software; you can redistribute it and/or modify it under
8 ; the terms of the GNU General Public License as published by the Free
9 ; Software Foundation; either version 3, or (at your option) any later
10 ; version.
12 ; GCC is distributed in the hope that it will be useful, but WITHOUT
13 ; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 ; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
15 ; License for more details.
17 ; You should have received a copy of the GNU General Public License
18 ; along with GCC; see the file COPYING3.  If not see
19 ; <http://www.gnu.org/licenses/>.
21 HeaderInclude
22 config/riscv/riscv-opts.h
24 mbig-endian
25 Target RejectNegative Mask(BIG_ENDIAN)
26 Assume target CPU is configured as big endian.
28 mlittle-endian
29 Target RejectNegative InverseMask(BIG_ENDIAN)
30 Assume target CPU is configured as little endian.
32 mbranch-cost=
33 Target RejectNegative Joined UInteger Var(riscv_branch_cost)
34 -mbranch-cost=N Set the cost of branches to roughly N instructions.
36 mplt
37 Target Var(TARGET_PLT) Init(1)
38 When generating -fpic code, allow the use of PLTs. Ignored for fno-pic.
40 mabi=
41 Target RejectNegative Joined Enum(abi_type) Var(riscv_abi) Init(ABI_ILP32) Negative(mabi=)
42 Specify integer and floating-point calling convention.
44 mpreferred-stack-boundary=
45 Target RejectNegative Joined UInteger Var(riscv_preferred_stack_boundary_arg)
46 Attempt to keep stack aligned to this power of 2.
48 Enum
49 Name(abi_type) Type(enum riscv_abi_type)
50 Supported ABIs (for use with the -mabi= option):
52 EnumValue
53 Enum(abi_type) String(ilp32) Value(ABI_ILP32)
55 EnumValue
56 Enum(abi_type) String(ilp32e) Value(ABI_ILP32E)
58 EnumValue
59 Enum(abi_type) String(ilp32f) Value(ABI_ILP32F)
61 EnumValue
62 Enum(abi_type) String(ilp32d) Value(ABI_ILP32D)
64 EnumValue
65 Enum(abi_type) String(lp64) Value(ABI_LP64)
67 EnumValue
68 Enum(abi_type) String(lp64f) Value(ABI_LP64F)
70 EnumValue
71 Enum(abi_type) String(lp64d) Value(ABI_LP64D)
73 mfdiv
74 Target Mask(FDIV)
75 Use hardware floating-point divide and square root instructions.
77 mdiv
78 Target Mask(DIV)
79 Use hardware instructions for integer division.
81 march=
82 Target RejectNegative Joined Negative(march=)
83 -march= Generate code for given RISC-V ISA (e.g. RV64IM).  ISA strings must be
84 lower-case.
86 mtune=
87 Target RejectNegative Joined Var(riscv_tune_string)
88 -mtune=PROCESSOR        Optimize the output for PROCESSOR.
90 mcpu=
91 Target RejectNegative Joined Var(riscv_cpu_string)
92 -mcpu=PROCESSOR Use architecture of and optimize the output for PROCESSOR.
94 msmall-data-limit=
95 Target Joined Separate UInteger Var(g_switch_value) Init(8)
96 -msmall-data-limit=N    Put global and static data smaller than <number> bytes into a special section (on some targets).
98 msave-restore
99 Target Mask(SAVE_RESTORE)
100 Use smaller but slower prologue and epilogue code.
102 mshorten-memrefs
103 Target Bool Var(riscv_mshorten_memrefs) Init(1)
104 Convert BASE + LARGE_OFFSET addresses to NEW_BASE + SMALL_OFFSET to allow more
105 memory accesses to be generated as compressed instructions.  Currently targets
106 32-bit integer load/stores.
108 mcmodel=
109 Target RejectNegative Joined Enum(code_model) Var(riscv_cmodel) Init(TARGET_DEFAULT_CMODEL)
110 Specify the code model.
112 mstrict-align
113 Target Mask(STRICT_ALIGN) Save
114 Do not generate unaligned memory accesses.
116 Enum
117 Name(code_model) Type(enum riscv_code_model)
118 Known code models (for use with the -mcmodel= option):
120 EnumValue
121 Enum(code_model) String(medlow) Value(CM_MEDLOW)
123 EnumValue
124 Enum(code_model) String(medany) Value(CM_MEDANY)
126 mexplicit-relocs
127 Target Mask(EXPLICIT_RELOCS)
128 Use %reloc() operators, rather than assembly macros, to load addresses.
130 mrelax
131 Target Bool Var(riscv_mrelax) Init(1)
132 Take advantage of linker relaxations to reduce the number of instructions
133 required to materialize symbol addresses.
135 Mask(64BIT)
137 Mask(MUL)
139 Mask(ATOMIC)
141 Mask(HARD_FLOAT)
143 Mask(DOUBLE_FLOAT)
145 Mask(RVC)
147 Mask(RVE)
149 mriscv-attribute
150 Target Var(riscv_emit_attribute_p) Init(-1)
151 Emit RISC-V ELF attribute.
153 malign-data=
154 Target RejectNegative Joined Var(riscv_align_data_type) Enum(riscv_align_data) Init(riscv_align_data_type_xlen)
155 Use the given data alignment.
157 Enum
158 Name(riscv_align_data) Type(enum riscv_align_data)
159 Known data alignment choices (for use with the -malign-data= option):
161 EnumValue
162 Enum(riscv_align_data) String(xlen) Value(riscv_align_data_type_xlen)
164 EnumValue
165 Enum(riscv_align_data) String(natural) Value(riscv_align_data_type_natural)
167 mstack-protector-guard=
168 Target RejectNegative Joined Enum(stack_protector_guard) Var(riscv_stack_protector_guard) Init(SSP_GLOBAL)
169 Use given stack-protector guard.
171 Enum
172 Name(stack_protector_guard) Type(enum stack_protector_guard)
173 Valid arguments to -mstack-protector-guard=:
175 EnumValue
176 Enum(stack_protector_guard) String(tls) Value(SSP_TLS)
178 EnumValue
179 Enum(stack_protector_guard) String(global) Value(SSP_GLOBAL)
181 mstack-protector-guard-reg=
182 Target RejectNegative Joined Var(riscv_stack_protector_guard_reg_str)
183 Use the given base register for addressing the stack-protector guard.
185 TargetVariable
186 int riscv_stack_protector_guard_reg = 0
188 mstack-protector-guard-offset=
189 Target RejectNegative Joined Integer Var(riscv_stack_protector_guard_offset_str)
190 Use the given offset for addressing the stack-protector guard.
192 TargetVariable
193 long riscv_stack_protector_guard_offset = 0
195 TargetVariable
196 int riscv_zi_subext
198 TargetVariable
199 int riscv_zb_subext
201 Enum
202 Name(isa_spec_class) Type(enum riscv_isa_spec_class)
203 Supported ISA specs (for use with the -misa-spec= option):
205 EnumValue
206 Enum(isa_spec_class) String(2.2) Value(ISA_SPEC_CLASS_2P2)
208 EnumValue
209 Enum(isa_spec_class) String(20190608) Value(ISA_SPEC_CLASS_20190608)
211 EnumValue
212 Enum(isa_spec_class) String(20191213) Value(ISA_SPEC_CLASS_20191213)
214 misa-spec=
215 Target RejectNegative Joined Enum(isa_spec_class) Var(riscv_isa_spec) Init(TARGET_DEFAULT_ISA_SPEC)
216 Set the version of RISC-V ISA spec.