]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/doc/gcc/gcc-command-options/machine-dependent-options/rl78-options.rst
cbe5b29b9d73b6c8b8b0aeec8402e8b3f85fabd3
[thirdparty/gcc.git] / gcc / doc / gcc / gcc-command-options / machine-dependent-options / rl78-options.rst
1 ..
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.
5
6 .. program:: RL78
7
8 .. index:: RL78 Options
9
10 .. _rl78-options:
11
12 RL78 Options
13 ^^^^^^^^^^^^
14
15 .. option:: -msim
16
17 Links in additional target libraries to support operation within a
18 simulator.
19
20 .. option:: -mmul=none
21
22 Specifies the type of hardware multiplication and division support to
23 be used. The simplest is ``none``, which uses software for both
24 multiplication and division. This is the default. The ``g13``
25 value is for the hardware multiply/divide peripheral found on the
26 RL78/G13 (S2 core) targets. The ``g14`` value selects the use of
27 the multiplication and division instructions supported by the RL78/G14
28 (S3 core) parts. The value ``rl78`` is an alias for ``g14`` and
29 the value ``mg10`` is an alias for ``none``.
30
31 In addition a C preprocessor macro is defined, based upon the setting
32 of this option. Possible values are: ``__RL78_MUL_NONE__``,
33 ``__RL78_MUL_G13__`` or ``__RL78_MUL_G14__``.
34
35 .. option:: -mcpu=g10
36
37 Specifies the RL78 core to target. The default is the G14 core, also
38 known as an S3 core or just RL78. The G13 or S2 core does not have
39 multiply or divide instructions, instead it uses a hardware peripheral
40 for these operations. The G10 or S1 core does not have register
41 banks, so it uses a different calling convention.
42
43 If this option is set it also selects the type of hardware multiply
44 support to use, unless this is overridden by an explicit
45 :option:`-mmul=none` option on the command line. Thus specifying
46 :option:`-mcpu=g13` enables the use of the G13 hardware multiply
47 peripheral and specifying :option:`-mcpu=g10` disables the use of
48 hardware multiplications altogether.
49
50 Note, although the RL78/G14 core is the default target, specifying
51 :option:`-mcpu=g14` or :option:`-mcpu=rl78` on the command line does
52 change the behavior of the toolchain since it also enables G14
53 hardware multiply support. If these options are not specified on the
54 command line then software multiplication routines will be used even
55 though the code targets the RL78 core. This is for backwards
56 compatibility with older toolchains which did not have hardware
57 multiply and divide support.
58
59 In addition a C preprocessor macro is defined, based upon the setting
60 of this option. Possible values are: ``__RL78_G10__``,
61 ``__RL78_G13__`` or ``__RL78_G14__``.
62
63 .. option:: -mg10, -mg13, -mg14, -mrl78
64
65 These are aliases for the corresponding :option:`-mcpu=` option. They
66 are provided for backwards compatibility.
67
68 .. option:: -mallregs
69
70 Allow the compiler to use all of the available registers. By default
71 registers ``r24..r31`` are reserved for use in interrupt handlers.
72 With this option enabled these registers can be used in ordinary
73 functions as well.
74
75 .. option:: -m64bit-doubles, -m32bit-doubles
76
77 Make the ``double`` data type be 64 bits (:option:`-m64bit-doubles`)
78 or 32 bits (:option:`-m32bit-doubles`) in size. The default is
79 :option:`-m32bit-doubles`.
80
81 .. option:: -msave-mduc-in-interrupts, -mno-save-mduc-in-interrupts
82
83 Specifies that interrupt handler functions should preserve the
84 MDUC registers. This is only necessary if normal code might use
85 the MDUC registers, for example because it performs multiplication
86 and division operations. The default is to ignore the MDUC registers
87 as this makes the interrupt handlers faster. The target option -mg13
88 needs to be passed for this to work as this feature is only available
89 on the G13 target (S2 core). The MDUC registers will only be saved
90 if the interrupt handler performs a multiplication or division
91 operation or it calls another function.