如何在android中使用arm_acle C语言扩展 [英] How to use arm_acle C language extensions in android

查看:22
本文介绍了如何在android中使用arm_acle C语言扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有很多在 android 上使用 arm neon 内在函数的例子,ndk 甚至有一个例子.我已经让它毫无问题地工作了.

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 还提供 ACLE(Arm C 语言扩展),但我几乎找不到示例.arm 文档本身仅建议包含 arm_acle.h 头文件,但是我仍然遇到错误.Google 提供的帮助几乎为零 :) 此外,搜索 arm 社区委员会的结果也很少.

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.

人们是不是不使用 acle,而是选择了内联汇编?

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

当我包含 arm_acle.h 并尝试使用 __ssat() 调用时,我必须进一步定义指令 __ARM_FEATURE_CRC32,并且在构建时出现错误错误:'__builtin_arm_qadd' 未在此范围内声明"

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.

有什么建议吗?

还是我在这里忽略了一些基本的东西?

Or am I overlooking something fundamental here?

附加信息:我的目标 arch 是 armv7-a-neon,并且在构建时在 make 文件中正确检测到.然后我进一步定义了-mfloat-abi=softfp -mfpu=neon -march=armv7",但无济于事.如果我撤消额外的调试定义,我只会得到错误:#errorACLE 内在支持未启用."(Neon 支持和检测成功)搜索我的代码库,arm_acle.h 头文件只存在于 clang host 工具,而 arm_neon.h 存在于几个预构建的工具 arm 目录中.

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.

正如我所说,arm_neon 工作检测工作正常,并且运行正常,是 arm_acle 组件不起作用.搜索像 http://androidxref.com 这样的在线存储库似乎表明只支持霓虹灯?

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?

推荐答案

GCC 目前不完全支持 ARM C 语言扩展(从 5.1 版开始).Android NDK 通常使用比这更旧的 GCC 版本,该版本也不完全支持 ACLE.

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.

本页 https://gcc.gnu.org/onlinedocs/gcc/ARM-C-Language-Extensions-_0028ACLE_0029.html 给出了当前针对 ARM 和 AArch64 目标的 ACLE 实现水平的一些想法.正如您将在那里看到的,目前 GCC 提供的 ACLE 的唯一功能是 arm_acle.h 中的 CRC32 内在函数和您已经在 arm_neon.h 中找到的 Neon 内在函数>.

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.

这篇关于如何在android中使用arm_acle C语言扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆