Android ARM6/7 and VFP/NEON question

sten

Newcomer
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 ARM6 (older devices, low ends, Huawei, ZTE, small SE) or ARM7 (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 ARM6 and ARM7 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: AMR6/VFP, ARM7/VFP and ARM7/VFP/NEON. Other proposals?
  4. The AMR6/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
 
Some comments:

  • ARM6 and ARM7 are the names of old ARM CPUs. You probably meant ARMv6 and ARMv7 which are the offical architecture names (ARM11 is ARMv6, Cortex-A8 and A9 are ARMv7).
  • you can get the architecture manual here (free registration required)
  • you don't want to blindly use NEON on any device that supports it because it's not always faster and using NEON will burn power uselessly (for instance on Cortex-A9 memcpy using NEON is not faster, while it is on Cortex-A8, so using it will only make sure the kernel will turn it on thus wasting power)
  • as far as I know the only widely available ARMv7-A device that doesn't have NEON is Tegra2.
  • basically I think you don't want to segregate based on architecture but on CPU model, which means a much larger range of possibilities.

Hope this helps.
 
In the NDK (if that is what you are targeting) there is functionality for extracting architecture version as well as if VFP3 and NEON are supported. This information can be used to switch implementation in runtime.

Have a look at android_getCpuFeatures in the cpu-features.h header file.
 
I don't see why would you separate VFP 6 and 7 they are both pretty much the same.

I personally target separate paths for VFP and Neon.
VFP code on A9 tends to be faster than on A8 since it is pipelined but when properly used and dealing with floating point data , NEON is always the best choice.

To give you an example:

I maintain three paths for my transformations related code:

1. Hand-coded VFP
2. Hand-coded Neon
3. Compiler generated C

On the original iPhone (arm6) VFP was about 3 times faster than C.
On Cortex8 devices ( iPhone 3gs and iPad1 ) Neon was by far the fastest, C code came second ( since compiler was generating Neon ops without utilizing SIMD ) and my asm optimized VFP code was the slowest ( non-pipelined VFP unit)

On Cortex9 devices , Neon was still at the top but by a smaller margin, while C and optimized VFP code were about the same ( VFP became pipelined )
 
Android also runs on x86 and MIPS.

No NDK support for MIPS though.

So long as file size is reasonable you should look into building a fat binary that has different compilations for different archs. The package manager will pick the best one at install time. You can read more about it in CPU-ARCH-ABIS.html in the NDK docs.
 
Android x86 works surprisingly well. If you have an EEEPc there are ISOs specifically for it because ASUS is involved and they work quite well. I had Honeycomb running off SDcard in no time. Even many market apps work. It is fast too.
 
Android x86 works surprisingly well. If you have an EEEPc there are ISOs specifically for it because ASUS is involved and they work quite well. I had Honeycomb running off SDcard in no time. Even many market apps work. It is fast too.
Does it include Intel ARM emulator or is that limited to non-native apps?
 
Back
Top