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

Note

Specifying the target processor can make the code incompatible with other ARM processors.

The following general points apply to processor and architecture options:

The following options are available:

-cpu name

This option 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. 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 option. If no -fpu option and no -cpu option are specified, -fpu softvfp is used.

If name is an architecture, it must be one of:

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.

Note

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.

Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI 0067D
Non-Confidential