1 ; Options for the RISC-V port of the compiler 2 ; 3 ; Copyright (C) 2011-2022 Free Software Foundation, Inc. 4 ; 5 ; This file is part of GCC. 6 ; 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. 11 ; 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. 16 ; 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/>. 20 21 HeaderInclude 22 config/riscv/riscv-opts.h 23 24 mbig-endian 25 Target RejectNegative Mask(BIG_ENDIAN) 26 Assume target CPU is configured as big endian. 27 28 mlittle-endian 29 Target RejectNegative InverseMask(BIG_ENDIAN) 30 Assume target CPU is configured as little endian. 31 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. 35 36 mplt 37 Target Var(TARGET_PLT) Init(1) 38 When generating -fpic code, allow the use of PLTs. Ignored for fno-pic. 39 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. 43 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. 47 48 Enum 49 Name(abi_type) Type(enum riscv_abi_type) 50 Supported ABIs (for use with the -mabi= option): 51 52 EnumValue 53 Enum(abi_type) String(ilp32) Value(ABI_ILP32) 54 55 EnumValue 56 Enum(abi_type) String(ilp32e) Value(ABI_ILP32E) 57 58 EnumValue 59 Enum(abi_type) String(ilp32f) Value(ABI_ILP32F) 60 61 EnumValue 62 Enum(abi_type) String(ilp32d) Value(ABI_ILP32D) 63 64 EnumValue 65 Enum(abi_type) String(lp64) Value(ABI_LP64) 66 67 EnumValue 68 Enum(abi_type) String(lp64f) Value(ABI_LP64F) 69 70 EnumValue 71 Enum(abi_type) String(lp64d) Value(ABI_LP64D) 72 73 mfdiv 74 Target Mask(FDIV) 75 Use hardware floating-point divide and square root instructions. 76 77 mdiv 78 Target Mask(DIV) 79 Use hardware instructions for integer division. 80 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. 85 86 mtune= 87 Target RejectNegative Joined Var(riscv_tune_string) 88 -mtune=PROCESSOR Optimize the output for PROCESSOR. 89 90 mcpu= 91 Target RejectNegative Joined Var(riscv_cpu_string) 92 -mcpu=PROCESSOR Use architecture of and optimize the output for PROCESSOR. 93 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). 97 98 msave-restore 99 Target Mask(SAVE_RESTORE) 100 Use smaller but slower prologue and epilogue code. 101 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. 107 108 mcmodel= 109 Target RejectNegative Joined Enum(code_model) Var(riscv_cmodel) Init(TARGET_DEFAULT_CMODEL) 110 Specify the code model. 111 112 mstrict-align 113 Target Mask(STRICT_ALIGN) Save 114 Do not generate unaligned memory accesses. 115 116 Enum 117 Name(code_model) Type(enum riscv_code_model) 118 Known code models (for use with the -mcmodel= option): 119 120 EnumValue 121 Enum(code_model) String(medlow) Value(CM_MEDLOW) 122 123 EnumValue 124 Enum(code_model) String(medany) Value(CM_MEDANY) 125 126 mexplicit-relocs 127 Target Mask(EXPLICIT_RELOCS) 128 Use %reloc() operators, rather than assembly macros, to load addresses. 129 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. 134 135 Mask(64BIT) 136 137 Mask(MUL) 138 139 Mask(ATOMIC) 140 141 Mask(HARD_FLOAT) 142 143 Mask(DOUBLE_FLOAT) 144 145 Mask(RVC) 146 147 Mask(RVE) 148 149 Mask(VECTOR) 150 151 mriscv-attribute 152 Target Var(riscv_emit_attribute_p) Init(-1) 153 Emit RISC-V ELF attribute. 154 155 malign-data= 156 Target RejectNegative Joined Var(riscv_align_data_type) Enum(riscv_align_data) Init(riscv_align_data_type_xlen) 157 Use the given data alignment. 158 159 Enum 160 Name(riscv_align_data) Type(enum riscv_align_data) 161 Known data alignment choices (for use with the -malign-data= option): 162 163 EnumValue 164 Enum(riscv_align_data) String(xlen) Value(riscv_align_data_type_xlen) 165 166 EnumValue 167 Enum(riscv_align_data) String(natural) Value(riscv_align_data_type_natural) 168 169 mstack-protector-guard= 170 Target RejectNegative Joined Enum(stack_protector_guard) Var(riscv_stack_protector_guard) Init(SSP_GLOBAL) 171 Use given stack-protector guard. 172 173 Enum 174 Name(stack_protector_guard) Type(enum stack_protector_guard) 175 Valid arguments to -mstack-protector-guard=: 176 177 EnumValue 178 Enum(stack_protector_guard) String(tls) Value(SSP_TLS) 179 180 EnumValue 181 Enum(stack_protector_guard) String(global) Value(SSP_GLOBAL) 182 183 mstack-protector-guard-reg= 184 Target RejectNegative Joined Var(riscv_stack_protector_guard_reg_str) 185 Use the given base register for addressing the stack-protector guard. 186 187 TargetVariable 188 int riscv_stack_protector_guard_reg = 0 189 190 mstack-protector-guard-offset= 191 Target RejectNegative Joined Integer Var(riscv_stack_protector_guard_offset_str) 192 Use the given offset for addressing the stack-protector guard. 193 194 TargetVariable 195 long riscv_stack_protector_guard_offset = 0 196 197 TargetVariable 198 int riscv_zi_subext 199 200 TargetVariable 201 int riscv_zb_subext 202 203 TargetVariable 204 int riscv_zk_subext 205 206 TargetVariable 207 int riscv_vector_elen_flags 208 209 TargetVariable 210 int riscv_zvl_flags 211 212 Enum 213 Name(isa_spec_class) Type(enum riscv_isa_spec_class) 214 Supported ISA specs (for use with the -misa-spec= option): 215 216 EnumValue 217 Enum(isa_spec_class) String(2.2) Value(ISA_SPEC_CLASS_2P2) 218 219 EnumValue 220 Enum(isa_spec_class) String(20190608) Value(ISA_SPEC_CLASS_20190608) 221 222 EnumValue 223 Enum(isa_spec_class) String(20191213) Value(ISA_SPEC_CLASS_20191213) 224 225 misa-spec= 226 Target RejectNegative Joined Enum(isa_spec_class) Var(riscv_isa_spec) Init(TARGET_DEFAULT_ISA_SPEC) 227 Set the version of RISC-V ISA spec. 228