From: Hans Kristian Rosbach Date: Tue, 12 May 2015 09:48:14 +0000 (+0200) Subject: Combine CRC32_UNROLL_LESS and ADLER32_UNROLL_LESS into UNROLL_LESS X-Git-Tag: 1.9.9-b1~838 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cd2fda2a376cfa359840f1e7e0b7338c9f5e15b;p=thirdparty%2Fzlib-ng.git Combine CRC32_UNROLL_LESS and ADLER32_UNROLL_LESS into UNROLL_LESS --- diff --git a/adler32.c b/adler32.c index 6d32159c1..e502919cd 100644 --- a/adler32.c +++ b/adler32.c @@ -103,13 +103,13 @@ uint32_t ZEXPORT adler32(adler, buf, len) /* do length NMAX blocks -- requires just one modulo operation */ while (len >= NMAX) { len -= NMAX; -#ifndef ADLER32_UNROLL_LESS +#ifndef UNROLL_LESS n = NMAX / 16; /* NMAX is divisible by 16 */ #else n = NMAX / 8; /* NMAX is divisible by 8 */ #endif do { -#ifndef ADLER32_UNROLL_LESS +#ifndef UNROLL_LESS DO16(buf); /* 16 sums unrolled */ buf += 16; #else @@ -123,7 +123,7 @@ uint32_t ZEXPORT adler32(adler, buf, len) /* do remaining bytes (less than NMAX, still just one modulo) */ if (len) { /* avoid modulos if none remaining */ -#ifndef ADLER32_UNROLL_LESS +#ifndef UNROLL_LESS while (len >= 16) { len -= 16; DO16(buf); diff --git a/configure b/configure index f3d0b8b1f..f1cc5031c 100755 --- a/configure +++ b/configure @@ -665,8 +665,8 @@ case "${ARCH}" in ;; esac - CFLAGS="${CFLAGS} -DUNALIGNED_OK -DADLER32_UNROLL_LESS -DCRC32_UNROLL_LESS -DX86_CPUID" - SFLAGS="${SFLAGS} -DUNALIGNED_OK -DADLER32_UNROLL_LESS -DCRC32_UNROLL_LESS -DX86_CPUID" + CFLAGS="${CFLAGS} -DUNALIGNED_OK -DUNROLL_LESS -DX86_CPUID" + SFLAGS="${SFLAGS} -DUNALIGNED_OK -DUNROLL_LESS -DX86_CPUID" # Enable arch-specific optimizations? if test $without_optimizations -eq 0; then @@ -708,10 +708,10 @@ case "${ARCH}" in case "${ARCH}" in armv6l | armv6hl) - # Tests done on Raspberry pi (armv6hl) indicate that UNALIGNED_OK and CRC32_UNROLL_LESS both + # Tests done on Raspberry pi (armv6hl) indicate that UNALIGNED_OK and UNROLL_LESS both # provide performance improvements, totaling about 1.5% for the two. - CFLAGS="${CFLAGS} -DUNALIGNED_OK -DADLER32_UNROLL_LESS -DCRC32_UNROLL_LESS" - SFLAGS="${SFLAGS} -DUNALIGNED_OK -DADLER32_UNROLL_LESS -DCRC32_UNROLL_LESS" + CFLAGS="${CFLAGS} -DUNALIGNED_OK -DUNROLL_LESS" + SFLAGS="${SFLAGS} -DUNALIGNED_OK -DUNROLL_LESS" ;; esac diff --git a/crc32.c b/crc32.c index 165368475..b1d542554 100644 --- a/crc32.c +++ b/crc32.c @@ -219,7 +219,7 @@ uint32_t ZEXPORT crc32(crc, buf, len) } crc = crc ^ 0xffffffff; -#ifdef CRC32_UNROLL_LESS +#ifdef UNROLL_LESS while (len >= 4) { DO4; len -= 4; @@ -260,7 +260,7 @@ static uint32_t crc32_little(uint32_t crc, const unsigned char *buf, unsigned le buf4 = (const z_crc_t *)(const void *)buf; -#ifndef CRC32_UNROLL_LESS +#ifndef UNROLL_LESS while (len >= 32) { DOLIT32; len -= 32; @@ -304,7 +304,7 @@ static uint32_t crc32_big(uint32_t crc, const unsigned char *buf, unsigned len) buf4 = (const z_crc_t *)(const void *)buf; buf4--; -#ifndef CRC32_UNROLL_LESS +#ifndef UNROLL_LESS while (len >= 32) { DOBIG32; len -= 32;