Keil™, An ARM® Company

RealView Compiler User's Guide

The --fpu option

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

OptionDescription

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

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

Note

Selection of a device implies the selection of a particular floating-point unit by default. For example, the option --device DARMP3 implies the option --fpu softvfp.

Any FPU explicitly selected using the --fpu option always overrides any FPU implicitly selected using the --device option. For example, the option --device DARMP3 --fpu=vfpv2 generates code that uses the VFPv2 hardware vector floating-point unit, even though the default for the device DARMP3 is the software floating-point library.

If you specify an FPU explicitly using the --fpu option that is incompatible with the device chosen using the --device option 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 © 2007 ARM Limited. All rights reserved.ARM DUI 0375A