| |||
Home > C and C++ Compilers > Command syntax > Specifying the target processor or architecture |
The options described in this section specify the target processor or architecture attributes for a compilation. The compiler can take advantage of certain extra features of the selected processor or architecture, such as support for halfword load and store instructions and instruction scheduling.
Specifying the target processor can make the code incompatible with other ARM processors.
The following general points apply to processor and architecture options:
The supported -cpu
values
are all current ARM product names or architecture versions. There
are no aliases or wildcard matching.
If you specify an architecture name for the -cpu
option,
the code is compiled to run on any processor supporting that architecture.
For example -cpu 4T
produces code that can be
used by either the ARM7TDMI® or ARM9TDMI™.
If you specify a processor for the -cpu
option,
for example -cpu ARM1020E
, the compiled code
is optimized for that processor. This enables the compiler to use specific
coprocessors or instruction scheduling for optimum performance.
Use only a single processor or architecture name
with -cpu
. You cannot specify both a processor
and an architecture.
If -cpu
is not specified, the default
is -cpu ARM7TDMI
.
Specifying a Thumb-aware processor, such as -cpu
ARM7TDMI
to armcc or armcpp does not make these compilers
generate Thumb code. It only allows features of the processor to
be used, such as interworking instructions. Use tcc or tcpp to generate
Thumb code.
The following options are available:
-cpu name
This option generates code for a specific ARM processor or architecture.
If
is a
processor:name
You must enter the name
exactly as it is shown on ARM data sheets, for example ARM7TDMI
.
Wildcard characters are not accepted. Valid values are any ARM6
or later ARM processor.
Selecting the processor selects the appropriate architecture, fpu, and memory organization.
Some -cpu
selections imply an -fpu
selection.
For example, with the ARM compilers -cpu ARM10200E
implies -fpu
vfpv2
. The implied -fpu
is overridden
if you specify an explicit -fpu
.
If no option
-fpu
option and no -cpu
option
are specified, -fpu softvfp
is used.
If
is an
architecture, it must be one of:name
3
ARMv3 without long multiply.
3M
ARMv3 with long multiply.
4
ARMv4 with long multiply but no Thumb.
4xM
ARMv4 without long multiply or Thumb.
4T
ARMv4 with long multiply and Thumb.
4TxM
ARMv4 without long multiply but with Thumb.
5T
ARMv5 with long multiply and Thumb.
5TE
ARMv5 with long multiply, Thumb, DSP multiply, and double-word instructions.
5TEJ
ARMv5 with long multiply, Thumb, DSP multiply, double-word instructions, and Jazelle extensions.
-fpu name
This option selects the target Floating-Point
Unit (FPU) architecture. If you specify this option it
overrides any implicit FPU set by the -cpu
option.
Valid options are:
none
Selects no floating-point option. No floating-point code is to be used.
vfp
Selects
hardware vector floating-point unit conforming to architecture VFPv1.
This is a synonym for -fpu vfpv1
. This option is
not available for the Thumb compilers.
vfpv1
Selects hardware vector floating-point unit conforming to architecture VFPv1, such as the VFP10 rev 0. This option is not available for the Thumb compilers.
vfpv2
Selects hardware vector floating-point unit conforming to architecture VFPv2, such as the VFP10 rev 1. This option is not available for the Thumb compilers.
fpa
Selects hardware Floating Point Accelerator (FPA). This option is not available for the Thumb compilers and is only provided for backwards compatibility.
softvfp+vfp
Selects a floating-point library with pure-endian doubles and software floating-point linkage that uses the VFP hardware. Select this option if you are interworking Thumb code with ARM code on a system that implements a VFP unit.
If you select this option:
tcc
and tcpp behave exactly as for -fpu softvfp
except that
they link with VFP-optimized floating-point libraries.
armcc and armcpp behave the same as for -fpu
vfp
except that all functions are given software floating-point
linkage. This means that ARM functions compiled with this option
pass and return floating-point arguments and results as they would
for -fpu softvfp
, but use VFP instructions internally.
If you specify this option for both armcc and tcc, it ensures
that your interworking floating-point code is compiled to use software
floating-point linkage. If you specify vfp
, vfpv1
,
or vfpv2
for armcc you must use the __softfp
keyword
to ensure that your interworking ARM code is compiled to use software floating-point
linkage. See the description of __softfp
in Function keywords for more information.
softvfp
Selects
software floating-point library (FPLib) with pure-endian doubles.
This is the default if you do not specify a -fpu
option.
softfpa
Selects software floating-point library with mixed-endian doubles.