From: inikep Date: Tue, 5 Apr 2016 08:18:37 +0000 (+0200) Subject: removed kSlotNew X-Git-Tag: v0.6.0^2~17^2~16^2~8^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74e3a7ba4c28eb4707ec1f0610fcdfa0c7d9575f;p=thirdparty%2Fzstd.git removed kSlotNew --- diff --git a/lib/zstd_compress.c b/lib/zstd_compress.c index 38b3f6083..e1ca3021e 100644 --- a/lib/zstd_compress.c +++ b/lib/zstd_compress.c @@ -1738,17 +1738,10 @@ _storeSequence: { #if ZSTD_REP_NUM == 4 if (offset >= ZSTD_REP_NUM) { -#if 1 rep[3] = rep[2]; rep[2] = rep[1]; rep[1] = rep[0]; rep[0] = offset - ZSTD_REP_MOVE; -#else - if (kSlotNew < 3) rep[3] = rep[2]; - if (kSlotNew < 2) rep[2] = rep[1]; - if (kSlotNew < 1) rep[1] = rep[0]; - rep[kSlotNew] = offset - ZSTD_REP_MOVE; -#endif } else { if (offset != 0) { size_t temp = rep[offset]; diff --git a/lib/zstd_decompress.c b/lib/zstd_decompress.c index 65d214a21..6ad49ee7a 100644 --- a/lib/zstd_decompress.c +++ b/lib/zstd_decompress.c @@ -727,17 +727,10 @@ static void ZSTD_decodeSequence(seq_t* seq, seqState_t* seqState, const U32 mls) } } else { offset -= ZSTD_REP_MOVE; - #if 1 // faster without kSlotNew seqState->prevOffset[3] = seqState->prevOffset[2]; seqState->prevOffset[2] = seqState->prevOffset[1]; seqState->prevOffset[1] = seqState->prevOffset[0]; seqState->prevOffset[0] = offset; - #else - if (kSlotNew < 3) seqState->prevOffset[3] = seqState->prevOffset[2]; - if (kSlotNew < 2) seqState->prevOffset[2] = seqState->prevOffset[1]; - if (kSlotNew < 1) seqState->prevOffset[1] = seqState->prevOffset[0]; - seqState->prevOffset[kSlotNew] = offset; - #endif } } seq->offset = offset; diff --git a/lib/zstd_internal.h b/lib/zstd_internal.h index c3ad3e1c9..951617d5d 100644 --- a/lib/zstd_internal.h +++ b/lib/zstd_internal.h @@ -46,17 +46,6 @@ #define MIN(a,b) ((a)<(b) ? (a) : (b)) #define MAX(a,b) ((a)>(b) ? (a) : (b)) -#define ZSTD_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) - -#if (ZSTD_GCC_VERSION >= 302) || (__INTEL_COMPILER >= 800) || defined(__clang__) -# define expect(expr,value) (__builtin_expect ((expr),(value)) ) -#else -# define expect(expr,value) (expr) -#endif - -#define likely(expr) expect((expr) != 0, 1) -#define unlikely(expr) expect((expr) != 0, 0) - /*-************************************* * Common constants @@ -256,7 +245,6 @@ typedef struct { ZSTD_stats_t stats; } seqStore_t; -extern int kSlotNew; const seqStore_t* ZSTD_getSeqStore(const ZSTD_CCtx* ctx); void ZSTD_seqToCodes(const seqStore_t* seqStorePtr, size_t const nbSeq); size_t ZSTD_compressBegin_targetSrcSize(ZSTD_CCtx* zc, const void* dict, size_t dictSize, size_t targetSrcSize, int compressionLevel); diff --git a/lib/zstd_opt.h b/lib/zstd_opt.h index 84cb406ce..684eedb11 100644 --- a/lib/zstd_opt.h +++ b/lib/zstd_opt.h @@ -551,11 +551,10 @@ void ZSTD_compressBlock_opt_generic(ZSTD_CCtx* ctx, mlen = opt[cur].mlen; if (opt[cur].off >= ZSTD_REP_NUM) { - opt[cur].rep[3] = (kSlotNew < 3) ? opt[cur-mlen].rep[2] : opt[cur-mlen].rep[3]; - opt[cur].rep[2] = (kSlotNew < 2) ? opt[cur-mlen].rep[1] : opt[cur-mlen].rep[2]; - opt[cur].rep[1] = (kSlotNew < 1) ? opt[cur-mlen].rep[0] : opt[cur-mlen].rep[1]; - opt[cur].rep[0] = opt[cur-mlen].rep[0]; - opt[cur].rep[kSlotNew] = opt[cur].off - ZSTD_REP_MOVE; + opt[cur].rep[3] = opt[cur-mlen].rep[2]; + opt[cur].rep[2] = opt[cur-mlen].rep[1]; + opt[cur].rep[1] = opt[cur-mlen].rep[0]; + opt[cur].rep[0] = opt[cur].off - ZSTD_REP_MOVE; ZSTD_LOG_ENCODE("%d: COPYREP_OFF cur=%d mlen=%d rep=%d rep[1]=%d\n", (int)(inr-base), cur, mlen, opt[cur].rep[0], opt[cur].rep[1]); } else { opt[cur].rep[3] = (opt[cur].off > 2) ? opt[cur-mlen].rep[2] : opt[cur-mlen].rep[3]; @@ -685,10 +684,10 @@ _storeSequence: /* cur, last_pos, best_mlen, best_off have to be set */ ZSTD_LOG_ENCODE("%d/%d: ENCODE literals=%d mlen=%d off=%d rep1=%d rep[1]=%d\n", (int)(ip-base), (int)(iend-base), (int)(litLength), (int)mlen, (int)(offset), (int)rep[0], (int)rep[1]); if (offset >= ZSTD_REP_NUM) { - if (kSlotNew < 3) rep[3] = rep[2]; - if (kSlotNew < 2) rep[2] = rep[1]; - if (kSlotNew < 1) rep[1] = rep[0]; - rep[kSlotNew] = offset - ZSTD_REP_MOVE; + rep[3] = rep[2]; + rep[2] = rep[1]; + rep[1] = rep[0]; + rep[0] = offset - ZSTD_REP_MOVE; } else { if (offset != 0) { size_t temp = rep[offset]; diff --git a/programs/bench.c b/programs/bench.c index 53460fa40..cea9634c2 100644 --- a/programs/bench.c +++ b/programs/bench.c @@ -234,8 +234,6 @@ typedef struct #define MIN(a,b) ((a)<(b) ? (a) : (b)) #define MAX(a,b) ((a)>(b) ? (a) : (b)) -int kSlotNew = 0; - static int BMK_benchMem(const void* srcBuffer, size_t srcSize, const char* displayName, int cLevel, const size_t* fileSizes, U32 nbFiles, @@ -460,7 +458,6 @@ static void BMK_benchCLevel(void* srcBuffer, size_t benchedSize, memset(&result, 0, sizeof(result)); memset(&total, 0, sizeof(total)); - kSlotNew = g_additionalParam; if (g_displayLevel == 1 && !g_additionalParam) DISPLAY("bench %s: input %u bytes, %i iterations, %u KB blocks\n", ZSTD_VERSION, (U32)benchedSize, g_nbIterations, (U32)(g_blockSize>>10));