Lines Matching refs:U32
32 U32 mls) in ZSTD_updateDUBT()
35 U32* const hashTable = ms->hashTable; in ZSTD_updateDUBT()
36 U32 const hashLog = cParams->hashLog; in ZSTD_updateDUBT()
38 U32* const bt = ms->chainTable; in ZSTD_updateDUBT()
39 U32 const btLog = cParams->chainLog - 1; in ZSTD_updateDUBT()
40 U32 const btMask = (1 << btLog) - 1; in ZSTD_updateDUBT()
43 U32 const target = (U32)(ip - base); in ZSTD_updateDUBT()
44 U32 idx = ms->nextToUpdate; in ZSTD_updateDUBT()
55 U32 const matchIndex = hashTable[h]; in ZSTD_updateDUBT()
57 U32* const nextCandidatePtr = bt + 2*(idx&btMask); in ZSTD_updateDUBT()
58 U32* const sortMarkPtr = nextCandidatePtr + 1; in ZSTD_updateDUBT()
76 U32 curr, const BYTE* inputEnd, in ZSTD_insertDUBT1()
77 U32 nbCompares, U32 btLow, in ZSTD_insertDUBT1()
81 U32* const bt = ms->chainTable; in ZSTD_insertDUBT1()
82 U32 const btLog = cParams->chainLog - 1; in ZSTD_insertDUBT1()
83 U32 const btMask = (1 << btLog) - 1; in ZSTD_insertDUBT1()
87 const U32 dictLimit = ms->window.dictLimit; in ZSTD_insertDUBT1()
93 U32* smallerPtr = bt + 2*(curr&btMask); in ZSTD_insertDUBT1()
94 U32* largerPtr = smallerPtr + 1; in ZSTD_insertDUBT1()
95 …U32 matchIndex = *smallerPtr; /* this candidate is unsorted : next sorted candidate is reached t… in ZSTD_insertDUBT1()
96 U32 dummy32; /* to be nullified at the end */ in ZSTD_insertDUBT1()
97 U32 const windowValid = ms->window.lowLimit; in ZSTD_insertDUBT1()
98 U32 const maxDistance = 1U << cParams->windowLog; in ZSTD_insertDUBT1()
99 U32 const windowLow = (curr - windowValid > maxDistance) ? curr - maxDistance : windowValid; in ZSTD_insertDUBT1()
108 U32* const nextPtr = bt + 2*(matchIndex & btMask); in ZSTD_insertDUBT1()
133 curr, matchIndex, (U32)matchLength); in ZSTD_insertDUBT1()
170 U32 nbCompares, in ZSTD_DUBT_findBetterDictMatch()
171 U32 const mls, in ZSTD_DUBT_findBetterDictMatch()
176 const U32 * const dictHashTable = dms->hashTable; in ZSTD_DUBT_findBetterDictMatch()
177 U32 const hashLog = dmsCParams->hashLog; in ZSTD_DUBT_findBetterDictMatch()
179 U32 dictMatchIndex = dictHashTable[h]; in ZSTD_DUBT_findBetterDictMatch()
183 U32 const curr = (U32)(ip-base); in ZSTD_DUBT_findBetterDictMatch()
186 U32 const dictHighLimit = (U32)(dms->window.nextSrc - dms->window.base); in ZSTD_DUBT_findBetterDictMatch()
187 U32 const dictLowLimit = dms->window.lowLimit; in ZSTD_DUBT_findBetterDictMatch()
188 U32 const dictIndexDelta = ms->window.lowLimit - dictHighLimit; in ZSTD_DUBT_findBetterDictMatch()
190 U32* const dictBt = dms->chainTable; in ZSTD_DUBT_findBetterDictMatch()
191 U32 const btLog = dmsCParams->chainLog - 1; in ZSTD_DUBT_findBetterDictMatch()
192 U32 const btMask = (1 << btLog) - 1; in ZSTD_DUBT_findBetterDictMatch()
193 …U32 const btLow = (btMask >= dictHighLimit - dictLowLimit) ? dictLowLimit : dictHighLimit … in ZSTD_DUBT_findBetterDictMatch()
201 U32* const nextPtr = dictBt + 2*(dictMatchIndex & btMask); in ZSTD_DUBT_findBetterDictMatch()
209 U32 matchIndex = dictMatchIndex + dictIndexDelta; in ZSTD_DUBT_findBetterDictMatch()
210 …h-bestLength)) > (int)(ZSTD_highbit32(curr-matchIndex+1) - ZSTD_highbit32((U32)offsetPtr[0]+1)) ) { in ZSTD_DUBT_findBetterDictMatch()
212 …curr, (U32)bestLength, (U32)matchLength, (U32)*offsetPtr, OFFSET_TO_OFFBASE(curr - matchIndex), di… in ZSTD_DUBT_findBetterDictMatch()
233 U32 const mIndex = curr - (U32)OFFBASE_TO_OFFSET(*offsetPtr); (void)mIndex; in ZSTD_DUBT_findBetterDictMatch()
235 curr, (U32)bestLength, (U32)*offsetPtr, mIndex); in ZSTD_DUBT_findBetterDictMatch()
247 U32 const mls, in ZSTD_DUBT_findBestMatch()
251 U32* const hashTable = ms->hashTable; in ZSTD_DUBT_findBestMatch()
252 U32 const hashLog = cParams->hashLog; in ZSTD_DUBT_findBestMatch()
254 U32 matchIndex = hashTable[h]; in ZSTD_DUBT_findBestMatch()
257 U32 const curr = (U32)(ip-base); in ZSTD_DUBT_findBestMatch()
258 U32 const windowLow = ZSTD_getLowestMatchIndex(ms, curr, cParams->windowLog); in ZSTD_DUBT_findBestMatch()
260 U32* const bt = ms->chainTable; in ZSTD_DUBT_findBestMatch()
261 U32 const btLog = cParams->chainLog - 1; in ZSTD_DUBT_findBestMatch()
262 U32 const btMask = (1 << btLog) - 1; in ZSTD_DUBT_findBestMatch()
263 U32 const btLow = (btMask >= curr) ? 0 : curr - btMask; in ZSTD_DUBT_findBestMatch()
264 U32 const unsortLimit = MAX(btLow, windowLow); in ZSTD_DUBT_findBestMatch()
266 U32* nextCandidate = bt + 2*(matchIndex&btMask); in ZSTD_DUBT_findBestMatch()
267 U32* unsortedMark = bt + 2*(matchIndex&btMask) + 1; in ZSTD_DUBT_findBestMatch()
268 U32 nbCompares = 1U << cParams->searchLog; in ZSTD_DUBT_findBestMatch()
269 U32 nbCandidates = nbCompares; in ZSTD_DUBT_findBestMatch()
270 U32 previousCandidate = 0; in ZSTD_DUBT_findBestMatch()
302 U32* const nextCandidateIdxPtr = bt + 2*(matchIndex&btMask) + 1; in ZSTD_DUBT_findBestMatch()
303 U32 const nextCandidateIdx = *nextCandidateIdxPtr; in ZSTD_DUBT_findBestMatch()
313 const U32 dictLimit = ms->window.dictLimit; in ZSTD_DUBT_findBestMatch()
316 U32* smallerPtr = bt + 2*(curr&btMask); in ZSTD_DUBT_findBestMatch()
317 U32* largerPtr = bt + 2*(curr&btMask) + 1; in ZSTD_DUBT_findBestMatch()
318 U32 matchEndIdx = curr + 8 + 1; in ZSTD_DUBT_findBestMatch()
319 U32 dummy32; /* to be nullified at the end */ in ZSTD_DUBT_findBestMatch()
326 U32* const nextPtr = bt + 2*(matchIndex & btMask); in ZSTD_DUBT_findBestMatch()
342 matchEndIdx = matchIndex + (U32)matchLength; in ZSTD_DUBT_findBestMatch()
343 …th-bestLength)) > (int)(ZSTD_highbit32(curr - matchIndex + 1) - ZSTD_highbit32((U32)*offBasePtr)) ) in ZSTD_DUBT_findBestMatch()
384 U32 const mIndex = curr - (U32)OFFBASE_TO_OFFSET(*offBasePtr); (void)mIndex; in ZSTD_DUBT_findBestMatch()
386 curr, (U32)bestLength, (U32)*offBasePtr, mIndex); in ZSTD_DUBT_findBestMatch()
399 const U32 mls /* template */, in ZSTD_BtFindBestMatch()
415 U32 const target = (U32)(ip - base); in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
416 U32* const hashTable = ms->hashTable; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
417 U32* const chainTable = ms->chainTable; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
418 U32 const chainSize = 1 << ms->cParams.chainLog; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
419 U32 idx = ms->nextToUpdate; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
420 U32 const minChain = chainSize < target - idx ? target - chainSize : idx; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
421 U32 const bucketSize = 1 << ZSTD_LAZY_DDSS_BUCKET_LOG; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
422 U32 const cacheSize = bucketSize - 1; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
423 U32 const chainAttempts = (1 << ms->cParams.searchLog) - cacheSize; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
424 U32 const chainLimit = chainAttempts > 255 ? 255 : chainAttempts; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
431 U32 const hashLog = ms->cParams.hashLog - ZSTD_LAZY_DDSS_BUCKET_LOG; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
432 U32* const tmpHashTable = hashTable; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
433 U32* const tmpChainTable = hashTable + ((size_t)1 << hashLog); in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
434 U32 const tmpChainSize = (U32)((1 << ZSTD_LAZY_DDSS_BUCKET_LOG) - 1) << hashLog; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
435 U32 const tmpMinChain = tmpChainSize < target ? target - tmpChainSize : idx; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
436 U32 hashIdx; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
445 U32 const h = (U32)ZSTD_hashPtr(base + idx, hashLog, ms->cParams.minMatch); in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
454 U32 chainPos = 0; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
456 U32 count; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
457 U32 countBeyondMinChain = 0; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
458 U32 i = tmpHashTable[hashIdx]; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
503 U32 const bucketIdx = --hashIdx << ZSTD_LAZY_DDSS_BUCKET_LOG; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
504 U32 const chainPackedPointer = tmpHashTable[hashIdx]; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
505 U32 i; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
514 U32 const h = (U32)ZSTD_hashPtr(base + idx, hashLog, ms->cParams.minMatch) in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
516 U32 i; in ZSTD_dedicatedDictSearch_lazy_loadDictionary()
530 size_t ZSTD_dedicatedDictSearch_lazy_search(size_t* offsetPtr, size_t ml, U32 nbAttempts, in ZSTD_dedicatedDictSearch_lazy_search()
533 const BYTE* const prefixStart, const U32 curr, in ZSTD_dedicatedDictSearch_lazy_search()
534 const U32 dictLimit, const size_t ddsIdx) { in ZSTD_dedicatedDictSearch_lazy_search()
535 const U32 ddsLowestIndex = dms->window.dictLimit; in ZSTD_dedicatedDictSearch_lazy_search()
538 const U32 ddsSize = (U32)(ddsEnd - ddsBase); in ZSTD_dedicatedDictSearch_lazy_search()
539 const U32 ddsIndexDelta = dictLimit - ddsSize; in ZSTD_dedicatedDictSearch_lazy_search()
540 const U32 bucketSize = (1 << ZSTD_LAZY_DDSS_BUCKET_LOG); in ZSTD_dedicatedDictSearch_lazy_search()
541 const U32 bucketLimit = nbAttempts < bucketSize - 1 ? nbAttempts : bucketSize - 1; in ZSTD_dedicatedDictSearch_lazy_search()
542 U32 ddsAttempt; in ZSTD_dedicatedDictSearch_lazy_search()
543 U32 matchIndex; in ZSTD_dedicatedDictSearch_lazy_search()
550 U32 const chainPackedPointer = dms->hashTable[ddsIdx + bucketSize - 1]; in ZSTD_dedicatedDictSearch_lazy_search()
551 U32 const chainIndex = chainPackedPointer >> 8; in ZSTD_dedicatedDictSearch_lazy_search()
587 U32 const chainPackedPointer = dms->hashTable[ddsIdx + bucketSize - 1]; in ZSTD_dedicatedDictSearch_lazy_search()
588 U32 chainIndex = chainPackedPointer >> 8; in ZSTD_dedicatedDictSearch_lazy_search()
589 U32 const chainLength = chainPackedPointer & 0xFF; in ZSTD_dedicatedDictSearch_lazy_search()
590 U32 const chainAttempts = nbAttempts - ddsAttempt; in ZSTD_dedicatedDictSearch_lazy_search()
591 U32 const chainLimit = chainAttempts > chainLength ? chainLength : chainAttempts; in ZSTD_dedicatedDictSearch_lazy_search()
592 U32 chainAttempt; in ZSTD_dedicatedDictSearch_lazy_search()
633 U32 ZSTD_insertAndFindFirstIndex_internal( in ZSTD_insertAndFindFirstIndex_internal()
636 const BYTE* ip, U32 const mls, U32 const lazySkipping) in ZSTD_insertAndFindFirstIndex_internal()
638 U32* const hashTable = ms->hashTable; in ZSTD_insertAndFindFirstIndex_internal()
639 const U32 hashLog = cParams->hashLog; in ZSTD_insertAndFindFirstIndex_internal()
640 U32* const chainTable = ms->chainTable; in ZSTD_insertAndFindFirstIndex_internal()
641 const U32 chainMask = (1 << cParams->chainLog) - 1; in ZSTD_insertAndFindFirstIndex_internal()
643 const U32 target = (U32)(ip - base); in ZSTD_insertAndFindFirstIndex_internal()
644 U32 idx = ms->nextToUpdate; in ZSTD_insertAndFindFirstIndex_internal()
660 U32 ZSTD_insertAndFindFirstIndex(ZSTD_MatchState_t* ms, const BYTE* ip) { in ZSTD_insertAndFindFirstIndex()
672 const U32 mls, const ZSTD_dictMode_e dictMode) in ZSTD_HcFindBestMatch()
675 U32* const chainTable = ms->chainTable; in ZSTD_HcFindBestMatch()
676 const U32 chainSize = (1 << cParams->chainLog); in ZSTD_HcFindBestMatch()
677 const U32 chainMask = chainSize-1; in ZSTD_HcFindBestMatch()
680 const U32 dictLimit = ms->window.dictLimit; in ZSTD_HcFindBestMatch()
683 const U32 curr = (U32)(ip-base); in ZSTD_HcFindBestMatch()
684 const U32 maxDistance = 1U << cParams->windowLog; in ZSTD_HcFindBestMatch()
685 const U32 lowestValid = ms->window.lowLimit; in ZSTD_HcFindBestMatch()
686 …const U32 withinMaxDistance = (curr - lowestValid > maxDistance) ? curr - maxDistance : lowestVali… in ZSTD_HcFindBestMatch()
687 const U32 isDictionary = (ms->loadedDictEnd != 0); in ZSTD_HcFindBestMatch()
688 const U32 lowLimit = isDictionary ? lowestValid : withinMaxDistance; in ZSTD_HcFindBestMatch()
689 const U32 minChain = curr > chainSize ? curr - chainSize : 0; in ZSTD_HcFindBestMatch()
690 U32 nbAttempts = 1U << cParams->searchLog; in ZSTD_HcFindBestMatch()
694 const U32 ddsHashLog = dictMode == ZSTD_dedicatedDictSearch in ZSTD_HcFindBestMatch()
699 U32 matchIndex; in ZSTD_HcFindBestMatch()
702 const U32* entry = &dms->hashTable[ddsIdx]; in ZSTD_HcFindBestMatch()
740 const U32* const dmsChainTable = dms->chainTable; in ZSTD_HcFindBestMatch()
741 const U32 dmsChainSize = (1 << dms->cParams.chainLog); in ZSTD_HcFindBestMatch()
742 const U32 dmsChainMask = dmsChainSize - 1; in ZSTD_HcFindBestMatch()
743 const U32 dmsLowestIndex = dms->window.dictLimit; in ZSTD_HcFindBestMatch()
746 const U32 dmsSize = (U32)(dmsEnd - dmsBase); in ZSTD_HcFindBestMatch()
747 const U32 dmsIndexDelta = dictLimit - dmsSize; in ZSTD_HcFindBestMatch()
748 const U32 dmsMinChain = dmsSize > dmsChainSize ? dmsSize - dmsChainSize : 0; in ZSTD_HcFindBestMatch()
791 MEM_STATIC U32 ZSTD_VecMask_next(ZSTD_VecMask val) { in ZSTD_VecMask_next()
799 FORCE_INLINE_TEMPLATE U32 ZSTD_row_nextIndex(BYTE* const tagRow, U32 const rowMask) { in ZSTD_row_nextIndex()
800 U32 next = (*tagRow-1) & rowMask; in ZSTD_row_nextIndex()
817 …ORCE_INLINE_TEMPLATE void ZSTD_row_prefetch(U32 const* hashTable, BYTE const* tagTable, U32 const … in ZSTD_row_prefetch()
839 U32 const rowLog, U32 const mls, in ZSTD_row_fillHashCache()
840 U32 idx, const BYTE* const iLimit) in ZSTD_row_fillHashCache()
842 U32 const* const hashTable = ms->hashTable; in ZSTD_row_fillHashCache()
844 U32 const hashLog = ms->rowHashLog; in ZSTD_row_fillHashCache()
845 U32 const maxElemsToPrefetch = (base + idx) > iLimit ? 0 : (U32)(iLimit - (base + idx) + 1); in ZSTD_row_fillHashCache()
846 U32 const lim = idx + MIN(ZSTD_ROW_HASH_CACHE_SIZE, maxElemsToPrefetch); in ZSTD_row_fillHashCache()
849 …U32 const hash = (U32)ZSTD_hashPtrSalted(base + idx, hashLog + ZSTD_ROW_HASH_TAG_BITS, mls, ms->ha… in ZSTD_row_fillHashCache()
850 U32 const row = (hash >> ZSTD_ROW_HASH_TAG_BITS) << rowLog; in ZSTD_row_fillHashCache()
866 U32 ZSTD_row_nextCachedHash(U32* cache, U32 const* hashTable, in ZSTD_row_nextCachedHash()
868 U32 idx, U32 const hashLog, in ZSTD_row_nextCachedHash()
869 U32 const rowLog, U32 const mls, in ZSTD_row_nextCachedHash()
872 …U32 const newHash = (U32)ZSTD_hashPtrSalted(base+idx+ZSTD_ROW_HASH_CACHE_SIZE, hashLog + ZSTD_ROW_… in ZSTD_row_nextCachedHash()
873 U32 const row = (newHash >> ZSTD_ROW_HASH_TAG_BITS) << rowLog; in ZSTD_row_nextCachedHash()
875 { U32 const hash = cache[idx & ZSTD_ROW_HASH_CACHE_MASK]; in ZSTD_row_nextCachedHash()
887 U32 updateStartIdx, U32 const updateEndIdx, in ZSTD_row_update_internalImpl()
888 U32 const mls, U32 const rowLog, in ZSTD_row_update_internalImpl()
889 U32 const rowMask, U32 const useCache) in ZSTD_row_update_internalImpl()
891 U32* const hashTable = ms->hashTable; in ZSTD_row_update_internalImpl()
893 U32 const hashLog = ms->rowHashLog; in ZSTD_row_update_internalImpl()
898 …U32 const hash = useCache ? ZSTD_row_nextCachedHash(ms->hashCache, hashTable, tagTable, base, upda… in ZSTD_row_update_internalImpl()
899 …: (U32)ZSTD_hashPtrSalted(base + updateStartIdx, hashLog + ZSTD_ROW_HASH_TAG_BITS, mls, ms->hashSa… in ZSTD_row_update_internalImpl()
900 U32 const relRow = (hash >> ZSTD_ROW_HASH_TAG_BITS) << rowLog; in ZSTD_row_update_internalImpl()
901 U32* const row = hashTable + relRow; in ZSTD_row_update_internalImpl()
903 U32 const pos = ZSTD_row_nextIndex(tagRow, rowMask); in ZSTD_row_update_internalImpl()
918 U32 const mls, U32 const rowLog, in ZSTD_row_update_internal()
919 U32 const rowMask, U32 const useCache) in ZSTD_row_update_internal()
921 U32 idx = ms->nextToUpdate; in ZSTD_row_update_internal()
923 const U32 target = (U32)(ip - base); in ZSTD_row_update_internal()
924 const U32 kSkipThreshold = 384; in ZSTD_row_update_internal()
925 const U32 kMaxMatchStartPositionsToUpdate = 96; in ZSTD_row_update_internal()
926 const U32 kMaxMatchEndPositionsToUpdate = 32; in ZSTD_row_update_internal()
935 U32 const bound = idx + kMaxMatchStartPositionsToUpdate; in ZSTD_row_update_internal()
951 const U32 rowLog = BOUNDED(4, ms->cParams.searchLog, 6); in ZSTD_row_update()
952 const U32 rowMask = (1u << rowLog) - 1; in ZSTD_row_update()
953 const U32 mls = MIN(ms->cParams.minMatch, 6 /* mls caps out at 6 */); in ZSTD_row_update()
963 FORCE_INLINE_TEMPLATE U32
964 ZSTD_row_matchMaskGroupWidth(const U32 rowEntries) in ZSTD_row_matchMaskGroupWidth()
989 ZSTD_row_getSSEMask(int nbChunks, const BYTE* const src, const BYTE tag, const U32 head) in ZSTD_row_getSSEMask()
1001 if (nbChunks == 2) return ZSTD_rotateRight_U32((U32)matches[1] << 16 | (U32)matches[0], head); in ZSTD_row_getSSEMask()
1009 ZSTD_row_getNEONMask(const U32 rowEntries, const BYTE* const src, const BYTE tag, const U32 headGro… in ZSTD_row_getNEONMask()
1062 ZSTD_row_getMatchMask(const BYTE* const tagRow, const BYTE tag, const U32 headGrouped, const U32 ro… in ZSTD_row_getMatchMask()
1117 return ZSTD_rotateRight_U32((U32)matches, headGrouped); in ZSTD_row_getMatchMask()
1146 const U32 mls, const ZSTD_dictMode_e dictMode, in ZSTD_RowFindBestMatch()
1147 const U32 rowLog) in ZSTD_RowFindBestMatch()
1149 U32* const hashTable = ms->hashTable; in ZSTD_RowFindBestMatch()
1151 U32* const hashCache = ms->hashCache; in ZSTD_RowFindBestMatch()
1152 const U32 hashLog = ms->rowHashLog; in ZSTD_RowFindBestMatch()
1156 const U32 dictLimit = ms->window.dictLimit; in ZSTD_RowFindBestMatch()
1159 const U32 curr = (U32)(ip-base); in ZSTD_RowFindBestMatch()
1160 const U32 maxDistance = 1U << cParams->windowLog; in ZSTD_RowFindBestMatch()
1161 const U32 lowestValid = ms->window.lowLimit; in ZSTD_RowFindBestMatch()
1162 …const U32 withinMaxDistance = (curr - lowestValid > maxDistance) ? curr - maxDistance : lowestVali… in ZSTD_RowFindBestMatch()
1163 const U32 isDictionary = (ms->loadedDictEnd != 0); in ZSTD_RowFindBestMatch()
1164 const U32 lowLimit = isDictionary ? lowestValid : withinMaxDistance; in ZSTD_RowFindBestMatch()
1165 const U32 rowEntries = (1U << rowLog); in ZSTD_RowFindBestMatch()
1166 const U32 rowMask = rowEntries - 1; in ZSTD_RowFindBestMatch()
1167 …const U32 cappedSearchLog = MIN(cParams->searchLog, rowLog); /* nb of searches is capped at nb ent… in ZSTD_RowFindBestMatch()
1168 const U32 groupWidth = ZSTD_row_matchMaskGroupWidth(rowEntries); in ZSTD_RowFindBestMatch()
1170 U32 nbAttempts = 1U << cappedSearchLog; in ZSTD_RowFindBestMatch()
1172 U32 hash; in ZSTD_RowFindBestMatch()
1179 …U32 ddsExtraAttempts = 0; /* cctx hash tables are limited in searches, but allow extra searches in… in ZSTD_RowFindBestMatch()
1180 U32 dmsTag = 0; in ZSTD_RowFindBestMatch()
1181 U32* dmsRow = NULL; in ZSTD_RowFindBestMatch()
1185 const U32 ddsHashLog = dms->cParams.hashLog - ZSTD_LAZY_DDSS_BUCKET_LOG; in ZSTD_RowFindBestMatch()
1195 U32* const dmsHashTable = dms->hashTable; in ZSTD_RowFindBestMatch()
1197 U32 const dmsHash = (U32)ZSTD_hashPtr(ip, dms->rowHashLog + ZSTD_ROW_HASH_TAG_BITS, mls); in ZSTD_RowFindBestMatch()
1198 U32 const dmsRelRow = (dmsHash >> ZSTD_ROW_HASH_TAG_BITS) << rowLog; in ZSTD_RowFindBestMatch()
1213 hash = (U32)ZSTD_hashPtrSalted(ip, hashLog + ZSTD_ROW_HASH_TAG_BITS, mls, hashSalt); in ZSTD_RowFindBestMatch()
1219 U32 const relRow = (hash >> ZSTD_ROW_HASH_TAG_BITS) << rowLog; in ZSTD_RowFindBestMatch()
1220 U32 const tag = hash & ZSTD_ROW_HASH_TAG_MASK; in ZSTD_RowFindBestMatch()
1221 U32* const row = hashTable + relRow; in ZSTD_RowFindBestMatch()
1223 U32 const headGrouped = (*tagRow & rowMask) * groupWidth; in ZSTD_RowFindBestMatch()
1224 U32 matchBuffer[ZSTD_ROW_HASH_MAX_ENTRIES]; in ZSTD_RowFindBestMatch()
1231 … U32 const matchPos = ((headGrouped + ZSTD_VecMask_next(matches)) / groupWidth) & rowMask; in ZSTD_RowFindBestMatch()
1232 U32 const matchIndex = row[matchPos]; in ZSTD_RowFindBestMatch()
1249 U32 const pos = ZSTD_row_nextIndex(tagRow, rowMask); in ZSTD_RowFindBestMatch()
1256 U32 const matchIndex = matchBuffer[currMatch]; in ZSTD_RowFindBestMatch()
1289 const U32 dmsLowestIndex = dms->window.dictLimit; in ZSTD_RowFindBestMatch()
1292 const U32 dmsSize = (U32)(dmsEnd - dmsBase); in ZSTD_RowFindBestMatch()
1293 const U32 dmsIndexDelta = dictLimit - dmsSize; in ZSTD_RowFindBestMatch()
1295 { U32 const headGrouped = (*dmsTagRow & rowMask) * groupWidth; in ZSTD_RowFindBestMatch()
1296 U32 matchBuffer[ZSTD_ROW_HASH_MAX_ENTRIES]; in ZSTD_RowFindBestMatch()
1302 … U32 const matchPos = ((headGrouped + ZSTD_VecMask_next(matches)) / groupWidth) & rowMask; in ZSTD_RowFindBestMatch()
1303 U32 const matchIndex = dmsRow[matchPos]; in ZSTD_RowFindBestMatch()
1314 U32 const matchIndex = matchBuffer[currMatch]; in ZSTD_RowFindBestMatch()
1493 U32 const mls, in ZSTD_searchMax()
1494 U32 const rowLog, in ZSTD_searchMax()
1519 U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_generic()
1521 const searchMethod_e searchMethod, const U32 depth, in ZSTD_compressBlock_lazy_generic()
1530 const U32 prefixLowestIndex = ms->window.dictLimit; in ZSTD_compressBlock_lazy_generic()
1532 const U32 mls = BOUNDED(4, ms->cParams.minMatch, 6); in ZSTD_compressBlock_lazy_generic()
1533 const U32 rowLog = BOUNDED(4, ms->cParams.searchLog, 6); in ZSTD_compressBlock_lazy_generic()
1535 U32 offset_1 = rep[0], offset_2 = rep[1]; in ZSTD_compressBlock_lazy_generic()
1536 U32 offsetSaved1 = 0, offsetSaved2 = 0; in ZSTD_compressBlock_lazy_generic()
1542 const U32 dictLowestIndex = isDxS ? dms->window.dictLimit : 0; in ZSTD_compressBlock_lazy_generic()
1546 const U32 dictIndexDelta = isDxS ? in ZSTD_compressBlock_lazy_generic()
1547 prefixLowestIndex - (U32)(dictEnd - dictBase) : in ZSTD_compressBlock_lazy_generic()
1549 const U32 dictAndPrefixLength = (U32)((ip - prefixLowest) + (dictEnd - dictLowest)); in ZSTD_compressBlock_lazy_generic()
1551 … "ZSTD_compressBlock_lazy_generic (dictMode=%u) (searchFunc=%u)", (U32)dictMode, (U32)searchMethod… in ZSTD_compressBlock_lazy_generic()
1554 U32 const curr = (U32)(ip - base); in ZSTD_compressBlock_lazy_generic()
1555 U32 const windowLow = ZSTD_getLowestPrefixIndex(ms, curr, ms->cParams.windowLog); in ZSTD_compressBlock_lazy_generic()
1556 U32 const maxRep = curr - windowLow; in ZSTD_compressBlock_lazy_generic()
1589 const U32 repIndex = (U32)(ip - base) + 1 - offset_1; in ZSTD_compressBlock_lazy_generic()
1637 int const gain1 = (int)(matchLength*3 - ZSTD_highbit32((U32)offBase) + 1); in ZSTD_compressBlock_lazy_generic()
1642 const U32 repIndex = (U32)(ip - base) - offset_1; in ZSTD_compressBlock_lazy_generic()
1651 int const gain1 = (int)(matchLength*3 - ZSTD_highbit32((U32)offBase) + 1); in ZSTD_compressBlock_lazy_generic()
1658 … int const gain2 = (int)(ml2*4 - ZSTD_highbit32((U32)ofbCandidate)); /* raw approx */ in ZSTD_compressBlock_lazy_generic()
1659 int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offBase) + 4); in ZSTD_compressBlock_lazy_generic()
1673 int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offBase) + 1); in ZSTD_compressBlock_lazy_generic()
1678 const U32 repIndex = (U32)(ip - base) - offset_1; in ZSTD_compressBlock_lazy_generic()
1687 int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offBase) + 1); in ZSTD_compressBlock_lazy_generic()
1694 … int const gain2 = (int)(ml2*4 - ZSTD_highbit32((U32)ofbCandidate)); /* raw approx */ in ZSTD_compressBlock_lazy_generic()
1695 int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offBase) + 7); in ZSTD_compressBlock_lazy_generic()
1715 U32 const matchIndex = (U32)((size_t)(start-base) - OFFBASE_TO_OFFSET(offBase)); in ZSTD_compressBlock_lazy_generic()
1720 offset_2 = offset_1; offset_1 = (U32)OFFBASE_TO_OFFSET(offBase); in ZSTD_compressBlock_lazy_generic()
1725 ZSTD_storeSeq(seqStore, litLength, anchor, iend, (U32)offBase, matchLength); in ZSTD_compressBlock_lazy_generic()
1739 U32 const current2 = (U32)(ip-base); in ZSTD_compressBlock_lazy_generic()
1740 U32 const repIndex = current2 - offset_2; in ZSTD_compressBlock_lazy_generic()
1748 …offBase = offset_2; offset_2 = offset_1; offset_1 = (U32)offBase; /* swap offset_2 <=> offset_1 … in ZSTD_compressBlock_lazy_generic()
1763 … offBase = offset_2; offset_2 = offset_1; offset_1 = (U32)offBase; /* swap repcodes */ in ZSTD_compressBlock_lazy_generic()
1786 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy()
1793 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_dictMatchState()
1800 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_dedicatedDictSearch()
1807 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_row()
1814 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_dictMatchState_row()
1821 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_dedicatedDictSearch_row()
1830 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy()
1837 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_dictMatchState()
1844 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_dedicatedDictSearch()
1851 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_row()
1858 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_dictMatchState_row()
1865 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_dedicatedDictSearch_row()
1874 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2()
1881 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_dictMatchState()
1888 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_dedicatedDictSearch()
1895 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_row()
1902 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_dictMatchState_row()
1909 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_dedicatedDictSearch_row()
1918 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_btlazy2()
1925 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_btlazy2_dictMatchState()
1940 U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_extDict_generic()
1942 const searchMethod_e searchMethod, const U32 depth) in ZSTD_compressBlock_lazy_extDict_generic()
1950 const U32 dictLimit = ms->window.dictLimit; in ZSTD_compressBlock_lazy_extDict_generic()
1955 const U32 windowLog = ms->cParams.windowLog; in ZSTD_compressBlock_lazy_extDict_generic()
1956 const U32 mls = BOUNDED(4, ms->cParams.minMatch, 6); in ZSTD_compressBlock_lazy_extDict_generic()
1957 const U32 rowLog = BOUNDED(4, ms->cParams.searchLog, 6); in ZSTD_compressBlock_lazy_extDict_generic()
1959 U32 offset_1 = rep[0], offset_2 = rep[1]; in ZSTD_compressBlock_lazy_extDict_generic()
1961 DEBUGLOG(5, "ZSTD_compressBlock_lazy_extDict_generic (searchFunc=%u)", (U32)searchMethod); in ZSTD_compressBlock_lazy_extDict_generic()
1983 U32 curr = (U32)(ip-base); in ZSTD_compressBlock_lazy_extDict_generic()
1986 { const U32 windowLow = ZSTD_getLowestMatchIndex(ms, curr+1, windowLog); in ZSTD_compressBlock_lazy_extDict_generic()
1987 const U32 repIndex = (U32)(curr+1 - offset_1); in ZSTD_compressBlock_lazy_extDict_generic()
2027 const U32 windowLow = ZSTD_getLowestMatchIndex(ms, curr, windowLog); in ZSTD_compressBlock_lazy_extDict_generic()
2028 const U32 repIndex = (U32)(curr - offset_1); in ZSTD_compressBlock_lazy_extDict_generic()
2038 int const gain1 = (int)(matchLength*3 - ZSTD_highbit32((U32)offBase) + 1); in ZSTD_compressBlock_lazy_extDict_generic()
2046 … int const gain2 = (int)(ml2*4 - ZSTD_highbit32((U32)ofbCandidate)); /* raw approx */ in ZSTD_compressBlock_lazy_extDict_generic()
2047 int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offBase) + 4); in ZSTD_compressBlock_lazy_extDict_generic()
2059 const U32 windowLow = ZSTD_getLowestMatchIndex(ms, curr, windowLog); in ZSTD_compressBlock_lazy_extDict_generic()
2060 const U32 repIndex = (U32)(curr - offset_1); in ZSTD_compressBlock_lazy_extDict_generic()
2070 int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offBase) + 1); in ZSTD_compressBlock_lazy_extDict_generic()
2078 … int const gain2 = (int)(ml2*4 - ZSTD_highbit32((U32)ofbCandidate)); /* raw approx */ in ZSTD_compressBlock_lazy_extDict_generic()
2079 int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offBase) + 7); in ZSTD_compressBlock_lazy_extDict_generic()
2089 U32 const matchIndex = (U32)((size_t)(start-base) - OFFBASE_TO_OFFSET(offBase)); in ZSTD_compressBlock_lazy_extDict_generic()
2093 offset_2 = offset_1; offset_1 = (U32)OFFBASE_TO_OFFSET(offBase); in ZSTD_compressBlock_lazy_extDict_generic()
2099 ZSTD_storeSeq(seqStore, litLength, anchor, iend, (U32)offBase, matchLength); in ZSTD_compressBlock_lazy_extDict_generic()
2112 const U32 repCurrent = (U32)(ip-base); in ZSTD_compressBlock_lazy_extDict_generic()
2113 const U32 windowLow = ZSTD_getLowestMatchIndex(ms, repCurrent, windowLog); in ZSTD_compressBlock_lazy_extDict_generic()
2114 const U32 repIndex = repCurrent - offset_2; in ZSTD_compressBlock_lazy_extDict_generic()
2123 … offBase = offset_2; offset_2 = offset_1; offset_1 = (U32)offBase; /* swap offset history */ in ZSTD_compressBlock_lazy_extDict_generic()
2143 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_extDict()
2150 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_greedy_extDict_row()
2159 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_extDict()
2167 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy_extDict_row()
2177 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_extDict()
2185 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_lazy2_extDict_row()
2194 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], in ZSTD_compressBlock_btlazy2_extDict()