Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ARM Cortex-A8: How to make use of both NEON and vfpv3

I'm using Cortex-A8 processor and I'm not understanding how to use the -mfpu flag.

On the Cortex-A8 there are both vfpv3 and neon co-processors. Previously I was not knowing how to use neon so I was only using

gcc -marm -mfloat-abi=softfp -mfpu=vfpv3

Now I have understood how SIMD processors run and I have written certain code using NEON intrinsics. To use neon co-processor now my -mfpu flag has to change to -mfpu=neon, so my compiler command line looks like this

gcc -marm -mfloat-abi=softfp -mfpu=neon

Now, does this mean that my vfpv3 is not used any more? I have lots of code which is not making use of NEON, do those parts not make use of vfpv3.

If both neon and vfpv3 are still used then I have no issues, but if only one of them is used how can I make use of both?

like image 472
HaggarTheHorrible Avatar asked Nov 18 '10 10:11

HaggarTheHorrible


1 Answers

NEON implies having the traditional VFP support too. VFP can be used for "normal" (non-vector) floating-point calculations. Also, NEON does not support double-precision FP so only VFP instructions can be used for that.
What you can do is add -S to gcc's command line and check the assembly. Instructions starting with V (e.g. vld1.32, vmla.f32) are NEON instructions, and those starting with F (fldd, fmacd) are VFP. (Although ARM docs now prefer using the V prefix even for VFP instructions, GCC does not do that.)

like image 91
Igor Skochinsky Avatar answered Oct 26 '22 08:10

Igor Skochinsky