2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
15 The following options control the architecture variant for which code
18 .. architecture variants
20 .. option:: -mbarrel-shifter
22 Generate instructions supported by barrel shifter. This is the default
23 unless :option:`-mcpu=ARC601` or :samp:`-mcpu=ARCEM` is in effect.
25 .. option:: -mjli-always
27 Force to call a function using jli_s instruction. This option is
28 valid only for ARCv2 architecture.
30 .. option:: -mcpu={cpu}
32 Set architecture type, register usage, and instruction scheduling
33 parameters for :samp:`{cpu}`. There are also shortcut alias options
34 available for backward compatibility and convenience. Supported
35 values for :samp:`{cpu}` are
37 .. index:: mA6, mARC600
40 Compile for ARC600. Aliases: :option:`-mA6`, :option:`-mARC600`.
43 Compile for ARC601. Alias: :option:`-mARC601`.
46 Compile for ARC700. Aliases: :option:`-mA7`, :option:`-mARC700`.
47 This is the default when configured with :option:`--with-cpu=arc700`.
56 Compile for ARC EM CPU with no hardware extensions.
59 Compile for ARC EM4 CPU.
62 Compile for ARC EM4 DMIPS CPU.
65 Compile for ARC EM4 DMIPS CPU with the single-precision floating-point
69 Compile for ARC EM4 DMIPS CPU with single-precision floating-point and
70 double assist instructions.
73 Compile for ARC HS CPU with no hardware extensions except the atomic
77 Compile for ARC HS34 CPU.
80 Compile for ARC HS38 CPU.
83 Compile for ARC HS38 CPU with all hardware extensions on.
86 Compile for ARC HS4x CPU.
89 Compile for ARC HS4xD CPU.
92 Compile for ARC HS4x CPU release 3.10a.
95 Compile for ARC 600 CPU with ``norm`` instructions enabled.
97 :samp:`arc600_mul32x16`
98 Compile for ARC 600 CPU with ``norm`` and 32x16-bit multiply
102 Compile for ARC 600 CPU with ``norm`` and ``mul64`` -family
103 instructions enabled.
106 Compile for ARC 601 CPU with ``norm`` instructions enabled.
108 :samp:`arc601_mul32x16`
109 Compile for ARC 601 CPU with ``norm`` and 32x16-bit multiply
110 instructions enabled.
113 Compile for ARC 601 CPU with ``norm`` and ``mul64`` -family
114 instructions enabled.
117 Compile for ARC 700 on NPS400 chip.
120 Compile for ARC EM minimalist configuration featuring reduced register
123 .. option:: -mdpfp, -mdpfp-compact
125 Generate double-precision FPX instructions, tuned for the compact
128 .. option:: -mdpfp-fast
130 Generate double-precision FPX instructions, tuned for the fast
133 .. option:: -mno-dpfp-lrsr
135 Disable ``lr`` and ``sr`` instructions from using FPX extension
140 Generate extended arithmetic instructions. Currently only
141 ``divaw``, ``adds``, ``subs``, and ``sat16`` are
142 supported. Only valid for :option:`-mcpu=ARC700`.
146 Do not generate ``mpy`` -family instructions for ARC700. This option is
151 Default setting; overrides :option:`-mno-mpy`.
153 .. option:: -mmul32x16
155 Generate 32x16-bit multiply and multiply-accumulate instructions.
159 Generate ``mul64`` and ``mulu64`` instructions.
160 Only valid for :option:`-mcpu=ARC600`.
164 Generate ``norm`` instructions. This is the default if :option:`-mcpu=ARC700`
167 .. option:: -mspfp, -mspfp-compact
169 Generate single-precision FPX instructions, tuned for the compact
172 .. option:: -mspfp-fast
174 Generate single-precision FPX instructions, tuned for the fast
179 Enable generation of ARC SIMD instructions via target-specific
180 builtins. Only valid for :option:`-mcpu=ARC700`.
182 .. option:: -msoft-float
184 This option ignored; it is provided for compatibility purposes only.
185 Software floating-point code is emitted by default, and this default
186 can overridden by FPX options; :option:`-mspfp`, :option:`-mspfp-compact`, or
187 :option:`-mspfp-fast` for single precision, and :option:`-mdpfp`,
188 :option:`-mdpfp-compact`, or :option:`-mdpfp-fast` for double precision.
192 Generate ``swap`` instructions.
196 This enables use of the locked load/store conditional extension to implement
197 atomic memory built-in functions. Not available for ARC 6xx or ARC
200 .. option:: -mdiv-rem
202 Enable ``div`` and ``rem`` instructions for ARCv2 cores.
204 .. option:: -mcode-density
206 Enable code density instructions for ARC EM.
207 This option is on by default for ARC HS.
211 Enable double load/store operations for ARC HS cores.
213 .. option:: -mtp-regno={regno}
215 Specify thread pointer register number.
217 .. option:: -mmpy-option={multo}
219 Compile ARCv2 code with a multiplier design option. You can specify
220 the option using either a string or numeric value for :samp:`{multo}`.
221 :samp:`wlh1` is the default value. The recognized values are:
223 :samp:`0` :samp:`none`
224 No multiplier available.
227 16x16 multiplier, fully pipelined.
228 The following instructions are enabled: ``mpyw`` and ``mpyuw``.
230 :samp:`2` :samp:`wlh1`
231 32x32 multiplier, fully
232 pipelined (1 stage). The following instructions are additionally
233 enabled: ``mpy``, ``mpyu``, ``mpym``, ``mpymu``, and ``mpy_s``.
235 :samp:`3` :samp:`wlh2`
236 32x32 multiplier, fully pipelined
237 (2 stages). The following instructions are additionally enabled: ``mpy``,
238 ``mpyu``, ``mpym``, ``mpymu``, and ``mpy_s``.
240 :samp:`4` :samp:`wlh3`
241 Two 16x16 multipliers, blocking,
242 sequential. The following instructions are additionally enabled: ``mpy``,
243 ``mpyu``, ``mpym``, ``mpymu``, and ``mpy_s``.
245 :samp:`5` :samp:`wlh4`
246 One 16x16 multiplier, blocking,
247 sequential. The following instructions are additionally enabled: ``mpy``,
248 ``mpyu``, ``mpym``, ``mpymu``, and ``mpy_s``.
250 :samp:`6` :samp:`wlh5`
251 One 32x4 multiplier, blocking,
252 sequential. The following instructions are additionally enabled: ``mpy``,
253 ``mpyu``, ``mpym``, ``mpymu``, and ``mpy_s``.
255 :samp:`7` :samp:`plus_dmpy`
258 :samp:`8` :samp:`plus_macd`
261 :samp:`9` :samp:`plus_qmacw`
264 This option is only available for ARCv2 cores.
266 .. option:: -mfpu={fpu}
268 Enables support for specific floating-point hardware extensions for ARCv2
269 cores. Supported values for :samp:`{fpu}` are:
272 Enables support for single-precision floating-point hardware
276 Enables support for double-precision floating-point hardware
277 extensions. The single-precision floating-point extension is also
278 enabled. Not available for ARC EM.
281 Enables support for double-precision floating-point hardware
282 extensions using double-precision assist instructions. The single-precision
283 floating-point extension is also enabled. This option is
284 only available for ARC EM.
287 Enables support for double-precision floating-point hardware
288 extensions using double-precision assist instructions.
289 The single-precision floating-point, square-root, and divide
290 extensions are also enabled. This option is
291 only available for ARC EM.
294 Enables support for double-precision floating-point hardware
295 extensions using double-precision assist instructions.
296 The single-precision floating-point and fused multiply and add
297 hardware extensions are also enabled. This option is
298 only available for ARC EM.
301 Enables support for double-precision floating-point hardware
302 extensions using double-precision assist instructions.
303 All single-precision floating-point hardware extensions are also
304 enabled. This option is only available for ARC EM.
307 Enables support for single-precision floating-point, square-root and divide
311 Enables support for double-precision floating-point, square-root and divide
312 hardware extensions. This option
313 includes option :samp:`fpus_div`. Not available for ARC EM.
316 Enables support for single-precision floating-point and
317 fused multiply and add hardware extensions.
320 Enables support for double-precision floating-point and
321 fused multiply and add hardware extensions. This option
322 includes option :samp:`fpus_fma`. Not available for ARC EM.
325 Enables support for all single-precision floating-point hardware
329 Enables support for all single- and double-precision floating-point
330 hardware extensions. Not available for ARC EM.
332 .. option:: -mirq-ctrl-saved={register-range},{blink},{lp_count}
334 Specifies general-purposes registers that the processor automatically
335 saves/restores on interrupt entry and exit. :samp:`{register-range}` is
336 specified as two registers separated by a dash. The register range
337 always starts with ``r0``, the upper limit is ``fp`` register.
338 :samp:`{blink}` and :samp:`{lp_count}` are optional. This option is only
339 valid for ARC EM and ARC HS cores.
341 .. option:: -mrgf-banked-regs={number}
343 Specifies the number of registers replicated in second register bank
344 on entry to fast interrupt. Fast interrupts are interrupts with the
345 highest priority level P0. These interrupts save only PC and STATUS32
346 registers to avoid memory transactions during interrupt entry and exit
347 sequences. Use this option when you are using fast interrupts in an
348 ARC V2 family processor. Permitted values are 4, 8, 16, and 32.
350 .. option:: -mlpc-width={width}
352 Specify the width of the ``lp_count`` register. Valid values for
353 :samp:`{width}` are 8, 16, 20, 24, 28 and 32 bits. The default width is
354 fixed to 32 bits. If the width is less than 32, the compiler does not
355 attempt to transform loops in your program to use the zero-delay loop
356 mechanism unless it is known that the ``lp_count`` register can
357 hold the required loop-counter value. Depending on the width
358 specified, the compiler and run-time library might continue to use the
359 loop mechanism for various needs. This option defines macro
360 ``__ARC_LPC_WIDTH__`` with the value of :samp:`{width}`.
364 This option instructs the compiler to generate code for a 16-entry
365 register file. This option defines the ``__ARC_RF16__``
368 .. option:: -mbranch-index
370 Enable use of ``bi`` or ``bih`` instructions to implement jump
373 The following options are passed through to the assembler, and also
374 define preprocessor macro symbols.
376 .. Flags used by the assembler, but for which we define preprocessor
377 macro symbols as well.
379 .. option:: -mdsp-packa
381 Passed down to the assembler to enable the DSP Pack A extensions.
382 Also sets the preprocessor symbol ``__Xdsp_packa``. This option is
387 Passed down to the assembler to enable the dual Viterbi butterfly
388 extension. Also sets the preprocessor symbol ``__Xdvbf``. This
389 option is deprecated.
391 .. ARC700 4.10 extension instruction
395 Passed down to the assembler to enable the locked load/store
396 conditional extension. Also sets the preprocessor symbol
399 .. option:: -mmac-d16
401 Passed down to the assembler. Also sets the preprocessor symbol
402 ``__Xxmac_d16``. This option is deprecated.
406 Passed down to the assembler. Also sets the preprocessor symbol
407 ``__Xxmac_24``. This option is deprecated.
409 .. ARC700 4.10 extension instruction
413 Passed down to the assembler to enable the 64-bit time-stamp counter
414 extension instruction. Also sets the preprocessor symbol
415 ``__Xrtsc``. This option is deprecated.
417 .. ARC700 4.10 extension instruction
421 Passed down to the assembler to enable the swap byte ordering
422 extension instruction. Also sets the preprocessor symbol
425 .. option:: -mtelephony
427 Passed down to the assembler to enable dual- and single-operand
428 instructions for telephony. Also sets the preprocessor symbol
429 ``__Xtelephony``. This option is deprecated.
433 Passed down to the assembler to enable the XY memory extension. Also
434 sets the preprocessor symbol ``__Xxy``.
436 The following options control how the assembly code is annotated:
438 .. Assembly annotation options
442 Annotate assembler instructions with estimated addresses.
444 .. option:: -mannotate-align
446 Explain what alignment considerations lead to the decision to make an
447 instruction short or long.
449 The following options are passed through to the linker:
451 .. options passed through to the linker
453 .. option:: -marclinux
455 Passed through to the linker, to specify use of the ``arclinux`` emulation.
456 This option is enabled by default in tool chains built for
457 ``arc-linux-uclibc`` and ``arceb-linux-uclibc`` targets
458 when profiling is not requested.
460 .. option:: -marclinux_prof
462 Passed through to the linker, to specify use of the
463 ``arclinux_prof`` emulation. This option is enabled by default in
464 tool chains built for ``arc-linux-uclibc`` and
465 ``arceb-linux-uclibc`` targets when profiling is requested.
467 The following options control the semantics of generated code:
469 .. semantically relevant code generation options
471 .. option:: -mlong-calls
473 Generate calls as register indirect calls, thus providing access
474 to the full 32-bit address range.
476 .. option:: -mmedium-calls
478 Don't use less than 25-bit addressing range for calls, which is the
479 offset available for an unconditional branch-and-link
480 instruction. Conditional execution of function calls is suppressed, to
481 allow use of the 25-bit range, rather than the 21-bit range with
482 conditional branch-and-link. This is the default for tool chains built
483 for ``arc-linux-uclibc`` and ``arceb-linux-uclibc`` targets.
487 Put definitions of externally-visible data in a small data section if
488 that data is no bigger than :samp:`{num}` bytes. The default value of
489 :samp:`{num}` is 4 for any ARC configuration, or 8 when we have double
490 load/store operations.
492 .. option:: -mno-sdata
494 Do not generate sdata references. This is the default for tool chains
495 built for ``arc-linux-uclibc`` and ``arceb-linux-uclibc``
500 Default setting; overrides :option:`-mno-sdata`.
502 .. option:: -mvolatile-cache
504 Use ordinarily cached memory accesses for volatile references. This is the
507 .. option:: -mno-volatile-cache
509 Enable cache bypass for volatile references.
511 .. option:: -mvolatile-cache
513 Default setting; overrides :option:`-mno-volatile-cache`.
515 The following options fine tune code generation:
517 .. code generation tuning options
519 .. option:: -malign-call
521 Does nothing. Preserved for backward compatibility.
523 .. option:: -mauto-modify-reg
525 Enable the use of pre/post modify with register displacement.
527 .. option:: -mbbit-peephole
529 Enable bbit peephole2.
531 .. option:: -mno-brcc
533 This option disables a target-specific pass in :samp:`arc_reorg` to
534 generate compare-and-branch (``brcc``) instructions.
536 generation of these instructions driven by the combiner pass.
538 .. option:: -mcase-vector-pcrel
540 Use PC-relative switch case tables to enable case table shortening.
541 This is the default for :option:`-Os`.
543 .. option:: -mcompact-casesi
545 Enable compact ``casesi`` pattern. This is the default for :option:`-Os`,
546 and only available for ARCv1 cores. This option is deprecated.
548 .. option:: -mno-cond-exec
550 Disable the ARCompact-specific pass to generate conditional
551 execution instructions.
553 Due to delay slot scheduling and interactions between operand numbers,
554 literal sizes, instruction lengths, and the support for conditional execution,
555 the target-independent pass to generate conditional execution is often lacking,
556 so the ARC port has kept a special pass around that tries to find more
557 conditional execution generation opportunities after register allocation,
558 branch shortening, and delay slot scheduling have been done. This pass
559 generally, but not always, improves performance and code size, at the cost of
560 extra compilation time, which is why there is an option to switch it off.
561 If you have a problem with call instructions exceeding their allowable
562 offset range because they are conditionalized, you should consider using
563 :option:`-mmedium-calls` instead.
565 .. option:: -mearly-cbranchsi
567 Enable pre-reload use of the ``cbranchsi`` pattern.
569 .. option:: -mexpand-adddi
571 Expand ``adddi3`` and ``subdi3`` at RTL generation time into
572 ``add.f``, ``adc`` etc. This option is deprecated.
574 .. option:: -mindexed-loads
576 Enable the use of indexed loads. This can be problematic because some
577 optimizers then assume that indexed stores exist, which is not
582 Enable Local Register Allocation. This is still experimental for ARC,
583 so by default the compiler uses standard reload
584 (i.e. :option:`-mno-lra`).
586 .. option:: -mlra-priority-none
588 Don't indicate any priority for target registers.
590 .. option:: -mlra-priority-compact
592 Indicate target register priority for ``r0`` .. ``r3`` / ``r12`` .. ``r15``.
594 .. option:: -mlra-priority-noncompact
596 Reduce target register priority for ``r0`` .. ``r3`` / ``r12`` .. ``r15``.
598 .. option:: -mmillicode
600 When optimizing for size (using :option:`-Os`), prologues and epilogues
601 that have to save or restore a large number of registers are often
602 shortened by using call to a special function in libgcc; this is
603 referred to as a *millicode* call. As these calls can pose
604 performance issues, and/or cause linking issues when linking in a
605 nonstandard way, this option is provided to turn on or off millicode
608 .. option:: -mcode-density-frame
610 This option enable the compiler to emit ``enter`` and ``leave``
611 instructions. These instructions are only valid for CPUs with
612 code-density feature.
614 .. option:: -mmixed-code
616 Does nothing. Preserved for backward compatibility.
618 .. option:: -mq-class
620 Ths option is deprecated. Enable :samp:`q` instruction alternatives.
621 This is the default for :option:`-Os`.
625 Does nothing. Preserved for backward compatibility.
629 Does nothing. Preserved for backward compatibility.
631 .. option:: -msize-level={level}
633 Fine-tune size optimization with regards to instruction lengths and alignment.
634 The recognized values for :samp:`{level}` are:
637 No size optimization. This level is deprecated and treated like :samp:`1`.
640 Short instructions are used opportunistically.
643 In addition, alignment of loops and of code after barriers are dropped.
646 In addition, optional data alignment is dropped, and the option Os is enabled.
648 This defaults to :samp:`3` when :option:`-Os` is in effect. Otherwise,
649 the behavior when this is not set is equivalent to level :samp:`1`.
651 .. option:: -mtune={cpu}
653 Set instruction scheduling parameters for :samp:`{cpu}`, overriding any implied
656 Supported values for :samp:`{cpu}` are
665 Tune for ARC700 CPU with standard multiplier block.
668 Tune for ARC700 CPU with XMAC block.
671 Tune for ARC725D CPU.
674 Tune for ARC750D CPU.
677 Tune for ARCv2 core3 type CPU. This option enable usage of
678 ``dbnz`` instruction.
681 Tune for ARC4x release 3.10a.
683 .. option:: -mmultcost={num}
685 Cost to assume for a multiply instruction, with :samp:`4` being equal to a
688 .. option:: -munalign-prob-threshold={probability}
690 Does nothing. Preserved for backward compatibility.
692 The following options are maintained for backward compatibility, but
693 are now deprecated and will be removed in a future release:
695 .. Deprecated options
697 .. option:: -margonaut
701 .. option:: -mbig-endian, -EB
703 Compile code for big-endian targets. Use of these options is now
704 deprecated. Big-endian code is supported by configuring GCC to build
705 ``arceb-elf32`` and ``arceb-linux-uclibc`` targets,
706 for which big endian is the default.
708 .. option:: -mlittle-endian, -EL
710 Compile code for little-endian targets. Use of these options is now
711 deprecated. Little-endian code is supported by configuring GCC to build
712 ``arc-elf32`` and ``arc-linux-uclibc`` targets,
713 for which little endian is the default.
715 .. option:: -mbarrel_shifter
717 Replaced by :option:`-mbarrel-shifter`.
719 .. option:: -mdpfp_compact
721 Replaced by :option:`-mdpfp-compact`.
723 .. option:: -mdpfp_fast
725 Replaced by :option:`-mdpfp-fast`.
727 .. option:: -mdsp_packa
729 Replaced by :option:`-mdsp-packa`.
733 Replaced by :option:`-mea`.
737 Replaced by :option:`-mmac-24`.
739 .. option:: -mmac_d16
741 Replaced by :option:`-mmac-d16`.
743 .. option:: -mspfp_compact
745 Replaced by :option:`-mspfp-compact`.
747 .. option:: -mspfp_fast
749 Replaced by :option:`-mspfp-fast`.
751 .. option:: -mtune={cpu}
753 Values :samp:`arc600`, :samp:`arc601`, :samp:`arc700` and
754 :samp:`arc700-xmac` for :samp:`{cpu}` are replaced by :samp:`ARC600`,
755 :samp:`ARC601`, :samp:`ARC700` and :samp:`ARC700-xmac` respectively.
757 .. option:: -multcost={num}
759 Replaced by :option:`-mmultcost`.