Linux – Determine if Linux Board is Using Hardware FPU

armfloating pointlinux

I am using an embedded Linux board based on a fairly old Freescale ARM chip. How do I determine whether the Python interpreter there is using the hardware FPU on the chip or not?

My /proc/cpuinfo is:

Processor       : ARM926EJ-S rev 5 (v5l)
BogoMIPS        : 179.81
Features        : swp half thumb fastmult edsp java
CPU implementer : 0x41
CPU architecture: 5TEJ
CPU variant     : 0x0
CPU part        : 0x926
CPU revision    : 5

Best Answer

In the ARM world from ARMv4 to ARMv7 floating-point support is called VFP, and hardware support for it appears in the Features line of /proc/cpuinfo or in the VFP support log message printed by the kernel while booting. (In ARMv8 it's just "FP".)

In /proc/cpuinfo on an Allwinner A20 this gives:

Features    : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm 

(see the various vfp features) and in the boot log:

VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 4

If VFP isn't fully supported, the kernel will instead log

VFP support v0.3: not present

or

VFP support v0.3: no double precision support

As to whether your Python interpreter is capable of using this, it appears to depend mainly on the architecture of your ARM Linux distribution. If I understand things correctly, basic Debian armel won't use the FPU, Debian armhf (and Raspbian armhf) will; the older Debian arm variant used FPU instructions, but these were emulated if the hardware didn't support them. On armel you can install kernels or C libraries with FPU support (although no such C library appears to be available in the Debian archives).

Related Question