From: Yann Collet Date: Mon, 5 Feb 2018 19:46:02 +0000 (-0800) Subject: minor : modified ZSTD_preserveUnsortedMark() to be more vectorization friendly X-Git-Tag: v1.3.4~1^2~61^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0170cf9a7af94d9ffdcdb5cd3ebc35fcd542f2ed;p=thirdparty%2Fzstd.git minor : modified ZSTD_preserveUnsortedMark() to be more vectorization friendly --- diff --git a/lib/common/fse_decompress.c b/lib/common/fse_decompress.c index 8e3f0035f..4c66c3b77 100644 --- a/lib/common/fse_decompress.c +++ b/lib/common/fse_decompress.c @@ -139,8 +139,8 @@ size_t FSE_buildDTable(FSE_DTable* dt, const short* normalizedCounter, unsigned { U32 u; for (u=0; usmaller:0*, meaning the next candidate will be considered smaller. + * to *sorted=>smaller:0*, meaning next candidate will be considered smaller. * This could be wrong, and result in data corruption. + * * On second thought, this corruption might be impossible, - * because unsorted elements are always at the beginning of the list, - * and squashing to zero reduce the list to a single element, + * because unsorted elements stand at the beginning of the list, + * and squashing to zero reduces the list to a single element, * which needs to be sorted anyway. * I haven't spent much thoughts into this possible scenario, - * and just felt it was safer to implement ZSTD_preserveUnsortedMark() */ + * and just felt it was safer to implement ZSTD_preserveUnsortedMark() + * + * `size` : must be a positive multiple of ZSTD_ROWSIZE */ +#define ZSTD_ROWSIZE 16 void ZSTD_preserveUnsortedMark (U32* const table, U32 const size, U32 const reducerValue) { - U32 u; - for (u=0; udtable; return 0; case set_repeat: if (!flagRepeatTable) return ERROR(corruption_detected);