These are the ‘-m
’ options defined for M680x0 and ColdFire processors. The default settings depend on which architecture was selected when the compiler was configured; the defaults for the most common choices are given below.
-march=
arch
68000
’, ‘68010
’, ‘68020
’, ‘68030
’, ‘68040
’, ‘68060
’ and ‘cpu32
’. ColdFire architectures are selected according to Freescale's ISA classification and the permissible values are: ‘isaa
’, ‘isaaplus
’, ‘isab
’ and ‘isac
’. GCC defines a macro __mcf
arch__
whenever it is generating code for a ColdFire target. The arch in this macro is one of the -march
arguments given above.
When used together, -march
and -mtune
select code that runs on a family of similar processors but that is optimized for a particular microarchitecture.
-mcpu=
cpu
68000
’, ‘68010
’, ‘68020
’, ‘68030
’, ‘68040
’, ‘68060
’, ‘68302
’, ‘68332
’ and ‘cpu32
’. The ColdFire cpus are given by the table below, which also classifies the CPUs into families:
Family |
‘-mcpu ’ arguments |
‘51 ’ |
‘51 ’ ‘51ac ’ ‘51ag ’ ‘51cn ’ ‘51em ’ ‘51je ’ ‘51jf ’ ‘51jg ’ ‘51jm ’ ‘51mm ’ ‘51qe ’ ‘51qm ’ |
‘5206 ’ |
‘5202 ’ ‘5204 ’ ‘5206 ’ |
‘5206e ’ |
‘5206e ’ |
‘5208 ’ |
‘5207 ’ ‘5208 ’ |
‘5211a ’ |
‘5210a ’ ‘5211a ’ |
‘5213 ’ |
‘5211 ’ ‘5212 ’ ‘5213 ’ |
‘5216 ’ |
‘5214 ’ ‘5216 ’ |
‘52235 ’ |
‘52230 ’ ‘52231 ’ ‘52232 ’ ‘52233 ’ ‘52234 ’ ‘52235 ’ |
‘5225 ’ |
‘5224 ’ ‘5225 ’ |
‘52259 ’ |
‘52252 ’ ‘52254 ’ ‘52255 ’ ‘52256 ’ ‘52258 ’ ‘52259 ’ |
‘5235 ’ |
‘5232 ’ ‘5233 ’ ‘5234 ’ ‘5235 ’ ‘523x ’ |
‘5249 ’ |
‘5249 ’ |
‘5250 ’ |
‘5250 ’ |
‘5271 ’ |
‘5270 ’ ‘5271 ’ |
‘5272 ’ |
‘5272 ’ |
‘5275 ’ |
‘5274 ’ ‘5275 ’ |
‘5282 ’ |
‘5280 ’ ‘5281 ’ ‘5282 ’ ‘528x ’ |
‘53017 ’ |
‘53011 ’ ‘53012 ’ ‘53013 ’ ‘53014 ’ ‘53015 ’ ‘53016 ’ ‘53017 ’ |
‘5307 ’ |
‘5307 ’ |
‘5329 ’ |
‘5327 ’ ‘5328 ’ ‘5329 ’ ‘532x ’ |
‘5373 ’ |
‘5372 ’ ‘5373 ’ ‘537x ’ |
‘5407 ’ |
‘5407 ’ |
‘5475 ’ |
‘5470 ’ ‘5471 ’ ‘5472 ’ ‘5473 ’ ‘5474 ’ ‘5475 ’ ‘547x ’ ‘5480 ’ ‘5481 ’ ‘5482 ’ ‘5483 ’ ‘5484 ’ ‘5485 ’ |
-mcpu=cpu overrides -march=arch if arch is compatible with cpu. Other combinations of -mcpu
and -march
are rejected.
GCC defines the macro __mcf_cpu_
cpu when ColdFire target cpu is selected. It also defines __mcf_family_
family, where the value of family is given by the table above.
-mtune=
tune
-march
and -mcpu
. The M680x0 microarchitectures are: ‘68000
’, ‘68010
’, ‘68020
’, ‘68030
’, ‘68040
’, ‘68060
’ and ‘cpu32
’. The ColdFire microarchitectures are: ‘cfv1
’, ‘cfv2
’, ‘cfv3
’, ‘cfv4
’ and ‘cfv4e
’. You can also use -mtune=68020-40
for code that needs to run relatively well on 68020, 68030 and 68040 targets. -mtune=68020-60
is similar but includes 68060 targets as well. These two options select the same tuning decisions as -m68020-40
and -m68020-60
respectively.
GCC defines the macros __mc
arch and __mc
arch__
when tuning for 680x0 architecture arch. It also defines mc
arch unless either -ansi
or a non-GNU -std
option is used. If GCC is tuning for a range of architectures, as selected by -mtune=68020-40
or -mtune=68020-60
, it defines the macros for every architecture in the range.
GCC also defines the macro __m
uarch__
when tuning for ColdFire microarchitecture uarch, where uarch is one of the arguments given above.
-m68000
-mc68000
-march=68000
. Use this option for microcontrollers with a 68000 or EC000 core, including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
-m68010
-march=68010
. -m68020
-mc68020
-march=68020
. -m68030
-march=68030
. -m68040
-march=68040
. This option inhibits the use of 68881/68882 instructions that have to be emulated by software on the 68040. Use this option if your 68040 does not have code to emulate those instructions.
-m68060
-march=68060
. This option inhibits the use of 68020 and 68881/68882 instructions that have to be emulated by software on the 68060. Use this option if your 68060 does not have code to emulate those instructions.
-mcpu32
-march=cpu32
. Use this option for microcontrollers with a CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334, 68336, 68340, 68341, 68349 and 68360.
-m5200
-mcpu=5206
, and is now deprecated in favor of that option. Use this option for microcontroller with a 5200 core, including the MCF5202, MCF5203, MCF5204 and MCF5206.
-m5206e
-mcpu=5206e
. -m528x
-mcpu=528x
. -m5307
-mcpu=5307
. -m5407
-mcpu=5407
. -mcfv4e
-mcpu=547x
, and is now deprecated in favor of that option. -m68020-40
The option is equivalent to -march=68020
-mtune=68020-40
.
-m68020-60
The option is equivalent to -march=68020
-mtune=68020-60
.
-mhard-float
-m68881
__HAVE_68881__
on M680x0 targets and __mcffpu__
on ColdFire targets. -msoft-float
-mdiv
-mno-div
-march
is used without -mcpu
, the default is “on” for ColdFire architectures and “off” for M680x0 architectures. Otherwise, the default is taken from the target CPU (either the default CPU, or the one specified by -mcpu
). For example, the default is “off” for -mcpu=5206
and “on” for -mcpu=5206e
. GCC defines the macro __mcfhwdiv__
when this option is enabled.
-mshort
int
to be 16 bits wide, like short int
. Additionally, parameters passed on the stack are also aligned to a 16-bit boundary even on targets whose API mandates promotion to 32-bit. -mno-short
int
to be 16 bits wide. This is the default. -mnobitfield
-mno-bitfield
-m68000
, -mcpu32
and -m5200
options imply -mnobitfield
. -mbitfield
-m68020
option implies -mbitfield
. This is the default if you use a configuration designed for a 68020. -mrtd
rtd
instruction, which pops their arguments while returning. This saves one instruction in the caller since there is no need to pop the arguments there. This calling convention is incompatible with the one normally used on Unix, so you cannot use it if you need to call libraries compiled with the Unix compiler.
Also, you must provide function prototypes for all functions that take variable numbers of arguments (including printf
); otherwise incorrect code is generated for calls to those functions.
In addition, seriously incorrect code results if you call a function with too many arguments. (Normally, extra arguments are harmlessly ignored.)
The rtd
instruction is supported by the 68010, 68020, 68030, 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
-mno-rtd
-mrtd
. This is the default. -malign-int
-mno-align-int
int
, long
, long long
, float
, double
, and long double
variables on a 32-bit boundary (-malign-int
) or a 16-bit boundary (-mno-align-int
). Aligning variables on 32-bit boundaries produces code that runs somewhat faster on processors with 32-bit busses at the expense of more memory. Warning: if you use the -malign-int
switch, GCC aligns structures containing the above types differently than most published application binary interface specifications for the m68k.
-mpcrel
-fpic
, allowing at most a 16-bit offset for pc-relative addressing. -fPIC
is not presently supported with -mpcrel
, though this could be supported for 68020 and higher processors. -mno-strict-align
-mstrict-align
-msep-data
-fPIC
. -mno-sep-data
-mid-shared-library
-fPIC
. -mno-id-shared-library
-mshared-library-id=n
-mxgot
-mno-xgot
-fPIC
suffices. GCC normally uses a single instruction to load values from the GOT. While this is relatively efficient, it only works if the GOT is smaller than about 64k. Anything larger causes the linker to report an error such as:
relocation truncated to fit: R_68K_GOT16O foobar
If this happens, you should recompile your code with -mxgot
. It should then work with very large GOTs. However, code generated with -mxgot
is less efficient, since it takes 4 instructions to fetch the value of a global symbol.
Note that some linkers, including newer versions of the GNU linker, can create multiple GOTs and sort GOT entries. If you have such a linker, you should only need to use -mxgot
when compiling a single object file that accesses more than 8192 GOT entries. Very few do.
These options have no effect unless GCC is generating position-independent code.
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-5.4.0/gcc/M680x0-Options.html