Each new version of the ARM architecture typically supports
extra instructions, extra modes of operation, pipeline differences,
and register renaming. You can often significantly improve the performance
of your C or C++ code by selecting the appropriate target processor
at compile time.
To specify a target processor at compile time:
Decide whether the compiled program
is to run on a specific ARM architecture-based processor or on different
ARM processors.
Obtain the name, or names, of the target processors
recognized by the compiler using the following compiler command-line
option:
--cpu=list
If the compiled program is to run on a specific
ARM architecture-based processor, having obtained the name of the
processor with the --cpu=list option, select
the target processor using the --cpu=name compiler
command-line option. For example, to compile code to run on a Cortex-M3
processor:
armcc --cpu=Cortex-M3 myprog.c
Alternatively, if the compiled program is to run on different
ARM processors, choose the lowest common denominator architecture
appropriate for the application and then specify that architecture
in place of the processor name. For example, to compile code for processors
supporting the ARMv6 architecture:
armcc --cpu=6 myprog.c
Selecting the target processor using the --cpu=name command-line
option enables the compiler to make full use of instructions that
are supported by the processor, and also to perform processor-specific
optimizations such as instruction scheduling.
--cpu=list lists all the processors and
architectures supported by the compiler.
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.