Monday, June 27, 2011

Linux on ARM: 300% faster with FPU

A company specializing in smartbooks, Genesi, today announced that it was possible to increase the performance of some devices by modifying the Linux distribution used. The gain, in some cases may reach 300%. And it is "simple": just use the FPU. Explain. In a processor, we find a unit that works on integers, but also a unit that works on floating point numbers, which allows for geometric calculations (for example).

If the FPU (the name of the floating point unit) is widespread on x86 since the mid-90s, ARM, especially at entry level, may not have this component. Currently, most distributions are compiled in a mode called "softfloat." This mode allows the use of floating point units of ARM SoC (the famous FPU) but through the whole units.

Put simply, the OS will detect calls to the FPU and then possibly run the code on the dedicated unit. This mode is useful because it allows you to run the code without knowing the exact type of FPU - there are several ARM architecture - and run software-the instructions are not available.

The problem of "softfloat" is that it is CPU intensive: code analysis before passing on the FPU significantly slows some programs. The simplest solution is to go "hardfloat" the instructions are passed directly to FPU, allowing a substantial gain. But it is obviously difficult in practice.

First hurdle, it is necessary to recompile the system and applications. If the code "softfloat" runs on SoC without a FPU, the "hardfloat" requires an FPU, and not just any. And all software must be adapted, again by recompiling. Second problem, the variety of ARM SoC: There are several FPU, it is not mandatory, and so on.

Overall, the choice will be simple: a Linux "hardfloat" will be compatible with the CPU ARMv7 (Cortex A8, Cortex A9, Scorpio), in VFPv3, the name of the FPU proposed by ARM. The HMIS will be a priori of the game, because one of the largest manufacturers of SoC - NVIDIA - did not include this feature in its chip (Tegra 2).

For machines still ARMv6 (ARM11 processor type, such as the Nokia N8) there is no salvation. And even if the Cortex A8 and Cortex A9 share the same instruction set, the lack of pipeline at the first strike on the FPU performance ... In fact, Genesi should propose within weeks of Debian compiled "hardfloat" to replace the Ubuntu distribution in "softfloat", with of course all the classic tailored programs.

Hopefully this initiative will be followed: many operating systems for smartphones are still softfloat while current devices are generally capable of operating in all hardfloat.

No comments:

Post a Comment