Compiling native library for iPhone with vectorization

I am struggling with the Eigen library compilation for iPhone 4, which has an ARM processor with the armv7 instruction set. While everything is working fine, when I specify the preprocessor, define EIGEN_DONT_VECTORIZE. But due to some performance issues, I would like to use optimized armv7 code.

No matter which compiler I use LLVM-GCC 4.2 or LLVM CLang 2.0, I always encounter compilation errors. I realized (or think better) that LLVM-GCC 4.2 is the only way to access these specific ARM-NEON instructions.

When I do not set EIGEN_DONT_VECTORIZE (and provide -mfloat-abi = softfp -mfpu = neon for gcc), I get the following gcc compiler error:

src / m3CoreLib / Eigen / src / Core / arch / NEON / PacketMath.h: 89: error: expected unqualified-id before '__ extension __'

I read about problems using the "old" gcc 4.2 and recommendations for using a newer version of gcc. I'm not sure, but I think this is not an option due to the approval of the app store. Is there anything else I can do to compile it for the iPhone.? Anyone who solved this?

Thanks Kay

+3
source share
1 answer

After scrolling with the various compiler settings for the clock and the clock, I found a satisfactory solution and came to the following conclusion.

There is an unexpectedly huge difference between the debug and release settings in relation to the Eigen template library method: release parameters with the standard optimization flags turned on allow the application to run 20 to 40 times faster than debugging. I have never seen such a difference in any language, in my experience it is usually 1.5 - 3.

Although I still cannot force vectorization, i.e. The code compiles only with EIGEN_DONT_VECTORIZE, the resulting performance now matches my needs.

+1
source

All Articles