Add config and header file for NEON support

Signed-off-by: Jun He <jun.he@arm.com>
Change-Id: I3fade568ff92b4303387705f843d0051d5e88349
This commit is contained in:
Jun He 2021-07-09 16:59:45 +08:00
parent ab9a57280d
commit 734b32bfe3
2 changed files with 12 additions and 0 deletions

View File

@ -178,6 +178,15 @@ int main() {
return _bzhi_u32(0, 1); return _bzhi_u32(0, 1);
}" SNAPPY_HAVE_BMI2) }" SNAPPY_HAVE_BMI2)
check_cxx_source_compiles("
#include <arm_neon.h>
int main() {
uint8_t val = 3, dup[8];
uint8x16_t v = vld1q_dup_u8(&val);
vst1q_u8(dup, v);
return 0;
}" SNAPPY_HAVE_NEON)
include(CheckSymbolExists) include(CheckSymbolExists)
check_symbol_exists("mmap" "sys/mman.h" HAVE_FUNC_MMAP) check_symbol_exists("mmap" "sys/mman.h" HAVE_FUNC_MMAP)
check_symbol_exists("sysconf" "unistd.h" HAVE_FUNC_SYSCONF) check_symbol_exists("sysconf" "unistd.h" HAVE_FUNC_SYSCONF)

View File

@ -49,6 +49,9 @@
/* Define to 1 if you target processors with BMI2+ and have <bmi2intrin.h>. */ /* Define to 1 if you target processors with BMI2+ and have <bmi2intrin.h>. */
#cmakedefine01 SNAPPY_HAVE_BMI2 #cmakedefine01 SNAPPY_HAVE_BMI2
/* Define to 1 if you target processors with NEON and have <arm_neon.h>. */
#cmakedefine01 SNAPPY_HAVE_NEON
/* Define to 1 if your processor stores words with the most significant byte /* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */ first (like Motorola and SPARC, unlike Intel and VAX). */
#cmakedefine SNAPPY_IS_BIG_ENDIAN 1 #cmakedefine SNAPPY_IS_BIG_ENDIAN 1