Lines Matching refs:ip
25 const BYTE* ip = base + ms->nextToUpdate;
33 for (; ip + fastHashFillStep - 1 <= iend; ip += fastHashFillStep) {
34 U32 const curr = (U32)(ip - base);
37 size_t const smHash = ZSTD_hashPtr(ip + i, hBitsS, mls);
38 size_t const lgHash = ZSTD_hashPtr(ip + i, hBitsL, 8);
82 size_t hl0; /* the long hash at ip */
85 U32 idxl0; /* the long match index for ip */
88 const BYTE* matchl0; /* the long match for ip */
89 const BYTE* matchs0; /* the short match for ip */
92 const BYTE* ip = istart; /* the current position */
98 ip += ((ip - prefixLowest) == 0);
100 U32 const current = (U32)(ip - base);
110 nextStep = ip + kStepIncr;
111 ip1 = ip + step;
117 hl0 = ZSTD_hashPtr(ip, hBitsL, 8);
123 const size_t hs0 = ZSTD_hashPtr(ip, hBitsS, mls);
125 curr = (U32)(ip-base);
131 if ((offset_1 > 0) & (MEM_read32(ip+1-offset_1) == MEM_read32(ip+1))) {
132 mLength = ZSTD_count(ip+1+4, ip+1+4-offset_1, iend) + 4;
133 ip++;
134 ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, STORE_REPCODE_1, mLength);
142 if (MEM_read64(matchl0) == MEM_read64(ip)) {
143 mLength = ZSTD_count(ip+8, matchl0+8, iend) + 8;
144 offset = (U32)(ip-matchl0);
145 while (((ip>anchor) & (matchl0>prefixLowest)) && (ip[-1] == matchl0[-1])) { ip--; matchl0--; mLength++; } /* catch up */
155 if (MEM_read32(matchs0) == MEM_read32(ip)) {
166 ip = ip1;
173 PREFETCH_L1(ip+256);
190 ip = ip1;
191 mLength = ZSTD_count(ip+8, matchl1+8, iend) + 8;
192 offset = (U32)(ip-matchl1);
193 while (((ip>anchor) & (matchl1>prefixLowest)) && (ip[-1] == matchl1[-1])) { ip--; matchl1--; mLength++; } /* catch up */
199 mLength = ZSTD_count(ip+4, matchs0+4, iend) + 4;
200 offset = (U32)(ip - matchs0);
201 while (((ip>anchor) & (matchs0>prefixLowest)) && (ip[-1] == matchs0[-1])) { ip--; matchs0--; mLength++; } /* catch up */
205 _match_found: /* requires ip, offset, mLength */
211 * greater than or equal to the new ip we will have after we're done
213 * (ip1 >= ip + mLength), which costs speed in practice, we do a simpler
215 * 4 bytes, so as long as step, the distance between ip and ip1
216 * (initially) is less than 4, we know ip1 < new ip. */
220 ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, STORE_OFFSET(offset), mLength);
224 ip += mLength;
225 anchor = ip;
227 if (ip <= ilimit) {
232 hashLong[ZSTD_hashPtr(ip-2, hBitsL, 8)] = (U32)(ip-2-base);
234 hashSmall[ZSTD_hashPtr(ip-1, hBitsS, mls)] = (U32)(ip-1-base);
238 while ( (ip <= ilimit)
240 & (MEM_read32(ip) == MEM_read32(ip - offset_2)) )) {
242 size_t const rLength = ZSTD_count(ip+4, ip+4-offset_2, iend) + 4;
244 hashSmall[ZSTD_hashPtr(ip, hBitsS, mls)] = (U32)(ip-base);
245 hashLong[ZSTD_hashPtr(ip, hBitsL, 8)] = (U32)(ip-base);
247 ip += rLength;
248 anchor = ip;
269 const BYTE* ip = istart;
291 const U32 dictAndPrefixLength = (U32)((ip - prefixLowest) + (dictEnd - dictStart));
299 ip += (dictAndPrefixLength == 0);
307 while (ip < ilimit) { /* < instead of <=, because repcode check at (ip+1) */
310 size_t const h2 = ZSTD_hashPtr(ip, hBitsL, 8);
311 size_t const h = ZSTD_hashPtr(ip, hBitsS, mls);
312 size_t const dictHL = ZSTD_hashPtr(ip, dictHBitsL, 8);
313 size_t const dictHS = ZSTD_hashPtr(ip, dictHBitsS, mls);
314 U32 const curr = (U32)(ip-base);
327 && (MEM_read32(repMatch) == MEM_read32(ip+1)) ) {
329 mLength = ZSTD_count_2segments(ip+1+4, repMatch+4, iend, repMatchEnd, prefixLowest) + 4;
330 ip++;
331 ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, STORE_REPCODE_1, mLength);
337 if (MEM_read64(matchLong) == MEM_read64(ip)) {
338 mLength = ZSTD_count(ip+8, matchLong+8, iend) + 8;
339 offset = (U32)(ip-matchLong);
340 while (((ip>anchor) & (matchLong>prefixLowest)) && (ip[-1] == matchLong[-1])) { ip--; matchLong--; mLength++; } /* catch up */
349 if (dictMatchL > dictStart && MEM_read64(dictMatchL) == MEM_read64(ip)) {
350 mLength = ZSTD_count_2segments(ip+8, dictMatchL+8, iend, dictEnd, prefixLowest) + 8;
352 while (((ip>anchor) & (dictMatchL>dictStart)) && (ip[-1] == dictMatchL[-1])) { ip--; dictMatchL--; mLength++; } /* catch up */
358 if (MEM_read32(match) == MEM_read32(ip)) {
367 if (match > dictStart && MEM_read32(match) == MEM_read32(ip)) {
371 ip += ((ip-anchor) >> kSearchStrength) + 1;
373 PREFETCH_L1(ip+256);
379 { size_t const hl3 = ZSTD_hashPtr(ip+1, hBitsL, 8);
380 size_t const dictHLNext = ZSTD_hashPtr(ip+1, dictHBitsL, 8);
387 if (MEM_read64(matchL3) == MEM_read64(ip+1)) {
388 mLength = ZSTD_count(ip+9, matchL3+8, iend) + 8;
389 ip++;
390 offset = (U32)(ip-matchL3);
391 while (((ip>anchor) & (matchL3>prefixLowest)) && (ip[-1] == matchL3[-1])) { ip--; matchL3--; mLength++; } /* catch up */
399 if (dictMatchL3 > dictStart && MEM_read64(dictMatchL3) == MEM_read64(ip+1)) {
400 mLength = ZSTD_count_2segments(ip+1+8, dictMatchL3+8, iend, dictEnd, prefixLowest) + 8;
401 ip++;
403 while (((ip>anchor) & (dictMatchL3>dictStart)) && (ip[-1] == dictMatchL3[-1])) { ip--; dictMatchL3--; mLength++; } /* catch up */
409 mLength = ZSTD_count_2segments(ip+4, match+4, iend, dictEnd, prefixLowest) + 4;
411 while (((ip>anchor) & (match>dictStart)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* catch up */
413 mLength = ZSTD_count(ip+4, match+4, iend) + 4;
414 offset = (U32)(ip - match);
415 while (((ip>anchor) & (match>prefixLowest)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* catch up */
422 ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, STORE_OFFSET(offset), mLength);
426 ip += mLength;
427 anchor = ip;
429 if (ip <= ilimit) {
434 hashLong[ZSTD_hashPtr(ip-2, hBitsL, 8)] = (U32)(ip-2-base);
436 hashSmall[ZSTD_hashPtr(ip-1, hBitsS, mls)] = (U32)(ip-1-base);
440 while (ip <= ilimit) {
441 U32 const current2 = (U32)(ip-base);
447 && (MEM_read32(repMatch2) == MEM_read32(ip)) ) {
449 size_t const repLength2 = ZSTD_count_2segments(ip+4, repMatch2+4, iend, repEnd2, prefixLowest) + 4;
452 hashSmall[ZSTD_hashPtr(ip, hBitsS, mls)] = current2;
453 hashLong[ZSTD_hashPtr(ip, hBitsL, 8)] = current2;
454 ip += repLength2;
455 anchor = ip;
461 } /* while (ip < ilimit) */
541 const BYTE* ip = istart;
564 while (ip < ilimit) { /* < instead of <=, because (ip+1) */
565 const size_t hSmall = ZSTD_hashPtr(ip, hBitsS, mls);
570 const size_t hLong = ZSTD_hashPtr(ip, hBitsL, 8);
575 const U32 curr = (U32)(ip-base);
584 && (MEM_read32(repMatch) == MEM_read32(ip+1)) ) {
586 mLength = ZSTD_count_2segments(ip+1+4, repMatch+4, iend, repMatchEnd, prefixStart) + 4;
587 ip++;
588 ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, STORE_REPCODE_1, mLength);
590 if ((matchLongIndex > dictStartIndex) && (MEM_read64(matchLong) == MEM_read64(ip))) {
594 mLength = ZSTD_count_2segments(ip+8, matchLong+8, iend, matchEnd, prefixStart) + 8;
596 while (((ip>anchor) & (matchLong>lowMatchPtr)) && (ip[-1] == matchLong[-1])) { ip--; matchLong--; mLength++; } /* catch up */
599 ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, STORE_OFFSET(offset), mLength);
601 } else if ((matchIndex > dictStartIndex) && (MEM_read32(match) == MEM_read32(ip))) {
602 size_t const h3 = ZSTD_hashPtr(ip+1, hBitsL, 8);
608 if ( (matchIndex3 > dictStartIndex) && (MEM_read64(match3) == MEM_read64(ip+1)) ) {
611 mLength = ZSTD_count_2segments(ip+9, match3+8, iend, matchEnd, prefixStart) + 8;
612 ip++;
614 while (((ip>anchor) & (match3>lowMatchPtr)) && (ip[-1] == match3[-1])) { ip--; match3--; mLength++; } /* catch up */
618 mLength = ZSTD_count_2segments(ip+4, match+4, iend, matchEnd, prefixStart) + 4;
620 while (((ip>anchor) & (match>lowMatchPtr)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* catch up */
624 ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, STORE_OFFSET(offset), mLength);
627 ip += ((ip-anchor) >> kSearchStrength) + 1;
632 ip += mLength;
633 anchor = ip;
635 if (ip <= ilimit) {
640 hashLong[ZSTD_hashPtr(ip-2, hBitsL, 8)] = (U32)(ip-2-base);
642 hashSmall[ZSTD_hashPtr(ip-1, hBitsS, mls)] = (U32)(ip-1-base);
646 while (ip <= ilimit) {
647 U32 const current2 = (U32)(ip-base);
652 && (MEM_read32(repMatch2) == MEM_read32(ip)) ) {
654 size_t const repLength2 = ZSTD_count_2segments(ip+4, repMatch2+4, iend, repEnd2, prefixStart) + 4;
657 hashSmall[ZSTD_hashPtr(ip, hBitsS, mls)] = current2;
658 hashLong[ZSTD_hashPtr(ip, hBitsL, 8)] = current2;
659 ip += repLength2;
660 anchor = ip;