zlib-ng/cmake/detect-intrinsics.cmake
yintong 10b51fa592
Some checks failed
Static Analysis / GCC (push) Has been cancelled
Static Analysis / Clang (push) Has been cancelled
CMake / ${{ matrix.name }} (${{ github.repository != 'zlib-ng/zlib-ng' && '-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-s390x.cmake -DZLIB_COMPAT=ON' || '-GNinja -DWITH_SANITIZER=Memory' }} -DWITH_DFLTCC_DEFLATE=ON -DWITH_DFLTCC_INFLATE=ON, ${{ github.repository == … (push) Has been cancelled
CMake / ${{ matrix.name }} (${{ github.repository != 'zlib-ng/zlib-ng' && '-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-s390x.cmake' || '' }} -DWITH_DFLTCC_DEFLATE=ON -DWITH_DFLTCC_INFLATE=ON -DWITH_SANITIZER=Undefined, ${{ github.repository == 'zlib-ng/zlib-ng' && … (push) Has been cancelled
CMake / ${{ matrix.name }} (-A ARM,version=10.0.22621.0, cl, Windows MSVC ARM No Test, windows-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-A ARM64, cl, Windows MSVC ARM64 No Test, windows-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_SHARED_LINKER_FLAGS=-m32 -DCMAKE_EXE_LINKER_FLAGS=-m32 -DWITH_BENCHMARKS=ON, ubuntu_gcc_m32, gcc, g++, Ubuntu GCC 32-bit, ubuntu-latest, gcc-multilib g++-multilib) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_OSX_DEPLOYMENT_TARGET=10.10 -DWITH_BENCHMARKS=ON, clang, clang++, -ld_classic, macOS Clang (Target 10.10), macos-13) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-aarch64.cmake -DWITH_ARMV8=OFF -DWITH_SANITIZER=Undefined, ubuntu_gcc_aarch64_no_armv8, aarch64-linux-gnu-gcov, Ubuntu GCC AARCH64 No ARMv8 UBSAN, ubuntu-22.04, qemu-user gcc-aarch64-linux-gnu … (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-aarch64.cmake -DWITH_NEON=OFF -DWITH_SANITIZER=Undefined, ubuntu_gcc_aarch64_no_neon, aarch64-linux-gnu-gcov, Ubuntu GCC AARCH64 No NEON UBSAN, ubuntu-22.04, qemu-user gcc-aarch64-linux-gnu g++… (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-aarch64.cmake -DZLIB_COMPAT=ON -DWITH_NEW_STRATEGIES=OFF -DWITH_OPTIM=OFF -DWITH_SANITIZER=Undefined, ubuntu_gcc_aarch64_compat_no_opt, aarch64-linux-gnu-gcov, Ubuntu GCC AARCH64 Compat No Opt … (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-arm.cmake -DZLIB_COMPAT=ON -DWITH_NEW_STRATEGIES=OFF -DWITH_OPTIM=OFF -DWITH_SANITIZER=Undefined, ubuntu_gcc_armsf_compat_no_opt, arm-linux-gnueabi-gcov, Ubuntu GCC ARM SF Compat No Opt UBSAN, … (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-armhf.cmake -DZLIB_COMPAT=ON -DWITH_NEW_STRATEGIES=OFF -DWITH_OPTIM=OFF -DWITH_SANITIZER=Undefined, ubuntu_gcc_armhf_compat_no_opt, arm-linux-gnueabihf-gcov, Ubuntu GCC ARM HF Compat No Opt UBS… (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw-i686.cmake, ubuntu_gcc_mingw_i686, i686-w64-mingw32-gcov-posix, -static, Ubuntu MinGW i686, ubuntu-22.04, wine wine32 gcc-mingw-w64-i686 g++-mingw-w64-i686 libpcre2-8-0=10.39-3ubuntu0.1 l… (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw-x86_64.cmake -DWITH_BENCHMARKS=ON, ubuntu_gcc_mingw_x86_64, -Wno-unused-parameter, x86_64-w64-mingw32-gcov-posix, -static, Ubuntu MinGW x86_64, ubuntu-latest, wine wine64 gcc-mingw-w64 g+… (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mips.cmake, ubuntu_gcc_mips, mips-linux-gnu-gcov, Ubuntu GCC MIPS, ubuntu-latest, qemu-user crossbuild-essential-mips) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mips64.cmake -DWITH_BENCHMARKS=ON, ubuntu_gcc_mips64, mips64-linux-gnuabi64-gcov, Ubuntu GCC MIPS64, ubuntu-latest, qemu-user crossbuild-essential-mips64) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc.cmake -DWITH_POWER8=OFF, ubuntu_gcc_ppc_no_power8, powerpc-linux-gnu-gcov, Ubuntu GCC PPC No Power8, ubuntu-latest, qemu-user crossbuild-essential-powerpc) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc.cmake, ubuntu_gcc_ppc, powerpc-linux-gnu-gcov, Ubuntu GCC PPC, ubuntu-latest, qemu-user crossbuild-essential-powerpc) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64-clang.cmake, Ubuntu Clang PPC64 Power9, ubuntu-latest, qemu-user clang binutils-powerpc64-linux-gnu libgcc-11-dev-ppc64-cross libc-dev-ppc64-cross libstdc++-11-dev-ppc64-cross) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64-power9.cmake, ubuntu_gcc_ppc64_power9, powerpc64-linux-gnu-gcov, -static, Ubuntu GCC PPC64 Power9, ubuntu-latest, qemu-user gcc-powerpc64-linux-gnu g++-powerpc64-linux-gnu libc-dev-pp… (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64.cmake -DWITH_BENCHMARKS=ON, ubuntu_gcc_ppc64, powerpc64-linux-gnu-gcov, -static, Ubuntu GCC PPC64, ubuntu-latest, qemu-user gcc-powerpc64-linux-gnu g++-powerpc64-linux-gnu libc-dev-pp… (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64le-clang.cmake, Ubuntu Clang PPC64LE Power9, ubuntu-latest, qemu-user crossbuild-essential-ppc64el) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64le-power9.cmake -DWITH_POWER8=OFF -DWITH_POWER9=OFF, ubuntu_gcc_ppc64le_novsx, powerpc64le-linux-gnu-gcov, Ubuntu GCC PPC64LE No VSX, ubuntu-latest, qemu-user crossbuild-essential-ppc6… (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64le-power9.cmake, ubuntu_gcc_ppc64le_power9, powerpc64le-linux-gnu-gcov, Ubuntu GCC PPC64LE Power9, ubuntu-latest, qemu-user crossbuild-essential-ppc64el) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-riscv-clang.cmake, Ubuntu Clang RISC-V, ubuntu-latest, qemu-user crossbuild-essential-riscv64) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-riscv.cmake -DWITH_BENCHMARKS=ON, ubuntu_gcc_riscv64, riscv64-linux-gnu-gcov, Ubuntu GCC RISC-V, ubuntu-latest, qemu-user crossbuild-essential-riscv64) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-sparc64.cmake, ubuntu_gcc_sparc64, sparc64-linux-gnu-gcov, -static, Ubuntu GCC SPARC64, ubuntu-latest, qemu-user gcc-sparc64-linux-gnu g++-sparc64-linux-gnu libc-dev-sparc64-cross) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DNOT_TWEAK_COMPILER, -DZLIB_COMPAT=ON -DWITH_NEW_STRATEGIES=OFF -DWITH_OPTIM=OFF -DWITH_SANITIZER=Address, ubuntu_gcc_compat_no_opt, gcc, g++, Ubuntu GCC Compat No Opt ASAN, ubuntu-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DUSE_MMAP, ubuntu_clang_mmap, clang-15, clang++-15, llvm-cov-15 gcov, Ubuntu Clang Memory Map, ubuntu-latest, clang-15 llvm-15 llvm-15-tools) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DWITH_AVX2=OFF -DWITH_AVX512=OFF -DWITH_SANITIZER=Undefined, ubuntu_gcc_sse42, gcc, g++, Ubuntu GCC SSE4.2 UBSAN, ubuntu-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DWITH_CHORBA=OFF, ubuntu_gcc_no_chorba, gcc, g++, Ubuntu GCC No Chorba, ubuntu-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DWITH_INFLATE_ALLOW_INVALID_DIST=ON, ubuntu_clang_inflate_allow_invalid_dist, clang-15, clang++-15, llvm-cov-15 gcov, Ubuntu Clang Inflate Allow Invalid Dist, ubuntu-latest, clang-15 llvm-15 llvm-15-tools) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DWITH_INFLATE_STRICT=ON, ubuntu_clang_inflate_strict, clang-15, clang++-15, llvm-cov-15 gcov, Ubuntu Clang Inflate Strict, ubuntu-latest, clang-15 llvm-15 llvm-15-tools) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DWITH_NATIVE_INSTRUCTIONS=ON -DNATIVE_ARCH_OVERRIDE="-mavx -mpclmul", ubuntu_gcc_native_inst_avx, gcc, g++, Ubuntu GCC Native Instructions (AVX), ubuntu-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DWITH_NATIVE_INSTRUCTIONS=ON, clang, clang++, macOS Clang Native Instructions (ARM64), macos-14) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DWITH_NATIVE_INSTRUCTIONS=ON, ubuntu_gcc_native_inst, gcc, g++, Ubuntu GCC Native Instructions, ubuntu-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DWITH_OPTIM=OFF -DHAVE_BUILTIN_CTZLL=OFF -DHAVE_BUILTIN_CTZ=OFF, ubuntu_gcc_no_ctz, gcc, g++, Ubuntu GCC No CTZ, ubuntu-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DWITH_OPTIM=OFF -DHAVE_BUILTIN_CTZLL=OFF, ubuntu_gcc_no_ctzll, gcc, g++, Ubuntu GCC No CTZLL, ubuntu-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DWITH_PCLMULQDQ=OFF -DWITH_SANITIZER=Undefined, ubuntu_gcc_no_pclmulqdq, gcc, g++, Ubuntu GCC No PCLMULQDQ UBSAN, ubuntu-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DWITH_REDUCED_MEM=ON, ubuntu_clang_reduced_mem, clang-15, clang++-15, llvm-cov-15 gcov, Ubuntu Clang Reduced Memory, ubuntu-latest, clang-15 llvm-15 llvm-15-tools) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DWITH_SANITIZER=Address -DWITH_BENCHMARKS=ON, ubuntu_gcc, gcc, g++, -Wno-maybe-uninitialized, Ubuntu GCC ASAN, ubuntu-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DWITH_SANITIZER=Address, macos_clang, clang, clang++, macOS Clang ASAN, macos-13) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DWITH_SANITIZER=Address, macos_clang_arm64, clang, clang++, macOS Clang ASAN (ARM64), macos-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DWITH_SANITIZER=Undefined, macos_gcc, gcc-10, g++-10, gcov-10, -ld_classic, macOS GCC UBSAN, macos-13, gcc@10) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DWITH_SANITIZER=Undefined, macos_gcc_arm64, gcc-13, g++-13, gcov-13, macOS GCC UBSAN (ARM64), macos-latest, gcc@13) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DWITH_SSE42=OFF -DWITH_AVX2=OFF -DWITH_AVX512=OFF -DWITH_SANITIZER=Undefined, ubuntu_gcc_ssse3, gcc, g++, Ubuntu GCC SSSE3 UBSAN, ubuntu-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DWITH_SSSE3=OFF -DWITH_SSE42=OFF -DWITH_AVX2=OFF -DWITH_AVX512=OFF -DWITH_SANITIZER=Undefined, ubuntu_gcc_sse2, gcc, g++, Ubuntu GCC SSE2 UBSAN, ubuntu-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DZLIB_COMPAT=ON -DZLIB_SYMBOL_PREFIX=zTest_, ubuntu_gcc_compat_sprefix, gcc, g++, Ubuntu GCC Compat Symbol Prefix, ubuntu-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-DZLIB_SYMBOL_PREFIX=zTest_, ubuntu_gcc_sprefix, gcc, g++, Ubuntu GCC Symbol Prefix, ubuntu-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-G "Visual Studio 16 2019" -A Win32 -T v140, cl, Windows MSVC 2019 v140 Win32, windows-2019) (push) Has been cancelled
CMake / ${{ matrix.name }} (-G "Visual Studio 16 2019" -A Win32 -T v141, cl, Windows MSVC 2019 v141 Win32, windows-2019) (push) Has been cancelled
CMake / ${{ matrix.name }} (-G "Visual Studio 16 2019" -A x64 -T v140, cl, Windows MSVC 2019 v140 Win64, windows-2019) (push) Has been cancelled
CMake / ${{ matrix.name }} (-G "Visual Studio 16 2019" -A x64 -T v141, cl, Windows MSVC 2019 v141 Win64, windows-2019) (push) Has been cancelled
CMake / ${{ matrix.name }} (-G "Visual Studio 17 2022" -A Win32 -T v142, cl, Windows MSVC 2022 v142 Win32, windows-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-G "Visual Studio 17 2022" -A Win32 -T v143, cl, Windows MSVC 2022 v143 Win32, windows-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-G "Visual Studio 17 2022" -A x64 -T v142, cl, Windows MSVC 2022 v142 Win64, windows-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-G "Visual Studio 17 2022" -A x64 -T v143 -DWITH_NATIVE_INSTRUCTIONS=ON -DNATIVE_ARCH_OVERRIDE=/arch:AVX, cl, Windows MSVC 2022 v143 Win64 Native Instructions (AVX), windows-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-G "Visual Studio 17 2022" -A x64 -T v143, cl, Windows MSVC 2022 v143 Win64, windows-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-G Ninja -DWITH_NATIVE_INSTRUCTIONS=ON -DNATIVE_ARCH_OVERRIDE="-mavx -mpclmul", gcc, g++, Windows GCC Native Instructions (AVX), windows-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-G Ninja -DZLIB_COMPAT=ON -DWITH_NEW_STRATEGIES=OFF -DWITH_OPTIM=OFF, win64_gcc_compat_no_opt, gcc, g++, Windows GCC Compat No Opt, windows-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-G Ninja, win64_gcc, gcc, g++, Windows GCC, windows-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-GNinja -DWITH_SANITIZER=Memory, clang-15, clang++-15, llvm-cov-15 gcov, use_sigaltstack=0, Ubuntu Clang MSAN, ubuntu-latest, ninja-build clang-15 llvm-15-tools libclang-rt-15-dev) (push) Has been cancelled
CMake / ${{ matrix.name }} (-O1, -DWITH_SANITIZER=Undefined, ubuntu_gcc_o1, gcc, g++, Ubuntu GCC -O1 UBSAN, ubuntu-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-T ClangCl -A Win32, Windows ClangCl Win32, windows-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-T ClangCl -A x64 -DWITH_NATIVE_INSTRUCTIONS=ON -DNATIVE_ARCH_OVERRIDE="-mavx -mpclmul", Windows ClangCl Win64 Native Instructions (AVX), windows-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-T ClangCl -A x64, Windows ClangCl Win64, windows-latest) (push) Has been cancelled
CMake / ${{ matrix.name }} (-mcpu=power8, -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64le.cmake -DWITH_GTEST=OFF, ubuntu_gcc_ppc64le, -mcpu=power8, powerpc64le-linux-gnu-gcov, Ubuntu GCC PPC64LE, ubuntu-latest, qemu-user crossbuild-essential-ppc64el) (push) Has been cancelled
CMake / ${{ matrix.name }} (../build, ../zlib-ng, -O3, ubuntu_gcc_osb, gcc, g++, Ubuntu GCC -O3 OSB, ubuntu-latest, true) (push) Has been cancelled
CMake / ${{ matrix.name }} (../build, ../zlib-ng/test/add-subdirectory-project, gcc, g++, Ubuntu GCC -O3 OSB add_subdirectory, ubuntu-latest, true) (push) Has been cancelled
CMake / ${{ matrix.name }} (Debug, ubuntu_clang_debug, clang-15, clang++-15, llvm-cov-15 gcov, Ubuntu Clang Debug, ubuntu-latest, clang-15 llvm-15 llvm-15-tools) (push) Has been cancelled
CMake / ${{ matrix.name }} (ON, -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld -Wl,--no-undefined-version" -DZLIBNG_ENABLE_TESTS=OFF -DZLIB_COMPAT=ON, clang-15, clang++-15, Ubuntu Clang Undefined Symbols Compat, ubuntu-latest, clang-15 llvm-15 lld) (push) Has been cancelled
CMake / ${{ matrix.name }} (ON, -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld -Wl,--no-undefined-version" -DZLIBNG_ENABLE_TESTS=OFF, clang-15, clang++-15, Ubuntu Clang Undefined Symbols, ubuntu-latest, clang-15 llvm-15 lld) (push) Has been cancelled
CMake / ${{ matrix.name }} (detect_leaks=0, ${{ github.repository != 'zlib-ng/zlib-ng' && '-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-s390x.cmake' || '' }} -DWITH_DFLTCC_DEFLATE=ON -DWITH_DFLTCC_INFLATE=ON -DWITH_SANITIZER=Address -DWITH_BENCHMARKS=ON, ${{ github.… (push) Has been cancelled
CMake / ${{ matrix.name }} (detect_leaks=0, -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-aarch64.cmake -DWITH_SANITIZER=Address -DWITH_BENCHMARKS=ON, ubuntu_gcc_aarch64, aarch64-linux-gnu-gcov, Ubuntu GCC AARCH64 ASAN, ubuntu-22.04, qemu-user gcc-aarch64-linux-gnu g… (push) Has been cancelled
CMake / ${{ matrix.name }} (detect_leaks=0, -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-arm.cmake -DWITH_SANITIZER=Address, ubuntu_gcc_armsf, arm-linux-gnueabi-gcov, Ubuntu GCC ARM SF ASAN, ubuntu-latest, qemu-user crossbuild-essential-armel) (push) Has been cancelled
CMake / ${{ matrix.name }} (detect_leaks=0, -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-armhf.cmake -DWITH_ARMV8=OFF -DWITH_SANITIZER=Address, ubuntu_gcc_armhf_no_armv8, arm-linux-gnueabihf-gcov, Ubuntu GCC ARM HF No ARMv8 ASAN, ubuntu-latest, qemu-user crossbuild-… (push) Has been cancelled
CMake / ${{ matrix.name }} (detect_leaks=0, -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-armhf.cmake -DWITH_NEON=OFF -DWITH_SANITIZER=Address, ubuntu_gcc_armhf_no_neon, arm-linux-gnueabihf-gcov, Ubuntu GCC ARM HF No NEON ASAN, ubuntu-latest, qemu-user crossbuild-ess… (push) Has been cancelled
CMake / ${{ matrix.name }} (detect_leaks=0, -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-armhf.cmake -DWITH_SANITIZER=Address -DWITH_BENCHMARKS=ON, ubuntu_gcc_armhf, -Wno-psabi -Wno-maybe-uninitialized, arm-linux-gnueabihf-gcov, Ubuntu GCC ARM HF ASAN, ubuntu-latest… (push) Has been cancelled
CMake / ${{ matrix.name }} (detect_leaks=0, -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-s390x.cmake -DWITH_CRC32_VX=OFF -DWITH_SANITIZER=Address, ubuntu_gcc_s390x_no_crc32, s390x-linux-gnu-gcov, -static, Ubuntu GCC S390X No vectorized CRC32 ASAN, ubuntu-latest, qem… (push) Has been cancelled
CMake / ${{ matrix.name }} (detect_leaks=0, -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-s390x.cmake -DWITH_SANITIZER=Address -DWITH_BENCHMARKS=ON, ubuntu_gcc_s390x, s390x-linux-gnu-gcov, -static, Ubuntu GCC S390X ASAN, ubuntu-latest, qemu-user crossbuild-essential-… (push) Has been cancelled
CMake / ${{ matrix.name }} (ubuntu_clang, clang-15, clang++-15, llvm-cov-15 gcov, Ubuntu Clang, ubuntu-latest, clang-15 llvm-15 llvm-15-tools) (push) Has been cancelled
CMake / ${{ matrix.name }} (wasm32, -DCMAKE_TOOLCHAIN_FILE=${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_C_COMPILER_TARGET=wasm32 -DCMAKE_CROSSCOMPILING_EMULATOR=${EMSDK_NODE} -DZLIB_COMPAT=ON, Ubuntu Emscripten WASM32, ubuntu-la… (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
Configure / ${{ matrix.name }} (${{ github.repository != 'zlib-ng/zlib-ng' && '-static' || '' }}, ${{ github.repository != 'zlib-ng/zlib-ng' && 's390x-linux-gnu' || '' }}, ${{ github.repository == 'zlib-ng/zlib-ng' && 'gcc' || 's390x-linux-gnu-gcc' }}, --warn --s… (push) Has been cancelled
Configure / ${{ matrix.name }} (${{ github.repository != 'zlib-ng/zlib-ng' && '-static' || '' }}, ${{ github.repository != 'zlib-ng/zlib-ng' && 's390x-linux-gnu' || '' }}, ${{ github.repository == 'zlib-ng/zlib-ng' && 'gcc' || 's390x-linux-gnu-gcc' }}, --warn --z… (push) Has been cancelled
Configure / ${{ matrix.name }} (-static, powerpc-linux-gnu, powerpc-linux-gnu-gcc, --warn --static, -static, Ubuntu GCC PPC, ubuntu-latest, qemu-user gcc-powerpc-linux-gnu libc-dev-powerpc-cross) (push) Has been cancelled
Configure / ${{ matrix.name }} (-static, powerpc-linux-gnu, powerpc64-linux-gnu-gcc, --warn --static, -static, Ubuntu GCC PPC64, ubuntu-latest, qemu-user gcc-powerpc64-linux-gnu libc-dev-ppc64-cross) (push) Has been cancelled
Configure / ${{ matrix.name }} (-static, s390x-linux-gnu, s390x-linux-gnu-gcc, --warn --static --without-crc32-vx, -static, Ubuntu GCC S390X No vectorized CRC32, ubuntu-latest, qemu-user gcc-s390x-linux-gnu libc-dev-s390x-cross) (push) Has been cancelled
Configure / ${{ matrix.name }} (-static, s390x-linux-gnu, s390x-linux-gnu-gcc, --warn --static, -static, Ubuntu GCC S390X, ubuntu-latest, qemu-user gcc-s390x-linux-gnu libc-dev-s390x-cross) (push) Has been cancelled
Configure / ${{ matrix.name }} (-static, wasm32, --warn --zlib-compat --static, emconfigure, node, -static, Ubuntu Emscripten WASM32, ubuntu-latest) (push) Has been cancelled
Configure / ${{ matrix.name }} (-std=gnu11, gcc-11, --sprefix=zTest_, macOS GCC Symbol Prefix (ARM64), macos-latest, gcc@11) (push) Has been cancelled
Configure / ${{ matrix.name }} (-std=gnu11, gcc-11, --warn, macOS GCC (ARM64), macos-latest, gcc@11) (push) Has been cancelled
Configure / ${{ matrix.name }} (-std=gnu11, gcc-11, --zlib-compat --sprefix=zTest_, macOS GCC Symbol Prefix & Compat (ARM64), macos-latest, gcc@11) (push) Has been cancelled
Configure / ${{ matrix.name }} (../build, ../zlib-ng, gcc, --warn, Ubuntu GCC OSB, ubuntu-latest) (push) Has been cancelled
Configure / ${{ matrix.name }} (aarch64-linux-gnu, aarch64-linux-gnu-gcc, --warn --without-armv8, Ubuntu GCC AARCH64 No ARMv8, ubuntu-latest, qemu-user gcc-aarch64-linux-gnu libc-dev-arm64-cross) (push) Has been cancelled
Configure / ${{ matrix.name }} (aarch64-linux-gnu, aarch64-linux-gnu-gcc, --warn --without-neon, Ubuntu GCC AARCH64 No NEON, ubuntu-latest, qemu-user gcc-aarch64-linux-gnu libc-dev-arm64-cross) (push) Has been cancelled
Configure / ${{ matrix.name }} (aarch64-linux-gnu, aarch64-linux-gnu-gcc, --warn --zlib-compat --without-optimizations --without-new-strategies, Ubuntu GCC AARCH64 Compat No Opt, ubuntu-latest, qemu-user gcc-aarch64-linux-gnu libc-dev-arm64-cross) (push) Has been cancelled
Configure / ${{ matrix.name }} (aarch64-linux-gnu, aarch64-linux-gnu-gcc, --warn, Ubuntu GCC AARCH64, ubuntu-latest, qemu-user gcc-aarch64-linux-gnu libc-dev-arm64-cross) (push) Has been cancelled
Configure / ${{ matrix.name }} (arm-linux-gnueabi, arm-linux-gnueabi-gcc, --warn --zlib-compat --without-optimizations --without-new-strategies, Ubuntu GCC ARM SF Compat No Opt, ubuntu-latest, qemu-user gcc-arm-linux-gnueabi libc-dev-armel-cross) (push) Has been cancelled
Configure / ${{ matrix.name }} (arm-linux-gnueabi, arm-linux-gnueabi-gcc, --warn, Ubuntu GCC ARM SF, ubuntu-latest, qemu-user gcc-arm-linux-gnueabi libc-dev-armel-cross) (push) Has been cancelled
Configure / ${{ matrix.name }} (arm-linux-gnueabihf, arm-linux-gnueabihf-gcc, --warn --without-armv8, Ubuntu GCC ARM HF No ARMv8, ubuntu-latest, qemu-user gcc-arm-linux-gnueabihf libc-dev-armel-cross) (push) Has been cancelled
Configure / ${{ matrix.name }} (arm-linux-gnueabihf, arm-linux-gnueabihf-gcc, --warn --without-neon, Ubuntu GCC ARM HF No NEON, ubuntu-latest, qemu-user gcc-arm-linux-gnueabihf libc-dev-armel-cross) (push) Has been cancelled
Configure / ${{ matrix.name }} (arm-linux-gnueabihf, arm-linux-gnueabihf-gcc, --warn --zlib-compat --without-optimizations --without-new-strategies, Ubuntu GCC ARM HF Compat No Opt, ubuntu-latest, qemu-user gcc-arm-linux-gnueabihf libc-dev-armel-cross) (push) Has been cancelled
Configure / ${{ matrix.name }} (arm-linux-gnueabihf, arm-linux-gnueabihf-gcc, --warn, Ubuntu GCC ARM HF, ubuntu-latest, qemu-user gcc-arm-linux-gnueabihf libc-dev-armel-cross) (push) Has been cancelled
Configure / ${{ matrix.name }} (gcc, --warn --zlib-compat --without-optimizations --without-new-strategies, Ubuntu GCC Compat No Opt, ubuntu-latest) (push) Has been cancelled
Configure / ${{ matrix.name }} (gcc, --warn, Ubuntu GCC, ubuntu-latest) (push) Has been cancelled
Configure / ${{ matrix.name }} (gcc-11, --sprefix=zTest_, macOS GCC Symbol Prefix, macos-13, gcc@11) (push) Has been cancelled
Configure / ${{ matrix.name }} (gcc-11, --warn, macOS GCC, macos-13, gcc@11) (push) Has been cancelled
Configure / ${{ matrix.name }} (gcc-11, --zlib-compat --sprefix=zTest_, macOS GCC Symbol Prefix & Compat, macos-13, gcc@11) (push) Has been cancelled
Configure / ${{ matrix.name }} (mips-linux-gnu, mips-linux-gnu-gcc, --warn, Ubuntu GCC MIPS, ubuntu-latest, qemu-user gcc-mips-linux-gnu libc-dev-mips-cross) (push) Has been cancelled
Configure / ${{ matrix.name }} (mips64-linux-gnuabi64, mips64-linux-gnuabi64-gcc, --warn, Ubuntu GCC MIPS64, ubuntu-latest, qemu-user gcc-mips64-linux-gnuabi64 libc-dev-mips64-cross) (push) Has been cancelled
Configure / ${{ matrix.name }} (powerpc-linux-gnu, powerpc-linux-gnu-gcc, --warn --without-power8, Ubuntu GCC PPC No Power8, ubuntu-latest, qemu-user gcc-powerpc-linux-gnu libc-dev-powerpc-cross) (push) Has been cancelled
Configure / ${{ matrix.name }} (powerpc64le-linux-gnu, powerpc64le-linux-gnu-gcc, --warn, Ubuntu GCC PPC64LE, ubuntu-latest, qemu-user gcc-powerpc64le-linux-gnu libc-dev-ppc64el-cross) (push) Has been cancelled
OSS-Fuzz / Fuzzing (push) Has been cancelled
Libpng / Ubuntu Clang (push) Has been cancelled
Link / Link zlib (push) Has been cancelled
Link / Link zlib-ng compat (push) Has been cancelled
Pigz / ${{ matrix.name }} (-DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchain-aarch64.cmake, ubuntu_gcc_pigz_aarch64, Ubuntu GCC AARCH64, ubuntu-latest, qemu-user gcc-aarch64-linux-gnu libc-dev-arm64-cross) (push) Has been cancelled
Pigz / ${{ matrix.name }} (-DWITH_OPTIM=OFF, ubuntu_clang_pigz_no_optim, clang, llvm-cov-15 gcov, Ubuntu Clang No Optim, ubuntu-latest, llvm-15 llvm-15-tools) (push) Has been cancelled
Pigz / ${{ matrix.name }} (-DWITH_THREADS=OFF -DPIGZ_VERSION=v2.6, ubuntu_clang_pigz_no_threads, clang, llvm-cov-15 gcov, Ubuntu Clang No Threads, ubuntu-latest, llvm-15 llvm-15-tools) (push) Has been cancelled
Pigz / ${{ matrix.name }} (-DZLIB_SYMBOL_PREFIX=zTest_, ubuntu_gcc_pigz, gcc, Ubuntu GCC Symbol Prefix, ubuntu-latest) (push) Has been cancelled
Pigz / ${{ matrix.name }} (ubuntu_clang_pigz, clang, llvm-cov-15 gcov, Ubuntu Clang, ubuntu-latest, llvm-15 llvm-15-tools) (push) Has been cancelled
Pigz / ${{ matrix.name }} (ubuntu_gcc_pigz, gcc, Ubuntu GCC, ubuntu-latest) (push) Has been cancelled
Package Check / ${{ matrix.name }} (-DZLIB_SYMBOL_PREFIX=zTest_, clang, --sprefix=zTest_, clang++, macOS Clang Symbol Prefix, macOS-latest) (push) Has been cancelled
Package Check / ${{ matrix.name }} (-m32, -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32, gcc, g++, -m32, -m32, Ubuntu GCC -m32, ubuntu-latest, gcc-multilib g++-multilib) (push) Has been cancelled
Package Check / ${{ matrix.name }} (aarch64-linux-gnu, -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-aarch64.cmake, aarch64-linux-gnu-gcc, aarch64-linux-gnu-g++, Ubuntu GCC AARCH64, ubuntu-latest, qemu-user gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross) (push) Has been cancelled
Package Check / ${{ matrix.name }} (arm-linux-gnueabihf, -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-armhf.cmake, arm-linux-gnueabihf-gcc, arm-linux-gnueabihf-g++, Ubuntu GCC ARM HF, ubuntu-latest, qemu-user gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-dev-armhf-c… (push) Has been cancelled
Package Check / ${{ matrix.name }} (clang, clang++, macOS Clang, macOS-latest) (push) Has been cancelled
Package Check / ${{ matrix.name }} (gcc, g++, Ubuntu GCC, ubuntu-latest) (push) Has been cancelled
Package Check / ${{ matrix.name }} (mips-linux-gnu, -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mips.cmake, mips-linux-gnu-gcc, mips-linux-gnu-g++, Ubuntu GCC MIPS, ubuntu-latest, qemu-user gcc-mips-linux-gnu g++-mips-linux-gnu libc6-dev-mips-cross) (push) Has been cancelled
Package Check / ${{ matrix.name }} (mips64-linux-gnuabi64, -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mips64.cmake, mips64-linux-gnuabi64-gcc, mips64-linux-gnuabi64-g++, Ubuntu GCC MIPS64, ubuntu-latest, qemu-user gcc-mips64-linux-gnuabi64 g++-mips64-linux-gnuabi64 libc6-… (push) Has been cancelled
Package Check / ${{ matrix.name }} (powerpc-linux-gnu, -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc.cmake, powerpc-linux-gnu-gcc, powerpc-linux-gnu-g++, Ubuntu GCC PPC, ubuntu-latest, qemu-user gcc-powerpc-linux-gnu g++-powerpc-linux-gnu libc6-dev-powerpc-cross) (push) Has been cancelled
Package Check / ${{ matrix.name }} (powerpc64le-linux-gnu, -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64le.cmake, powerpc64le-linux-gnu-gcc, powerpc64le-linux-gnu-g++, Ubuntu GCC PPC64LE, ubuntu-latest, qemu-user gcc-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu … (push) Has been cancelled
CMake / Upload Coverage Reports (push) Has been cancelled
Pigz / Upload Coverage Reports (push) Has been cancelled
riscv: add crc32 optimization using zbc extension
2025-04-27 18:23:50 +02:00

679 lines
24 KiB
CMake

# detect-intrinsics.cmake -- Detect compiler intrinsics support
# Licensed under the Zlib license, see LICENSE.md for details
macro(check_armv8_compiler_flag)
if(NOT NATIVEFLAG)
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
check_c_compiler_flag("-march=armv8-a+crc" HAVE_MARCH_ARMV8_CRC)
if(HAVE_MARCH_ARMV8_CRC)
set(ARMV8FLAG "-march=armv8-a+crc" CACHE INTERNAL "Compiler option to enable ARMv8 support")
else()
check_c_compiler_flag("-march=armv8-a+crc+simd" HAVE_MARCH_ARMV8_CRC_SIMD)
if(HAVE_MARCH_ARMV8_CRC_SIMD)
set(ARMV8FLAG "-march=armv8-a+crc+simd" CACHE INTERNAL "Compiler option to enable ARMv8 support")
else()
check_c_compiler_flag("-Wa,-march=armv8-a+crc" HAVE_WA_MARCH_ARMV8_CRC)
if(HAVE_WA_MARCH_ARMV8_CRC)
set(ARMV8FLAG "-Wa,-march=armv8-a+crc" CACHE INTERNAL "Compiler option to enable ARMv8 support")
else()
check_c_compiler_flag("-Wa,-march=armv8-a+crc+simd" HAVE_WA_MARCH_ARMV8_CRC_SIMD)
if(HAVE_WA_MARCH_ARMV8_CRC_SIMD)
set(ARMV8FLAG "-Wa,-march=armv8-a+crc+simd" CACHE INTERNAL "Compiler option to enable ARMv8 support")
endif()
endif()
endif()
endif()
endif()
endif()
# Check whether compiler supports ARMv8 inline asm
set(CMAKE_REQUIRED_FLAGS "${ARMV8FLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"unsigned int f(unsigned int a, unsigned int b) {
unsigned int c;
#ifdef __aarch64__
__asm__ __volatile__ ( \"crc32w %w0, %w1, %w2\" : \"=r\" (c) : \"r\" (a), \"r\" (b));
#else
__asm__ __volatile__ ( \"crc32w %0, %1, %2\" : \"=r\" (c) : \"r\" (a), \"r\" (b));
#endif
return (int)c;
}
int main(void) { return f(1,2); }"
HAVE_ARMV8_INLINE_ASM
)
# Check whether compiler supports ARMv8 intrinsics
check_c_source_compiles(
"#if defined(_MSC_VER)
#include <intrin.h>
#else
#include <arm_acle.h>
#endif
unsigned int f(unsigned int a, unsigned int b) {
return __crc32w(a, b);
}
int main(void) { return 0; }"
HAVE_ARMV8_INTRIN
)
set(CMAKE_REQUIRED_FLAGS)
endmacro()
macro(check_armv6_compiler_flag)
if(NOT NATIVEFLAG)
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
check_c_compiler_flag("-march=armv6" HAVE_MARCH_ARMV6)
if(HAVE_MARCH_ARMV6)
set(ARMV6FLAG "-march=armv6" CACHE INTERNAL "Compiler option to enable ARMv6 support")
else()
check_c_compiler_flag("-Wa,-march=armv6" HAVE_WA_MARCH_ARMV6)
if(HAVE_WA_MARCH_ARMV6)
set(ARMV6FLAG "-Wa,-march=armv6" CACHE INTERNAL "Compiler option to enable ARMv6 support")
endif()
endif()
endif()
endif()
# Check whether compiler supports ARMv6 inline asm
set(CMAKE_REQUIRED_FLAGS "${ARMV6FLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"unsigned int f(unsigned int a, unsigned int b) {
unsigned int c;
__asm__ __volatile__ ( \"uqsub16 %0, %1, %2\" : \"=r\" (c) : \"r\" (a), \"r\" (b) );
return (int)c;
}
int main(void) { return f(1,2); }"
HAVE_ARMV6_INLINE_ASM
)
# Check whether compiler supports ARMv6 intrinsics
check_c_source_compiles(
"#if defined(_MSC_VER)
#include <intrin.h>
#else
#include <arm_acle.h>
#endif
unsigned int f(unsigned int a, unsigned int b) {
#if defined(_MSC_VER)
return _arm_uqsub16(a, b);
#else
return __uqsub16(a, b);
#endif
}
int main(void) { return f(1,2); }"
HAVE_ARMV6_INTRIN
)
set(CMAKE_REQUIRED_FLAGS)
endmacro()
macro(check_avx512_intrinsics)
if(NOT NATIVEFLAG)
if(CMAKE_C_COMPILER_ID MATCHES "Intel")
if(CMAKE_HOST_UNIX OR APPLE)
set(AVX512FLAG "-mavx512f -mavx512dq -mavx512bw -mavx512vl -mbmi2")
else()
set(AVX512FLAG "/arch:AVX512")
endif()
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
# For CPUs that can benefit from AVX512, it seems GCC generates suboptimal
# instruction scheduling unless you specify a reasonable -mtune= target
set(AVX512FLAG "-mavx512f -mavx512dq -mavx512bw -mavx512vl -mbmi2")
if(NOT MSVC)
check_c_compiler_flag("-mtune=cascadelake" HAVE_CASCADE_LAKE)
if(HAVE_CASCADE_LAKE)
set(AVX512FLAG "${AVX512FLAG} -mtune=cascadelake")
else()
set(AVX512FLAG "${AVX512FLAG} -mtune=skylake-avx512")
endif()
unset(HAVE_CASCADE_LAKE)
endif()
elseif(MSVC)
set(AVX512FLAG "/arch:AVX512")
endif()
endif()
# Check whether compiler supports AVX512 intrinsics
set(CMAKE_REQUIRED_FLAGS "${AVX512FLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"#include <immintrin.h>
__m512i f(__m512i y) {
__m512i x = _mm512_set1_epi8(2);
return _mm512_sub_epi8(x, y);
}
int main(void) { return 0; }"
HAVE_AVX512_INTRIN
)
endmacro()
macro(check_avx512vnni_intrinsics)
if(NOT NATIVEFLAG)
if(CMAKE_C_COMPILER_ID MATCHES "Intel")
if(CMAKE_HOST_UNIX OR APPLE OR CMAKE_C_COMPILER_ID MATCHES "IntelLLVM")
set(AVX512VNNIFLAG "-mavx512f -mavx512dq -mavx512bw -mavx512vl -mavx512vnni -mbmi2")
else()
set(AVX512VNNIFLAG "/arch:AVX512")
endif()
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(AVX512VNNIFLAG "-mavx512f -mavx512dq -mavx512bw -mavx512vl -mavx512vnni -mbmi2")
if(NOT MSVC)
check_c_compiler_flag("-mtune=cascadelake" HAVE_CASCADE_LAKE)
if(HAVE_CASCADE_LAKE)
set(AVX512VNNIFLAG "${AVX512VNNIFLAG} -mtune=cascadelake")
else()
set(AVX512VNNIFLAG "${AVX512VNNIFLAG} -mtune=skylake-avx512")
endif()
unset(HAVE_CASCADE_LAKE)
endif()
elseif(MSVC)
set(AVX512VNNIFLAG "/arch:AVX512")
endif()
endif()
# Check whether compiler supports AVX512vnni intrinsics
set(CMAKE_REQUIRED_FLAGS "${AVX512VNNIFLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"#include <immintrin.h>
__m512i f(__m512i x, __m512i y) {
__m512i z = _mm512_setzero_epi32();
return _mm512_dpbusd_epi32(z, x, y);
}
int main(void) { return 0; }"
HAVE_AVX512VNNI_INTRIN
)
set(CMAKE_REQUIRED_FLAGS)
endmacro()
macro(check_avx2_intrinsics)
if(NOT NATIVEFLAG)
if(CMAKE_C_COMPILER_ID MATCHES "Intel")
if(CMAKE_HOST_UNIX OR APPLE)
set(AVX2FLAG "-mavx2 -mbmi2")
else()
set(AVX2FLAG "/arch:AVX2")
endif()
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(AVX2FLAG "-mavx2 -mbmi2")
elseif(MSVC)
set(AVX2FLAG "/arch:AVX2")
endif()
endif()
# Check whether compiler supports AVX2 intrinics
set(CMAKE_REQUIRED_FLAGS "${AVX2FLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"#include <immintrin.h>
__m256i f(__m256i x) {
const __m256i y = _mm256_set1_epi16(1);
return _mm256_subs_epu16(x, y);
}
int main(void) { return 0; }"
HAVE_AVX2_INTRIN
)
set(CMAKE_REQUIRED_FLAGS)
endmacro()
macro(check_neon_compiler_flag)
if(NOT NATIVEFLAG)
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
if("${ARCH}" MATCHES "aarch64")
set(NEONFLAG "-march=armv8-a+simd")
else()
set(NEONFLAG "-mfpu=neon")
endif()
endif()
endif()
# Check whether compiler supports NEON flag
set(CMAKE_REQUIRED_FLAGS "${NEONFLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"#if defined(_M_ARM64) || defined(_M_ARM64EC)
# include <arm64_neon.h>
#else
# include <arm_neon.h>
#endif
int main() { return 0; }"
NEON_AVAILABLE FAIL_REGEX "not supported")
# Check whether compiler native flag is enough for NEON support
# Some GCC versions don't enable FPU (vector unit) when using -march=native
if(NEON_AVAILABLE AND NATIVEFLAG AND (NOT "${ARCH}" MATCHES "aarch64"))
check_c_source_compiles(
"#include <arm_neon.h>
uint8x16_t f(uint8x16_t x, uint8x16_t y) {
return vaddq_u8(x, y);
}
int main(int argc, char* argv[]) {
uint8x16_t a = vdupq_n_u8(argc);
uint8x16_t b = vdupq_n_u8(argc);
uint8x16_t result = f(a, b);
return result[0];
}"
ARM_NEON_SUPPORT_NATIVE
)
if(NOT ARM_NEON_SUPPORT_NATIVE)
set(CMAKE_REQUIRED_FLAGS "${NATIVEFLAG} -mfpu=neon ${ZNOLTOFLAG}")
check_c_source_compiles(
"#include <arm_neon.h>
uint8x16_t f(uint8x16_t x, uint8x16_t y) {
return vaddq_u8(x, y);
}
int main(int argc, char* argv[]) {
uint8x16_t a = vdupq_n_u8(argc);
uint8x16_t b = vdupq_n_u8(argc);
uint8x16_t result = f(a, b);
return result[0];
}"
ARM_NEON_SUPPORT_NATIVE_MFPU
)
if(ARM_NEON_SUPPORT_NATIVE_MFPU)
set(NEONFLAG "-mfpu=neon")
else()
# Remove local NEON_AVAILABLE variable and overwrite the cache
unset(NEON_AVAILABLE)
set(NEON_AVAILABLE "" CACHE INTERNAL "NEON support available" FORCE)
endif()
endif()
endif()
set(CMAKE_REQUIRED_FLAGS)
endmacro()
macro(check_neon_ld4_intrinsics)
if(NOT NATIVEFLAG)
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
if("${ARCH}" MATCHES "aarch64")
set(NEONFLAG "-march=armv8-a+simd")
else()
set(NEONFLAG "-mfpu=neon")
endif()
endif()
endif()
# Check whether compiler supports loading 4 neon vecs into a register range
set(CMAKE_REQUIRED_FLAGS "${NEONFLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"#if defined(_MSC_VER) && (defined(_M_ARM64) || defined(_M_ARM64EC))
# include <arm64_neon.h>
#else
# include <arm_neon.h>
#endif
int32x4x4_t f(int var[16]) { return vld1q_s32_x4(var); }
int main(void) { return 0; }"
NEON_HAS_LD4)
set(CMAKE_REQUIRED_FLAGS)
endmacro()
macro(check_pclmulqdq_intrinsics)
if(NOT NATIVEFLAG)
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "IntelLLVM")
set(PCLMULFLAG "-mpclmul")
endif()
endif()
# Check whether compiler supports PCLMULQDQ intrinsics
if(NOT (APPLE AND "${ARCH}" MATCHES "i386"))
# The pclmul code currently crashes on Mac in 32bit mode. Avoid for now.
set(CMAKE_REQUIRED_FLAGS "${PCLMULFLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"#include <immintrin.h>
#include <wmmintrin.h>
__m128i f(__m128i a, __m128i b) { return _mm_clmulepi64_si128(a, b, 0x10); }
int main(void) { return 0; }"
HAVE_PCLMULQDQ_INTRIN
)
set(CMAKE_REQUIRED_FLAGS)
else()
set(HAVE_PCLMULQDQ_INTRIN OFF)
endif()
endmacro()
macro(check_vpclmulqdq_intrinsics)
if(NOT NATIVEFLAG)
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "IntelLLVM")
set(VPCLMULFLAG "-mvpclmulqdq -mavx512f")
endif()
endif()
# Check whether compiler supports VPCLMULQDQ intrinsics
if(NOT (APPLE AND "${ARCH}" MATCHES "i386"))
set(CMAKE_REQUIRED_FLAGS "${VPCLMULFLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"#include <immintrin.h>
#include <wmmintrin.h>
__m512i f(__m512i a) {
__m512i b = _mm512_setzero_si512();
return _mm512_clmulepi64_epi128(a, b, 0x10);
}
int main(void) { return 0; }"
HAVE_VPCLMULQDQ_INTRIN
)
set(CMAKE_REQUIRED_FLAGS)
else()
set(HAVE_VPCLMULQDQ_INTRIN OFF)
endif()
endmacro()
macro(check_ppc_intrinsics)
# Check if compiler supports AltiVec
set(CMAKE_REQUIRED_FLAGS "-maltivec ${ZNOLTOFLAG}")
check_c_source_compiles(
"#include <altivec.h>
int main(void)
{
vector int a = vec_splats(0);
vector int b = vec_splats(0);
a = vec_add(a, b);
return 0;
}"
HAVE_ALTIVEC
)
set(CMAKE_REQUIRED_FLAGS)
if(HAVE_ALTIVEC)
set(PPCFLAGS "-maltivec")
endif()
set(CMAKE_REQUIRED_FLAGS "-maltivec -mno-vsx ${ZNOLTOFLAG}")
check_c_source_compiles(
"#include <altivec.h>
int main(void)
{
vector int a = vec_splats(0);
vector int b = vec_splats(0);
a = vec_add(a, b);
return 0;
}"
HAVE_NOVSX
)
set(CMAKE_REQUIRED_FLAGS)
if(HAVE_NOVSX)
set(PPCFLAGS "${PPCFLAGS} -mno-vsx")
endif()
# Check if we have what we need for AltiVec optimizations
set(CMAKE_REQUIRED_FLAGS "${PPCFLAGS} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"#include <sys/auxv.h>
#ifdef __FreeBSD__
#include <machine/cpu.h>
#endif
int main() {
#ifdef __FreeBSD__
unsigned long hwcap;
elf_aux_info(AT_HWCAP, &hwcap, sizeof(hwcap));
return (hwcap & PPC_FEATURE_HAS_ALTIVEC);
#else
return (getauxval(AT_HWCAP) & PPC_FEATURE_HAS_ALTIVEC);
#endif
}"
HAVE_VMX
)
set(CMAKE_REQUIRED_FLAGS)
endmacro()
macro(check_power8_intrinsics)
if(NOT NATIVEFLAG)
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(POWER8FLAG "-mcpu=power8")
endif()
endif()
# Check if we have what we need for POWER8 optimizations
set(CMAKE_REQUIRED_FLAGS "${POWER8FLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"#include <sys/auxv.h>
#ifdef __FreeBSD__
#include <machine/cpu.h>
#endif
int main() {
#ifdef __FreeBSD__
unsigned long hwcap;
elf_aux_info(AT_HWCAP2, &hwcap, sizeof(hwcap));
return (hwcap & PPC_FEATURE2_ARCH_2_07);
#else
return (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07);
#endif
}"
HAVE_POWER8_INTRIN
)
if(NOT HAVE_POWER8_INTRIN AND HAVE_LINUX_AUXVEC_H)
check_c_source_compiles(
"#include <sys/auxv.h>
#include <linux/auxvec.h>
int main() {
return (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07);
}"
HAVE_POWER8_INTRIN2
)
if(HAVE_POWER8_INTRIN2)
set(POWER8_NEED_AUXVEC_H 1)
set(HAVE_POWER8_INTRIN ${HAVE_POWER8_INTRIN2} CACHE INTERNAL "Have POWER8 intrinsics" FORCE)
unset(HAVE_POWER8_INTRIN2 CACHE)
endif()
endif()
set(CMAKE_REQUIRED_FLAGS)
endmacro()
macro(check_rvv_intrinsics)
if(NOT NATIVEFLAG)
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(RISCVFLAG "-march=rv64gcv")
endif()
endif()
# Check whether compiler supports RVV
set(CMAKE_REQUIRED_FLAGS "${RISCVFLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"#include <riscv_vector.h>
int main() {
return 0;
}"
HAVE_RVV_INTRIN
)
set(CMAKE_REQUIRED_FLAGS)
endmacro()
macro(check_riscv_zbc_ext)
if(NOT NATIVEFLAG)
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(RISCVZBCFLAG "-march=rv64gc_zbc")
endif()
endif()
# Check whether compiler supports RISC-V Zbc inline asm
# gcc-11 / clang-14 at least
set(CMAKE_REQUIRED_FLAGS "${RISCVZBCFLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"#include <stdint.h>
uint64_t f(uint64_t a, uint64_t b) {
uint64_t c;
__asm__ __volatile__ (\"clmul %[result], %[input_a], %[input_b]\" : [result] \"=r\" (c) : [input_a] \"r\" (a), [input_b] \"r\" (b));
return c;
}
int main(void) { return f(1, 2); }"
HAVE_RISCV_ZBC
)
set(CMAKE_REQUIRED_FLAGS)
endmacro()
macro(check_s390_intrinsics)
check_c_source_compiles(
"#include <sys/auxv.h>
#ifndef HWCAP_S390_VXRS
#define HWCAP_S390_VXRS (1 << 11)
#endif
int main() {
return (getauxval(AT_HWCAP) & HWCAP_S390_VXRS);
}"
HAVE_S390_INTRIN
)
endmacro()
macro(check_power9_intrinsics)
if(NOT NATIVEFLAG)
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(POWER9FLAG "-mcpu=power9")
endif()
endif()
# Check if we have what we need for POWER9 optimizations
set(CMAKE_REQUIRED_FLAGS "${POWER9FLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"#include <sys/auxv.h>
#ifdef __FreeBSD__
#include <machine/cpu.h>
#endif
int main() {
#ifdef __FreeBSD__
unsigned long hwcap;
elf_aux_info(AT_HWCAP2, &hwcap, sizeof(hwcap));
return (hwcap & PPC_FEATURE2_ARCH_3_00);
#else
return (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_3_00);
#endif
}"
HAVE_POWER9_INTRIN
)
if(NOT HAVE_POWER9_INTRIN AND HAVE_LINUX_AUXVEC_H)
check_c_source_compiles(
"#include <sys/auxv.h>
#include <linux/auxvec.h>
int main() {
return (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_3_00);
}"
HAVE_POWER9_INTRIN2
)
if(HAVE_POWER9_INTRIN2)
set(POWER9_NEED_AUXVEC_H 1)
set(HAVE_POWER9_INTRIN ${HAVE_POWER9_INTRIN2} CACHE INTERNAL "Have POWER9 intrinsics" FORCE)
unset(HAVE_POWER9_INTRIN2 CACHE)
endif()
endif()
set(CMAKE_REQUIRED_FLAGS)
endmacro()
macro(check_sse2_intrinsics)
if(NOT NATIVEFLAG)
if(CMAKE_C_COMPILER_ID MATCHES "Intel")
if(CMAKE_HOST_UNIX OR APPLE)
set(SSE2FLAG "-msse2")
else()
set(SSE2FLAG "/arch:SSE2")
endif()
elseif(MSVC)
if(NOT "${ARCH}" MATCHES "x86_64")
set(SSE2FLAG "/arch:SSE2")
endif()
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(SSE2FLAG "-msse2")
endif()
endif()
# Check whether compiler supports SSE2 intrinsics
set(CMAKE_REQUIRED_FLAGS "${SSE2FLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"#include <immintrin.h>
__m128i f(__m128i x, __m128i y) { return _mm_sad_epu8(x, y); }
int main(void) { return 0; }"
HAVE_SSE2_INTRIN
)
set(CMAKE_REQUIRED_FLAGS)
endmacro()
macro(check_ssse3_intrinsics)
if(NOT NATIVEFLAG)
if(CMAKE_C_COMPILER_ID MATCHES "Intel")
if(CMAKE_HOST_UNIX OR APPLE)
set(SSSE3FLAG "-mssse3")
else()
set(SSSE3FLAG "/arch:SSSE3")
endif()
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(SSSE3FLAG "-mssse3")
endif()
endif()
# Check whether compiler supports SSSE3 intrinsics
set(CMAKE_REQUIRED_FLAGS "${SSSE3FLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"#include <immintrin.h>
__m128i f(__m128i u) {
__m128i v = _mm_set1_epi32(1);
return _mm_hadd_epi32(u, v);
}
int main(void) { return 0; }"
HAVE_SSSE3_INTRIN
)
endmacro()
macro(check_sse41_intrinsics)
if(NOT NATIVEFLAG)
if(CMAKE_C_COMPILER_ID MATCHES "Intel")
if(CMAKE_HOST_UNIX OR APPLE)
set(SSE41FLAG "-msse4.1")
else()
set(SSE41FLAG "/arch:SSE4.1")
endif()
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(SSE41FLAG "-msse4.1")
endif()
endif()
# Check whether compiler supports SSE4.1 intrinsics
set(CMAKE_REQUIRED_FLAGS "${SSE41FLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"#include <smmintrin.h>
__m128i f(__m128i a, __m128i b) { return _mm_min_epi32(a, b); }
int main(void) { return 0; }"
HAVE_SSE41_INTRIN
)
set(CMAKE_REQUIRED_FLAGS)
endmacro()
macro(check_sse42_intrinsics)
if(NOT NATIVEFLAG)
if(CMAKE_C_COMPILER_ID MATCHES "Intel")
if(CMAKE_HOST_UNIX OR APPLE)
set(SSE42FLAG "-msse4.2")
else()
set(SSE42FLAG "/arch:SSE4.2")
endif()
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(SSE42FLAG "-msse4.2")
endif()
endif()
# Check whether compiler supports SSE4.2 intrinsics
set(CMAKE_REQUIRED_FLAGS "${SSE42FLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"#include <nmmintrin.h>
unsigned int f(unsigned int a, unsigned int b) { return _mm_crc32_u32(a, b); }
int main(void) { return 0; }"
HAVE_SSE42_INTRIN
)
set(CMAKE_REQUIRED_FLAGS)
endmacro()
macro(check_vgfma_intrinsics)
if(NOT NATIVEFLAG)
set(VGFMAFLAG "-march=z13")
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
set(VGFMAFLAG "${VGFMAFLAG} -mzarch")
endif()
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(VGFMAFLAG "${VGFMAFLAG} -fzvector")
endif()
endif()
# Check whether compiler supports "VECTOR GALOIS FIELD MULTIPLY SUM AND ACCUMULATE" intrinsic
set(CMAKE_REQUIRED_FLAGS "${VGFMAFLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"#include <vecintrin.h>
int main(void) {
unsigned long long a __attribute__((vector_size(16))) = { 0 };
unsigned long long b __attribute__((vector_size(16))) = { 0 };
unsigned char c __attribute__((vector_size(16))) = { 0 };
c = vec_gfmsum_accum_128(a, b, c);
return c[0];
}"
HAVE_VGFMA_INTRIN FAIL_REGEX "not supported")
set(CMAKE_REQUIRED_FLAGS)
endmacro()
macro(check_xsave_intrinsics)
if(NOT NATIVEFLAG AND NOT MSVC AND NOT CMAKE_C_COMPILER_ID MATCHES "Intel")
set(XSAVEFLAG "-mxsave")
endif()
set(CMAKE_REQUIRED_FLAGS "${XSAVEFLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
check_c_source_compiles(
"#ifdef _MSC_VER
# include <intrin.h>
#elif __GNUC__ == 8 && __GNUC_MINOR__ > 1
# include <xsaveintrin.h>
#else
# include <immintrin.h>
#endif
unsigned int f(unsigned int a) { return (int) _xgetbv(a); }
int main(void) { return 0; }"
HAVE_XSAVE_INTRIN FAIL_REGEX "not supported")
set(CMAKE_REQUIRED_FLAGS)
endmacro()