1 ; Options for the rs6000 port of the compiler
3 ; Copyright (C) 2005-2023 Free Software Foundation, Inc.
4 ; Contributed by Aldy Hernandez <aldy@quesejoda.com>.
6 ; This file is part of GCC.
8 ; GCC is free software; you can redistribute it and/or modify it under
9 ; the terms of the GNU General Public License as published by the Free
10 ; Software Foundation; either version 3, or (at your option) any later
13 ; GCC is distributed in the hope that it will be useful, but WITHOUT
14 ; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 ; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 ; License for more details.
18 ; You should have received a copy of the GNU General Public License
19 ; along with GCC; see the file COPYING3. If not see
20 ; <http://www.gnu.org/licenses/>.
23 config/rs6000/rs6000-opts.h
25 ;; ISA flag bits (on/off)
27 HOST_WIDE_INT rs6000_isa_flags = TARGET_DEFAULT
30 HOST_WIDE_INT x_rs6000_isa_flags
32 ;; Miscellaneous flag bits that were set explicitly by the user
34 HOST_WIDE_INT rs6000_isa_flags_explicit
37 HOST_WIDE_INT x_rs6000_isa_flags_explicit
41 enum processor_type rs6000_cpu = PROCESSOR_PPC603
45 enum processor_type rs6000_tune = PROCESSOR_PPC603
47 ;; Always emit branch hint bits.
49 unsigned char rs6000_always_hint
51 ;; Schedule instructions for group formation.
53 unsigned char rs6000_sched_groups
55 ;; Align branch targets.
57 unsigned char rs6000_align_branch_targets
59 ;; Support for -msched-costly-dep option.
61 enum rs6000_dependence_cost rs6000_sched_costly_dep = no_dep_costly
63 ;; Support for -minsert-sched-nops option.
65 enum rs6000_nop_insertion rs6000_sched_insert_nops = sched_finish_none
67 ;; Non-zero to allow overriding loop alignment.
69 unsigned char can_override_loop_align
71 ;; Which small data model to use (for System V targets only)
73 enum rs6000_sdata_type rs6000_sdata = SDATA_DATA
75 ;; Bit size of immediate TLS offsets and string from which it is decoded.
77 int rs6000_tls_size = 32
79 ;; ABI enumeration available for subtarget to use.
81 enum rs6000_abi rs6000_current_abi = ABI_NONE
83 ;; Type of traceback to use.
85 enum rs6000_traceback_type rs6000_traceback = traceback_default
87 ;; Control alignment for fields within structures.
89 unsigned char rs6000_alignment_flags
91 ;; Code model for 64-bit linux.
93 enum rs6000_cmodel rs6000_current_cmodel = CMODEL_SMALL
95 ;; What type of reciprocal estimation instructions to generate
97 unsigned int rs6000_recip_control
101 unsigned int rs6000_debug
103 ;; Whether to enable the -mfloat128 stuff without necessarily enabling the
104 ;; __float128 keyword.
106 unsigned char x_TARGET_FLOAT128_TYPE
109 unsigned char TARGET_FLOAT128_TYPE
111 ;; This option existed in the past, but now is always on.
113 Target RejectNegative Undocumented Ignore
116 Target Mask(POWERPC64) Var(rs6000_isa_flags)
117 Use PowerPC-64 instruction set.
120 Target Mask(PPC_GPOPT) Var(rs6000_isa_flags)
121 Use PowerPC General Purpose group optional instructions.
124 Target Mask(PPC_GFXOPT) Var(rs6000_isa_flags)
125 Use PowerPC Graphics group optional instructions.
128 Target Mask(MFCRF) Var(rs6000_isa_flags)
129 Use PowerPC V2.01 single field mfcr instruction.
132 Target Mask(POPCNTB) Var(rs6000_isa_flags)
133 Use PowerPC V2.02 popcntb instruction.
136 Target Mask(FPRND) Var(rs6000_isa_flags)
137 Use PowerPC V2.02 floating point rounding instructions.
140 Target Mask(CMPB) Var(rs6000_isa_flags)
141 Use PowerPC V2.05 compare bytes instruction.
143 ;; This option existed in the past, but now is always off.
145 Target RejectNegative Undocumented Ignore
148 Target RejectNegative Undocumented WarnRemoved
151 Target Mask(ALTIVEC) Var(rs6000_isa_flags)
152 Use AltiVec instructions.
155 Target Mask(DFP) Var(rs6000_isa_flags)
156 Use decimal floating point instructions.
159 Target Mask(MULHW) Var(rs6000_isa_flags)
160 Use 4xx half-word multiply instructions.
163 Target Mask(DLMZB) Var(rs6000_isa_flags)
164 Use 4xx string-search dlmzb instruction.
167 Target Mask(MULTIPLE) Var(rs6000_isa_flags)
168 Generate load/store multiple instructions.
170 ;; This option existed in the past, but now is always off.
172 Target RejectNegative Undocumented Ignore
175 Target RejectNegative Undocumented WarnRemoved
178 Target RejectNegative Mask(SOFT_FLOAT) Var(rs6000_isa_flags)
179 Do not use hardware floating point.
182 Target RejectNegative InverseMask(SOFT_FLOAT, HARD_FLOAT) Var(rs6000_isa_flags)
183 Use hardware floating point.
186 Target Mask(POPCNTD) Var(rs6000_isa_flags)
187 Use PowerPC V2.06 popcntd instruction.
190 Target Var(TARGET_FRIZ) Init(-1) Save
191 Under -ffast-math, generate a FRIZ instruction for (double)(long long) conversions.
194 Target RejectNegative Joined Var(rs6000_veclibabi_name)
195 Vector library ABI to use.
198 Target Mask(VSX) Var(rs6000_isa_flags)
199 Use vector/scalar (VSX) instructions.
202 Target Undocumented Var(TARGET_VSX_ALIGN_128) Save
203 ; If -mvsx, set alignment to 128 bits instead of 32/64
206 Target Undocumented Var(TARGET_ALLOW_MOVMISALIGN) Init(-1) Save
207 ; Allow the movmisalign in DF/DI vectors
209 mefficient-unaligned-vsx
210 Target Undocumented Mask(EFFICIENT_UNALIGNED_VSX) Var(rs6000_isa_flags)
211 ; Consider unaligned VSX vector and fp accesses to be efficient
214 Target Undocumented Var(TARGET_SCHED_GROUPS) Init(-1) Save
215 ; Explicitly set rs6000_sched_groups
218 Target Undocumented Var(TARGET_ALWAYS_HINT) Init(-1) Save
219 ; Explicitly set rs6000_always_hint
221 malign-branch-targets
222 Target Undocumented Var(TARGET_ALIGN_BRANCH_TARGETS) Init(-1) Save
223 ; Explicitly set rs6000_align_branch_targets
226 Target RejectNegative Mask(NO_UPDATE) Var(rs6000_isa_flags)
227 Do not generate load/store with update instructions.
230 Target RejectNegative InverseMask(NO_UPDATE, UPDATE) Var(rs6000_isa_flags)
231 Generate load/store with update instructions.
234 Target Var(TARGET_SINGLE_PIC_BASE) Init(0)
235 Do not load the PIC register in function prologues.
237 mavoid-indexed-addresses
238 Target Var(TARGET_AVOID_XFORM) Init(-1) Save
239 Avoid generation of indexed load/store instructions when possible.
242 Target Undocumented Var(TARGET_SCHED_PROLOG) Init(1) Save
245 Target Var(TARGET_SCHED_PROLOG) Save
246 Schedule the start and end of the procedure.
249 Target RejectNegative Var(aix_struct_return) Save
250 Return all structures in memory (AIX default).
253 Target RejectNegative Var(aix_struct_return,0) Save
254 Return small structures in registers (SVR4 default).
257 Target Var(TARGET_XL_COMPAT) Save
258 Conform more closely to IBM XLC semantics.
262 Generate software reciprocal divide and square root for better throughput.
265 Target RejectNegative Joined Var(rs6000_recip_name)
266 Generate software reciprocal divide and square root for better throughput.
269 Target Mask(RECIP_PRECISION) Var(rs6000_isa_flags)
270 Assume that the reciprocal estimate instructions provide more accuracy.
273 Target RejectNegative Var(TARGET_NO_FP_IN_TOC) Save
274 Do not place floating point constants in TOC.
277 Target RejectNegative Var(TARGET_NO_FP_IN_TOC,0) Save
278 Place floating point constants in TOC.
281 Target RejectNegative Var(TARGET_NO_SUM_IN_TOC) Save
282 Do not place symbol+offset constants in TOC.
285 Target RejectNegative Var(TARGET_NO_SUM_IN_TOC,0) Save
286 Place symbol+offset constants in TOC.
288 ; Output only one TOC entry per module. Normally linking fails if
289 ; there are more than 16K unique variables/constants in an executable. With
290 ; this option, linking fails only if there are more than 16K modules, or
291 ; if there are more than 16K unique variables/constant in a single module.
293 ; This is at the cost of having 2 extra loads and one extra store per
294 ; function, and one less allocable register.
296 Target Mask(MINIMAL_TOC) Var(rs6000_isa_flags)
297 Use only one TOC entry per procedure.
301 Put everything in the regular TOC.
304 Target Var(TARGET_ALTIVEC_VRSAVE) Save
305 Generate VRSAVE instructions when generating AltiVec code.
308 Target RejectNegative Alias(mvrsave) NegativeAlias Warn(%<-mvrsave=no%> is deprecated; use %<-mno-vrsave%> instead)
309 Deprecated option. Use -mno-vrsave instead.
312 Target RejectNegative Alias(mvrsave) Warn(%<-mvrsave=yes%> is deprecated; use %<-mvrsave%> instead)
313 Deprecated option. Use -mvrsave instead.
315 mblock-move-inline-limit=
316 Target Var(rs6000_block_move_inline_limit) Init(0) RejectNegative Joined UInteger Save
317 Max number of bytes to move inline.
319 mblock-ops-unaligned-vsx
320 Target Mask(BLOCK_OPS_UNALIGNED_VSX) Var(rs6000_isa_flags)
321 Generate unaligned VSX load/store for inline expansion of memcpy/memmove.
323 mblock-ops-vector-pair
324 Target Undocumented Mask(BLOCK_OPS_VECTOR_PAIR) Var(rs6000_isa_flags)
325 Generate unaligned VSX vector pair load/store for inline expansion of memcpy/memmove.
327 mblock-compare-inline-limit=
328 Target Var(rs6000_block_compare_inline_limit) Init(63) RejectNegative Joined UInteger Save
329 Max number of bytes to compare without loops.
331 mblock-compare-inline-loop-limit=
332 Target Var(rs6000_block_compare_inline_loop_limit) Init(-1) RejectNegative Joined UInteger Save
333 Max number of bytes to compare with loops.
335 mstring-compare-inline-limit=
336 Target Var(rs6000_string_compare_inline_limit) Init(64) RejectNegative Joined UInteger Save
337 Max number of bytes to compare.
340 Target Mask(ISEL) Var(rs6000_isa_flags)
341 Generate isel instructions.
344 Target RejectNegative Joined
345 -mdebug= Enable debug output.
349 Target RejectNegative Var(rs6000_altivec_abi) Save
350 Use the AltiVec ABI extensions.
353 Target RejectNegative Var(rs6000_altivec_abi, 0)
354 Do not use the AltiVec ABI extensions.
356 ; AIX Extended vector ABI
358 Target RejectNegative Var(rs6000_aix_extabi, 1) Save
359 Use the AIX Vector Extended ABI.
362 Target RejectNegative Var(rs6000_aix_extabi, 0)
363 Do not use the AIX Vector Extended ABI.
365 ; PPC64 Linux ELF ABI
367 Target RejectNegative Var(rs6000_elf_abi, 1) Save
371 Target RejectNegative Var(rs6000_elf_abi, 2)
374 ; These are here for testing during development only, do not document
375 ; in the manual please.
377 ; If we want Darwin's struct-by-value-in-regs ABI.
379 Target RejectNegative Undocumented Warn(using darwin64 ABI) Var(rs6000_darwin64_abi) Save
382 Target RejectNegative Undocumented Warn(using old darwin ABI) Var(rs6000_darwin64_abi, 0)
385 Target RejectNegative Var(rs6000_ieeequad) Save
388 Target RejectNegative Var(rs6000_ieeequad, 0)
391 Target RejectNegative Joined Var(rs6000_cpu_index) Init(-1) Enum(rs6000_cpu_opt_value) Save
392 -mcpu= Use features of and schedule code for given CPU.
395 Target RejectNegative Joined Var(rs6000_tune_index) Init(-1) Enum(rs6000_cpu_opt_value) Save
396 -mtune= Schedule code for given CPU.
399 Target RejectNegative Joined Enum(rs6000_traceback_type) Var(rs6000_traceback)
400 -mtraceback=[full,part,no] Select type of traceback table.
403 Name(rs6000_traceback_type) Type(enum rs6000_traceback_type)
406 Enum(rs6000_traceback_type) String(full) Value(traceback_full)
409 Enum(rs6000_traceback_type) String(part) Value(traceback_part)
412 Enum(rs6000_traceback_type) String(no) Value(traceback_none)
415 Target Var(rs6000_default_long_calls) Save
416 Avoid all range limits on call instructions.
418 ; This option existed in the past, but now is always on.
420 Target RejectNegative Undocumented Ignore
423 Target Var(rs6000_warn_altivec_long) Init(1) Save
424 Warn about deprecated 'vector long ...' AltiVec type usage.
427 Target RejectNegative Joined UInteger Var(rs6000_long_double_type_size) Save
428 Use -mlong-double-64 for 64-bit IEEE floating point format. Use
429 -mlong-double-128 for 128-bit floating point format (either IEEE or IBM).
431 ; This option existed in the past, but now is always on.
433 Target RejectNegative Undocumented Ignore
436 Target RejectNegative Joined Var(rs6000_sched_costly_dep_str)
437 Determine which dependences between insns are considered costly.
440 Target RejectNegative Joined Var(rs6000_sched_insert_nops_str)
441 Specify which post scheduling nop insertion scheme to apply.
444 Target RejectNegative Joined Enum(rs6000_alignment_flags) Var(rs6000_alignment_flags)
445 Specify alignment of structure fields default/natural.
448 Name(rs6000_alignment_flags) Type(unsigned char)
449 Valid arguments to -malign-:
452 Enum(rs6000_alignment_flags) String(power) Value(MASK_ALIGN_POWER)
455 Enum(rs6000_alignment_flags) String(natural) Value(MASK_ALIGN_NATURAL)
457 mprioritize-restricted-insns=
458 Target RejectNegative Joined UInteger Var(rs6000_sched_restricted_insns_priority) Save
459 Specify scheduling priority for dispatch slot restricted insns.
461 mpointers-to-nested-functions
462 Target Var(TARGET_POINTERS_TO_NESTED_FUNCTIONS) Init(1) Save
463 Use r11 to hold the static link in calls to functions via pointers.
466 Target Mask(SAVE_TOC_INDIRECT) Var(rs6000_isa_flags)
467 Save the TOC in the prologue for indirect calls rather than inline.
469 ; This option existed in the past, but now is always the same as -mvsx.
471 Target RejectNegative Undocumented Ignore
474 Target Mask(P8_FUSION) Var(rs6000_isa_flags)
475 Fuse certain integer operations together for better performance on power8.
478 Target Undocumented Mask(P8_FUSION_SIGN) Var(rs6000_isa_flags)
479 Allow sign extension in fusion operations.
482 Target Mask(P8_VECTOR) Var(rs6000_isa_flags)
483 Use vector and scalar instructions added in ISA 2.07.
486 Target Undocumented Mask(P10_FUSION) Var(rs6000_isa_flags)
487 Fuse certain integer operations together for better performance on power10.
490 Target Mask(CRYPTO) Var(rs6000_isa_flags)
491 Use ISA 2.07 Category:Vector.AES and Category:Vector.SHA2 instructions.
494 Target Undocumented Mask(DIRECT_MOVE) Var(rs6000_isa_flags) WarnRemoved
497 Target Mask(HTM) Var(rs6000_isa_flags)
498 Use ISA 2.07 transactional memory (HTM) instructions.
501 Target Mask(QUAD_MEMORY) Var(rs6000_isa_flags)
502 Generate the quad word memory instructions (lq/stq).
505 Target Mask(QUAD_MEMORY_ATOMIC) Var(rs6000_isa_flags)
506 Generate the quad word memory atomic instructions (lqarx/stqcx).
509 Target Var(rs6000_compat_align_parm) Init(0) Save
510 Generate aggregate parameter passing code with at most 64-bit alignment.
513 Target Undocumented Var(rs6000_optimize_swaps) Init(1) Save
514 Analyze and remove doubleword swaps from VSX computations.
516 munroll-only-small-loops
517 Target Undocumented Var(unroll_only_small_loops) Init(0) Save
518 ; Use conservative small loop unrolling.
521 Target Undocumented Mask(P9_MISC) Var(rs6000_isa_flags)
522 Use certain scalar instructions added in ISA 3.0.
525 Target Undocumented Mask(P9_VECTOR) Var(rs6000_isa_flags)
526 Use vector instructions added in ISA 3.0.
529 Target Undocumented Mask(P9_MINMAX) Var(rs6000_isa_flags)
530 Use the new min/max instructions defined in ISA 3.0.
533 Target Undocumented Mask(MODULO) Var(rs6000_isa_flags)
534 Generate the integer modulo instructions.
537 Target Mask(FLOAT128_KEYWORD) Var(rs6000_isa_flags)
538 Enable IEEE 128-bit floating point via the __float128 keyword.
541 Target Mask(FLOAT128_HW) Var(rs6000_isa_flags)
542 Enable using IEEE 128-bit floating point instructions.
545 Target Undocumented Mask(FLOAT128_CVT) Var(rs6000_isa_flags)
546 Enable default conversions between __float128 & long double.
548 mstack-protector-guard=
549 Target RejectNegative Joined Enum(stack_protector_guard) Var(rs6000_stack_protector_guard) Init(SSP_TLS)
550 Use given stack-protector guard.
553 Name(stack_protector_guard) Type(enum stack_protector_guard)
554 Valid arguments to -mstack-protector-guard=:
557 Enum(stack_protector_guard) String(tls) Value(SSP_TLS)
560 Enum(stack_protector_guard) String(global) Value(SSP_GLOBAL)
562 mstack-protector-guard-reg=
563 Target RejectNegative Joined Var(rs6000_stack_protector_guard_reg_str)
564 Use the given base register for addressing the stack-protector guard.
567 int rs6000_stack_protector_guard_reg = 0
569 mstack-protector-guard-offset=
570 Target RejectNegative Joined Integer Var(rs6000_stack_protector_guard_offset_str)
571 Use the given offset for addressing the stack-protector guard.
574 long rs6000_stack_protector_guard_offset = 0
576 ;; -mno-speculate-indirect-jumps adds deliberate misprediction to indirect
577 ;; branches via the CTR.
578 mspeculate-indirect-jumps
579 Target Undocumented Var(rs6000_speculate_indirect_jumps) Init(1) Save
582 Target Undocumented Mask(POWER10) Var(rs6000_isa_flags) WarnRemoved
585 Target Mask(PREFIXED) Var(rs6000_isa_flags)
586 Generate (do not generate) prefixed memory instructions.
589 Target Mask(PCREL) Var(rs6000_isa_flags)
590 Generate (do not generate) pc-relative memory addressing.
593 Target Undocumented Mask(PCREL_OPT) Var(rs6000_isa_flags)
594 Generate (do not generate) pc-relative memory optimizations for externals.
597 Target Mask(MMA) Var(rs6000_isa_flags)
598 Generate (do not generate) MMA instructions.
601 Target Undocumented Var(rs6000_relative_jumptables) Init(1) Save
604 Target Var(rs6000_rop_protect) Init(0)
605 Enable instructions that guard against return-oriented programming attacks.
608 Target Var(rs6000_privileged) Init(0)
609 Generate code that will run in privileged state.
612 Target Var(TARGET_SPLAT_WORD_CONSTANT) Init(1) Save
613 Generate (do not generate) code that uses the XXSPLTIW instruction.
615 msplat-float-constant
616 Target Var(TARGET_SPLAT_FLOAT_CONSTANT) Init(1) Save
617 Generate (do not generate) code that uses the XXSPLTIDP instruction.
620 Target Var(TARGET_IEEE128_CONSTANT) Init(1) Save
621 Generate (do not generate) code that uses the LXVKQ instruction.
623 ; Documented parameters
625 -param=rs6000-vect-unroll-limit=
626 Target Joined UInteger Var(rs6000_vect_unroll_limit) Init(4) IntegerRange(1, 64) Param
627 Used to limit unroll factor which indicates how much the autovectorizer may
628 unroll a loop. The default value is 4.
630 ; Undocumented parameters
631 -param=rs6000-density-pct-threshold=
632 Target Undocumented Joined UInteger Var(rs6000_density_pct_threshold) Init(85) IntegerRange(0, 100) Param
633 When costing for loop vectorization, we probably need to penalize the loop body
634 cost if the existing cost model may not adequately reflect delays from
635 unavailable vector resources. We collect the cost for vectorized statements
636 and non-vectorized statements separately, check the proportion of vec_cost to
637 total cost of vec_cost and non vec_cost, and penalize only if the proportion
638 exceeds the threshold specified by this parameter. The default value is 85.
640 -param=rs6000-density-size-threshold=
641 Target Undocumented Joined UInteger Var(rs6000_density_size_threshold) Init(70) IntegerRange(0, 1000) Param
642 Like parameter rs6000-density-pct-threshold, we also check the total sum of
643 vec_cost and non vec_cost, and penalize only if the sum exceeds the threshold
644 specified by this parameter. The default value is 70.
646 -param=rs6000-density-penalty=
647 Target Undocumented Joined UInteger Var(rs6000_density_penalty) Init(10) IntegerRange(0, 1000) Param
648 When both heuristics with rs6000-density-pct-threshold and
649 rs6000-density-size-threshold are satisfied, we decide to penalize the loop
650 body cost by the value which is specified by this parameter. The default
653 -param=rs6000-density-load-pct-threshold=
654 Target Undocumented Joined UInteger Var(rs6000_density_load_pct_threshold) Init(45) IntegerRange(0, 100) Param
655 When costing for loop vectorization, we probably need to penalize the loop body
656 cost by accounting for excess strided or elementwise loads. We collect the
657 numbers for general statements and load statements according to the information
658 for statements to be vectorized, check the proportion of load statements, and
659 penalize only if the proportion exceeds the threshold specified by this
660 parameter. The default value is 45.
662 -param=rs6000-density-load-num-threshold=
663 Target Undocumented Joined UInteger Var(rs6000_density_load_num_threshold) Init(20) IntegerRange(0, 1000) Param
664 Like parameter rs6000-density-load-pct-threshold, we also check if the total
665 number of load statements exceeds the threshold specified by this parameter,
666 and penalize only if it's satisfied. The default value is 20.
668 -param=rs6000-vect-unroll-issue=
669 Target Undocumented Joined UInteger Var(rs6000_vect_unroll_issue) Init(4) IntegerRange(1, 128) Param
670 Indicate how many non memory access vector instructions can be issued per
671 cycle, it's used in unroll factor determination for autovectorizer. The
674 -param=rs6000-vect-unroll-reduc-threshold=
675 Target Undocumented Joined UInteger Var(rs6000_vect_unroll_reduc_threshold) Init(1) Param
676 When reduction factor computed for a loop exceeds the threshold specified by
677 this parameter, prefer to unroll this loop. The default value is 1.