How to use arm_acle C language extensions in android

橙三吉。 提交于 2019-12-11 12:40:15

问题


There are lots of examples of using arm neon intrinsics for android, with the ndk even having an example. I've gotten that to work with no problem.

Arm also offer the ACLE (Arm C Language Extension), but I can find next to nothing by way of examples. The arm document itself merely suggests including the arm_acle.h header file, however I still get errors. Google has offered almost zero assistance :) Also searching the arm community boards has yielded little by way of results.

Do people not use the acle, and chose inline assembly instead?

When I inlcude the arm_acle.h and atttempt to use the __ssat() call, I have to further define a directive __ARM_FEATURE_CRC32, and when building I get the error" error: '__builtin_arm_qadd' was not declared in this scope"

The header doesn't seen to include any dependencies, and the documentation list no specific link dependencies.

Any advice?

Or am I overlooking something fundamental here?

Additional Information: My target arch is armv7-a-neon and is correctly detected in the make file at build time. I then further define "-mfloat-abi=softfp -mfpu=neon -march=armv7", but to no avail. If I undo my additional debugging defines, I simply get " error: #error "ACLE intrinsics support not enabled." (Neon support and detection succeeds) Searching my code base, the arm_acle.h header file is only present for the clang host tools, whereas arm_neon.h is is present for several prebuilts tool arm directories.

As I said, the arm_neon works detection works fine, and runs fine, it's the arm_acle component that doesn't work. Searching the online repositories like http://androidxref.com seems to suggest only neon is supported?


回答1:


The ARM C Language Extensions are currently not fully supported in GCC (as of version 5.1). The Android NDK normally uses a version of GCC older than this, which also does not have full support for ACLE.

This page https://gcc.gnu.org/onlinedocs/gcc/ARM-C-Language-Extensions-_0028ACLE_0029.html gives some idea of the current level of implementation of ACLE for both ARM and AArch64 targets. As you'll see there, the only features of ACLE currently provided by GCC are the CRC32 intrinsics in arm_acle.h and the Neon Intrinsics you've already found in arm_neon.h.



来源:https://stackoverflow.com/questions/31416325/how-to-use-arm-acle-c-language-extensions-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!