Lines Matching +full:0 +full:ms
20 ZSTD_updateDUBT(ZSTD_matchState_t* ms, in ZSTD_updateDUBT() argument
24 const ZSTD_compressionParameters* const cParams = &ms->cParams; in ZSTD_updateDUBT()
25 U32* const hashTable = ms->hashTable; in ZSTD_updateDUBT()
28 U32* const bt = ms->chainTable; in ZSTD_updateDUBT()
32 const BYTE* const base = ms->window.base; in ZSTD_updateDUBT()
34 U32 idx = ms->nextToUpdate; in ZSTD_updateDUBT()
38 idx, target, ms->window.dictLimit); in ZSTD_updateDUBT()
42 assert(idx >= ms->window.dictLimit); /* condition for valid base+idx */ in ZSTD_updateDUBT()
55 ms->nextToUpdate = target; in ZSTD_updateDUBT()
64 ZSTD_insertDUBT1(const ZSTD_matchState_t* ms, in ZSTD_insertDUBT1() argument
69 const ZSTD_compressionParameters* const cParams = &ms->cParams; in ZSTD_insertDUBT1()
70 U32* const bt = ms->chainTable; in ZSTD_insertDUBT1()
73 size_t commonLengthSmaller=0, commonLengthLarger=0; in ZSTD_insertDUBT1()
74 const BYTE* const base = ms->window.base; in ZSTD_insertDUBT1()
75 const BYTE* const dictBase = ms->window.dictBase; in ZSTD_insertDUBT1()
76 const U32 dictLimit = ms->window.dictLimit; in ZSTD_insertDUBT1()
86 U32 const windowValid = ms->window.lowLimit; in ZSTD_insertDUBT1()
110 …rt( (matchIndex+matchLength >= dictLimit) /* might be wrong if extDict is incorrectly set to 0 */ in ZSTD_insertDUBT1()
143 matchIndex, btLow, nextPtr[0]); in ZSTD_insertDUBT1()
145 matchIndex = nextPtr[0]; in ZSTD_insertDUBT1()
148 *smallerPtr = *largerPtr = 0; in ZSTD_insertDUBT1()
154 const ZSTD_matchState_t* ms, in ZSTD_DUBT_findBetterDictMatch() argument
162 const ZSTD_matchState_t * const dms = ms->dictMatchState; in ZSTD_DUBT_findBetterDictMatch()
169 const BYTE* const base = ms->window.base; in ZSTD_DUBT_findBetterDictMatch()
170 const BYTE* const prefixStart = base + ms->window.dictLimit; in ZSTD_DUBT_findBetterDictMatch()
176 U32 const dictIndexDelta = ms->window.lowLimit - dictHighLimit; in ZSTD_DUBT_findBetterDictMatch()
183 size_t commonLengthSmaller=0, commonLengthLarger=0; in ZSTD_DUBT_findBetterDictMatch()
198 …h-bestLength)) > (int)(ZSTD_highbit32(curr-matchIndex+1) - ZSTD_highbit32((U32)offsetPtr[0]+1)) ) { in ZSTD_DUBT_findBetterDictMatch()
216 dictMatchIndex = nextPtr[0]; in ZSTD_DUBT_findBetterDictMatch()
231 ZSTD_DUBT_findBestMatch(ZSTD_matchState_t* ms, in ZSTD_DUBT_findBestMatch() argument
237 const ZSTD_compressionParameters* const cParams = &ms->cParams; in ZSTD_DUBT_findBestMatch()
238 U32* const hashTable = ms->hashTable; in ZSTD_DUBT_findBestMatch()
243 const BYTE* const base = ms->window.base; in ZSTD_DUBT_findBestMatch()
245 U32 const windowLow = ZSTD_getLowestMatchIndex(ms, curr, cParams->windowLog); in ZSTD_DUBT_findBestMatch()
247 U32* const bt = ms->chainTable; in ZSTD_DUBT_findBestMatch()
250 U32 const btLow = (btMask >= curr) ? 0 : curr - btMask; in ZSTD_DUBT_findBestMatch()
257 U32 previousCandidate = 0; in ZSTD_DUBT_findBestMatch()
283 *nextCandidate = *unsortedMark = 0; in ZSTD_DUBT_findBestMatch()
288 while (matchIndex) { /* will end on matchIndex == 0 */ in ZSTD_DUBT_findBestMatch()
291 ZSTD_insertDUBT1(ms, matchIndex, iend, in ZSTD_DUBT_findBestMatch()
298 { size_t commonLengthSmaller = 0, commonLengthLarger = 0; in ZSTD_DUBT_findBestMatch()
299 const BYTE* const dictBase = ms->window.dictBase; in ZSTD_DUBT_findBestMatch()
300 const U32 dictLimit = ms->window.dictLimit; in ZSTD_DUBT_findBestMatch()
307 size_t bestLength = 0; in ZSTD_DUBT_findBestMatch()
330 …gth-bestLength)) > (int)(ZSTD_highbit32(curr-matchIndex+1) - ZSTD_highbit32((U32)offsetPtr[0]+1)) ) in ZSTD_DUBT_findBestMatch()
334 nbCompares = 0; /* in addition to avoiding checking any in ZSTD_DUBT_findBestMatch()
355 matchIndex = nextPtr[0]; in ZSTD_DUBT_findBestMatch()
358 *smallerPtr = *largerPtr = 0; in ZSTD_DUBT_findBestMatch()
363 ms, ip, iend, in ZSTD_DUBT_findBestMatch()
369 ms->nextToUpdate = matchEndIdx - 8; /* skip repetitive patterns */ in ZSTD_DUBT_findBestMatch()
382 ZSTD_BtFindBestMatch( ZSTD_matchState_t* ms, in ZSTD_BtFindBestMatch() argument
389 if (ip < ms->window.base + ms->nextToUpdate) return 0; /* skipped area */ in ZSTD_BtFindBestMatch()
390 ZSTD_updateDUBT(ms, ip, iLimit, mls); in ZSTD_BtFindBestMatch()
391 return ZSTD_DUBT_findBestMatch(ms, ip, iLimit, offsetPtr, mls, dictMode); in ZSTD_BtFindBestMatch()
398 void ZSTD_dedicatedDictSearch_lazy_loadDictionary(ZSTD_matchState_t* ms, const BYTE* const ip) in ZSTD_dedicatedDictSearch_lazy_loadDictionary() argument
400 const BYTE* const base = ms->window.base; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
402 U32* const hashTable = ms->hashTable; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
403 U32* const chainTable = ms->chainTable; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
404 U32 const chainSize = 1 << ms->cParams.chainLog; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
405 U32 idx = ms->nextToUpdate; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
409 U32 const chainAttempts = (1 << ms->cParams.searchLog) - cacheSize; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
417 U32 const hashLog = ms->cParams.hashLog - ZSTD_LAZY_DDSS_BUCKET_LOG; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
424 assert(ms->cParams.chainLog <= 24); in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
425 assert(ms->cParams.hashLog > ms->cParams.chainLog); in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
426 assert(idx != 0); in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
431 U32 const h = (U32)ZSTD_hashPtr(base + idx, hashLog, ms->cParams.minMatch); in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
440 U32 chainPos = 0; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
441 for (hashIdx = 0; hashIdx < (1U << hashLog); hashIdx++) { in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
443 U32 countBeyondMinChain = 0; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
445 for (count = 0; i >= tmpMinChain && count < cacheSize; count++) { in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
454 for (count = 0; count < chainLimit;) { in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
476 count = 0; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
481 tmpHashTable[hashIdx] = 0; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
492 for (i = 0; i < cacheSize; i++) { in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
493 hashTable[bucketIdx + i] = 0; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
499 for (idx = ms->nextToUpdate; idx < target; idx++) { in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
500 U32 const h = (U32)ZSTD_hashPtr(base + idx, hashLog, ms->cParams.minMatch) in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
509 ms->nextToUpdate = target; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
531 for (ddsAttempt = 0; ddsAttempt < bucketSize - 1; ddsAttempt++) { in ZSTD_dedicatedDictSearch_lazy_search()
542 for (ddsAttempt = 0; ddsAttempt < bucketLimit; ddsAttempt++) { in ZSTD_dedicatedDictSearch_lazy_search()
543 size_t currentMl=0; in ZSTD_dedicatedDictSearch_lazy_search()
575 U32 const chainLength = chainPackedPointer & 0xFF; in ZSTD_dedicatedDictSearch_lazy_search()
580 for (chainAttempt = 0 ; chainAttempt < chainLimit; chainAttempt++) { in ZSTD_dedicatedDictSearch_lazy_search()
584 for (chainAttempt = 0 ; chainAttempt < chainLimit; chainAttempt++, chainIndex++) { in ZSTD_dedicatedDictSearch_lazy_search()
585 size_t currentMl=0; in ZSTD_dedicatedDictSearch_lazy_search()
618 ZSTD_matchState_t* ms, in ZSTD_insertAndFindFirstIndex_internal() argument
622 U32* const hashTable = ms->hashTable; in ZSTD_insertAndFindFirstIndex_internal()
624 U32* const chainTable = ms->chainTable; in ZSTD_insertAndFindFirstIndex_internal()
626 const BYTE* const base = ms->window.base; in ZSTD_insertAndFindFirstIndex_internal()
628 U32 idx = ms->nextToUpdate; in ZSTD_insertAndFindFirstIndex_internal()
637 ms->nextToUpdate = target; in ZSTD_insertAndFindFirstIndex_internal()
641 U32 ZSTD_insertAndFindFirstIndex(ZSTD_matchState_t* ms, const BYTE* ip) { in ZSTD_insertAndFindFirstIndex() argument
642 const ZSTD_compressionParameters* const cParams = &ms->cParams; in ZSTD_insertAndFindFirstIndex()
643 return ZSTD_insertAndFindFirstIndex_internal(ms, cParams, ip, ms->cParams.minMatch); in ZSTD_insertAndFindFirstIndex()
649 ZSTD_matchState_t* ms, in ZSTD_HcFindBestMatch() argument
654 const ZSTD_compressionParameters* const cParams = &ms->cParams; in ZSTD_HcFindBestMatch()
655 U32* const chainTable = ms->chainTable; in ZSTD_HcFindBestMatch()
658 const BYTE* const base = ms->window.base; in ZSTD_HcFindBestMatch()
659 const BYTE* const dictBase = ms->window.dictBase; in ZSTD_HcFindBestMatch()
660 const U32 dictLimit = ms->window.dictLimit; in ZSTD_HcFindBestMatch()
665 const U32 lowestValid = ms->window.lowLimit; in ZSTD_HcFindBestMatch()
667 const U32 isDictionary = (ms->loadedDictEnd != 0); in ZSTD_HcFindBestMatch()
669 const U32 minChain = curr > chainSize ? curr - chainSize : 0; in ZSTD_HcFindBestMatch()
673 const ZSTD_matchState_t* const dms = ms->dictMatchState; in ZSTD_HcFindBestMatch()
675 ? dms->cParams.hashLog - ZSTD_LAZY_DDSS_BUCKET_LOG : 0; in ZSTD_HcFindBestMatch()
677 ? ZSTD_hashPtr(ip, ddsHashLog, mls) << ZSTD_LAZY_DDSS_BUCKET_LOG : 0; in ZSTD_HcFindBestMatch()
687 matchIndex = ZSTD_insertAndFindFirstIndex_internal(ms, cParams, ip, mls); in ZSTD_HcFindBestMatch()
689 for ( ; (matchIndex>=lowLimit) & (nbAttempts>0) ; nbAttempts--) { in ZSTD_HcFindBestMatch()
690 size_t currentMl=0; in ZSTD_HcFindBestMatch()
727 const U32 dmsMinChain = dmsSize > dmsChainSize ? dmsSize - dmsChainSize : 0; in ZSTD_HcFindBestMatch()
731 for ( ; (matchIndex>=dmsLowestIndex) & (nbAttempts>0) ; nbAttempts--) { in ZSTD_HcFindBestMatch()
732 size_t currentMl=0; in ZSTD_HcFindBestMatch()
773 assert(val != 0); in ZSTD_VecMask_next()
775 if (val != 0) { in ZSTD_VecMask_next()
781 __assume(0); in ZSTD_VecMask_next()
787 if (leastSignificantWord == 0) { in ZSTD_VecMask_next()
800 val = val - ((val >> 1) & 0x5555555555555555); in ZSTD_VecMask_next()
801 val = (val & 0x3333333333333333ULL) + ((val >> 2) & 0x3333333333333333ULL); in ZSTD_VecMask_next()
802 return (U32)((((val + (val >> 4)) & 0xF0F0F0F0F0F0F0FULL) * 0x101010101010101ULL) >> 56); in ZSTD_VecMask_next()
813 count &= 0x3F; /* for fickle pattern recognition */ in ZSTD_rotateRight_U64()
814 return (value >> count) | (U64)(value << ((0U - count) & 0x3F)); in ZSTD_rotateRight_U64()
820 count &= 0x1F; /* for fickle pattern recognition */ in ZSTD_rotateRight_U32()
821 return (value >> count) | (U32)(value << ((0U - count) & 0x1F)); in ZSTD_rotateRight_U32()
827 count &= 0x0F; /* for fickle pattern recognition */ in ZSTD_rotateRight_U16()
828 return (value >> count) | (U16)(value << ((0U - count) & 0x0F)); in ZSTD_rotateRight_U16()
833 * value to reflect the update. Essentially cycles backwards from [0, {entries per row})
845 assert((align & (align - 1)) == 0); in ZSTD_isAligned()
846 return (((size_t)ptr) & (align - 1)) == 0; in ZSTD_isAligned()
871 FORCE_INLINE_TEMPLATE void ZSTD_row_fillHashCache(ZSTD_matchState_t* ms, const BYTE* base, in ZSTD_row_fillHashCache() argument
875 U32 const* const hashTable = ms->hashTable; in ZSTD_row_fillHashCache()
876 U16 const* const tagTable = ms->tagTable; in ZSTD_row_fillHashCache()
877 U32 const hashLog = ms->rowHashLog; in ZSTD_row_fillHashCache()
878 U32 const maxElemsToPrefetch = (base + idx) > iLimit ? 0 : (U32)(iLimit - (base + idx) + 1); in ZSTD_row_fillHashCache()
885 ms->hashCache[idx & ZSTD_ROW_HASH_CACHE_MASK] = hash; in ZSTD_row_fillHashCache()
888 …DEBUGLOG(6, "ZSTD_row_fillHashCache(): [%u %u %u %u %u %u %u %u]", ms->hashCache[0], ms->hashCache… in ZSTD_row_fillHashCache()
889 … ms->hashCache[2], ms->hashCache[3], ms->hashCache[4], in ZSTD_row_fillHashCache()
890 … ms->hashCache[5], ms->hashCache[6], ms->hashCache[7]); in ZSTD_row_fillHashCache()
914 FORCE_INLINE_TEMPLATE void ZSTD_row_update_internalImpl(ZSTD_matchState_t* ms, in ZSTD_row_update_internalImpl() argument
919 U32* const hashTable = ms->hashTable; in ZSTD_row_update_internalImpl()
920 U16* const tagTable = ms->tagTable; in ZSTD_row_update_internalImpl()
921 U32 const hashLog = ms->rowHashLog; in ZSTD_row_update_internalImpl()
922 const BYTE* const base = ms->window.base; in ZSTD_row_update_internalImpl()
926 …U32 const hash = useCache ? ZSTD_row_nextCachedHash(ms->hashCache, hashTable, tagTable, base, upda… in ZSTD_row_update_internalImpl()
941 …* Inserts the byte at ip into the appropriate position in the hash table, and updates ms->nextToUp…
944 FORCE_INLINE_TEMPLATE void ZSTD_row_update_internal(ZSTD_matchState_t* ms, const BYTE* ip, in ZSTD_row_update_internal() argument
948 U32 idx = ms->nextToUpdate; in ZSTD_row_update_internal()
949 const BYTE* const base = ms->window.base; in ZSTD_row_update_internal()
963 ZSTD_row_update_internalImpl(ms, idx, bound, mls, rowLog, rowMask, useCache); in ZSTD_row_update_internal()
965 ZSTD_row_fillHashCache(ms, base, rowLog, mls, idx, ip+1); in ZSTD_row_update_internal()
969 ZSTD_row_update_internalImpl(ms, idx, target, mls, rowLog, rowMask, useCache); in ZSTD_row_update_internal()
970 ms->nextToUpdate = target; in ZSTD_row_update_internal()
977 void ZSTD_row_update(ZSTD_matchState_t* const ms, const BYTE* ip) { in ZSTD_row_update() argument
978 const U32 rowLog = BOUNDED(4, ms->cParams.searchLog, 6); in ZSTD_row_update()
980 const U32 mls = MIN(ms->cParams.minMatch, 6 /* mls caps out at 6 */); in ZSTD_row_update()
983 ZSTD_row_update_internal(ms, ip, mls, rowLog, rowMask, 0 /* dont use cache */); in ZSTD_row_update()
991 int matches[4] = {0}; in ZSTD_row_getSSEMask()
994 for (i=0; i<nbChunks; i++) { in ZSTD_row_getSSEMask()
999 if (nbChunks == 1) return ZSTD_rotateRight_U16((U16)matches[0], head); in ZSTD_row_getSSEMask()
1000 if (nbChunks == 2) return ZSTD_rotateRight_U32((U32)matches[1] << 16 | (U32)matches[0], head); in ZSTD_row_getSSEMask()
1002 …U64((U64)matches[3] << 48 | (U64)matches[2] << 32 | (U64)matches[1] << 16 | (U64)matches[0], head); in ZSTD_row_getSSEMask()
1034 const U16 lo = (U16)vgetq_lane_u8(t3, 0); in ZSTD_row_getMatchMask()
1038 const uint8x16_t chunk0 = vreinterpretq_u8_u16(chunk.val[0]); in ZSTD_row_getMatchMask()
1048 const uint8x8_t t4 = vsri_n_u8(t3.val[1], t3.val[0], 4); in ZSTD_row_getMatchMask()
1049 const U32 matches = vget_lane_u32(vreinterpret_u32_u8(t4), 0); in ZSTD_row_getMatchMask()
1054 const uint8x16_t cmp0 = vceqq_u8(chunk.val[0], dup); in ZSTD_row_getMatchMask()
1064 const U64 matches = vget_lane_u64(vreinterpret_u64_u8(t4), 0); in ZSTD_row_getMatchMask()
1072 const size_t xFF = ~((size_t)0); in ZSTD_row_getMatchMask()
1073 const size_t x01 = xFF / 0xFF; in ZSTD_row_getMatchMask()
1076 ZSTD_VecMask matches = 0; in ZSTD_row_getMatchMask()
1080 const size_t extractMagic = (xFF / 0x7F) >> chunkSize; in ZSTD_row_getMatchMask()
1088 } while (i >= 0); in ZSTD_row_getMatchMask()
1091 const size_t extractMagic = (msb / 0x1FF) | msb; in ZSTD_row_getMatchMask()
1099 } while (i >= 0); in ZSTD_row_getMatchMask()
1130 ZSTD_matchState_t* ms, in ZSTD_RowFindBestMatch() argument
1136 U32* const hashTable = ms->hashTable; in ZSTD_RowFindBestMatch()
1137 U16* const tagTable = ms->tagTable; in ZSTD_RowFindBestMatch()
1138 U32* const hashCache = ms->hashCache; in ZSTD_RowFindBestMatch()
1139 const U32 hashLog = ms->rowHashLog; in ZSTD_RowFindBestMatch()
1140 const ZSTD_compressionParameters* const cParams = &ms->cParams; in ZSTD_RowFindBestMatch()
1141 const BYTE* const base = ms->window.base; in ZSTD_RowFindBestMatch()
1142 const BYTE* const dictBase = ms->window.dictBase; in ZSTD_RowFindBestMatch()
1143 const U32 dictLimit = ms->window.dictLimit; in ZSTD_RowFindBestMatch()
1148 const U32 lowestValid = ms->window.lowLimit; in ZSTD_RowFindBestMatch()
1150 const U32 isDictionary = (ms->loadedDictEnd != 0); in ZSTD_RowFindBestMatch()
1159 const ZSTD_matchState_t* const dms = ms->dictMatchState; in ZSTD_RowFindBestMatch()
1162 size_t ddsIdx = 0; in ZSTD_RowFindBestMatch()
1163 …U32 ddsExtraAttempts = 0; /* cctx hash tables are limited in searches, but allow extra searches in… in ZSTD_RowFindBestMatch()
1164 U32 dmsTag = 0; in ZSTD_RowFindBestMatch()
1174 ddsExtraAttempts = cParams->searchLog > rowLog ? 1U << (cParams->searchLog - rowLog) : 0; in ZSTD_RowFindBestMatch()
1190 ZSTD_row_update_internal(ms, ip, mls, rowLog, rowMask, 1 /* useCache */); in ZSTD_RowFindBestMatch()
1199 size_t numMatches = 0; in ZSTD_RowFindBestMatch()
1200 size_t currMatch = 0; in ZSTD_RowFindBestMatch()
1204 for (; (matches > 0) && (nbAttempts > 0); --nbAttempts, matches &= (matches - 1)) { in ZSTD_RowFindBestMatch()
1223 row[pos] = ms->nextToUpdate++; in ZSTD_RowFindBestMatch()
1229 size_t currentMl=0; in ZSTD_RowFindBestMatch()
1268 size_t numMatches = 0; in ZSTD_RowFindBestMatch()
1269 size_t currMatch = 0; in ZSTD_RowFindBestMatch()
1272 for (; (matches > 0) && (nbAttempts > 0); --nbAttempts, matches &= (matches - 1)) { in ZSTD_RowFindBestMatch()
1284 size_t currentMl=0; in ZSTD_RowFindBestMatch()
1308 ZSTD_matchState_t* ms,
1338 ZSTD_matchState_t* ms, \
1342 assert(MAX(4, MIN(6, ms->cParams.minMatch)) == mls); \
1343 return ZSTD_BtFindBestMatch(ms, ip, iLimit, offsetPtr, mls, ZSTD_##dictMode); \
1351 ZSTD_matchState_t* ms, \
1355 assert(MAX(4, MIN(6, ms->cParams.minMatch)) == mls); \
1356 return ZSTD_HcFindBestMatch(ms, ip, iLimit, offsetPtr, mls, ZSTD_##dictMode); \
1364 ZSTD_matchState_t* ms, \
1368 assert(MAX(4, MIN(6, ms->cParams.minMatch)) == mls); \
1369 assert(MAX(4, MIN(6, ms->cParams.searchLog)) == rowLog); \
1370 return ZSTD_RowFindBestMatch(ms, ip, iLimit, offsetPtr, mls, ZSTD_##dictMode, rowLog); \
1443 typedef enum { search_hashChain=0, search_binaryTree=1, search_rowHash=2 } searchMethod_e;
1453 ZSTD_selectLazyVTable(ZSTD_matchState_t const* ms, searchMethod_e searchMethod, ZSTD_dictMode_e dic… in ZSTD_selectLazyVTable() argument
1461 U32 const mls = MAX(4, MIN(6, ms->cParams.minMatch)); in ZSTD_selectLazyVTable()
1462 U32 const rowLog = MAX(4, MIN(6, ms->cParams.searchLog)); in ZSTD_selectLazyVTable()
1477 ZSTD_matchState_t* ms, seqStore_t* seqStore, in ZSTD_compressBlock_lazy_generic() argument
1488 const BYTE* const base = ms->window.base; in ZSTD_compressBlock_lazy_generic()
1489 const U32 prefixLowestIndex = ms->window.dictLimit; in ZSTD_compressBlock_lazy_generic()
1492 searchMax_f const searchMax = ZSTD_selectLazyVTable(ms, searchMethod, dictMode)->searchMax; in ZSTD_compressBlock_lazy_generic()
1493 U32 offset_1 = rep[0], offset_2 = rep[1], savedOffset=0; in ZSTD_compressBlock_lazy_generic()
1498 const ZSTD_matchState_t* const dms = ms->dictMatchState; in ZSTD_compressBlock_lazy_generic()
1499 const U32 dictLowestIndex = isDxS ? dms->window.dictLimit : 0; in ZSTD_compressBlock_lazy_generic()
1505 0; in ZSTD_compressBlock_lazy_generic()
1511 ip += (dictAndPrefixLength == 0); in ZSTD_compressBlock_lazy_generic()
1514 U32 const windowLow = ZSTD_getLowestPrefixIndex(ms, curr, ms->cParams.windowLog); in ZSTD_compressBlock_lazy_generic()
1516 if (offset_2 > maxRep) savedOffset = offset_2, offset_2 = 0; in ZSTD_compressBlock_lazy_generic()
1517 if (offset_1 > maxRep) savedOffset = offset_1, offset_1 = 0; in ZSTD_compressBlock_lazy_generic()
1520 /* dictMatchState repCode checks don't currently handle repCode == 0 in ZSTD_compressBlock_lazy_generic()
1527 const U32 rowLog = MAX(4, MIN(6, ms->cParams.searchLog)); in ZSTD_compressBlock_lazy_generic()
1528 ZSTD_row_fillHashCache(ms, base, rowLog, in ZSTD_compressBlock_lazy_generic()
1529 MIN(ms->cParams.minMatch, 6 /* mls caps out at 6 */), in ZSTD_compressBlock_lazy_generic()
1530 ms->nextToUpdate, ilimit); in ZSTD_compressBlock_lazy_generic()
1541 size_t matchLength=0; in ZSTD_compressBlock_lazy_generic()
1544 DEBUGLOG(7, "search baseline (depth 0)"); in ZSTD_compressBlock_lazy_generic()
1557 if (depth==0) goto _storeSequence; in ZSTD_compressBlock_lazy_generic()
1561 && ((offset_1 > 0) & (MEM_read32(ip+1-offset_1) == MEM_read32(ip+1)))) { in ZSTD_compressBlock_lazy_generic()
1563 if (depth==0) goto _storeSequence; in ZSTD_compressBlock_lazy_generic()
1566 /* first search (depth 0) */ in ZSTD_compressBlock_lazy_generic()
1568 size_t const ml2 = searchMax(ms, ip, iend, &offsetFound); in ZSTD_compressBlock_lazy_generic()
1584 && (offcode) && ((offset_1>0) & (MEM_read32(ip) == MEM_read32(ip - offset_1)))) { in ZSTD_compressBlock_lazy_generic()
1607 size_t const ml2 = searchMax(ms, ip, iend, &offset2); in ZSTD_compressBlock_lazy_generic()
1620 && (offcode) && ((offset_1>0) & (MEM_read32(ip) == MEM_read32(ip - offset_1)))) { in ZSTD_compressBlock_lazy_generic()
1643 size_t const ml2 = searchMax(ms, ip, iend, &offset2); in ZSTD_compressBlock_lazy_generic()
1692 ZSTD_storeSeq(seqStore, 0, anchor, iend, STORE_REPCODE_1, matchLength); in ZSTD_compressBlock_lazy_generic()
1702 while ( ((ip <= ilimit) & (offset_2>0)) in ZSTD_compressBlock_lazy_generic()
1707 ZSTD_storeSeq(seqStore, 0, anchor, iend, STORE_REPCODE_1, matchLength); in ZSTD_compressBlock_lazy_generic()
1714 rep[0] = offset_1 ? offset_1 : savedOffset; in ZSTD_compressBlock_lazy_generic()
1723 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_btlazy2() argument
1726 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_binaryTree, 2, ZSTD… in ZSTD_compressBlock_btlazy2()
1730 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2() argument
1733 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 2, ZSTD_… in ZSTD_compressBlock_lazy2()
1737 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy() argument
1740 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 1, ZSTD_… in ZSTD_compressBlock_lazy()
1744 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy() argument
1747 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 0, ZSTD_… in ZSTD_compressBlock_greedy()
1751 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_btlazy2_dictMatchState() argument
1754 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_binaryTree, 2, ZSTD… in ZSTD_compressBlock_btlazy2_dictMatchState()
1758 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_dictMatchState() argument
1761 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 2, ZSTD_… in ZSTD_compressBlock_lazy2_dictMatchState()
1765 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_dictMatchState() argument
1768 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 1, ZSTD_… in ZSTD_compressBlock_lazy_dictMatchState()
1772 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_dictMatchState() argument
1775 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 0, ZSTD_… in ZSTD_compressBlock_greedy_dictMatchState()
1780 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_dedicatedDictSearch() argument
1783 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 2, ZSTD_… in ZSTD_compressBlock_lazy2_dedicatedDictSearch()
1787 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_dedicatedDictSearch() argument
1790 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 1, ZSTD_… in ZSTD_compressBlock_lazy_dedicatedDictSearch()
1794 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_dedicatedDictSearch() argument
1797 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 0, ZSTD_… in ZSTD_compressBlock_greedy_dedicatedDictSearch()
1802 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_row() argument
1805 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 2, ZSTD_no… in ZSTD_compressBlock_lazy2_row()
1809 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_row() argument
1812 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 1, ZSTD_no… in ZSTD_compressBlock_lazy_row()
1816 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_row() argument
1819 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 0, ZSTD_no… in ZSTD_compressBlock_greedy_row()
1823 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_dictMatchState_row() argument
1826 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 2, ZSTD_di… in ZSTD_compressBlock_lazy2_dictMatchState_row()
1830 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_dictMatchState_row() argument
1833 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 1, ZSTD_di… in ZSTD_compressBlock_lazy_dictMatchState_row()
1837 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_dictMatchState_row() argument
1840 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 0, ZSTD_di… in ZSTD_compressBlock_greedy_dictMatchState_row()
1845 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_dedicatedDictSearch_row() argument
1848 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 2, ZSTD_de… in ZSTD_compressBlock_lazy2_dedicatedDictSearch_row()
1852 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_dedicatedDictSearch_row() argument
1855 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 1, ZSTD_de… in ZSTD_compressBlock_lazy_dedicatedDictSearch_row()
1859 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_dedicatedDictSearch_row() argument
1862 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 0, ZSTD_de… in ZSTD_compressBlock_greedy_dedicatedDictSearch_row()
1867 ZSTD_matchState_t* ms, seqStore_t* seqStore, in ZSTD_compressBlock_lazy_extDict_generic() argument
1877 const BYTE* const base = ms->window.base; in ZSTD_compressBlock_lazy_extDict_generic()
1878 const U32 dictLimit = ms->window.dictLimit; in ZSTD_compressBlock_lazy_extDict_generic()
1880 const BYTE* const dictBase = ms->window.dictBase; in ZSTD_compressBlock_lazy_extDict_generic()
1882 const BYTE* const dictStart = dictBase + ms->window.lowLimit; in ZSTD_compressBlock_lazy_extDict_generic()
1883 const U32 windowLog = ms->cParams.windowLog; in ZSTD_compressBlock_lazy_extDict_generic()
1884 const U32 rowLog = ms->cParams.searchLog < 5 ? 4 : 5; in ZSTD_compressBlock_lazy_extDict_generic()
1886 searchMax_f const searchMax = ZSTD_selectLazyVTable(ms, searchMethod, ZSTD_extDict)->searchMax; in ZSTD_compressBlock_lazy_extDict_generic()
1887 U32 offset_1 = rep[0], offset_2 = rep[1]; in ZSTD_compressBlock_lazy_extDict_generic()
1894 ZSTD_row_fillHashCache(ms, base, rowLog, in ZSTD_compressBlock_lazy_extDict_generic()
1895 MIN(ms->cParams.minMatch, 6 /* mls caps out at 6 */), in ZSTD_compressBlock_lazy_extDict_generic()
1896 ms->nextToUpdate, ilimit); in ZSTD_compressBlock_lazy_extDict_generic()
1907 size_t matchLength=0; in ZSTD_compressBlock_lazy_extDict_generic()
1913 { const U32 windowLow = ZSTD_getLowestMatchIndex(ms, curr+1, windowLog); in ZSTD_compressBlock_lazy_extDict_generic()
1923 if (depth==0) goto _storeSequence; in ZSTD_compressBlock_lazy_extDict_generic()
1926 /* first search (depth 0) */ in ZSTD_compressBlock_lazy_extDict_generic()
1928 size_t const ml2 = searchMax(ms, ip, iend, &offsetFound); in ZSTD_compressBlock_lazy_extDict_generic()
1945 const U32 windowLow = ZSTD_getLowestMatchIndex(ms, curr, windowLog); in ZSTD_compressBlock_lazy_extDict_generic()
1963 size_t const ml2 = searchMax(ms, ip, iend, &offset2); in ZSTD_compressBlock_lazy_extDict_generic()
1977 const U32 windowLow = ZSTD_getLowestMatchIndex(ms, curr, windowLog); in ZSTD_compressBlock_lazy_extDict_generic()
1995 size_t const ml2 = searchMax(ms, ip, iend, &offset2); in ZSTD_compressBlock_lazy_extDict_generic()
2024 const U32 windowLow = ZSTD_getLowestMatchIndex(ms, repCurrent, windowLog); in ZSTD_compressBlock_lazy_extDict_generic()
2035 ZSTD_storeSeq(seqStore, 0, anchor, iend, STORE_REPCODE_1, matchLength); in ZSTD_compressBlock_lazy_extDict_generic()
2044 rep[0] = offset_1; in ZSTD_compressBlock_lazy_extDict_generic()
2053 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_extDict() argument
2056 …return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_hashChain, … in ZSTD_compressBlock_greedy_extDict()
2060 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_extDict() argument
2064 …return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_hashChain, … in ZSTD_compressBlock_lazy_extDict()
2068 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_extDict() argument
2072 …return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_hashChain, … in ZSTD_compressBlock_lazy2_extDict()
2076 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_btlazy2_extDict() argument
2080 …return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_binaryTree,… in ZSTD_compressBlock_btlazy2_extDict()
2084 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_extDict_row() argument
2087 …return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 0); in ZSTD_compressBlock_greedy_extDict_row()
2091 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_extDict_row() argument
2095 …return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 1); in ZSTD_compressBlock_lazy_extDict_row()
2099 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_extDict_row() argument
2103 …return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 2); in ZSTD_compressBlock_lazy2_extDict_row()