mirror of
https://github.com/facebook/zstd.git
synced 2025-12-07 00:02:39 -05:00
Rewrite Fix to Still Auto-Vectorize
This commit is contained in:
parent
61765cacd0
commit
48572f52b1
@ -2332,12 +2332,17 @@ ZSTD_reduceTable_internal (U32* const table, U32 const size, U32 const reducerVa
|
|||||||
for (rowNb=0 ; rowNb < nbRows ; rowNb++) {
|
for (rowNb=0 ; rowNb < nbRows ; rowNb++) {
|
||||||
int column;
|
int column;
|
||||||
for (column=0; column<ZSTD_ROWSIZE; column++) {
|
for (column=0; column<ZSTD_ROWSIZE; column++) {
|
||||||
|
U32 newVal;
|
||||||
if (preserveMark && table[cellNb] == ZSTD_DUBT_UNSORTED_MARK) {
|
if (preserveMark && table[cellNb] == ZSTD_DUBT_UNSORTED_MARK) {
|
||||||
|
/* This write is pointless, but is required(?) for the compiler
|
||||||
|
* to auto-vectorize the loop. */
|
||||||
|
newVal = ZSTD_DUBT_UNSORTED_MARK;
|
||||||
} else if (table[cellNb] < reducerThreshold) {
|
} else if (table[cellNb] < reducerThreshold) {
|
||||||
table[cellNb] = 0;
|
newVal = 0;
|
||||||
} else {
|
} else {
|
||||||
table[cellNb] -= reducerValue;
|
newVal = table[cellNb] - reducerValue;
|
||||||
}
|
}
|
||||||
|
table[cellNb] = newVal;
|
||||||
cellNb++;
|
cellNb++;
|
||||||
} }
|
} }
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user