By default Android NDK does not generate code with VFP (vector floating point) or NEON instructions turned on. How can i turn them on?
By default Android NDK does not generate code with VFP (vector floating point) or
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are documentation about this in the following files in Android NDK: docs/CPU-ARCH-ABIS.html and docs/CPU-ARM-NEON.html.
Basically you want to put
to generate two shared libraries, one without (targeting ARMv5TE) and one with VFP support (targeting ARMv7).
To build .c/.cpp file with NEON support add .neon suffix to filename (for example: file.cpp.neon) in Android.mk file. Or to build all files with NEON enabled, put into Android.mk file:
Be careful – not all ARMv7 devices support NEON (like Nvidia Tegra 2). Better detect it at runtime and choose different codepath then.
Read the docs for more info.