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()
778 if (leastSignificantWord == 0) { in ZSTD_VecMask_next()
791 val = val - ((val >> 1) & 0x5555555555555555); in ZSTD_VecMask_next()
792 val = (val & 0x3333333333333333ULL) + ((val >> 2) & 0x3333333333333333ULL); in ZSTD_VecMask_next()
793 return (U32)((((val + (val >> 4)) & 0xF0F0F0F0F0F0F0FULL) * 0x101010101010101ULL) >> 56); in ZSTD_VecMask_next()
804 count &= 0x3F; /* for fickle pattern recognition */ in ZSTD_rotateRight_U64()
805 return (value >> count) | (U64)(value << ((0U - count) & 0x3F)); in ZSTD_rotateRight_U64()
811 count &= 0x1F; /* for fickle pattern recognition */ in ZSTD_rotateRight_U32()
812 return (value >> count) | (U32)(value << ((0U - count) & 0x1F)); in ZSTD_rotateRight_U32()
818 count &= 0x0F; /* for fickle pattern recognition */ in ZSTD_rotateRight_U16()
819 return (value >> count) | (U16)(value << ((0U - count) & 0x0F)); in ZSTD_rotateRight_U16()
824 * value to reflect the update. Essentially cycles backwards from [0, {entries per row})
836 assert((align & (align - 1)) == 0); in ZSTD_isAligned()
837 return (((size_t)ptr) & (align - 1)) == 0; in ZSTD_isAligned()
862 FORCE_INLINE_TEMPLATE void ZSTD_row_fillHashCache(ZSTD_matchState_t* ms, const BYTE* base, in ZSTD_row_fillHashCache() argument
866 U32 const* const hashTable = ms->hashTable; in ZSTD_row_fillHashCache()
867 U16 const* const tagTable = ms->tagTable; in ZSTD_row_fillHashCache()
868 U32 const hashLog = ms->rowHashLog; in ZSTD_row_fillHashCache()
869 U32 const maxElemsToPrefetch = (base + idx) > iLimit ? 0 : (U32)(iLimit - (base + idx) + 1); in ZSTD_row_fillHashCache()
876 ms->hashCache[idx & ZSTD_ROW_HASH_CACHE_MASK] = hash; in ZSTD_row_fillHashCache()
879 …DEBUGLOG(6, "ZSTD_row_fillHashCache(): [%u %u %u %u %u %u %u %u]", ms->hashCache[0], ms->hashCache… in ZSTD_row_fillHashCache()
880ms->hashCache[2], ms->hashCache[3], ms->hashCache[4], in ZSTD_row_fillHashCache()
881ms->hashCache[5], ms->hashCache[6], ms->hashCache[7]); in ZSTD_row_fillHashCache()
905 FORCE_INLINE_TEMPLATE void ZSTD_row_update_internalImpl(ZSTD_matchState_t* ms, in ZSTD_row_update_internalImpl() argument
910 U32* const hashTable = ms->hashTable; in ZSTD_row_update_internalImpl()
911 U16* const tagTable = ms->tagTable; in ZSTD_row_update_internalImpl()
912 U32 const hashLog = ms->rowHashLog; in ZSTD_row_update_internalImpl()
913 const BYTE* const base = ms->window.base; in ZSTD_row_update_internalImpl()
917 …U32 const hash = useCache ? ZSTD_row_nextCachedHash(ms->hashCache, hashTable, tagTable, base, upda… in ZSTD_row_update_internalImpl()
932 …* Inserts the byte at ip into the appropriate position in the hash table, and updates ms->nextToUp…
935 FORCE_INLINE_TEMPLATE void ZSTD_row_update_internal(ZSTD_matchState_t* ms, const BYTE* ip, in ZSTD_row_update_internal() argument
939 U32 idx = ms->nextToUpdate; in ZSTD_row_update_internal()
940 const BYTE* const base = ms->window.base; in ZSTD_row_update_internal()
954 ZSTD_row_update_internalImpl(ms, idx, bound, mls, rowLog, rowMask, useCache); in ZSTD_row_update_internal()
956 ZSTD_row_fillHashCache(ms, base, rowLog, mls, idx, ip+1); in ZSTD_row_update_internal()
960 ZSTD_row_update_internalImpl(ms, idx, target, mls, rowLog, rowMask, useCache); in ZSTD_row_update_internal()
961 ms->nextToUpdate = target; in ZSTD_row_update_internal()
968 void ZSTD_row_update(ZSTD_matchState_t* const ms, const BYTE* ip) { in ZSTD_row_update() argument
969 const U32 rowLog = BOUNDED(4, ms->cParams.searchLog, 6); in ZSTD_row_update()
971 const U32 mls = MIN(ms->cParams.minMatch, 6 /* mls caps out at 6 */); in ZSTD_row_update()
974 ZSTD_row_update_internal(ms, ip, mls, rowLog, rowMask, 0 /* dont use cache */); in ZSTD_row_update()
982 int matches[4] = {0}; in ZSTD_row_getSSEMask()
985 for (i=0; i<nbChunks; i++) { in ZSTD_row_getSSEMask()
990 if (nbChunks == 1) return ZSTD_rotateRight_U16((U16)matches[0], head); in ZSTD_row_getSSEMask()
991 if (nbChunks == 2) return ZSTD_rotateRight_U32((U32)matches[1] << 16 | (U32)matches[0], head); in ZSTD_row_getSSEMask()
993 …U64((U64)matches[3] << 48 | (U64)matches[2] << 32 | (U64)matches[1] << 16 | (U64)matches[0], head); in ZSTD_row_getSSEMask()
1025 const U16 lo = (U16)vgetq_lane_u8(t3, 0); in ZSTD_row_getMatchMask()
1029 const uint8x16_t chunk0 = vreinterpretq_u8_u16(chunk.val[0]); in ZSTD_row_getMatchMask()
1039 const uint8x8_t t4 = vsri_n_u8(t3.val[1], t3.val[0], 4); in ZSTD_row_getMatchMask()
1040 const U32 matches = vget_lane_u32(vreinterpret_u32_u8(t4), 0); in ZSTD_row_getMatchMask()
1045 const uint8x16_t cmp0 = vceqq_u8(chunk.val[0], dup); in ZSTD_row_getMatchMask()
1055 const U64 matches = vget_lane_u64(vreinterpret_u64_u8(t4), 0); in ZSTD_row_getMatchMask()
1063 const size_t xFF = ~((size_t)0); in ZSTD_row_getMatchMask()
1064 const size_t x01 = xFF / 0xFF; in ZSTD_row_getMatchMask()
1067 ZSTD_VecMask matches = 0; in ZSTD_row_getMatchMask()
1071 const size_t extractMagic = (xFF / 0x7F) >> chunkSize; in ZSTD_row_getMatchMask()
1079 } while (i >= 0); in ZSTD_row_getMatchMask()
1082 const size_t extractMagic = (msb / 0x1FF) | msb; in ZSTD_row_getMatchMask()
1090 } while (i >= 0); in ZSTD_row_getMatchMask()
1121 ZSTD_matchState_t* ms, in ZSTD_RowFindBestMatch() argument
1127 U32* const hashTable = ms->hashTable; in ZSTD_RowFindBestMatch()
1128 U16* const tagTable = ms->tagTable; in ZSTD_RowFindBestMatch()
1129 U32* const hashCache = ms->hashCache; in ZSTD_RowFindBestMatch()
1130 const U32 hashLog = ms->rowHashLog; in ZSTD_RowFindBestMatch()
1131 const ZSTD_compressionParameters* const cParams = &ms->cParams; in ZSTD_RowFindBestMatch()
1132 const BYTE* const base = ms->window.base; in ZSTD_RowFindBestMatch()
1133 const BYTE* const dictBase = ms->window.dictBase; in ZSTD_RowFindBestMatch()
1134 const U32 dictLimit = ms->window.dictLimit; in ZSTD_RowFindBestMatch()
1139 const U32 lowestValid = ms->window.lowLimit; in ZSTD_RowFindBestMatch()
1141 const U32 isDictionary = (ms->loadedDictEnd != 0); in ZSTD_RowFindBestMatch()
1150 const ZSTD_matchState_t* const dms = ms->dictMatchState; in ZSTD_RowFindBestMatch()
1153 size_t ddsIdx = 0; in ZSTD_RowFindBestMatch()
1154 …U32 ddsExtraAttempts = 0; /* cctx hash tables are limited in searches, but allow extra searches in… in ZSTD_RowFindBestMatch()
1155 U32 dmsTag = 0; in ZSTD_RowFindBestMatch()
1165 ddsExtraAttempts = cParams->searchLog > rowLog ? 1U << (cParams->searchLog - rowLog) : 0; in ZSTD_RowFindBestMatch()
1181 ZSTD_row_update_internal(ms, ip, mls, rowLog, rowMask, 1 /* useCache */); in ZSTD_RowFindBestMatch()
1190 size_t numMatches = 0; in ZSTD_RowFindBestMatch()
1191 size_t currMatch = 0; in ZSTD_RowFindBestMatch()
1195 for (; (matches > 0) && (nbAttempts > 0); --nbAttempts, matches &= (matches - 1)) { in ZSTD_RowFindBestMatch()
1214 row[pos] = ms->nextToUpdate++; in ZSTD_RowFindBestMatch()
1220 size_t currentMl=0; in ZSTD_RowFindBestMatch()
1259 size_t numMatches = 0; in ZSTD_RowFindBestMatch()
1260 size_t currMatch = 0; in ZSTD_RowFindBestMatch()
1263 for (; (matches > 0) && (nbAttempts > 0); --nbAttempts, matches &= (matches - 1)) { in ZSTD_RowFindBestMatch()
1275 size_t currentMl=0; in ZSTD_RowFindBestMatch()
1328 ZSTD_matchState_t* ms, \
1332 assert(MAX(4, MIN(6, ms->cParams.minMatch)) == mls); \
1333 return ZSTD_BtFindBestMatch(ms, ip, iLimit, offBasePtr, mls, ZSTD_##dictMode); \
1338 ZSTD_matchState_t* ms, \
1342 assert(MAX(4, MIN(6, ms->cParams.minMatch)) == mls); \
1343 return ZSTD_HcFindBestMatch(ms, ip, iLimit, offsetPtr, mls, ZSTD_##dictMode); \
1348 ZSTD_matchState_t* ms, \
1352 assert(MAX(4, MIN(6, ms->cParams.minMatch)) == mls); \
1353 assert(MAX(4, MIN(6, ms->cParams.searchLog)) == rowLog); \
1354 return ZSTD_RowFindBestMatch(ms, ip, iLimit, offsetPtr, mls, ZSTD_##dictMode, rowLog); \
1385 typedef enum { search_hashChain=0, search_binaryTree=1, search_rowHash=2 } searchMethod_e;
1389 return ZSTD_BT_SEARCH_FN(dictMode, mls)(ms, ip, iend, offsetPtr);
1392 return ZSTD_HC_SEARCH_FN(dictMode, mls)(ms, ip, iend, offsetPtr);
1395 return ZSTD_ROW_SEARCH_FN(dictMode, mls, rowLog)(ms, ip, iend, offsetPtr);
1436 * @param ms The match state.
1449 ZSTD_matchState_t* ms, in ZSTD_searchMax() argument
1468 return 0; in ZSTD_searchMax()
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()
1491 const U32 mls = BOUNDED(4, ms->cParams.minMatch, 6); in ZSTD_compressBlock_lazy_generic()
1492 const U32 rowLog = BOUNDED(4, ms->cParams.searchLog, 6); in ZSTD_compressBlock_lazy_generic()
1494 U32 offset_1 = rep[0], offset_2 = rep[1], savedOffset=0; in ZSTD_compressBlock_lazy_generic()
1499 const ZSTD_matchState_t* const dms = ms->dictMatchState; in ZSTD_compressBlock_lazy_generic()
1500 const U32 dictLowestIndex = isDxS ? dms->window.dictLimit : 0; in ZSTD_compressBlock_lazy_generic()
1506 0; in ZSTD_compressBlock_lazy_generic()
1510 ip += (dictAndPrefixLength == 0); in ZSTD_compressBlock_lazy_generic()
1513 U32 const windowLow = ZSTD_getLowestPrefixIndex(ms, curr, ms->cParams.windowLog); in ZSTD_compressBlock_lazy_generic()
1515 if (offset_2 > maxRep) savedOffset = offset_2, offset_2 = 0; in ZSTD_compressBlock_lazy_generic()
1516 if (offset_1 > maxRep) savedOffset = offset_1, offset_1 = 0; in ZSTD_compressBlock_lazy_generic()
1519 /* dictMatchState repCode checks don't currently handle repCode == 0 in ZSTD_compressBlock_lazy_generic()
1526 ZSTD_row_fillHashCache(ms, base, rowLog, in ZSTD_compressBlock_lazy_generic()
1527 MIN(ms->cParams.minMatch, 6 /* mls caps out at 6 */), in ZSTD_compressBlock_lazy_generic()
1528 ms->nextToUpdate, ilimit); in ZSTD_compressBlock_lazy_generic()
1539 size_t matchLength=0; in ZSTD_compressBlock_lazy_generic()
1542 DEBUGLOG(7, "search baseline (depth 0)"); in ZSTD_compressBlock_lazy_generic()
1555 if (depth==0) goto _storeSequence; in ZSTD_compressBlock_lazy_generic()
1559 && ((offset_1 > 0) & (MEM_read32(ip+1-offset_1) == MEM_read32(ip+1)))) { in ZSTD_compressBlock_lazy_generic()
1561 if (depth==0) goto _storeSequence; in ZSTD_compressBlock_lazy_generic()
1564 /* first search (depth 0) */ in ZSTD_compressBlock_lazy_generic()
1566 …size_t const ml2 = ZSTD_searchMax(ms, ip, iend, &offsetFound, mls, rowLog, searchMethod, dictMode); in ZSTD_compressBlock_lazy_generic()
1582 && (offcode) && ((offset_1>0) & (MEM_read32(ip) == MEM_read32(ip - offset_1)))) { in ZSTD_compressBlock_lazy_generic()
1605 … size_t const ml2 = ZSTD_searchMax(ms, ip, iend, &offset2, mls, rowLog, searchMethod, dictMode); in ZSTD_compressBlock_lazy_generic()
1618 && (offcode) && ((offset_1>0) & (MEM_read32(ip) == MEM_read32(ip - offset_1)))) { in ZSTD_compressBlock_lazy_generic()
1641 … size_t const ml2 = ZSTD_searchMax(ms, ip, iend, &offset2, mls, rowLog, searchMethod, dictMode); in ZSTD_compressBlock_lazy_generic()
1690 ZSTD_storeSeq(seqStore, 0, anchor, iend, STORE_REPCODE_1, matchLength); in ZSTD_compressBlock_lazy_generic()
1700 while ( ((ip <= ilimit) & (offset_2>0)) in ZSTD_compressBlock_lazy_generic()
1705 ZSTD_storeSeq(seqStore, 0, anchor, iend, STORE_REPCODE_1, matchLength); in ZSTD_compressBlock_lazy_generic()
1712 rep[0] = offset_1 ? offset_1 : savedOffset; in ZSTD_compressBlock_lazy_generic()
1721 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_btlazy2() argument
1724 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_binaryTree, 2, ZSTD… in ZSTD_compressBlock_btlazy2()
1728 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2() argument
1731 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 2, ZSTD_… in ZSTD_compressBlock_lazy2()
1735 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy() argument
1738 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 1, ZSTD_… in ZSTD_compressBlock_lazy()
1742 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy() argument
1745 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 0, ZSTD_… in ZSTD_compressBlock_greedy()
1749 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_btlazy2_dictMatchState() argument
1752 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_binaryTree, 2, ZSTD… in ZSTD_compressBlock_btlazy2_dictMatchState()
1756 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_dictMatchState() argument
1759 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 2, ZSTD_… in ZSTD_compressBlock_lazy2_dictMatchState()
1763 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_dictMatchState() argument
1766 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 1, ZSTD_… in ZSTD_compressBlock_lazy_dictMatchState()
1770 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_dictMatchState() argument
1773 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 0, ZSTD_… in ZSTD_compressBlock_greedy_dictMatchState()
1778 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_dedicatedDictSearch() argument
1781 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 2, ZSTD_… in ZSTD_compressBlock_lazy2_dedicatedDictSearch()
1785 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_dedicatedDictSearch() argument
1788 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 1, ZSTD_… in ZSTD_compressBlock_lazy_dedicatedDictSearch()
1792 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_dedicatedDictSearch() argument
1795 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_hashChain, 0, ZSTD_… in ZSTD_compressBlock_greedy_dedicatedDictSearch()
1800 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_row() argument
1803 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 2, ZSTD_no… in ZSTD_compressBlock_lazy2_row()
1807 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_row() argument
1810 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 1, ZSTD_no… in ZSTD_compressBlock_lazy_row()
1814 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_row() argument
1817 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 0, ZSTD_no… in ZSTD_compressBlock_greedy_row()
1821 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_dictMatchState_row() argument
1824 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 2, ZSTD_di… in ZSTD_compressBlock_lazy2_dictMatchState_row()
1828 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_dictMatchState_row() argument
1831 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 1, ZSTD_di… in ZSTD_compressBlock_lazy_dictMatchState_row()
1835 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_dictMatchState_row() argument
1838 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 0, ZSTD_di… in ZSTD_compressBlock_greedy_dictMatchState_row()
1843 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_dedicatedDictSearch_row() argument
1846 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 2, ZSTD_de… in ZSTD_compressBlock_lazy2_dedicatedDictSearch_row()
1850 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_dedicatedDictSearch_row() argument
1853 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 1, ZSTD_de… in ZSTD_compressBlock_lazy_dedicatedDictSearch_row()
1857 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_dedicatedDictSearch_row() argument
1860 …return ZSTD_compressBlock_lazy_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 0, ZSTD_de… in ZSTD_compressBlock_greedy_dedicatedDictSearch_row()
1865 ZSTD_matchState_t* ms, seqStore_t* seqStore, in ZSTD_compressBlock_lazy_extDict_generic() argument
1875 const BYTE* const base = ms->window.base; in ZSTD_compressBlock_lazy_extDict_generic()
1876 const U32 dictLimit = ms->window.dictLimit; in ZSTD_compressBlock_lazy_extDict_generic()
1878 const BYTE* const dictBase = ms->window.dictBase; in ZSTD_compressBlock_lazy_extDict_generic()
1880 const BYTE* const dictStart = dictBase + ms->window.lowLimit; in ZSTD_compressBlock_lazy_extDict_generic()
1881 const U32 windowLog = ms->cParams.windowLog; in ZSTD_compressBlock_lazy_extDict_generic()
1882 const U32 mls = BOUNDED(4, ms->cParams.minMatch, 6); in ZSTD_compressBlock_lazy_extDict_generic()
1883 const U32 rowLog = BOUNDED(4, ms->cParams.searchLog, 6); in ZSTD_compressBlock_lazy_extDict_generic()
1885 U32 offset_1 = rep[0], offset_2 = rep[1]; in ZSTD_compressBlock_lazy_extDict_generic()
1892 ZSTD_row_fillHashCache(ms, base, rowLog, in ZSTD_compressBlock_lazy_extDict_generic()
1893 MIN(ms->cParams.minMatch, 6 /* mls caps out at 6 */), in ZSTD_compressBlock_lazy_extDict_generic()
1894 ms->nextToUpdate, ilimit); in ZSTD_compressBlock_lazy_extDict_generic()
1905 size_t matchLength=0; in ZSTD_compressBlock_lazy_extDict_generic()
1911 { const U32 windowLow = ZSTD_getLowestMatchIndex(ms, curr+1, windowLog); in ZSTD_compressBlock_lazy_extDict_generic()
1921 if (depth==0) goto _storeSequence; in ZSTD_compressBlock_lazy_extDict_generic()
1924 /* first search (depth 0) */ in ZSTD_compressBlock_lazy_extDict_generic()
1926 …size_t const ml2 = ZSTD_searchMax(ms, ip, iend, &offsetFound, mls, rowLog, searchMethod, ZSTD_extD… in ZSTD_compressBlock_lazy_extDict_generic()
1943 const U32 windowLow = ZSTD_getLowestMatchIndex(ms, curr, windowLog); in ZSTD_compressBlock_lazy_extDict_generic()
1961 …size_t const ml2 = ZSTD_searchMax(ms, ip, iend, &offset2, mls, rowLog, searchMethod, ZSTD_extDict); in ZSTD_compressBlock_lazy_extDict_generic()
1975 const U32 windowLow = ZSTD_getLowestMatchIndex(ms, curr, windowLog); in ZSTD_compressBlock_lazy_extDict_generic()
1993 …size_t const ml2 = ZSTD_searchMax(ms, ip, iend, &offset2, mls, rowLog, searchMethod, ZSTD_extDict); in ZSTD_compressBlock_lazy_extDict_generic()
2022 const U32 windowLow = ZSTD_getLowestMatchIndex(ms, repCurrent, windowLog); in ZSTD_compressBlock_lazy_extDict_generic()
2033 ZSTD_storeSeq(seqStore, 0, anchor, iend, STORE_REPCODE_1, matchLength); in ZSTD_compressBlock_lazy_extDict_generic()
2042 rep[0] = offset_1; in ZSTD_compressBlock_lazy_extDict_generic()
2051 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_extDict() argument
2054 …return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_hashChain, in ZSTD_compressBlock_greedy_extDict()
2058 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_extDict() argument
2062 …return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_hashChain, … in ZSTD_compressBlock_lazy_extDict()
2066 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_extDict() argument
2070 …return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_hashChain, … in ZSTD_compressBlock_lazy2_extDict()
2074 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_btlazy2_extDict() argument
2078 …return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_binaryTree,… in ZSTD_compressBlock_btlazy2_extDict()
2082 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_extDict_row() argument
2085 …return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 0); in ZSTD_compressBlock_greedy_extDict_row()
2089 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_extDict_row() argument
2093 …return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 1); in ZSTD_compressBlock_lazy_extDict_row()
2097 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_extDict_row() argument
2101 …return ZSTD_compressBlock_lazy_extDict_generic(ms, seqStore, rep, src, srcSize, search_rowHash, 2); in ZSTD_compressBlock_lazy2_extDict_row()