This page contains details about the hard-float ABI Arm port (armhf) for Debian, released for the first time with Wheezy (7.0).
Other ports to Arm hardware exist / have existed in Debian - seeArmPorts for more links and an overview.
Contents
ArmHardFloatTodo contains all current status information. What works, what doesn't, Bugs, transitions etc.
ArmHardFloatChroot contains quick start instructions for setting up a armhf chroot.
This page contains background on the port itself and how and why it came to be.
A lot of modern Arm boards and devices ship with a floating-point unit (FPU) but the current Debian armel port doesn't take much advantage of it.
A new Arm port requiring the presence of a FPU would help squeeze the most performance juice out of hardware with a FPU.
Currently the Debian armhf port requires at least an Armv7 CPU with Thumb-2 and VFP3D16.
The Arm core and application list on wikipedia may be a useful reference. It also references similar more-complete lists elsewhere.
This section provides some background information on FPUs, Arm EABI, GCC floating-point ABIs, hwcaps...
With Armv5 an optional floating point instruction set known as Vector Floating Point (VFP) was introduced. This is now effectively the norm for modern Arm implementations; although it is possible to configureCortex-A8,Cortex-A9 andCortex-A5 with noVFP almost all implementations do provide it. Prior to this there was no real standardized set of floating point instructions, with some vendors supplying their own coprocessors, most supplying none, and the original Arm FPU 'standard' implementation being almost entirely unused in the real world.
VFP was extended over time, with VFPv2 (someArm9 /Arm11) VFPv3-D16 (e.g. Marvell Dove) and VFPv3+NEON (MostCortex-A8) present in current production silicon.
In spite of the name, the baseVFP architecture is not well suited for vector operations. For practical purposes it is a normal scalar floating point unit. TheNEON extension defines vector instructions similar to SSE or?AltiVec and shares a register file with theVFP unit.
NEON and VFP/VFP2/VFP3 remain an optional part of the architecture.
The Arm EABI specification covers calling conventions across libraries and binaries. It defines two incompatible ABIs: one uses (VFP) floating point registers for passing function arguments,the other does not.
Unlike many other architectures, Arm supports use of FPU instructions while still conforming to the base ABI. This allows code to take advantage of the FPU without breaking compatibility with older libraries or applications. This does incur some overhead relative to a full hard-float system, and obviously requires aVFP capable CPU.
For historical reasons and to match the Arm RVCT kit, the GCC FPU and ABI selection options are not entirely orthogonal. The-mfloat-abi= option controls both the ABI, and whether floating point instructions may be used. The available options are:
soft: Full software floating point.
softfp: Use the FPU, but remain compatible with soft-float code.
hard: Full hardware floating point.
In addition, the-mfpu= option can be used to select a VFP/NEON (or FPA or Maverick) variant. This has no effect when -mfloat-abi=soft is specified.
The combination of -mfpu=vfp and -mfloat-abi=hard is not available in FSF GCC 4.4; see TODO section below for options.
See/VfpComparison for an in depth discussion and some performance research.
The GCC-mfloat-abi=softfp flag allows use ofVFP while remaining compatible with soft-float code. This allows selection of appropriate routines at runtime based on the availability ofVFP hardware.
The runtime linker,ld.so, supports a mechanism for selecting runtime libraries based on features reported by the kernel. For instance, it's possible to provide two versions of libm, one in/lib and another one in/lib/vfp, andld.so will select the/lib/vfp one on systems withVFP.
This mechanism is dubbed "hwcaps".
This only works when the binaries are compatible (use the same ABI); you can't select between hard-float and soft-float libs with hwcaps. See/VfpComparison for more details.
http://wiki.debian.org/Multiarch/LibraryPathOverview is a great in-depth explanation of how ld.so and gcc and multilib paths interact if you want to understand this stuff.
A new port would be little-endian as that is almost invariably used in recent Arm designs.
Since the new port would requireVFP, it would limit which?SoCs are supported by the new port.
The toolchain needs to be configured with a specific base CPU and baseVFP version in mind.
It might make sense for such a new port -- which would essentially target newer hardware -- to target newer CPUs. For instance, it could target Armv6 or Armv7?SoCs, and VFPv2, VFPv3-D16 orNEON.
If targeting Armv7, another option is to build for Thumb-2 which provides both code-size and speed(generally) improvements.
The table below recaps which port names Debian/dpkg saw so far.
name | endianess | status |
arm | little-endian | Original Debian arm port using original ABI ('OABI'), last release in Debian lenny; being retired in favor ofarmel |
armel | little-endian | introduced in Debian lenny; EABI, actively maintained; targetsarmv4t; doesn't require an FPU |
armeb | big-endian | unofficial OABI port; inactive and dead |
The name of the new Arm port using the hard-float ABI is 'armhf' (for 'hard-float').
See Port naming debate notes below for info on why and how this name was chosen.
In practice armel will be used for older CPUs (armv4t, armv5, armv6), and armhf for newer CPUs (armv7+VFP).
Other ('flavoured') builds of the base ports for different CPU optimisations and hardware capabilities are possible. The question of which (if any) other flavours will be maintained is currently under discussion, and is likely to be decided at theDebian Arm/Embedded Sprint in Feb 2011. e.g armel flavours for v6 and v7 CPUs withoutVFP, or an armhf flavour for VFP+NEON.
GCC when built to target the GNUarm-linux-gnueabi triplet will support both the hard-float and soft-float calling conventions.
dpkg relies on the triplet to identify the port (gcc -dumpmachine output). Some other projects such as multiarch rely on having distinct triplets across all Debian architectures.
One option would be to use the vendor field in the triplet to have distinct triplets. For instance, the triplet could bearm-hardfloat-linux-gnueabi.
arm-none-linux-gnueabi, just like inCodeSourcery compilers, would be an option but it is confusing to relate toarm-linux-gnueabi versusarm-none-linux-gnueabi; it is clearer to relate toarm-hardfloat-linux-gnueabi and also allows distinguishing betweenCodeSourcery and the new port.
The final descision was to use a triplet of arm-linux-gnueabihf
Genesi USA, Inc. did a proof-of-concept rebuild of Ubuntu karmic (9.10)'s armel port with the hard-floating. They noticedimportant wins (in the order of 40% performance improvement) in floating-point heavy applications/libraries such as mesa, with aCortex-A8 CPU.
It's likely that the performance benefits are much larger onCortex-A8 CPUs than onCortex-A9 CPUs which have a fasterVFP design and more conventional pipeline.
NEON is an extension of theVFP which allows for very efficient manipulation of matrices, and vector data in general. This is notably useful for processing audio and video data, or for fastmemcpy().
Programs usually take advantage ofNEON thanks to hand-crafted assembly routines. GCC can automatically vectorize code and generateNEON instructions, however this tends to have limited success. It would seem sensible NOT to requireNEON in a new port since some modern Armv7?SoCs such as Marvell Dove and NVidia Tegra2 don't implement it.
It is also possible to useNEON instructions for regular scalar floating point code, and this can give significant (2-3x) speedup onCortex-A8 hardware. However GCC does not currently implement this, and it is not always applicable asNEON instructions are not fully IEEE compliant.
See/VfpComparison for an in depth discussion and some performance research.
Genesi-USA would be happy to continue sharing the 9 EfikaMX (Freescale i.MX51) buildds used for their proof-of-concept to help get a new port started.
Genesi-USA is also giving hardware (10 EfikaMX T03) to main Debian sub-project leads for Education, Embedded, Live systems, Ubuntu developers, and Linaro developers.
Genesi-USA is also giving old hardware (EfikaMX T02) which could be used to help out buildds, setup porterboxes or give away to interested developers who would work on the new port. While stock it is limited, if you are interested, register yourself intoPowerDeveloper site and, then, contact Hector Oron <zumbi@debian.org>.
For the official debian port freescale IMX53 quickstart boards donated by linaro are currently being used. Various other hardware is also on the market, see [ArmHardFloatBuildHardware] for a comparison of current and potential build hardware.
.. the new port could either have backported support ingcc-4.4, or usegcc-4.5 from the start
.. or use a different code base such asCodeSourcery SourceryG++ (~4.4.1) or Linaro GCC (~4.4.1 -> 4.5)
Manufacturer | SoC | architecture | VFP | SIMD | Notes |
Freescale | iMX5x | armv7 | |||
Freescale | iMX6 | armv7 | |||
Nvidia | Tegra2 | armv7 | none | ||
Marvell | Dove | armv7 | iwMMXt | ||
OMAP3xxx | armv7 | ||||
OMAP4xxx | armv7 | ||||
OMAP5xxx | armv7 | VFPv4 | Cortex-A15 (Armv7-A) +Cortex-M4 (Armv7-ME) | ||
Qualcomm | Snapdragon | armv7 | NEON[1] | Qualcomm "Scorpion" core | |
S5PC100 | armv7 | ||||
A1x | armv7 |
Larger list athttp://en.wikipedia.org/wiki/ARM_architectureTI OMAP specific infos athttp://en.wikipedia.org/wiki/Texas_Instruments_OMAP
Port naming is a classic bikeshed issue. It is also important as decisions have long-term effects, and the issues are quite complex. The Arm architecture has more variation than most and thus presents particular naming challenges. So we had quite a long discussion about the port name (and the need for a port at all).
You can read the full naming debate threads here:http://lists.debian.org/debian-arm/2010/07/msg00019.html "armelfp: new architecture name for an armel variant"http://lists.debian.org/debian-arm/2010/07/msg00100.html "cortex / arm-hardfloat-linux-gnueabi (was Re: armelfp: new architecture name for an armel variant)"
(that'll keep you entertained for a couple of hours at least
Here is a very brief summary of some major points raised.
'cortex' was suggested by Genesi's Matt Sealey as it more-or-less defines the armv7+vpf3-d16+Thumb-2 set of options the port is targetting, but the idea of using a marketing name for the arch was not popular.
Other suggestions generally were about encoding more things in the port name: base arm architecture flavour, endianness, arm 'profile' (A/M/R as inCortex-A8, cortex-M3). So we had "armelfp" or "armelhp" and "armelvfp" and "arm7hf" and "armel7hf". THis was followed by suggestions to shorten names along the lines of: Losing the "e" for EABI and "l" for little endian doesn't seem like that big a loss, as by far the most usual operation of these processor cores is under a little-endian EABI environment, and OABI is not even considered supported anymore for these chips.
The eventual conclusion was that port names in Debian should encode incompatible ABIs, not compatible variations within an ABI (such as CPU optimisations, referred to as 'flavours'). The default flavour for a port can change over time as older CPUs become obsolete. (e.g. the i386 architecture has been built for 386, 486 and 586 flavours over time). Rebuilds of a port for a new flavour within the ABI are possible to gain performance improvements, but Debian itself normally provides builds to the lowest common denominator still in widespread use, maximising generality. Thus attempts to encode all the possible flavour options in the port name were unnecessary and produced long and awkward names. A better solution to the problem of recording the flavour to which a port or package is built is suitable package metadata.
CodeSourcery and Linaro gcc are almost the same thing, Genesi recommendCodeSourcery 2010q1 for now - it is gcc 4.4.1 but it is functionally equivalent to gcc 4.5 for the purpose of a port. There are qualms about not using mainline FSF GCC - I (matt sealey) understand Debian policy decides no custom patches unless they are going to be mainlined in the future. It can be argued that Codesourcery commits most of the Arm, PPC support for GCC and are the architects of hardfp support in gcc 4.5 (published and maintained in the SourceryG++ tree). It's still GPL.
The lowest worthwhile CPU implementation is Armv7-A (therefore the recommended build option is-march=armv7-a)
FPU should be set at VFPv3-D16 as they represent the miminum specification of the processors to support here (therefore the recommended build option is-mfpu=vfpv3-d16)
Using armv7 as a base
[1]http://www.bdti.com/InsideDSP/2007/11/14/Qualcomm
ArmHardFloatPort (last modified 2017-08-05 15:01:44)