matrix:
name: [
Ubuntu GCC,
- Ubuntu GCC OSB -O1,
+ Ubuntu GCC OSB -O1 No Unaligned,
+ Ubuntu GCC -O3 No Unaligned,
Ubuntu GCC Link Zlib,
Ubuntu GCC No AVX2,
Ubuntu GCC No SSE2,
cmake-args: -DWITH_SANITIZERS=ON
codecov: ubuntu_gcc
- - name: Ubuntu GCC OSB -O1
+ - name: Ubuntu GCC OSB -O1 No Unaligned
os: ubuntu-latest
compiler: gcc
- cmake-args: -DWITH_SANITIZERS=ON
+ cmake-args: -DWITH_SANITIZERS=ON -DWITH_UNALIGNED=OFF
build-dir: ../build
build-src-dir: ../zlib-ng
codecov: ubuntu_gcc_osb
cflags: -O1 -g3
+ - name: Ubuntu GCC -O3 No Unaligned
+ os: ubuntu-latest
+ compiler: gcc
+ cmake-args: -DWITH_SANITIZERS=ON -DWITH_UNALIGNED=OFF
+ codecov: ubuntu_gcc_o3
+ cflags: -O3
+
- name: Ubuntu GCC Link Zlib
os: ubuntu-latest
compiler: gcc
option(WITH_CODE_COVERAGE "Enable code coverage reporting" OFF)
option(WITH_INFLATE_STRICT "Build with strict inflate distance checking" OFF)
option(WITH_INFLATE_ALLOW_INVALID_DIST "Build with zero fill for inflate invalid distances" OFF)
+option(WITH_UNALIGNED "Support unaligned reads on platforms that support it" ON)
if(BASEARCH_ARM_FOUND)
option(WITH_ACLE "Build with ACLE" ON)
WITH_POWER8
WITH_INFLATE_STRICT
WITH_INFLATE_ALLOW_INVALID_DIST
+ WITH_UNALIGNED
INSTALL_UTILS
)
endif()
# Set architecture alignment requirements
-if(BASEARCH_ARM_FOUND OR (BASEARCH_PPC_FOUND AND "${ARCH}" MATCHES "powerpc64le") OR BASEARCH_X86_FOUND)
- if(NOT DEFINED UNALIGNED_OK)
- set(UNALIGNED_OK TRUE)
+if(WITH_UNALIGNED)
+ if(BASEARCH_ARM_FOUND OR (BASEARCH_PPC_FOUND AND "${ARCH}" MATCHES "powerpc64le") OR BASEARCH_X86_FOUND)
+ if(NOT DEFINED UNALIGNED_OK)
+ set(UNALIGNED_OK TRUE)
+ endif()
endif()
-endif()
-if(UNALIGNED_OK)
- 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)
+ if(UNALIGNED_OK)
+ 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()
-endif()
-if(BASEARCH_PPC_FOUND)
- if(NOT DEFINED UNALIGNED64_OK)
- if("${ARCH}" MATCHES "powerpc64le")
+ 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()
-endif()
-if(BASEARCH_X86_FOUND)
- if(NOT DEFINED UNALIGNED64_OK)
- set(UNALIGNED64_OK TRUE)
+ if(UNALIGNED64_OK)
+ add_definitions(-DUNALIGNED64_OK)
+ message(STATUS "Architecture supports unaligned reads of > 4 bytes")
endif()
-endif()
-if(UNALIGNED64_OK)
- add_definitions(-DUNALIGNED64_OK)
- message(STATUS "Architecture supports unaligned reads of > 4 bytes")
+else()
+ message(STATUS "Unaligned reads manually disabled")
endif()
# Apply warning compiler flags
| CMake | configure | Description | Default |
|:--------------------------------|:----------------------|:--------------------------------------------------------------------|------------------------|
| ZLIB_DUAL_LINK | | Dual link tests with system zlib | OFF |
-| UNALIGNED_OK | | Allow unaligned reads | ON (x86, arm) |
| | --force-sse2 | Assume SSE2 instructions are always available | ON (x86), OFF (x86_64) |
| WITH_AVX2 | | Build with AVX2 intrinsics | ON |
| WITH_SSE2 | | Build with SSE2 intrinsics | ON |
| WITH_POWER8 | | Build with POWER8 optimisations | ON |
| WITH_DFLTCC_DEFLATE | --with-dfltcc-deflate | Use DEFLATE COMPRESSION CALL instruction for compression on IBM Z | OFF |
| WITH_DFLTCC_INFLATE | --with-dfltcc-inflate | Use DEFLATE COMPRESSION CALL instruction for decompression on IBM Z | OFF |
+| WITH_UNALIGNED | | Allow optimizations that use unaligned reads if safe on current arch| ON |
| WITH_INFLATE_STRICT | | Build with strict inflate distance checking | OFF |
| WITH_INFLATE_ALLOW_INVALID_DIST | | Build with zero fill for inflate invalid distances | OFF |
| INSTALL_UTILS | | Copy minigzip and minideflate during install | OFF |