Vector Floating Point Implementation Tutorial

This topic describes how to configure a base port to use the floating point coprocessor.

ARM provide a hardware floating point coprocessor that provides floating point computation that is fully compliant with IEEE Std 754-1985.

To support a coprocessor, you need to:

  • Configure the Kernel to use VFP through a macro setting in the Variant.

  • Configure the ROM to include a Kernel extension to support IEEE-without-exceptions mode.

  • Configure the ROM to include VFP support libraries.

  • Port the User Library to implement its Math class functions to use VFP-enabled functions. This is described in the Math Class Port Tutorial.

Variant configuration

Define the macro __CPU_HAS_VFP in the base port’s variant.mmh. This macro forces the inclusion of VFP support when the kernel is re-compiled. As an example, see the Integrator CM1136 base port, and specifically: ...\integrator\core\cm1136\variant.mmh. When the kernel is re-compiled, VFP support is included.

HAL configuration

Add the HAL attribute for VFP to your base port's config.hcf file, by adding the following line to this file:

EHardwareFloatingPoint = GetHardwareFloatingPoint

As an example, see the Integrator CM1136 base port, and specifically: ...\integrator\core\cm920\hal\config.hcf

See also Creating the Config & Values files in the HAL Port Implementation Tutorial for more information.

IEEE-without-exceptions mode

Symbian platform supports two execution modes :

RunFast

In this mode, denormalised numbers, i.e. those outside the range of normal floating point values, are treated as zero, and a default NaN (Not a Number) value is used for all NaN situations regardless of the inputs.

IEEE-without-exceptions

In this mode, denormalised numbers are treated as their actual values, and the IEEE754-mandated values for NaN s are used.

The floating point model mandated by the Java specification is identical to this mode, and means that this mode is sufficient to implement a VFP-accelerated JVM.

NOTE: There may be some applications that depend on the correct handling of calculations involving, or resulting in, very small numbers; for such applications, RunFast mode may not be appropriate.

RunFast mode

For RunFast execution mode, nothing else needs to be implemented, and no extra components need to be added to the ROM.

IEEE-without-exceptions mode

For IEEE-without-exceptions mode, you need to include the kernel extension evfp.dll in the ROM image by adding the following line into the .iby or .oby file for your port:

extension[VARID]=KERNEL_DIR\DEBUG_DIR\evfp.dll \sys\bin\evfp.dll

As an example, see the Integrator CM1136 base port, and specifically: ...\integrator\core\cm1136\rom\base_integrator1136.iby

Note:

  • This is the default execution mode.

  • It is possible to switch between this execution mode and the RunFast execution mode.

  • evfp.dll is built using ARM's VFP support code and can only be built using the RVCT tool chain.

VFP-enabled floating port support libraries

Symbian platform provides both the VFP version and the non-VFP version of the floating point support functions. You choose the VFP version when you build your ROM image by specifying the VFPHELPERS macro to BUILDROM. This causes the ROM building tool chain to replace the following three DLLs:

  • drtaeabi.dll

  • dfpaeabi.dll

  • dfprvct2_2.dll

There are two ways to specify the VFPHELPERS macro:

  1. by adding the following line into the header.iby file for your port:

    #define VFPHELPERS

    You use this technique to permanently include the VFP versions in your ROM image.

  2. by passing VFPHELPERS as a pre-processor argument using the -D option when invoking BUILDROM, i.e. :

    BUILDROM -DVFPHELPERS ...

    You use this technique if you only want to include the VFP versions for a specific ROM image, for example, when testing.

If you use the first technique, you can still provide non-VFP versions for a specific ROM image by passing NOVFPHELPERS as a pre-rpocessor argument using the -D option when invoking BUILDROM, i.e. :

BUILDROM -DNOVFPHELPERS ...

In effect, you are overriding the definition in the header.iby file.

For example, see the Integrator CM1136 base port, and specifically: ...\integrator\core\cm1136\rom\header.iby

Related concepts
Vector Floating Point (VFP)