From: Matheus Castanho Date: Mon, 22 Jun 2020 14:02:10 +0000 (-0300) Subject: Add POWER8_VSX_SLIDEHASH macro X-Git-Tag: 1.9.9-b1~177 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d76526e0b4f9d70e678883d304c3d3cd519efe86;p=thirdparty%2Fzlib-ng.git Add POWER8_VSX_SLIDEHASH macro The slide_hash optimization for POWER currently depends on POWER8 macro to be enabled. Switch this to use POWER8_VSX_SLIDEHASH instead to better match the naming scheme used by other archs. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b681346..020da4aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -705,6 +705,7 @@ if(WITH_OPTIM) add_definitions(-DPOWER8) add_definitions(-DPOWER_FEATURES) add_definitions(-DPOWER8_VSX_ADLER32) + add_definitions(-DPOWER8_VSX_SLIDEHASH) set(ZLIB_POWER8_SRCS ${ARCHDIR}/adler32_power8.c ${ARCHDIR}/slide_hash_power8.c) diff --git a/arch/power/slide_hash_power8.c b/arch/power/slide_hash_power8.c index c277c15d..b869307a 100644 --- a/arch/power/slide_hash_power8.c +++ b/arch/power/slide_hash_power8.c @@ -1,8 +1,11 @@ /* Optimized slide_hash for POWER processors - * Copyright (C) 2019-2020 Matheus Castanho , IBM + * Copyright (C) 2019-2020 IBM Corporation + * Author: Matheus Castanho * For conditions of distribution and use, see copyright notice in zlib.h */ +#ifdef POWER8_VSX_SLIDEHASH + #include #include "zbuild.h" #include "deflate.h" @@ -53,3 +56,5 @@ void ZLIB_INTERNAL slide_hash_power8(deflate_state *s) { p = &s->prev[n]; slide_hash_power8_loop(s,n,p); } + +#endif /* POWER8_VSX_SLIDEHASH */ diff --git a/configure b/configure index 25dd20af..16fbadcf 100755 --- a/configure +++ b/configure @@ -1394,7 +1394,7 @@ case "${ARCH}" in if test $HAVE_POWER8 -eq 1; then ARCH_STATIC_OBJS="${ARCH_STATIC_OBJS} adler32_power8.o power.o slide_hash_power8.o" ARCH_SHARED_OBJS="${ARCH_SHARED_OBJS} adler32_power8.lo power.lo slide_hash_power8.lo" - POWERFLAGS="-DPOWER8 -DPOWER_FEATURES -DPOWER8_VSX_ADLER32" + POWERFLAGS="-DPOWER8 -DPOWER_FEATURES -DPOWER8_VSX_ADLER32 -DPOWER8_VSX_SLIDEHASH" fi fi diff --git a/functable.c b/functable.c index 6679a9d0..a9d5f554 100644 --- a/functable.c +++ b/functable.c @@ -35,7 +35,7 @@ extern Pos quick_insert_string_acle(deflate_state *const s, const Pos str); void slide_hash_sse2(deflate_state *s); #elif defined(ARM_NEON_SLIDEHASH) void slide_hash_neon(deflate_state *s); -#elif defined(POWER8) +#elif defined(POWER8_VSX_SLIDEHASH) void slide_hash_power8(deflate_state *s); #endif #ifdef X86_AVX2 @@ -189,7 +189,7 @@ ZLIB_INTERNAL void slide_hash_stub(deflate_state *s) { if (x86_cpu_has_avx2) functable.slide_hash = &slide_hash_avx2; #endif -#ifdef POWER8 +#ifdef POWER8_VSX_SLIDEHASH if (power_cpu_has_arch_2_07) functable.slide_hash = &slide_hash_power8; #endif