1.16 Floating-point build options in ARMv6 and earlier

In ARMv6 and earlier, the Thumb instruction set does not include VFP instructions and therefore cannot access VFP registers. When choosing the floating-point linkage option you therefore need to consider whether your code contains Thumb instructions.

ARM only

Choose options such as --fpu vfpv2 --apcs=/hardfp to have the compiler generate ARM code only for functions containing floating-point operations.

When you select the option --fpu vfpv2, the compiler generates ARM code for any function containing floating-point operations, regardless of whether the compiler is compiling for ARM or Thumb. This is because the Thumb instruction set in ARMv6 and earlier does not contain VFP instructions and therefore cannot access VFP registers.

Specifying hardware linkage using --apcs=/hardfp avoids the overhead of software linkage.

Mixed ARM/Thumb

Choose options such as --fpu vfpv2 --apcs=/softfp to have the compiler generate mixed ARM/Thumb code.

When you select the option --apcs=/softfp, all functions are compiled using software floating-point linkage.

When you compile for Thumb, selecting these options enables the use of ARM Compiler libraries that use VFP registers, using software linkage.

The option that provides the best code size or performance depends on the code being compiled. When compiling for ARM, experiment with the options --apcs=/softfp and --apcs=/hardfp to determine which provides the required code size and performance attributes.

If you have a mix of ARM and Thumb then you might want to experiment with the --fpu option to get the best results.

For more information, see the Technical Reference Manual for your processor.

Non-ConfidentialPDF file icon PDF versionARM DUI0471M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.