2.1.19. --cpu=name

This option enables code generation for the selected ARM processor or architecture.

Syntax

--cpu=name

Where:

name

is the name of a processor or architecture.

If name is the name of a processor, enter it as shown on ARM data sheets, for example, ARM7TDMI, ARM1176JZ-S, MPCore.

If name is the name of an architecture, it must belong to the list of architectures shown in Table 2.2.

Processor and architecture names are not case-sensitive.

Wildcard characters are not accepted.

Table 2.2. Supported ARM architectures

ArchitectureDescription
4ARMv4 without Thumb
4TARMv4 with Thumb
5TARMv5 with Thumb and interworking
5TEARMv5 with Thumb, interworking, DSP multiply, and double-word instructions
5TEJARMv5 with Thumb, interworking, DSP multiply, double-word instructions, and Jazelle® extensions[a]
6ARMv6 with Thumb, interworking, DSP multiply, double-word instructions, unaligned and mixed-endian support, Jazelle, and media extensions
6-MARMv6 micro-controller profile with Thumb only plus processor state instructions
6KARMv6 with SMP extensions
6S-MARMv6 micro-controller profile with Thumb only, plus processor state instructions and OS extensions
6T2ARMv6 with Thumb-2
6ZARMv6 with Security Extensions
7ARMv7 with Thumb-2 only and without hardware divide[b]
7-AARMv7 application profile supporting virtual MMU-based memory systems, with ARM, Thumb, Thumb-2, and Thumb-2EE instruction sets, DSP support, and 32-bit SIMD support
7-RARMv7 real-time profile with ARM, Thumb, Thumb-2, DSP support, and 32-bit SIMD support
7-MARMv7 micro-controller profile with Thumb-2 only and hardware divide

[a] The ARM compiler cannot generate Java bytecodes.

[b] ARM v7 is not a recognized ARM architecture. Rather, it is the common subset of architectures ARMv7-A, ARMv7-R and ARMv7-M.


Default

If you do not specify a --cpu option, the compiler assumes --cpu=ARM7TDMI.

To get a full list of CPU architectures and processors, use the --cpu=list option.

Usage

The following general points apply to processor and architecture options:

Processors
  • Selecting the processor selects the appropriate architecture, Floating-Point Unit (FPU), and memory organization.

  • The supported --cpu values include all current ARM product names or architecture versions.

    Other ARM architecture-based processors, such as the Marvell Feroceon and the Intel XScale, are also supported.

  • If you specify a processor for the --cpu option, the compiled code is optimized for that processor. This enables the compiler to use specific coprocessors or instruction scheduling for optimum performance.

Architectures
  • 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 the ARM926EJ-S®.

FPU
  • Some specifications of --cpu imply an --fpu selection. For example, when compiling with the --arm option, --cpu=ARM1136JF-S implies --fpu=vfpv2.

    Note

    Any explicit FPU, set with --fpu on the command line, overrides an implicit FPU.

  • If no --fpu option is specified and no --cpu option is specified, --fpu=softvfp is used.

  • If an architecture v7 processor with an FPU is selected, the default FPU type is --fpu=vfpv3.

ARM/Thumb
  • Specifying a processor or architecture 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.

    Note

    Specifying the target processor or architecture might make the object code generated by the compiler 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. Therefore, you must choose the lowest common denominator processor suited to your purpose.

  • If you are compiling code that is intended for mixed ARM/Thumb systems for processors that support ARMv4T or ARMv5T, then you must specify the interworking option --apcs=/interwork. By default, this is enabled for processors that support ARMv5T or above.

  • If you compile for Thumb, that is with the --thumb option on the command line, the compiler compiles as much of the code as possible using the Thumb instruction set. However, the compiler might generate ARM code for some parts of the compilation. For example, if you are compiling code for a Thumb-1 processor and using VFP, any function containing floating-point operations is compiled for ARM.

  • If you are compiling code for ARMv7-M, for example --cpu=Cortex-M3, you do not need to specify --thumb on the command line, because ARMv7-M supports Thumb-2 only.

Restrictions

You cannot specify both a processor and an architecture on the same command-line.

See also

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential