]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Combine CRC32_UNROLL_LESS and ADLER32_UNROLL_LESS into UNROLL_LESS
authorHans Kristian Rosbach <hk-git@circlestorm.org>
Tue, 12 May 2015 09:48:14 +0000 (11:48 +0200)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Tue, 12 May 2015 09:48:14 +0000 (11:48 +0200)
adler32.c
configure
crc32.c

index 6d32159c13f32f5caf0e9148923efb244c9afe13..e502919cdcd87feb579e3f84d99578815c7f670d 100644 (file)
--- 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);
index f3d0b8b1f6e2d3660c1604516d7f7399b8345492..f1cc5031c95dc94f1f6d38bd97e62247253c70cf 100755 (executable)
--- 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 165368475e1cf35a755eae00239a4881ac68153b..b1d542554493713a86c82f050c1f3320fd47c85c 100644 (file)
--- 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;