| |||
| Home > Using the ARM Compiler > armcc command syntax > Specifying the target processor or architecture | |||
These options enable you to 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 might make the code incompatible with other ARM processors. For example, code compiled for architecture ARMv6 might not run on an ARM920T processor, if the compiled code includes instructions specific to ARMv6.
You can specify how the compiler is configured at startup using either:
--armTo target the ARM instruction set. This is the default.
--thumbTo target the Thumb instruction set.
For more details on these options, see Targeting the instruction set.
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 5TE produces code that can be
used by either the ARM926EJ-S® or ARM10200E®.
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 processor that supports Thumb instructions,
such as --cpu ARM7TDMI does not make the compiler
generate Thumb code. It only enables features of the processor to
be used, such as long multiply. Use the --thumb option
to generate Thumb code.
The following options are available:
--cpu listLists the supported architecture and processor names
that you can use with the --cpu option.name
--cpu nameGenerates 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.
Selecting the processor selects the appropriate architecture, Floating-Point Unit (FPU), and memory organization.
Some specifications of --cpu imply
an --fpu selection. For example, when compiling
with the --arm option, --cpu ARM1136JF-S implies --fpu
vfpv2. Be aware that any explicit FPU
(set with --fpu) on the command line overrides
an implicit FPU.
If no --fpu option and no --cpu option
are specified, --fpu softvfp is used.
If is an
architecture, it must be one of:name
4ARMv4 with long multiply but no Thumb.
4TARMv4 with long multiply and Thumb.
5TARMv5 with long multiply, Thumb and interworking.
5TEARMv5 with long multiply, Thumb, interworking, DSP multiply, and double-word instructions.
5TEJARMv5 with long multiply, Thumb, interworking, DSP multiply, double-word instructions, and Jazelle® extensions.
6ARMv6 with long multiply, Thumb, interworking, DSP multiply, double-word instructions, unaligned and mixed-endian support, Jazelle, and media extensions.
6T2ARMv6 with Thumb-2.
6KARMv6 with SMP extensions.
6ZARMv6 with Security Extensions.
--fpu listLists
the supported FPU architecture names that you can use with the --fpu option.name
Deprecated options are not listed.
--fpu nameDetermines the target FPU architecture.
If you specify this option, it overrides any implicit FPU
option that appears on the command line, for example, where you
use the --cpu option.
Valid options for are:name
noneSelects no floating-point option. No floating-point code is to be used. This produces an error if your code contains floats.
vfpv2Selects
hardware vector floating-point unit conforming to architecture VFPv2,
such as the VFP10 rev 1. This is the default if you select a CPU
with an FPU, or if you specify --fpu vfp.
If you enter armcc --thumb --fpu vfpv2 on
the command line, the compiler compiles as much of the code using
the Thumb instruction set as possible, but hard floating-point-sensitive functions
are compiled to ARM code. In this case, the value of the predefine __thumb is
not correct.
If you specify either vfp or vfpv2 with
the --arm option for ARM C code 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.
softvfpSelects
software floating-point linkage. This is the default if you do not
specify a --fpu option, or if you select a CPU
that does not have an FPU.
softvfp+vfpv2Selects a floating-point library with software floating-point linkage that uses Vector Floating Point (VFP) instructions. 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:
Compiling
with --thumb behaves in a similar way to --fpu
softvfp except that it links with floating-point libraries
that use VFP instructions.
Compiling with --arm behaves in
a similar way to --fpu vfpv2 except that all functions
are given software floating-point linkage. This means that functions
pass and return floating-point arguments and results in the same
way as they would for --fpu softvfp, but use VFP instructions
internally.
If you specify softvfp+vfpv2 with the --arm or --thumb option for
C code, it ensures that your interworking floating-point code is
compiled to use software floating-point linkage.
To get a full list of FPU architectures use the --fpu
list option.