VectorCamp / vectorscan

A portable fork of the high-performance regular expression matching library
https://www.vectorcamp.gr/project/vectorscan/
Other
505 stars 54 forks source link

can not build on armv7 #61

Closed tekkenly closed 2 years ago

tekkenly commented 3 years ago

I'm trying to build using armv7 gcc, found these errors. looks like some api are only available under armv8. Is it possible to make them armv7 compatible?

In file included from /home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/simd_utils.h:67:0,
                 from /home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/common/bitutils.h:38,
                 from /home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/arm/bitutils.h:41,
                 from /home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/bitutils.h:51,
                 from /home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/bitfield.h:38,
                 from /home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/charreach.h:40,
                 from /home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/ue2string.h:37,
                 from /home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/compiler/compiler.h:41,
                 from /home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/hs.cpp:38:
/home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/arm/simd_utils.h: In function 'int diff128(m128, m128)':
/home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/arm/simd_utils.h:60:15: error: 'vaddvq_s8' was not declared in this scope
     int res = vaddvq_s8((int8x16_t) vceqq_s32(a, b));
               ^~~~~~~~~
/home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/arm/simd_utils.h:60:15: note: suggested alternative: 'vaddq_s8'
     int res = vaddvq_s8((int8x16_t) vceqq_s32(a, b));
               ^~~~~~~~~
               vaddq_s8
/home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/arm/simd_utils.h: In function 'u32 diffrich128(m128, m128)':
/home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/arm/simd_utils.h:74:12: error: 'vaddvq_u32' was not declared in this scope
     return vaddvq_u32(vandq_u32(vmvnq_s32(vceqq_s32((int32x4_t)a, (int32x4_t)b)), movemask));
            ^~~~~~~~~~
/home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/arm/simd_utils.h:74:12: note: suggested alternative: 'vaddq_u32'
     return vaddvq_u32(vandq_u32(vmvnq_s32(vceqq_s32((int32x4_t)a, (int32x4_t)b)), movemask));
            ^~~~~~~~~~
            vaddq_u32
/home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/arm/simd_utils.h: In function 'u32 diffrich64_128(m128, m128)':
/home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/arm/simd_utils.h:83:43: error: 'vceqq_s64' was not declared in this scope
     return vaddvq_u64(vandq_u64(vmvnq_s32(vceqq_s64((int64x2_t)a, (int64x2_t)b)), movemask));
                                           ^~~~~~~~~
/home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/arm/simd_utils.h:83:43: note: suggested alternative: 'vceq_p64'
     return vaddvq_u64(vandq_u64(vmvnq_s32(vceqq_s64((int64x2_t)a, (int64x2_t)b)), movemask));
                                           ^~~~~~~~~
                                           vceq_p64
/home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/arm/simd_utils.h:83:12: error: 'vaddvq_u64' was not declared in this scope
     return vaddvq_u64(vandq_u64(vmvnq_s32(vceqq_s64((int64x2_t)a, (int64x2_t)b)), movemask));
            ^~~~~~~~~~
/home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/arm/simd_utils.h:83:12: note: suggested alternative: 'vaddq_u64'
     return vaddvq_u64(vandq_u64(vmvnq_s32(vceqq_s64((int64x2_t)a, (int64x2_t)b)), movemask));
            ^~~~~~~~~~
            vaddq_u64
/home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/arm/simd_utils.h: In function 'm128 eq64_m128(m128, m128)':
/home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/arm/simd_utils.h:121:19: error: 'vceqq_u64' was not declared in this scope
     return (m128) vceqq_u64((int64x2_t)a, (int64x2_t)b);
                   ^~~~~~~~~
/home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/arm/simd_utils.h:121:19: note: suggested alternative: 'vceq_p64'
     return (m128) vceqq_u64((int64x2_t)a, (int64x2_t)b);
                   ^~~~~~~~~
                   vceq_p64
/home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/arm/simd_utils.h: In function 'm128 pshufb_m128(m128, m128)':
/home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/arm/simd_utils.h:379:18: error: 'vqtbl1q_s8' was not declared in this scope
     return (m128)vqtbl1q_s8((int8x16_t)a, (uint8x16_t)btranslated);
                  ^~~~~~~~~~
/home/ltekken/workref/fortipkg/build/vectorscan/vectorscan-5.4.2-1/armv7/src/util/arch/arm/simd_utils.h:379:18: note: suggested alternative: 'vtbl1_s8'
     return (m128)vqtbl1q_s8((int8x16_t)a, (uint8x16_t)btranslated);
                  ^~~~~~~~~~
                  vtbl1_s8
markos commented 3 years ago

hi @tekkenly armv7 support is still not decided, I have enough armv7 hardware here so it's possible it will happen, but at the moment focus is on armv8 hardware.

necuil commented 2 years ago

You can temporarily compile and use x86 source code on armv7 through sse2neon (https://github.com/DLTcollab/sse2neon), and all test cases have passed successfully on my android device. It should be noted that the thumb instruction should be turned off, otherwise it will cause SIGBUS

markos commented 2 years ago

I will not add yet another emulation library as a dependency to Vectorscan, Arm support is already included anyway. Arm 32-bit support is probably not going to happen soon, but it's on the horizon. It will however stay on Linux/arm and not Android.

necuil commented 2 years ago

Of course, compiling via sse2neon is only a temporary solution until vectorscan supports armv7. In fact, on the armv7 platform, it seems that the char of all platforms is an unsigned type, the only difference between android and pc is that the char of arm64 is also an unsigned type

markos commented 2 years ago

if it's only that difference, it's makes it easier to include the change, but still it will be an unsupported platform, we do not have the resources to support Android as well.

markos commented 2 years ago

@tekkenly we have decided we will not support add support for armv7 and Android to Vectorscan, we would accept PRs that do not break support on other platforms and don't increase maintainance burden, or otherwise we would discuss how this effort could be funded. But for the time being, I'm afraid this will have to be closed as wontfix.