| |||
| Home > Coding Practices > Using floating-point arithmetic > 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
| Option | Description | Usage notes |
|---|---|---|
| This is a synonym for | |
| Selects hardware vector floating-point unit conforming to architecture VFPv2. | |
| 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 |
| Selects the software floating-point library | |
| Selects a floating-point library with software floating-point linkage that can use VFPv2 instructions. | |
| Selects a floating-point library with software floating-point linkage that uses VFPv3 instructions. | Available in RVDS 3.0 and later only |
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.
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:
--fpu=name in the Compiler Reference Guide.