7.29 --cpu=name compiler option

Enables code generation for the selected ARM processor or architecture.

Syntax

--cpu=name
Where name is the name of a processor:
Enter name as shown on ARM data sheets, for example, ARM7TDMI.
Processor and architecture names are not case-sensitive.
Wildcard characters are not accepted.
The following table shows examples of supported processor names for each architecture. For a complete list of the supported processor names, specify the --cpu=list option.

Table 7-3 Supported ARM architectures

Architecture Description Example processor names
4T ARMv4 with Thumb ARM7TDMI, ARM9TDMI, ARM720T, ARM740T, ARM920T, ARM922T, ARM940T
5TE ARMv5 with Thumb, interworking, DSP multiply, and double-word instructions ARM9E-S, ARM946E-S, ARM966E-S
5TEJ
ARMv5 with Thumb, interworking, DSP multiply, double-word instructions, and Jazelle® extensions

Note

armcc cannot generate Java bytecodes.
ARM926EJ-S
6-M ARMv6 micro-controller profile with Thumb only, plus processor state instructions Cortex-M1.no_os_extension, Cortex-M0, SC000, Cortex-M0plus
6S-M ARMv6 micro-controller profile with Thumb only, plus processor state instructions and OS extensions Cortex-M1.os_extension
7-R ARMv7 real-time profile with ARM, Thumb (Thumb-2 technology), DSP support, and 32-bit SIMD support Cortex-R4, Cortex-R4F, Cortex-R7
7-M ARMv7 micro-controller profile with Thumb (Thumb-2 technology) only and hardware divide Cortex-M3, SC300
7E-M ARMv7-M enhanced with DSP (saturating and 32-bit SIMD) instructions Cortex-M4, Cortex-M7

Default

armcc assumes --cpu=ARM7TDMI if you do not specify a --cpu option.

Usage

The following general points apply to processor options:
Processors
  • Selecting the processor selects the appropriate architecture, Floating-Point Unit (FPU), and memory organization.
  • If you specify a processor for the --cpu option, the generated 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 generated code can run on any processor supporting that architecture. For example, --cpu=5TE produces code that can be used by the ARM926EJ-S® processor.
FPU
  • Some specifications of --cpu imply an --fpu selection.
    For example, when building with the --arm option, --cpu=Cortex-R4F implies --fpu=vfpv3_d16.

    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.
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, unless the processor is a Thumb-only processor, for example Cortex-M4. In this case, --thumb is not required.

    Note

    Specifying the target processor or architecture might make the generated object code incompatible with other ARM processors. For example, code generated for architecture ARMv6 might not run on an ARM920T processor, if the generated object code includes instructions specific to ARMv6. Therefore, you must choose the lowest common denominator processor suited to your purpose.
  • If you are building 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 build for Thumb, that is with the --thumb option on the command line, the compiler generates 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 generating code for a 16-bit Thumb processor and using VFP, any function containing floating-point operations is compiled for ARM.

Restrictions

You cannot specify both a processor and an architecture on the same command-line.
Related reference
7.6 --apcs=qualifier...qualifier
7.28 --cpu=list
7.70 --fpu=name compiler option
7.160 --thumb
9.14 __smc
Related information
SMC
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.