I am trying to build an executable for Cortex A8 using RVDS 4.0. My code uses NEON but I want to set fpu option to either none or SoftVFP. The ARM website mentions that NEON is disabled when fpu is set to SoftVFP. Is this because VFP and NEON share registers?
Can some one please explain why I can not use NEON when fpu is set to SoftVFP or if there is any option through which I can enable NEON even when fpu is set to SOftVFP?
Thanks
Yes, the NEON and VFP registers are shared. This simplifies operating system context-switching support, since any OS aware of VFP will handle NEON correctly too.
It is unsafe to link code built for softVFP with code built for hardware VFP, because they place function arguments/results in different registers - using NEON is a lot like using hardware VFP where this is concerned.
There is a special case though, when you have to link against SoftVFP libraries, but you happen to know your SoC supports it(Do you know this? There are plenty of A8's without NEON). The special case is called softvfp+. The way this works is that function arguments are passed in integer registers, but inside of functions the compiler can use the FPU, or you can use NEON. For ARM's compiler targeting a CortexA8 with NEON, you'd want to use "--fpu=softvfp+vfpv3"
See this for some options for ARM's compiler related to this. Many other compilers have similar switches.
For ARM's RVCT3.x and above compilers, you'll want(http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0491c/CIHCJIFE.html):
For GCC, you'll want "-mfloat-abi=softfp", and I think "-mfpu=‘neon’". From the GCC manual(http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html):