voID foo(uint64_t* Res){ uint64_t x = 0xff12aa8902acf78dulL; uint64x1_t a,b; a = vld1_u64 (&x); b = vext_u64 (a,a,3); vst1_u64 (Res,b);}
但我不断收到以下编译器错误:
/home/developer/adt/ndk/ndk-build all Install : libneon_test.so => libs/armeabi/libneon_test.soCompile thumb : neon_test <= neon.cjni/neon.c: In function 'foo':jni/neon.c:17:1: error: constant out of rangemake: *** [obj/local/armeabi-v7a/obJs/neon_test/neon.o] Error 1`
第17行是foo()的最后一个括号.
有谁知道这个奇怪的错误可能是什么原因?
解决方法 问题出在这一行b = vext_u64 (a,3);
对于vext_u64,it isn’t allowed,您不能将3作为班次.
uint64x1_t vext_u64(uint64x1_t a,uint64x1_t b,__constrange(0,0) int c); // VEXT.64 d0,d0,#0
看起来gcc的implementation (definition?)霓虹内在函数在这方面不如armcc.
理解这种行为的一个技巧是将-S传递给gcc以将代码转换为程序集然后尝试编译该程序集文件.那样gcc会告诉你究竟是哪一行给出了问题.
$~/bin/androID-ndk-r8d/toolchains/arm-linux-androIDeabi-4.7/prebuilt/linux-x86/bin/arm-linux-androIDeabi-gcc --sysroot=/home/auselen/bin/androID-ndk-r8d/platforms/androID-14/arch-arm -std=c99 -S neon.c -mfloat-abi=softfp -mfpu=neon -O2neon.c: In function 'foo':neon.c:11:1: error: constant out of range$~/bin/androID-ndk-r8d/toolchains/arm-linux-androIDeabi-4.7/prebuilt/linux-x86/bin/arm-linux-androIDeabi-gcc --sysroot=/home/auselen/bin/androID-ndk-r8d/platforms/androID-14/arch-arm -std=c99 -c neon.s -mfloat-abi=softfp -mfpu=neon -O2neon.s: Assembler messages:neon.s:28: Error: shift out of range -- `vext.64 d16,d16,#3'总结
以上是内存溢出为你收集整理的NEON内在函数不断超出范围全部内容,希望文章能够帮你解决NEON内在函数不断超出范围所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)