Syntax

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.

Selects a hardware vector floating-point unit conforming to VFPv3-D16 architecture, that also
provides the half-precision extensions.

vfpv4

Selects a hardware floating-point unit conforming to the VFPv4 architecture.

vfpv4_d16

Selects a hardware floating-point unit conforming to the VFPv4-D16 architecture.

fpv4-sp

Selects a hardware floating-point unit conforming to the single precision variant of the FPv4
architecture.

softvfp

Selects software floating-point support where floating-point operations are performed by a
floating-point library, fplib. This is the default if you do not specify a
--fpu option, or if you select a processor that does not have an FPU.

softvfp+vfpv2

Selects a hardware vector floating-point unit conforming to VFPv2, with software floating-point
linkage. 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:

Building with --thumb behaves in a similar way to
--fpu=softvfp except that it links with floating-point libraries that use VFP
instructions.

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

softvfp+vfpv3

Selects a hardware vector floating-point unit conforming to VFPv3, with software
floating-point linkage. Select this option if you are interworking Thumb code with ARM code on a
system that implements a VFPv3 unit.

Usage

Any FPU explicitly selected using the
--fpu option always overrides any FPU implicitly selected using the
--cpu option. For example, the option --cpu=ARM1136JF-S
--fpu=softvfp generates code that uses the software floating-point library
fplib, even though the choice of processor implies the use of architecture VFPv2.

To control floating-point linkage without affecting the choice of FPU, you can use
--apcs=/softfp or --apcs=/hardfp.

Restrictions

The compiler only permits hardware VFP
architectures (for example, --fpu=vfpv3, --fpu=softvfp+vfpv2), to
be specified when MRRC and MCRR instructions are supported in the
processor instruction set. MRRC and MCRR instructions are not
supported in 4, 4T, 5T and 6-M. Therefore, the compiler does not allow the use of these
architectures with hardware VFP architectures.

Other than this, the compiler does not
check that --cpu and --fpu combinations are valid. Beyond the
scope of the compiler, additional architectural
constraints apply. For example, VFPv3 is not supported with architectures prior to ARMv7. Therefore,
the combination of --fpu and --cpu options permitted by the
compiler does not necessarily translate to the
actual device in use.

The compiler only generates scalar floating-point operations. If you want to use VFP vector
operations, you must do this using assembly code.

NEON support is disabled for
softvfp.

Default

The default target FPU architecture is derived
from the use of the --cpu option.

If the processor specified with
--cpu has a VFP coprocessor, the default target FPU architecture is the VFP
architecture for that processor. For example, the option --cpu ARM1136JF-S implies the
option --fpu vfpv2. If a VFP coprocessor is present, VFP instructions are
generated.

If you are building ARM Linux applications with --arm_linux or
--arm_linux_paths, the default is always software floating-point linkage. Even if
you specify a CPU that implies an FPU (for example, --cpu=ARM1136JF-S), the
compiler still defaults to --fpu=softvfp+vfp, not --fpu=vfp.

If there is no VFP coprocessor, the compiler generates code that makes calls to the software
floating-point library fplib to carry out floating-point operations.