4.6.3. The --fpu option

By default, the compiler generates code that makes calls to the software floating-point library fplib in order to carry out floating-point operations. To make use of VFP instructions you must use appropriate compiler options to modify the code generated, as described in Table 4.11.

Table 4.11. VFP compiler options

OptionDescriptionUsage notes

--fpu vfp

This is a synonym for --fpu vfpv2.

 

--fpu vfpv2

Selects hardware vector floating-point unit conforming to architecture VFPv2.

 

--fpu vfpv3

Selects hardware vector floating-point unit conforming to architecture VFPv3.

VFPv3 is backwards compatible with VFPv2 except that VFPv3 cannot trap floating-point exceptions.

Available in RVDS 3.0 and later only

--fpu softvfp

Selects the software 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.

 

--fpu softvfp+vfpv2

Selects a floating-point library with software floating-point linkage that can use VFPv2 instructions.

 

--fpu softvfp+vfpv3

Selects a floating-point library with software floating-point linkage that uses VFPv3 instructions.Available in RVDS 3.0 and later only

Note

By default, some choices of processor or architecture imply the selection of a particular floating-point unit. For example, the option --cpu ARM1136JF-S implies the option --fpu vfpv2.

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 CPU implies the use of architecture VFPv2.

If you specify an FPU implicitly using the --cpu option that is incompatible with an FPU chosen explicitly using --fpu then the compiler generates an error.

Note

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

For more information about which compiler option to use in a particular set of circumstances see:

Copyright © 2002-2007 ARM Limited. All rights reserved.ARM DUI 0205H
Non-Confidential