| |||
| Home > Compiler Command-line Options > Command-line options > --fpu=name | |||
This option enables you to specify the target FPU architecture.
If you specify this option, it overrides any implicit FPU
option that appears on the command line, for example, where you
use the --cpu option.
To obtain a full list of FPU architectures use the --fpu=list option.
--fpu=name
Where is
one of:name
noneSelects no floating-point option. No floating-point code is to be used. This produces an error if your code contains float types.
vfpvThis
is a synonym for vfpv2.
vfpv2Selects a hardware vector floating-point unit conforming to architecture VFPv2.
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.
vfpv3Selects a hardware vector floating-point unit conforming to architecture VFPv3. VFPv3 is backwards compatible with VFPv2 except that VFPv3 cannot trap floating-point exceptions.
vfpv3_fp16Selects a hardware vector floating-point unit conforming to architecture VFPv3 that also provides the half-precision extensions.
vfpv3_d16Selects a hardware vector floating-point unit conforming to VFPv3-D16 architecture.
vfpv3_d16_fp16Selects a hardware vector floating-point unit conforming to VFPv3-D16 architecture, that also provides the half-precision extensions.
vfpv4Selects a hardware floating-point unit conforming to FPv4 architecture.
vfpv4_d16Selects a hardware floating-point unit conforming to the VFPv4-D16 architecture.
fpv4-spSelects a hardware floating-point unit conforming to the single precision variant of the FPv4 architecture.
softvfpSelects
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 CPU that does not have an FPU.
softvfp+vfpv2Selects 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:
Compiling
with --thumb behaves in a similar way to --fpu=softvfp except that
it links with floating-point libraries that use VFP instructions.
Compiling 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.
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+vfpv3Selects 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.
softvfp+vfpv3_fp16Selects a hardware vector floating-point unit conforming to VFPv3-fp16, with software floating-point linkage.
softvfp+vfpv3_d16Selects a hardware vector floating-point unit conforming to VFPv3-D16, with software floating-point linkage.
softvfp+vfpv3_d16_fp16Selects a hardware vector floating-point unit conforming
to vfpv3_d16_fp16, with software floating-point
linkage.
softvfp+vfpv4Selects a hardware floating-point unit conforming to FPv4, with software floating-point linkage.
softvfp+vfpv4_d16Selects a hardware floating-point unit conforming to VFPv4-D16, with software floating-point linkage.
softvfp+fpv4-spSelects a hardware floating-point unit conforming to FPv4-SP, with software floating-point linkage.
Any FPU explicitly selected using the --fpu option
always overrides any FPU implicitly selected using the --cpu option.
For example, the option --cpu=Cortex-R4F --fpu=softvfp generates
code that uses the software floating-point library fplib,
even though the choice of CPU implies the use of architecture VFPv3-D16.
To control floating-point linkage without affecting the choice
of FPU, you can use --apcs=/softfp or --apcs=/hardfp.
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 CPU 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.
The default target FPU architecture is derived from the use
of the --cpu option.
If the CPU specified with --cpu has a VFP
coprocessor, the default target FPU architecture is the VFP architecture
for that CPU. If a VFP coprocessor is present, VFP instructions
are generated.
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.
Vector Floating-Point (VFP) architectures in Using the Compiler
Compiler support for floating-point computations and linkage in Using the Compiler
MRC, MRC2, MRRC and MRRC2 in the Assembler Reference
MCR, MCR2, MCRR, and MCRR2 in the Assembler Reference.