@@ -90,7 +90,7 @@ void ZSTD_fillHashTable(ZSTD_matchState_t* ms,
9090 * This is also the work we do at the beginning to enter the loop initially.
9191 */
9292FORCE_INLINE_TEMPLATE size_t
93- ZSTD_compressBlock_fast_generic (
93+ ZSTD_compressBlock_fast_noDict_generic (
9494 ZSTD_matchState_t * ms , seqStore_t * seqStore , U32 rep [ZSTD_REP_NUM ],
9595 void const * src , size_t srcSize ,
9696 U32 const mls )
@@ -310,6 +310,18 @@ ZSTD_compressBlock_fast_generic(
310310 goto _start ;
311311}
312312
313+ #define ZSTD_GEN_FAST_FN (dictMode , mls ) \
314+ static size_t ZSTD_compressBlock_fast_##dictMode##_##mls( \
315+ ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], \
316+ void const* src, size_t srcSize) \
317+ { \
318+ return ZSTD_compressBlock_fast_##dictMode##_generic(ms, seqStore, rep, src, srcSize, mls); \
319+ }
320+
321+ ZSTD_GEN_FAST_FN (noDict , 4 )
322+ ZSTD_GEN_FAST_FN (noDict , 5 )
323+ ZSTD_GEN_FAST_FN (noDict , 6 )
324+ ZSTD_GEN_FAST_FN (noDict , 7 )
313325
314326size_t ZSTD_compressBlock_fast (
315327 ZSTD_matchState_t * ms , seqStore_t * seqStore , U32 rep [ZSTD_REP_NUM ],
@@ -321,13 +333,13 @@ size_t ZSTD_compressBlock_fast(
321333 {
322334 default : /* includes case 3 */
323335 case 4 :
324- return ZSTD_compressBlock_fast_generic (ms , seqStore , rep , src , srcSize , 4 );
336+ return ZSTD_compressBlock_fast_noDict_4 (ms , seqStore , rep , src , srcSize );
325337 case 5 :
326- return ZSTD_compressBlock_fast_generic (ms , seqStore , rep , src , srcSize , 5 );
338+ return ZSTD_compressBlock_fast_noDict_5 (ms , seqStore , rep , src , srcSize );
327339 case 6 :
328- return ZSTD_compressBlock_fast_generic (ms , seqStore , rep , src , srcSize , 6 );
340+ return ZSTD_compressBlock_fast_noDict_6 (ms , seqStore , rep , src , srcSize );
329341 case 7 :
330- return ZSTD_compressBlock_fast_generic (ms , seqStore , rep , src , srcSize , 7 );
342+ return ZSTD_compressBlock_fast_noDict_7 (ms , seqStore , rep , src , srcSize );
331343 }
332344}
333345
@@ -479,6 +491,12 @@ size_t ZSTD_compressBlock_fast_dictMatchState_generic(
479491 return (size_t )(iend - anchor );
480492}
481493
494+
495+ ZSTD_GEN_FAST_FN (dictMatchState , 4 )
496+ ZSTD_GEN_FAST_FN (dictMatchState , 5 )
497+ ZSTD_GEN_FAST_FN (dictMatchState , 6 )
498+ ZSTD_GEN_FAST_FN (dictMatchState , 7 )
499+
482500size_t ZSTD_compressBlock_fast_dictMatchState (
483501 ZSTD_matchState_t * ms , seqStore_t * seqStore , U32 rep [ZSTD_REP_NUM ],
484502 void const * src , size_t srcSize )
@@ -489,13 +507,13 @@ size_t ZSTD_compressBlock_fast_dictMatchState(
489507 {
490508 default : /* includes case 3 */
491509 case 4 :
492- return ZSTD_compressBlock_fast_dictMatchState_generic (ms , seqStore , rep , src , srcSize , 4 );
510+ return ZSTD_compressBlock_fast_dictMatchState_4 (ms , seqStore , rep , src , srcSize );
493511 case 5 :
494- return ZSTD_compressBlock_fast_dictMatchState_generic (ms , seqStore , rep , src , srcSize , 5 );
512+ return ZSTD_compressBlock_fast_dictMatchState_5 (ms , seqStore , rep , src , srcSize );
495513 case 6 :
496- return ZSTD_compressBlock_fast_dictMatchState_generic (ms , seqStore , rep , src , srcSize , 6 );
514+ return ZSTD_compressBlock_fast_dictMatchState_6 (ms , seqStore , rep , src , srcSize );
497515 case 7 :
498- return ZSTD_compressBlock_fast_dictMatchState_generic (ms , seqStore , rep , src , srcSize , 7 );
516+ return ZSTD_compressBlock_fast_dictMatchState_7 (ms , seqStore , rep , src , srcSize );
499517 }
500518}
501519
@@ -530,7 +548,7 @@ static size_t ZSTD_compressBlock_fast_extDict_generic(
530548
531549 /* switch to "regular" variant if extDict is invalidated due to maxDistance */
532550 if (prefixStartIndex == dictStartIndex )
533- return ZSTD_compressBlock_fast_generic (ms , seqStore , rep , src , srcSize , mls );
551+ return ZSTD_compressBlock_fast (ms , seqStore , rep , src , srcSize );
534552
535553 /* Search Loop */
536554 while (ip < ilimit ) { /* < instead of <=, because (ip+1) */
@@ -603,6 +621,10 @@ static size_t ZSTD_compressBlock_fast_extDict_generic(
603621 return (size_t )(iend - anchor );
604622}
605623
624+ ZSTD_GEN_FAST_FN (extDict , 4 )
625+ ZSTD_GEN_FAST_FN (extDict , 5 )
626+ ZSTD_GEN_FAST_FN (extDict , 6 )
627+ ZSTD_GEN_FAST_FN (extDict , 7 )
606628
607629size_t ZSTD_compressBlock_fast_extDict (
608630 ZSTD_matchState_t * ms , seqStore_t * seqStore , U32 rep [ZSTD_REP_NUM ],
@@ -613,12 +635,12 @@ size_t ZSTD_compressBlock_fast_extDict(
613635 {
614636 default : /* includes case 3 */
615637 case 4 :
616- return ZSTD_compressBlock_fast_extDict_generic (ms , seqStore , rep , src , srcSize , 4 );
638+ return ZSTD_compressBlock_fast_extDict_4 (ms , seqStore , rep , src , srcSize );
617639 case 5 :
618- return ZSTD_compressBlock_fast_extDict_generic (ms , seqStore , rep , src , srcSize , 5 );
640+ return ZSTD_compressBlock_fast_extDict_5 (ms , seqStore , rep , src , srcSize );
619641 case 6 :
620- return ZSTD_compressBlock_fast_extDict_generic (ms , seqStore , rep , src , srcSize , 6 );
642+ return ZSTD_compressBlock_fast_extDict_6 (ms , seqStore , rep , src , srcSize );
621643 case 7 :
622- return ZSTD_compressBlock_fast_extDict_generic (ms , seqStore , rep , src , srcSize , 7 );
644+ return ZSTD_compressBlock_fast_extDict_7 (ms , seqStore , rep , src , srcSize );
623645 }
624646}
0 commit comments