- NE10是开源ARM NEON函数库,主要包含常用数学函数、数字信号处理函数、图像处理函数,由3种版本代码的实现,分别为C语言版本、NEON Intrisincs版本、NEON汇编版本。
- 官方主页:
https://projectne10.github.io/Ne10/doc/index.html - 源代码
https://github.com/projectNe10/Ne10 - 安装
参考链接:https://projectne10.github.io/Ne10/doc/md_doc_building.html
cd $NE10_PATH
mkdir build && cd build
export NE10_LINUX_TARGET_ARCH=armv7 # Can also be "aarch64"
cmake -DCMAKE_TOOLCHAIN_FILE=../GNUlinux_config.cmake ..
make
- 测试
编写测试程序test.c
#include <stdio.h>
#include "NE10.h"
int main(void)
{
ne10_float32_t a = -0.8;
ne10_float32_t b1, b2;
ne10_abs_float_c(&b1, &a, 1); /* C语言版本 */
ne10_abs_float_neon(&b2, &a, 1); /* NEON Intrisincs版本 */
printf("%f %f %f\n", b1, b2);
return 0;
}
交叉编译:
arm-linux-gnueabi-gcc -O2 -o test test.c -I/your/include/path -L/your/lib/path -lNE10 -static -mfpu=neon
- 运行结果