diff options
author | Jun He <jun.he@arm.com> | 2021-07-09 16:59:45 +0800 |
---|---|---|
committer | Jun He <jun.he@arm.com> | 2021-08-12 15:45:46 +0800 |
commit | 734b32bfe3d85675652964d09b59eff33a00f557 (patch) | |
tree | 267474480926b965c477022f6c039dd564757bfb | |
parent | ab9a57280d7d56a76a9e9a2d860fe205eb45221f (diff) | |
download | snappy-git-734b32bfe3d85675652964d09b59eff33a00f557.tar.gz |
Add config and header file for NEON support
Signed-off-by: Jun He <jun.he@arm.com>
Change-Id: I3fade568ff92b4303387705f843d0051d5e88349
-rw-r--r-- | CMakeLists.txt | 9 | ||||
-rw-r--r-- | cmake/config.h.in | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 672561e..6eef485 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -178,6 +178,15 @@ int main() { return _bzhi_u32(0, 1); }" 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) check_symbol_exists("mmap" "sys/mman.h" HAVE_FUNC_MMAP) check_symbol_exists("sysconf" "unistd.h" HAVE_FUNC_SYSCONF) diff --git a/cmake/config.h.in b/cmake/config.h.in index 872bd3c..568f69c 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -49,6 +49,9 @@ /* Define to 1 if you target processors with BMI2+ and have <bmi2intrin.h>. */ #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 first (like Motorola and SPARC, unlike Intel and VAX). */ #cmakedefine SNAPPY_IS_BIG_ENDIAN 1 |