Android ARMv6/v7 and VFP/NEON

STeN picture STeN · Feb 22, 2012 · Viewed 18.6k times · Source

I would like to understand more the CPU used on Android phones. The reason is that we are building the C library which has the certain CPU/math processor architecture flags we can set.

  1. So far we have found that all Android devices CPUs are ARM design and are either ARMv6 (older devices, low ends, Huawei, ZTE, small SE) or ARMv7 (Honeycomb tablets and all more expensive devices, almost all with resolution WVGA and higher)I have checked ~20 devices and all have processor of that type. Is that correct? Are there some others?

  2. Now when it comes to the multimedia and mathematical operations I think two units are important – the VFP for floating point arithmetic and the SIMD - NEON. After testing the above mentioned group of devices I have found that VFP support is in almost all devices, while NEON not. Any comments to that?

  3. I do not know what exactly is the ARMv6 and ARMv7 difference (besides the speed in general). Now we are building a multimedia C library, which has couple of flags for building. My question is how to target the largest number of devices on one side and how to allow the users of the better devices to use their hardware. My proposal is to prepare 3 distinct builds: ARMv6/VFP, ARMv7/VFP and ARMv7/VFP/NEON. Other proposals?

  4. The ARMv6/VFP I think should run on all configurations, except devices, which are missing the VFP (e.g. the old HTC Wildfire) – but those will remain unsupported.

Is this a good approach? Any comments are welcomed.

Regards, STeN

Answer

Mārtiņš Možeiko picture Mārtiņš Možeiko · Feb 22, 2012
  1. That's correct. Currently there are two types - ARMv6 and ARMv7. Most likely in nearest future there will additionally x86 target. Newest NDK already supports builds for it.

  2. VFP is mandatory on ARMv7, but not on ARMv6. NEON is optional, and not all devices support it. Most distinct example is Nvidia Tegra 2. It is deployed on most high-end tablets and phones, but it doesn't support NEON. Nvidia Tegra 3 supports NEON.

  3. I think you should stick to ARMv6 with floating point emulation, ARMv7+VFP, ARMv7+NEON.

  4. Exactly - VFP is not supported on all ARMv6 devices. So simply don't use it there. By default NDK builds armeabi target that is intended for ARMv6 devices and doesn't use VFP. armeabi-v7a builds for ARMv7 and uses VFP.