68c528
From cfbf97cb54a6d06a80e86c85869331e4e2871129 Mon Sep 17 00:00:00 2001
4e3973
From: Ilya Leoshkevich <iii@linux.ibm.com>
4e3973
Date: Thu, 19 Mar 2020 11:52:03 +0100
4e3973
Subject: [PATCH] s390x: vectorize crc32
4e3973
4e3973
Use vector extensions when compiling for s390x and binutils knows
4e3973
about them. At runtime, check whether kernel supports vector
4e3973
extensions (it has to be not just the CPU, but also the kernel) and
4e3973
choose between the regular and the vectorized implementations.
4e3973
---
68c528
 Makefile.in                     |   9 ++
68c528
 configure                       |  28 +++++
68c528
 contrib/gcc/zifunc.h            |  21 +++-
68c528
 contrib/s390/crc32-vx.c         | 195 ++++++++++++++++++++++++++++++++
68c528
 contrib/s390/crc32_z_resolver.c |  41 +++++++
68c528
 crc32.c                         |  11 +-
68c528
 6 files changed, 301 insertions(+), 4 deletions(-)
4e3973
 create mode 100644 contrib/s390/crc32-vx.c
68c528
 create mode 100644 contrib/s390/crc32_z_resolver.c
4e3973
4e3973
diff --git a/Makefile.in b/Makefile.in
68c528
index d392616..63f76da 100644
4e3973
--- a/Makefile.in
4e3973
+++ b/Makefile.in
4e3973
@@ -29,6 +29,7 @@ LDFLAGS=
4e3973
 TEST_LDFLAGS=-L. libz.a
4e3973
 LDSHARED=$(CC)
4e3973
 CPP=$(CC) -E
4e3973
+VGFMAFLAG=
4e3973
 
4e3973
 STATICLIB=libz.a
4e3973
 SHAREDLIB=libz.so
68c528
@@ -179,6 +180,9 @@ crc32.o: $(SRCDIR)crc32.c
68c528
 crc32_z_power8.o: $(SRCDIR)contrib/power/crc32_z_power8.c
68c528
 	$(CC) $(CFLAGS) -mcpu=power8 $(ZINC) -c -o $@ $(SRCDIR)contrib/power/crc32_z_power8.c
4e3973
 
4e3973
+crc32-vx.o: $(SRCDIR)contrib/s390/crc32-vx.c
4e3973
+	$(CC) $(CFLAGS) $(VGFMAFLAG) $(ZINC) -c -o $@ $(SRCDIR)contrib/s390/crc32-vx.c
4e3973
+
4e3973
 deflate.o: $(SRCDIR)deflate.c
4e3973
 	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)deflate.c
4e3973
 
68c528
@@ -229,6 +233,11 @@ crc32.lo: $(SRCDIR)crc32.c
4e3973
 	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/crc32.o $(SRCDIR)crc32.c
4e3973
 	-@mv objs/crc32.o $@
4e3973
 
4e3973
+crc32-vx.lo: $(SRCDIR)contrib/s390/crc32-vx.c
4e3973
+	-@mkdir objs 2>/dev/null || test -d objs
4e3973
+	$(CC) $(SFLAGS) $(VGFMAFLAG) $(ZINC) -DPIC -c -o objs/crc32-vx.o $(SRCDIR)contrib/s390/crc32-vx.c
4e3973
+	-@mv objs/crc32-vx.o $@
4e3973
+
68c528
 crc32_z_power8.lo: $(SRCDIR)contrib/power/crc32_z_power8.c
4e3973
 	-@mkdir objs 2>/dev/null || test -d objs
68c528
 	$(CC) $(SFLAGS) -mcpu=power8 $(ZINC) -DPIC -c -o objs/crc32_z_power8.o $(SRCDIR)contrib/power/crc32_z_power8.c
4e3973
diff --git a/configure b/configure
68c528
index e37dac8..a4606b8 100755
4e3973
--- a/configure
4e3973
+++ b/configure
68c528
@@ -915,6 +915,32 @@ else
68c528
   echo "Checking for Power optimizations support... No." | tee -a configure.log
4e3973
 fi
4e3973
 
4e3973
+# check if we are compiling for s390 and binutils support vector extensions
4e3973
+VGFMAFLAG=-march=z13
4e3973
+cat > $test.c <
4e3973
+#ifndef __s390__
4e3973
+#error
4e3973
+#endif
4e3973
+EOF
4e3973
+if try $CC -c $CFLAGS $VGFMAFLAG $test.c; then
4e3973
+  CFLAGS="$CFLAGS -DHAVE_S390X_VX"
4e3973
+  SFLAGS="$SFLAGS -DHAVE_S390X_VX"
4e3973
+  OBJC="$OBJC crc32-vx.o"
4e3973
+  PIC_OBJC="$PIC_OBJC crc32-vx.lo"
4e3973
+  echo "Checking for s390 vector extensions... Yes." | tee -a configure.log
4e3973
+
4e3973
+  for flag in -mzarch -fzvector; do
4e3973
+    if try $CC -c $CFLAGS $VGFMAFLAG $flag $test.c; then
4e3973
+      VGFMAFLAG="$VGFMAFLAG $flag"
4e3973
+      echo "Checking for $flag... Yes." | tee -a configure.log
4e3973
+    else
4e3973
+      echo "Checking for $flag... No." | tee -a configure.log
4e3973
+    fi
4e3973
+  done
4e3973
+else
4e3973
+  echo "Checking for s390 vector extensions... No." | tee -a configure.log
4e3973
+fi
4e3973
+
4e3973
 # show the results in the log
4e3973
 echo >> configure.log
4e3973
 echo ALL = $ALL >> configure.log
68c528
@@ -947,6 +973,7 @@ echo mandir = $mandir >> configure.log
4e3973
 echo prefix = $prefix >> configure.log
4e3973
 echo sharedlibdir = $sharedlibdir >> configure.log
4e3973
 echo uname = $uname >> configure.log
4e3973
+echo VGFMAFLAG = $VGFMAFLAG >> configure.log
4e3973
 
4e3973
 # udpate Makefile with the configure results
4e3973
 sed < ${SRCDIR}Makefile.in "
68c528
@@ -956,6 +983,7 @@ sed < ${SRCDIR}Makefile.in "
4e3973
 /^LDFLAGS *=/s#=.*#=$LDFLAGS#
4e3973
 /^LDSHARED *=/s#=.*#=$LDSHARED#
4e3973
 /^CPP *=/s#=.*#=$CPP#
4e3973
+/^VGFMAFLAG *=/s#=.*#=$VGFMAFLAG#
4e3973
 /^STATICLIB *=/s#=.*#=$STATICLIB#
4e3973
 /^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
4e3973
 /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
68c528
diff --git a/contrib/gcc/zifunc.h b/contrib/gcc/zifunc.h
68c528
index daf4fe4..b62379e 100644
68c528
--- a/contrib/gcc/zifunc.h
68c528
+++ b/contrib/gcc/zifunc.h
68c528
@@ -8,9 +8,28 @@
68c528
 
68c528
 /* Helpers for arch optimizations */
68c528
 
68c528
+#if defined(__clang__)
68c528
+#if __has_feature(coverage_sanitizer)
68c528
+#define Z_IFUNC_NO_SANCOV __attribute__((no_sanitize("coverage")))
68c528
+#else /* __has_feature(coverage_sanitizer) */
68c528
+#define Z_IFUNC_NO_SANCOV
68c528
+#endif /* __has_feature(coverage_sanitizer) */
68c528
+#else /* __clang__ */
68c528
+#define Z_IFUNC_NO_SANCOV
68c528
+#endif /* __clang__ */
68c528
+
68c528
+#ifdef __s390__
68c528
+#define Z_IFUNC_PARAMS unsigned long hwcap
68c528
+#define Z_IFUNC_ATTRS Z_IFUNC_NO_SANCOV
68c528
+#else /* __s390__ */
68c528
+#define Z_IFUNC_PARAMS void
68c528
+#define Z_IFUNC_ATTRS
68c528
+#endif /* __s390__ */
68c528
+
68c528
 #define Z_IFUNC(fname) \
68c528
     typeof(fname) fname __attribute__ ((ifunc (#fname "_resolver"))); \
68c528
-    local typeof(fname) *fname##_resolver(void)
68c528
+    Z_IFUNC_ATTRS \
68c528
+    local typeof(fname) *fname##_resolver(Z_IFUNC_PARAMS)
68c528
 /* This is a helper macro to declare a resolver for an indirect function
68c528
  * (ifunc). Let's say you have function
68c528
  *
4e3973
diff --git a/contrib/s390/crc32-vx.c b/contrib/s390/crc32-vx.c
4e3973
new file mode 100644
4e3973
index 0000000..fa5387c
4e3973
--- /dev/null
4e3973
+++ b/contrib/s390/crc32-vx.c
4e3973
@@ -0,0 +1,195 @@
4e3973
+/*
4e3973
+ * Hardware-accelerated CRC-32 variants for Linux on z Systems
4e3973
+ *
4e3973
+ * Use the z/Architecture Vector Extension Facility to accelerate the
4e3973
+ * computing of bitreflected CRC-32 checksums.
4e3973
+ *
4e3973
+ * This CRC-32 implementation algorithm is bitreflected and processes
4e3973
+ * the least-significant bit first (Little-Endian).
4e3973
+ *
4e3973
+ * This code was originally written by Hendrik Brueckner
4e3973
+ * <brueckner@linux.vnet.ibm.com> for use in the Linux kernel and has been
4e3973
+ * relicensed under the zlib license.
4e3973
+ */
4e3973
+
4e3973
+#include "../../zutil.h"
4e3973
+
4e3973
+#include <stdint.h>
4e3973
+#include <vecintrin.h>
4e3973
+
4e3973
+typedef unsigned char uv16qi __attribute__((vector_size(16)));
4e3973
+typedef unsigned int uv4si __attribute__((vector_size(16)));
4e3973
+typedef unsigned long long uv2di __attribute__((vector_size(16)));
4e3973
+
4e3973
+uint32_t crc32_le_vgfm_16(uint32_t crc, const unsigned char *buf, size_t len) {
4e3973
+    /*
4e3973
+     * The CRC-32 constant block contains reduction constants to fold and
4e3973
+     * process particular chunks of the input data stream in parallel.
4e3973
+     *
4e3973
+     * For the CRC-32 variants, the constants are precomputed according to
4e3973
+     * these definitions:
4e3973
+     *
4e3973
+     *      R1 = [(x4*128+32 mod P'(x) << 32)]' << 1
4e3973
+     *      R2 = [(x4*128-32 mod P'(x) << 32)]' << 1
4e3973
+     *      R3 = [(x128+32 mod P'(x) << 32)]'   << 1
4e3973
+     *      R4 = [(x128-32 mod P'(x) << 32)]'   << 1
4e3973
+     *      R5 = [(x64 mod P'(x) << 32)]'       << 1
4e3973
+     *      R6 = [(x32 mod P'(x) << 32)]'       << 1
4e3973
+     *
4e3973
+     *      The bitreflected Barret reduction constant, u', is defined as
4e3973
+     *      the bit reversal of floor(x**64 / P(x)).
4e3973
+     *
4e3973
+     *      where P(x) is the polynomial in the normal domain and the P'(x) is the
4e3973
+     *      polynomial in the reversed (bitreflected) domain.
4e3973
+     *
4e3973
+     * CRC-32 (IEEE 802.3 Ethernet, ...) polynomials:
4e3973
+     *
4e3973
+     *      P(x)  = 0x04C11DB7
4e3973
+     *      P'(x) = 0xEDB88320
4e3973
+     */
4e3973
+    const uv16qi perm_le2be = {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};  /* BE->LE mask */
4e3973
+    const uv2di r2r1 = {0x1C6E41596, 0x154442BD4};                                     /* R2, R1 */
4e3973
+    const uv2di r4r3 = {0x0CCAA009E, 0x1751997D0};                                     /* R4, R3 */
4e3973
+    const uv2di r5 = {0, 0x163CD6124};                                                 /* R5 */
4e3973
+    const uv2di ru_poly = {0, 0x1F7011641};                                            /* u' */
4e3973
+    const uv2di crc_poly = {0, 0x1DB710641};                                           /* P'(x) << 1 */
4e3973
+
4e3973
+    /*
4e3973
+     * Load the initial CRC value.
4e3973
+     *
4e3973
+     * The CRC value is loaded into the rightmost word of the
4e3973
+     * vector register and is later XORed with the LSB portion
4e3973
+     * of the loaded input data.
4e3973
+     */
4e3973
+    uv2di v0 = {0, 0};
4e3973
+    v0 = (uv2di)vec_insert(crc, (uv4si)v0, 3);
4e3973
+
4e3973
+    /* Load a 64-byte data chunk and XOR with CRC */
4e3973
+    uv2di v1 = vec_perm(((uv2di *)buf)[0], ((uv2di *)buf)[0], perm_le2be);
4e3973
+    uv2di v2 = vec_perm(((uv2di *)buf)[1], ((uv2di *)buf)[1], perm_le2be);
4e3973
+    uv2di v3 = vec_perm(((uv2di *)buf)[2], ((uv2di *)buf)[2], perm_le2be);
4e3973
+    uv2di v4 = vec_perm(((uv2di *)buf)[3], ((uv2di *)buf)[3], perm_le2be);
4e3973
+
4e3973
+    v1 ^= v0;
4e3973
+    buf += 64;
4e3973
+    len -= 64;
4e3973
+
4e3973
+    while (len >= 64) {
4e3973
+        /* Load the next 64-byte data chunk */
4e3973
+        uv16qi part1 = vec_perm(((uv16qi *)buf)[0], ((uv16qi *)buf)[0], perm_le2be);
4e3973
+        uv16qi part2 = vec_perm(((uv16qi *)buf)[1], ((uv16qi *)buf)[1], perm_le2be);
4e3973
+        uv16qi part3 = vec_perm(((uv16qi *)buf)[2], ((uv16qi *)buf)[2], perm_le2be);
4e3973
+        uv16qi part4 = vec_perm(((uv16qi *)buf)[3], ((uv16qi *)buf)[3], perm_le2be);
4e3973
+
4e3973
+        /*
4e3973
+         * Perform a GF(2) multiplication of the doublewords in V1 with
4e3973
+         * the R1 and R2 reduction constants in V0.  The intermediate result
4e3973
+         * is then folded (accumulated) with the next data chunk in PART1 and
4e3973
+         * stored in V1. Repeat this step for the register contents
4e3973
+         * in V2, V3, and V4 respectively.
4e3973
+         */
4e3973
+        v1 = (uv2di)vec_gfmsum_accum_128(r2r1, v1, part1);
4e3973
+        v2 = (uv2di)vec_gfmsum_accum_128(r2r1, v2, part2);
4e3973
+        v3 = (uv2di)vec_gfmsum_accum_128(r2r1, v3, part3);
4e3973
+        v4 = (uv2di)vec_gfmsum_accum_128(r2r1, v4, part4);
4e3973
+
4e3973
+        buf += 64;
4e3973
+        len -= 64;
4e3973
+    }
4e3973
+
4e3973
+    /*
4e3973
+     * Fold V1 to V4 into a single 128-bit value in V1.  Multiply V1 with R3
4e3973
+     * and R4 and accumulating the next 128-bit chunk until a single 128-bit
4e3973
+     * value remains.
4e3973
+     */
4e3973
+    v1 = (uv2di)vec_gfmsum_accum_128(r4r3, v1, (uv16qi)v2);
4e3973
+    v1 = (uv2di)vec_gfmsum_accum_128(r4r3, v1, (uv16qi)v3);
4e3973
+    v1 = (uv2di)vec_gfmsum_accum_128(r4r3, v1, (uv16qi)v4);
4e3973
+
4e3973
+    while (len >= 16) {
4e3973
+        /* Load next data chunk */
4e3973
+        v2 = vec_perm(*(uv2di *)buf, *(uv2di *)buf, perm_le2be);
4e3973
+
4e3973
+        /* Fold next data chunk */
4e3973
+        v1 = (uv2di)vec_gfmsum_accum_128(r4r3, v1, (uv16qi)v2);
4e3973
+
4e3973
+        buf += 16;
4e3973
+        len -= 16;
4e3973
+    }
4e3973
+
4e3973
+    /*
4e3973
+     * Set up a vector register for byte shifts.  The shift value must
4e3973
+     * be loaded in bits 1-4 in byte element 7 of a vector register.
4e3973
+     * Shift by 8 bytes: 0x40
4e3973
+     * Shift by 4 bytes: 0x20
4e3973
+     */
4e3973
+    uv16qi v9 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
4e3973
+    v9 = vec_insert((unsigned char)0x40, v9, 7);
4e3973
+
4e3973
+    /*
4e3973
+     * Prepare V0 for the next GF(2) multiplication: shift V0 by 8 bytes
4e3973
+     * to move R4 into the rightmost doubleword and set the leftmost
4e3973
+     * doubleword to 0x1.
4e3973
+     */
4e3973
+    v0 = vec_srb(r4r3, (uv2di)v9);
4e3973
+    v0[0] = 1;
4e3973
+
4e3973
+    /*
4e3973
+     * Compute GF(2) product of V1 and V0.  The rightmost doubleword
4e3973
+     * of V1 is multiplied with R4.  The leftmost doubleword of V1 is
4e3973
+     * multiplied by 0x1 and is then XORed with rightmost product.
4e3973
+     * Implicitly, the intermediate leftmost product becomes padded
4e3973
+     */
4e3973
+    v1 = (uv2di)vec_gfmsum_128(v0, v1);
4e3973
+
4e3973
+    /*
4e3973
+     * Now do the final 32-bit fold by multiplying the rightmost word
4e3973
+     * in V1 with R5 and XOR the result with the remaining bits in V1.
4e3973
+     *
4e3973
+     * To achieve this by a single VGFMAG, right shift V1 by a word
4e3973
+     * and store the result in V2 which is then accumulated.  Use the
4e3973
+     * vector unpack instruction to load the rightmost half of the
4e3973
+     * doubleword into the rightmost doubleword element of V1; the other
4e3973
+     * half is loaded in the leftmost doubleword.
4e3973
+     * The vector register with CONST_R5 contains the R5 constant in the
4e3973
+     * rightmost doubleword and the leftmost doubleword is zero to ignore
4e3973
+     * the leftmost product of V1.
4e3973
+     */
4e3973
+    v9 = vec_insert((unsigned char)0x20, v9, 7);
4e3973
+    v2 = vec_srb(v1, (uv2di)v9);
4e3973
+    v1 = vec_unpackl((uv4si)v1);  /* Split rightmost doubleword */
4e3973
+    v1 = (uv2di)vec_gfmsum_accum_128(r5, v1, (uv16qi)v2);
4e3973
+
4e3973
+    /*
4e3973
+     * Apply a Barret reduction to compute the final 32-bit CRC value.
4e3973
+     *
4e3973
+     * The input values to the Barret reduction are the degree-63 polynomial
4e3973
+     * in V1 (R(x)), degree-32 generator polynomial, and the reduction
4e3973
+     * constant u.  The Barret reduction result is the CRC value of R(x) mod
4e3973
+     * P(x).
4e3973
+     *
4e3973
+     * The Barret reduction algorithm is defined as:
4e3973
+     *
4e3973
+     *    1. T1(x) = floor( R(x) / x^32 ) GF2MUL u
4e3973
+     *    2. T2(x) = floor( T1(x) / x^32 ) GF2MUL P(x)
4e3973
+     *    3. C(x)  = R(x) XOR T2(x) mod x^32
4e3973
+     *
4e3973
+     *  Note: The leftmost doubleword of vector register containing
4e3973
+     *  CONST_RU_POLY is zero and, thus, the intermediate GF(2) product
4e3973
+     *  is zero and does not contribute to the final result.
4e3973
+     */
4e3973
+
4e3973
+    /* T1(x) = floor( R(x) / x^32 ) GF2MUL u */
4e3973
+    v2 = vec_unpackl((uv4si)v1);
4e3973
+    v2 = (uv2di)vec_gfmsum_128(ru_poly, v2);
4e3973
+
4e3973
+    /*
4e3973
+     * Compute the GF(2) product of the CRC polynomial with T1(x) in
4e3973
+     * V2 and XOR the intermediate result, T2(x), with the value in V1.
4e3973
+     * The final result is stored in word element 2 of V2.
4e3973
+     */
4e3973
+    v2 = vec_unpackl((uv4si)v2);
4e3973
+    v2 = (uv2di)vec_gfmsum_accum_128(crc_poly, v2, (uv16qi)v1);
4e3973
+
4e3973
+    return ((uv4si)v2)[2];
4e3973
+}
68c528
diff --git a/contrib/s390/crc32_z_resolver.c b/contrib/s390/crc32_z_resolver.c
68c528
new file mode 100644
68c528
index 0000000..9749cab
68c528
--- /dev/null
68c528
+++ b/contrib/s390/crc32_z_resolver.c
68c528
@@ -0,0 +1,41 @@
4e3973
+#include <sys/auxv.h>
68c528
+#include "../gcc/zifunc.h"
4e3973
+
4e3973
+#define VX_MIN_LEN 64
4e3973
+#define VX_ALIGNMENT 16L
4e3973
+#define VX_ALIGN_MASK (VX_ALIGNMENT - 1)
4e3973
+
4e3973
+unsigned int crc32_le_vgfm_16(unsigned int crc, const unsigned char FAR *buf, z_size_t len);
4e3973
+
4e3973
+local unsigned long s390_crc32_vx(unsigned long crc, const unsigned char FAR *buf, z_size_t len)
4e3973
+{
68c528
+    uintptr_t prealign, aligned, remaining;
4e3973
+
4e3973
+    if (buf == Z_NULL) return 0UL;
4e3973
+
4e3973
+    if (len < VX_MIN_LEN + VX_ALIGN_MASK)
68c528
+        return crc32_z_default(crc, buf, len);
4e3973
+
4e3973
+    if ((uintptr_t)buf & VX_ALIGN_MASK) {
4e3973
+        prealign = VX_ALIGNMENT - ((uintptr_t)buf & VX_ALIGN_MASK);
4e3973
+        len -= prealign;
68c528
+        crc = crc32_z_default(crc, buf, prealign);
4e3973
+        buf += prealign;
4e3973
+    }
4e3973
+    aligned = len & ~VX_ALIGN_MASK;
4e3973
+    remaining = len & VX_ALIGN_MASK;
4e3973
+
4e3973
+    crc = crc32_le_vgfm_16(crc ^ 0xffffffff, buf, (size_t)aligned) ^ 0xffffffff;
4e3973
+
4e3973
+    if (remaining)
68c528
+        crc = crc32_z_default(crc, buf + aligned, remaining);
4e3973
+
4e3973
+    return crc;
4e3973
+}
4e3973
+
68c528
+Z_IFUNC(crc32_z)
68c528
+{
4e3973
+    if (hwcap & HWCAP_S390_VX)
4e3973
+        return s390_crc32_vx;
68c528
+    return crc32_z_default;
68c528
+}
68c528
diff --git a/crc32.c b/crc32.c
68c528
index b0cda20..379fac3 100644
68c528
--- a/crc32.c
68c528
+++ b/crc32.c
68c528
@@ -199,12 +199,12 @@ const z_crc_t FAR * ZEXPORT get_crc_table()
68c528
 #define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1
4e3973
 
68c528
 /* ========================================================================= */
68c528
-#ifdef Z_POWER_OPT
68c528
+#if defined(Z_POWER_OPT) || defined(HAVE_S390X_VX)
68c528
 /* Rename function so resolver can use its symbol. The default version will be
68c528
  * returned by the resolver if the host has no support for an optimized version.
68c528
  */
68c528
 #define crc32_z crc32_z_default
68c528
-#endif /* Z_POWER_OPT */
68c528
+#endif /* defined(Z_POWER_OPT) || defined(HAVE_S390X_VX) */
4e3973
 
68c528
 unsigned long ZEXPORT crc32_z(crc, buf, len)
68c528
     unsigned long crc;
68c528
@@ -240,10 +240,15 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
68c528
     return crc ^ 0xffffffffUL;
4e3973
 }
4e3973
 
68c528
-#ifdef Z_POWER_OPT
68c528
+#if defined(Z_POWER_OPT) || defined(HAVE_S390X_VX)
68c528
 #undef crc32_z
68c528
+#ifdef Z_POWER_OPT
68c528
 #include "contrib/power/crc32_z_resolver.c"
68c528
 #endif /* Z_POWER_OPT */
68c528
+#ifdef HAVE_S390X_VX
68c528
+#include "contrib/s390/crc32_z_resolver.c"
68c528
+#endif /* HAVE_S390X_VX */
68c528
+#endif /* defined(Z_POWER_OPT) || defined(HAVE_S390X_VX) */
68c528
 
68c528
 /* ========================================================================= */
68c528
 unsigned long ZEXPORT crc32(crc, buf, len)
4e3973
-- 
68c528
2.39.1
4e3973