error: incompatible types when assigning to type ‘int32x4_t’ from type ‘int’
fwz-fpga opened this issue · comments
I have a device with linux os && armv7.
Recently, I need to cross compile to build xnnpack lib, host is x86_64 cpu. And the toolchain is gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi.
With this toolchain, the error is
error: incompatible types when assigning to type ‘int32x4_t’ from type ‘int’ vacc0x0123 = vcvtnq_s32_f32(vproduct0x0123);
I find that arm_neon.h in gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi doesn't have this vcvtnq_s32_f32 intrinsic.
This toolchain is for AArch32, is it the problem of toolchain?
I have tried gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabi , it is the same error.
As for complie, I have tried another toolchain gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu this is for aarch64, it works fine.
So what's the problem, aarch32 toolchain not support some xnnpack kernels?
Like this, https://github.com/google/XNNPACK/pull/1404/files , modify the cmakelist.txt, remove XNNPACK_NEONDOT_MICROKERNEL_SRCS, it can build success. :(
In which source file do you get the error?
XNNPACK/src/qs8-gemm/gen/1x8c4-minmax-fp32-neondot.c:94:16: error: incompatible types when assigning to type ‘int32x4_t’ from type ‘int’
vacc0x0123 = vcvtnq_s32_f32(vproduct0x0123);
toolchain.cmake
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR armv7)
set(TOOLCHAIN_DIR /root/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi/bin)
set(CMAKE_C_COMPILER ${TOOLCHAIN_DIR}/arm-linux-gnueabi-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_DIR}/arm-linux-gnueabi-g++)
add_compile_options(-fstack-protector-all -Wall -mfloat-abi=softfp)
The compiler lacks the right intrinsic function. XNNPACK includes a polyfill for this intrinsic, but for some reason it doesn't get used:
XNNPACK/src/xnnpack/intrinsics-polyfill.h
Lines 134 to 147 in 694d252
I know the reason, I use this commit 16d79ed
XNNPACK/src/xnnpack/intrinsics-polyfill.h
Lines 134 to 141 in 16d79ed
Now master is ok.
THX :)