2.3.10. 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.

Note

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:

--arm

To target the ARM instruction set. This is the default.

--thumb

To 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 following options are available:

--cpu list

Lists the supported architecture and processor names that you can use with the --cpu name option.

--cpu name

Generates code for a specific ARM processor or architecture.

If name is a processor:

  • 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 name is an architecture, it must be one of:

4

ARMv4 with long multiply but no Thumb.

4T

ARMv4 with long multiply and Thumb.

5T

ARMv5 with long multiply, Thumb and interworking.

5TE

ARMv5 with long multiply, Thumb, interworking, DSP multiply, and double-word instructions.

5TEJ

ARMv5 with long multiply, Thumb, interworking, DSP multiply, double-word instructions, and Jazelle® extensions.

6

ARMv6 with long multiply, Thumb, interworking, DSP multiply, double-word instructions, unaligned and mixed-endian support, Jazelle, and media extensions.

6T2

ARMv6 with Thumb-2.

6K

ARMv6 with SMP extensions.

6Z

ARMv6 with Security Extensions.

--fpu list

Lists the supported FPU architecture names that you can use with the --fpu name option.

Deprecated options are not listed.

--fpu name

Determines 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 name are:

none

Selects no floating-point option. No floating-point code is to be used. This produces an error if your code contains floats.

vfpv2

Selects 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.

Note

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.

softvfp

Selects 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+vfpv2

Selects 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.

Note

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.

Copyright © 2002-2005 ARM Limited. All rights reserved.ARM DUI 0205F
Non-Confidential