add_definitions(-DUNALIGNED_OK)
message(STATUS "Architecture supports unaligned reads")
endif()
+if(BASEARCH_ARM_FOUND)
+ if(NOT DEFINED UNALIGNED64_OK)
+ if("${ARCH}" MATCHES "(arm(v[8-9])?|aarch64)")
+ set(UNALIGNED64_OK TRUE)
+ endif()
+ endif()
+endif()
+if(BASEARCH_PPC_FOUND)
+ if(NOT DEFINED UNALIGNED64_OK)
+ if("${ARCH}" MATCHES "powerpc64le")
+ set(UNALIGNED64_OK TRUE)
+ endif()
+ endif()
+endif()
+if(BASEARCH_X86_FOUND)
+ if(NOT DEFINED UNALIGNED64_OK)
+ set(UNALIGNED64_OK TRUE)
+ endif()
+endif()
+if(UNALIGNED64_OK)
+ add_definitions(-DUNALIGNED64_OK)
+ message(STATUS "Architecture supports unaligned reads of > 4 bytes")
+endif()
# Apply warning flags to cflags
if(WITH_MAINTAINER_WARNINGS)
endforeach()
endforeach()
- minigzip_stdio_cmp(minigzip "detect-text" "test/data/lcet10.txt" -A)
+ minigzip_stdio_cmp(minigzip "detect-text" "test/data/lcet10.txt" -A)
minigzip_stdio_cmp(minigzip "detect-binary" "test/data/paper-100k.pdf" -A)
if(NOT WIN32 AND ZLIB_COMPAT)
#endif
-#ifdef HAVE_BUILTIN_CTZLL
-/* UNALIGNED_OK, 64-bit integer comparison */
+#if defined(UNALIGNED64_OK) && defined(HAVE_BUILTIN_CTZLL)
+/* UNALIGNED64_OK, 64-bit integer comparison */
static inline int32_t compare256_unaligned_64_static(const unsigned char *src0, const unsigned char *src1) {
int32_t len = 0;
i386 | i486 | i586 | i686)
ARCHDIR=arch/x86
- CFLAGS="${CFLAGS} -DUNALIGNED_OK"
- SFLAGS="${SFLAGS} -DUNALIGNED_OK"
+ CFLAGS="${CFLAGS} -DUNALIGNED_OK -DUNALIGNED64_OK"
+ SFLAGS="${SFLAGS} -DUNALIGNED_OK -DUNALIGNED64_OK"
# Enable arch-specific optimizations?
if test $without_optimizations -eq 0; then
SFLAGS="${SFLAGS} -DX86_NOCHECK_SSE2"
fi
fi
-
+
if test ${HAVE_SSSE3_INTRIN} -eq 1; then
CFLAGS="${CFLAGS} -DX86_SSSE3 -DX86_SSSE3_ADLER32"
SFLAGS="${SFLAGS} -DX86_SSSE3 -DX86_SSSE3_ADLER32"
x86_64)
ARCHDIR=arch/x86
- CFLAGS="${CFLAGS} -DUNALIGNED_OK"
- SFLAGS="${SFLAGS} -DUNALIGNED_OK"
+ CFLAGS="${CFLAGS} -DUNALIGNED_OK -DUNALIGNED64_OK"
+ SFLAGS="${SFLAGS} -DUNALIGNED_OK -DUNALIGNED64_OK"
# Enable arch-specific optimizations?
if test $without_optimizations -eq 0; then
fi
;;
armv8-a | armv8-a+simd)
- CFLAGS="${CFLAGS} -DUNALIGNED_OK"
- SFLAGS="${SFLAGS} -DUNALIGNED_OK"
+ CFLAGS="${CFLAGS} -DUNALIGNED_OK -DUNALIGNED64_OK"
+ SFLAGS="${SFLAGS} -DUNALIGNED_OK -DUNALIGNED64_OK"
if test $without_optimizations -eq 0; then
if test $buildacle -eq 1; then
fi
;;
armv8-a+crc | armv8-a+crc+simd | armv8.[1234]-a | armv8.[1234]-a+simd)
- CFLAGS="-march=${ARCH} ${CFLAGS} -DUNALIGNED_OK"
- SFLAGS="-march=${ARCH} ${SFLAGS} -DUNALIGNED_OK"
+ CFLAGS="-march=${ARCH} ${CFLAGS} -DUNALIGNED_OK -DUNALIGNED64_OK"
+ SFLAGS="-march=${ARCH} ${SFLAGS} -DUNALIGNED_OK -DUNALIGNED64_OK"
if test $without_optimizations -eq 0; then
CFLAGS="${CFLAGS} -DARM_ACLE_CRC_HASH"
fi
fi
- CFLAGS="-march=${ARCH} ${CFLAGS} -DUNALIGNED_OK"
- SFLAGS="-march=${ARCH} ${SFLAGS} -DUNALIGNED_OK"
+ CFLAGS="-march=${ARCH} ${CFLAGS} -DUNALIGNED_OK -DUNALIGNED64_OK"
+ SFLAGS="-march=${ARCH} ${SFLAGS} -DUNALIGNED_OK -DUNALIGNED64_OK"
;;
powerpc*)
case "${ARCH}" in
;;
powerpc64le)
[ ! -z $CROSS_PREFIX ] && QEMU_ARCH=ppc64le
- CFLAGS="${CFLAGS} -DUNALIGNED_OK"
- SFLAGS="${SFLAGS} -DUNALIGNED_OK"
+ CFLAGS="${CFLAGS} -DUNALIGNED_OK -DUNALIGNED64_OK"
+ SFLAGS="${SFLAGS} -DUNALIGNED_OK -DUNALIGNED64_OK"
;;
esac
#ifdef UNALIGNED_OK
extern int32_t compare258_unaligned_16(const unsigned char *src0, const unsigned char *src1);
extern int32_t compare258_unaligned_32(const unsigned char *src0, const unsigned char *src1);
+#ifdef UNALIGNED64_OK
extern int32_t compare258_unaligned_64(const unsigned char *src0, const unsigned char *src1);
+#endif
#ifdef X86_SSE42_CMP_STR
extern int32_t compare258_unaligned_sse4(const unsigned char *src0, const unsigned char *src1);
#endif
#ifdef UNALIGNED_OK
extern int32_t longest_match_unaligned_16(deflate_state *const s, Pos cur_match);
extern int32_t longest_match_unaligned_32(deflate_state *const s, Pos cur_match);
+#ifdef UNALIGNED64_OK
extern int32_t longest_match_unaligned_64(deflate_state *const s, Pos cur_match);
+#endif
#ifdef X86_SSE42_CMP_STR
extern int32_t longest_match_unaligned_sse4(deflate_state *const s, Pos cur_match);
#endif
functable.compare258 = &compare258_c;
#ifdef UNALIGNED_OK
-# ifdef HAVE_BUILTIN_CTZLL
+# if defined(UNALIGNED64_OK) && defined(HAVE_BUILTIN_CTZLL)
functable.compare258 = &compare258_unaligned_64;
# elif defined(HAVE_BUILTIN_CTZ)
functable.compare258 = &compare258_unaligned_32;
functable.longest_match = &longest_match_c;
#ifdef UNALIGNED_OK
-# ifdef HAVE_BUILTIN_CTZLL
+# if defined(UNALIGNED64_OK) && defined(HAVE_BUILTIN_CTZLL)
functable.longest_match = &longest_match_unaligned_64;
# elif defined(HAVE_BUILTIN_CTZ)
functable.longest_match = &longest_match_unaligned_32;
RC = rc
CP = copy /y
CFLAGS = -nologo -MD -W3 -O2 -Oy- -Zi -Fd"zlib" $(LOC)
-WFLAGS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DUNALIGNED_OK -D_ARM64_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1
+WFLAGS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DUNALIGNED_OK -DUNALIGNED64_OK -D_ARM64_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1
LDFLAGS = -nologo -debug -incremental:no -opt:ref -manifest
ARFLAGS = -nologo
RCFLAGS = /dARM64 /r
RC = rc
CP = copy /y
CFLAGS = -nologo -MD -W3 -O2 -Oy- -Zi -Fd"zlib" $(LOC)
-WFLAGS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DX86_PCLMULQDQ_CRC -DX86_SSE2 -DX86_CPUID -DX86_SSE42_CRC_INTRIN -DX86_SSE42_CRC_HASH -DX86_AVX2 -DUNALIGNED_OK
+WFLAGS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DX86_PCLMULQDQ_CRC -DX86_SSE2 -DX86_CPUID -DX86_SSE42_CRC_INTRIN -DX86_SSE42_CRC_HASH -DX86_AVX2 -DUNALIGNED_OK -DUNALIGNED64_OK
LDFLAGS = -nologo -debug -incremental:no -opt:ref -manifest
ARFLAGS = -nologo
RCFLAGS = /dWIN32 /r