summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMika Lindqvist <postmaster@raasu.org>2021-07-21 19:26:43 +0300
committerHans Kristian Rosbach <hk-github@circlestorm.org>2021-12-24 12:52:14 +0100
commit13f155ea25f63d791696492bdeef89320fb6b6a7 (patch)
tree39c97f7497ac38f757f64491760ae8cf255fcc60
parent8e22abdbf8f35010c2964de11f044f416b0d3d08 (diff)
[arm] Disable ACLE, UNALIGNED_OK and UNALIGNED64_OK on armv7 and earlier.
* armv7 has partial support for unaligned reads, but compiler might use instructions that do not support unaligned accesses
-rw-r--r--CMakeLists.txt8
1 files changed, 5 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 946b4e7..f6a56f0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -277,7 +277,7 @@ endif()
# Set architecture alignment requirements
if(WITH_UNALIGNED)
- if(BASEARCH_ARM_FOUND OR (BASEARCH_PPC_FOUND AND "${ARCH}" MATCHES "powerpc64le") OR BASEARCH_X86_FOUND)
+ if((BASEARCH_ARM_FOUND AND NOT "${ARCH}" MATCHES "armv[2-7]") OR (BASEARCH_PPC_FOUND AND "${ARCH}" MATCHES "powerpc64le") OR BASEARCH_X86_FOUND)
if(NOT DEFINED UNALIGNED_OK)
set(UNALIGNED_OK TRUE)
endif()
@@ -288,7 +288,9 @@ if(WITH_UNALIGNED)
endif()
if(BASEARCH_ARM_FOUND)
if(NOT DEFINED UNALIGNED64_OK)
- if("${ARCH}" MATCHES "(arm(v[8-9])?|aarch64)")
+ if("${ARCH}" MATCHES "armv[2-7]")
+ set(UNALIGNED64_OK FALSE)
+ elseif("${ARCH}" MATCHES "(arm(v[8-9])?|aarch64)")
set(UNALIGNED64_OK TRUE)
endif()
endif()
@@ -721,7 +723,7 @@ if(WITH_OPTIM)
endif()
list(APPEND ZLIB_ARCH_HDRS ${ARCHDIR}/arm.h)
list(APPEND ZLIB_ARCH_SRCS ${ARCHDIR}/armfeature.c)
- if(WITH_ACLE AND NOT MSVC)
+ if(WITH_ACLE AND NOT MSVC AND NOT "${ARCH}" MATCHES "armv[2-7]")
add_definitions(-DARM_ACLE_CRC_HASH)
set(ACLE_SRCS ${ARCHDIR}/crc32_acle.c ${ARCHDIR}/insert_string_acle.c)
set_property(SOURCE ${ACLE_SRCS} PROPERTY COMPILE_FLAGS "${ACLEFLAG} ${NOLTOFLAG}")