@@ -774,31 +774,6 @@ MEM_STATIC U32 ZSTD_VecMask_next(ZSTD_VecMask val) {
774774 return ZSTD_countTrailingZeros64 (val );
775775}
776776
777- /* ZSTD_rotateRight_*():
778- * Rotates a bitfield to the right by "count" bits.
779- * https://en.wikipedia.org/w/index.php?title=Circular_shift&oldid=991635599#Implementing_circular_shifts
780- */
781- FORCE_INLINE_TEMPLATE
782- U64 ZSTD_rotateRight_U64 (U64 const value , U32 count ) {
783- assert (count < 64 );
784- count &= 0x3F ; /* for fickle pattern recognition */
785- return (value >> count ) | (U64 )(value << ((0U - count ) & 0x3F ));
786- }
787-
788- FORCE_INLINE_TEMPLATE
789- U32 ZSTD_rotateRight_U32 (U32 const value , U32 count ) {
790- assert (count < 32 );
791- count &= 0x1F ; /* for fickle pattern recognition */
792- return (value >> count ) | (U32 )(value << ((0U - count ) & 0x1F ));
793- }
794-
795- FORCE_INLINE_TEMPLATE
796- U16 ZSTD_rotateRight_U16 (U16 const value , U32 count ) {
797- assert (count < 16 );
798- count &= 0x0F ; /* for fickle pattern recognition */
799- return (value >> count ) | (U16 )(value << ((0U - count ) & 0x0F ));
800- }
801-
802777/* ZSTD_row_nextIndex():
803778 * Returns the next index to insert at within a tagTable row, and updates the "head"
804779 * value to reflect the update. Essentially cycles backwards from [0, {entries per row})
@@ -891,6 +866,7 @@ FORCE_INLINE_TEMPLATE void ZSTD_row_update_internalImpl(ZSTD_matchState_t* ms,
891866 U32 * const hashTable = ms -> hashTable ;
892867 U16 * const tagTable = ms -> tagTable ;
893868 U32 const hashLog = ms -> rowHashLog ;
869+ U32 hashSaltEntropyCollected = 0 ;
894870 const BYTE * const base = ms -> window .base ;
895871
896872 DEBUGLOG (6 , "ZSTD_row_update_internalImpl(): updateStartIdx=%u, updateEndIdx=%u" , updateStartIdx , updateEndIdx );
@@ -906,8 +882,9 @@ FORCE_INLINE_TEMPLATE void ZSTD_row_update_internalImpl(ZSTD_matchState_t* ms,
906882 assert (hash == ZSTD_hashPtrSalted (base + updateStartIdx , hashLog + ZSTD_ROW_HASH_TAG_BITS , mls , ms -> hashSalt ));
907883 ((BYTE * )tagRow )[pos + ZSTD_ROW_HASH_TAG_OFFSET ] = hash & ZSTD_ROW_HASH_TAG_MASK ;
908884 row [pos ] = updateStartIdx ;
909- ms -> hashSaltEntropy + = hash ;
885+ hashSaltEntropyCollected = hash ;
910886 }
887+ ms -> hashSaltEntropy += hashSaltEntropyCollected ; /* collect salt entropy */
911888}
912889
913890/* ZSTD_row_update_internal():
0 commit comments