]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Add POWER8_VSX_SLIDEHASH macro
authorMatheus Castanho <msc@linux.ibm.com>
Mon, 22 Jun 2020 14:02:10 +0000 (11:02 -0300)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sat, 27 Jun 2020 15:42:55 +0000 (17:42 +0200)
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.

CMakeLists.txt
arch/power/slide_hash_power8.c
configure
functable.c

index 3b68134659c3fb7605c2f0866188c7532e0c68b2..020da4aaea4b01ebe9b7bd9470ca3e04ea817320 100644 (file)
@@ -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)
index c277c15d9a6ee16cd0928537fe58ab502e5b3229..b869307a09c8f2645b26460fc1694acb4fac32cb 100644 (file)
@@ -1,8 +1,11 @@
 /* Optimized slide_hash for POWER processors
- * Copyright (C) 2019-2020 Matheus Castanho <msc@linux.ibm.com>, IBM
+ * Copyright (C) 2019-2020 IBM Corporation
+ * Author: Matheus Castanho <msc@linux.ibm.com>
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
+#ifdef POWER8_VSX_SLIDEHASH
+
 #include <altivec.h>
 #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 */
index 25dd20af713174241423f6b519ac252304c3fd90..16fbadcf791f7554cabab480933a528ca11285d2 100755 (executable)
--- 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
 
index 6679a9d09f30999f9a0f75e428354b609301efe7..a9d5f5543ec5401152d385cbb8fc52743e26b530 100644 (file)
@@ -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