2.1.55. --fpu=name

This option enables you to determine 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.

Syntax

--fpu=name

Where name is one of:

none

Selects no floating-point option. No floating-point code is to be used. This produces an error if your code contains float types.

vfpv3

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

vfpv2

Selects hardware vector floating-point unit conforming to architecture VFPv2. This is the default if you specify --fpu=vfp.

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.

If you specify either vfp or vfpv2 with the --arm option for ARM C code you must use the __softfp keyword to ensure that your interworking ARM code is compiled to use software floating-point linkage.

softvfp

Selects software floating-point linkage. This is the default if you do not specify a --fpu option, or if you select a CPU that does not have an FPU.

In previous releases of RVCT, if you specified --fpu=softvfp and a CPU with implicit VFP hardware, the linker chose a library that implemented the software floating-point calls using VFP instructions. This is no longer the case. If you require this legacy behavior, use --fpu=softvfp+vfp.

softvfp+vfpv2

Selects a floating-point library with software floating-point linkage that uses VFP instructions. 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.

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 floating-point library with software floating-point linkage that uses VFPv3 instructions. Select this option if you are interworking Thumb code with ARM code on a system that implements a VFPv3 unit.

See also

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential