DLTcollab / sse2neon

A translator from Intel SSE intrinsics to Arm/Aarch64 NEON implementation
MIT License
1.3k stars 208 forks source link

sse2neon.h:2655:22: error: argument to '__builtin_neon_vextq_v' must be a constant integer #15

Closed huangtianhua closed 4 years ago

huangtianhua commented 4 years ago

I build apache/impala on aarch64, I download the file https://github.com/DLTcollab/sse2neon/blob/master/sse2neon.h under impala directory, and include it in some other files, an error raised:

/home/jenkins/workspace/impala/be/src/util/sse2neon.h:2655:22: error: argument to 'builtin_neon_vextq_v' must be a constant integer return (__m128i) vextq_s8((int8x16_t) a, (int8x16_t) b, c); ^~~~~~~~~ /home/jenkins/workspace/native-toolchain/build/llvm-5.0.1-p2/lib/clang/5.0.1/include/arm_neon.h:5825:23: note: expanded from macro 'vextq_s8' ret = (int8x16_t) builtin_neon_vextq_v((int8x16_t)s0, (int8x16_t)s1, p2, 32); \

I don't know how to fix this, the third argument c is const integer type, the value of c only can be known at run-time, right? But according to compile error, it seems that the value of c should be known at compile-time. So I have no idea is it an error of the sse2neon.h? Or how to fix this?

huangtianhua commented 4 years ago

Or this project is only work for intel arm64 server?

jserv commented 4 years ago

It seems that you are using clang/llvm. Can you show the instructions to reproduce?

huangtianhua commented 4 years ago

@jserv Thanks for replying. I am trying to build/test apache/impala on aarch64, there are some modifications, I executed "./buildall.sh" under impala root directly and above error raised, and I have no idea to fix it. So what did you mean 'the instructions to reproduce'?

jserv commented 4 years ago

I think it would be great if sse2neon can collaborate with Apache Impala contributors. However, @marktwtn and I need to know how to reproduce the problem. @huangtianhua, can you write down something about the build configurations, toolchain, etc.?

jserv commented 4 years ago

Or this project is only work for intel arm64 server?

We verified sse2neon on both Aarch64 and ARMv7-A targets. According to the above compilation errors, I guess the lacking of proper compiler options which enforce Arm specific assignments.

huangtianhua commented 4 years ago

@jserv I followed suggestion of Impala pmc huangquanlong to build native-toolchain first, and I have merged some patches to native-toolchain: https://gerrit.cloudera.org/#/q/owner:huangtianhua223%2540gmail.com after above patches, the native-toolchain built success and now I am building impala, the building uses gcc which built in native-toolchain, I modified some compiler options in these patches to support arm64, or maybe there is something wrong?