endif()
endif()
+#
+# Enable deflate_quick at level 1
+#
+if(NOT WITH_NEW_STRATEGIES)
+ add_definitions(-DNO_QUICK_STRATEGY)
+endif()
#
# Enable deflate_medium at level 4-6
#
if(HAVE_SSE42CRC_INTRIN)
add_definitions(-DX86_SSE42_CRC_INTRIN)
endif()
- if(WITH_NEW_STRATEGIES)
- add_definitions(-DX86_QUICK_STRATEGY)
- list(APPEND ZLIB_ARCH_SRCS ${ARCHDIR}/deflate_quick.c)
- add_feature_info(SSE42_DEFLATE_QUICK 1 "Support SSE4.2 accelerated quick compression")
- endif()
endif()
if(HAVE_SSE42CMPSTR_INTRIN)
add_definitions(-DX86_SSE42_CMP_STR)
compress.c
crc32.c
deflate.c
+ deflate_quick.c
deflate_fast.c
deflate_medium.c
deflate_slow.c
deflate.o \
deflate_fast.o \
deflate_medium.o \
+ deflate_quick.o \
deflate_slow.o \
functable.o \
infback.o \
deflate.lo \
deflate_fast.lo \
deflate_medium.lo \
+ deflate_quick.lo \
deflate_slow.lo \
functable.lo \
infback.lo \
x86.o x86.lo \
compare258_avx.o compare258_avx.lo \
compare258_sse.o compare258_sse.lo \
- deflate_quick.o deflate_quick.lo \
insert_string_sse.o insert_string_sse.lo \
crc_folding.o crc_folding.lo \
slide_avx.o slide_avx.lo
compare258_sse.lo:
$(CC) $(SFLAGS) $(SSE4FLAG) -DPIC $(INCLUDES) -c -o $@ $(SRCDIR)/compare258_sse.c
-deflate_quick.o:
- $(CC) $(CFLAGS) $(SSE4FLAG) $(INCLUDES) -c -o $@ $(SRCDIR)/deflate_quick.c
-
-deflate_quick.lo:
- $(CC) $(SFLAGS) $(SSE4FLAG) -DPIC $(INCLUDES) -c -o $@ $(SRCDIR)/deflate_quick.c
-
insert_string_sse.o:
$(CC) $(CFLAGS) $(SSE4FLAG) $(INCLUDES) -c -o $@ $(SRCDIR)/insert_string_sse.c
this function needs to be updated.
*/
z_size_t ZEXPORT PREFIX(compressBound)(z_size_t sourceLen) {
-#ifdef X86_QUICK_STRATEGY
+#ifndef NO_QUICK_STRATEGY
/* Quick deflate strategy worse case is 9 bits per literal, rounded to nearest byte,
plus the size of block & gzip headers and footers */
return sourceLen + ((sourceLen + 13 + 7) >> 3) + 18;
HAVE_PCLMULQDQ_INTRIN=0
fi
+ # Enable deflate_medium at level 1
+ if test $without_new_strategies -eq 1; then
+ CFLAGS="${CFLAGS} -DNO_QUICK_STRATEGY"
+ SFLAGS="${SFLAGS} -DNO_QUICK_STRATEGY"
+ fi
# Enable deflate_medium at level 4-6
if test $without_new_strategies -eq 1; then
CFLAGS="${CFLAGS} -DNO_MEDIUM_STRATEGY"
CFLAGS="${CFLAGS} -DX86_NOCHECK_SSE2"
SFLAGS="${SFLAGS} -DX86_NOCHECK_SSE2"
fi
-
- # Enable deflate_quick at level 1?
- if test $without_new_strategies -eq 0; then
- CFLAGS="${CFLAGS} -DX86_QUICK_STRATEGY"
- SFLAGS="${SFLAGS} -DX86_QUICK_STRATEGY"
-
- ARCH_STATIC_OBJS="${ARCH_STATIC_OBJS} deflate_quick.o"
- ARCH_SHARED_OBJS="${ARCH_SHARED_OBJS} deflate_quick.lo"
- fi
fi
if test ${HAVE_SSE42CRC_INTRIN} -eq 1; then
ARCH_STATIC_OBJS="${ARCH_STATIC_OBJS} compare258_sse.o"
ARCH_SHARED_OBJS="${ARCH_SHARED_OBJS} compare258_sse.lo"
fi
-
- # Enable deflate_quick at level 1?
- if test $without_new_strategies -eq 0; then
- CFLAGS="${CFLAGS} -DX86_QUICK_STRATEGY"
- SFLAGS="${SFLAGS} -DX86_QUICK_STRATEGY"
-
- ARCH_STATIC_OBJS="${ARCH_STATIC_OBJS} deflate_quick.o"
- ARCH_SHARED_OBJS="${ARCH_SHARED_OBJS} deflate_quick.lo"
- fi
fi
;;
/* good lazy nice chain */
/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */
-#ifdef X86_QUICK_STRATEGY
+#ifndef NO_QUICK_STRATEGY
/* 1 */ {4, 4, 8, 4, deflate_quick},
/* 2 */ {4, 4, 8, 4, deflate_fast}, /* max speed, no lazy matches */
#else
if (windowBits == 8)
windowBits = 9; /* until 256-byte window bug fixed */
-#ifdef X86_QUICK_STRATEGY
+#ifndef NO_QUICK_STRATEGY
if (level == 1)
windowBits = 13;
#endif
s->level == 0 ? deflate_stored(s, flush) :
s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :
s->strategy == Z_RLE ? deflate_rle(s, flush) :
-#ifdef X86_QUICK_STRATEGY
- (s->level == 1 && !x86_cpu_has_sse42) ? deflate_fast(s, flush) :
+#ifndef NO_QUICK_STRATEGY
+ s->level == 1 ? deflate_fast(s, flush) :
#endif
(*(configuration_table[s->level].func))(s, flush);
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-#include "../../zbuild.h"
-#include <immintrin.h>
-#ifdef _MSC_VER
-# include <nmmintrin.h>
-#endif
-#include "../../deflate.h"
-#include "../../deflate_p.h"
-#include "../../functable.h"
-#include "../../memcopy.h"
-#include "../../trees_emit.h"
+#include "zbuild.h"
+#include "deflate.h"
+#include "deflate_p.h"
+#include "functable.h"
+#include "trees_emit.h"
extern const ct_data static_ltree[L_CODES+2];
extern const ct_data static_dtree[D_CODES];
deflate.obj \
deflate_fast.obj \
deflate_slow.obj \
+ deflate_quick.obj \
deflate_medium.obj \
functable.obj \
infback.obj \
uncompr.obj: $(SRCDIR)/uncompr.c $(SRCDIR)/zbuild.h $(SRCDIR)/zlib$(SUFFIX).h
crc32.obj: $(SRCDIR)/crc32.c $(SRCDIR)/zbuild.h $(SRCDIR)/zendian.h $(SRCDIR)/deflate.h $(SRCDIR)/functable.h $(SRCDIR)/crc32.h
deflate.obj: $(SRCDIR)/deflate.c $(SRCDIR)/zbuild.h $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/functable.h
+deflate_quick.obj: $(SRCDIR)/deflate_quick.c $(SRCDIR)/zbuild.h $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/functable.h $(SRCDIR)/trees_emit.h
deflate_fast.obj: $(SRCDIR)/deflate_fast.c $(SRCDIR)/zbuild.h $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/functable.h
deflate_medium.obj: $(SRCDIR)/deflate_medium.c $(SRCDIR)/zbuild.h $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/functable.h
deflate_slow.obj: $(SRCDIR)/deflate_slow.c $(SRCDIR)/zbuild.h $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/functable.h
deflate.obj: $(SRCDIR)/deflate.c $(SRCDIR)/zbuild.h $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/functable.h
deflate_fast.obj: $(SRCDIR)/deflate_fast.c $(SRCDIR)/zbuild.h $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/functable.h
deflate_medium.obj: $(SRCDIR)/deflate_medium.c $(SRCDIR)/zbuild.h $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/functable.h
+deflate_quick.obj: $(SRCDIR)/deflate_quick.c $(SRCDIR)/zbuild.h $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/functable.h $(SRCDIR)/trees_emit.h
deflate_slow.obj: $(SRCDIR)/deflate_slow.c $(SRCDIR)/zbuild.h $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/functable.h
infback.obj: $(SRCDIR)/infback.c $(SRCDIR)/zbuild.h $(SRCDIR)/zutil.h $(SRCDIR)/inftrees.h $(SRCDIR)/inflate.h $(SRCDIR)/inffast.h
inffast.obj: $(SRCDIR)/inffast.c $(SRCDIR)/zbuild.h $(SRCDIR)/zutil.h $(SRCDIR)/inftrees.h $(SRCDIR)/inflate.h $(SRCDIR)/inffast.h $(SRCDIR)/memcopy.h
RC = rc
CP = copy /y
CFLAGS = -nologo -MD -W3 -O2 -Oy- -Zi -Fd"zlib" $(LOC)
-WFLAGS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DX86_PCLMULQDQ_CRC -DX86_SSE2 -DX86_CPUID -DX86_SSE42_CRC_INTRIN -DX86_SSE42_CRC_HASH -DX86_AVX2 -DUNALIGNED_OK -DX86_QUICK_STRATEGY
+WFLAGS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DX86_PCLMULQDQ_CRC -DX86_SSE2 -DX86_CPUID -DX86_SSE42_CRC_INTRIN -DX86_SSE42_CRC_HASH -DX86_AVX2 -DUNALIGNED_OK
LDFLAGS = -nologo -debug -incremental:no -opt:ref -manifest
ARFLAGS = -nologo
RCFLAGS = /dWIN32 /r
deflate.obj: $(SRCDIR)/deflate.c $(SRCDIR)/zbuild.h $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/functable.h
deflate_fast.obj: $(SRCDIR)/deflate_fast.c $(SRCDIR)/zbuild.h $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/functable.h
deflate_medium.obj: $(SRCDIR)/deflate_medium.c $(SRCDIR)/zbuild.h $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/functable.h
-deflate_quick.obj: $(SRCDIR)/arch/x86/deflate_quick.c $(SRCDIR)/zbuild.h $(SRCDIR)/deflate.h $(SRCDIR)/memcopy.h
+deflate_quick.obj: $(SRCDIR)/deflate_quick.c $(SRCDIR)/zbuild.h $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/functable.h $(SRCDIR)/trees_emit.h
deflate_slow.obj: $(SRCDIR)/deflate_slow.c $(SRCDIR)/zbuild.h $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/functable.h
infback.obj: $(SRCDIR)/infback.c $(SRCDIR)/zbuild.h $(SRCDIR)/zutil.h $(SRCDIR)/inftrees.h $(SRCDIR)/inflate.h $(SRCDIR)/inffast.h
inffast.obj: $(SRCDIR)/inffast.c $(SRCDIR)/zbuild.h $(SRCDIR)/zutil.h $(SRCDIR)/inftrees.h $(SRCDIR)/inflate.h $(SRCDIR)/inffast.h $(SRCDIR)/memcopy.h