pi_css5
,我在浮动测试中混淆.
从cat / proc / cpuinfo(下面),我猜有3种类型的浮动功能:neon,vfp,vfpv3?从这个question&answer开始,它似乎取决于编译器.
我仍然不知道我应该在compille标志中指定哪个(-mfpu = neon / vfp / vfpv3),或者我应该用每个编译程序,或者只是不指定-mfpu?
cat /proc/cpuinfo Processor : ARMv7 Processor rev 4 (v7l) BogoMIPS : 532.00 Features : swp half thumb fastmult vfp edsp neon vfpv3 tls CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x2 CPU part : 0xc09 CPU revision : 4它可能比你预期的要复杂一点. GCC arm options page不解释fpu版本,但 ARM’s manual for their compiler确实如此.你还应该注意到 Linux doesn’t provide whole story about fpu features,只讲述vfp,vfpv3,vfpv3d16或vfpv4.
回到你的问题,你应该选择其中最大的共同因素,编译你的代码并比较结果.另一方面,如果一个CPU有vfpv4而另一个有vfpv3哪一个你觉得哪个更好?
如果你的问题就像在neon,vfp或vfpv3之间选择一样简单.选择霓虹灯(source).
-mfpu=neon selects VFPv3 with NEON coprocessor extensions.
从gcc手册,
If the selected floating-point hardware includes the NEON extension
(e.g.-mfpu=neon
), note that floating-point operations will
not be used by GCC’s auto-vectorization pass unless
`-funsafe-math-optimizations’ is also specified. This is because
NEON hardware does not fully implement the IEEE 754 standard for
floating-point arithmetic (in particular denormal values are
treated as zero), so the use of NEON instructions may lead to a
loss of precision.
有关此主题的更多信息,请参见Subnormal IEEE-754 floating point numbers support on ios….