Skip to content

Commit 0dffae4

Browse files
AArch64: Remove 32-bit code from ZSTD_decodeSequence
Remove the 32-bit code paths from the AArch64 only sections of ZSTD_decodeSequence.
1 parent 33618c8 commit 0dffae4

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

lib/decompress/zstd_decompress_block.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,7 @@ ZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets, c
12611261
const ZSTD_seqSymbol* const mlDInfo = seqState->stateML.table + seqState->stateML.state;
12621262
const ZSTD_seqSymbol* const ofDInfo = seqState->stateOffb.table + seqState->stateOffb.state;
12631263
# endif
1264+
(void)longOffsets;
12641265
seq.matchLength = mlDInfo->baseValue;
12651266
seq.litLength = llDInfo->baseValue;
12661267
{ U32 const ofBase = ofDInfo->baseValue;
@@ -1290,18 +1291,7 @@ ZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets, c
12901291
ZSTD_STATIC_ASSERT(LONG_OFFSETS_MAX_EXTRA_BITS_32 == 5);
12911292
ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 > LONG_OFFSETS_MAX_EXTRA_BITS_32);
12921293
ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 - LONG_OFFSETS_MAX_EXTRA_BITS_32 >= MaxMLBits);
1293-
if (MEM_32bits() && longOffsets && (ofBits >= STREAM_ACCUMULATOR_MIN_32)) {
1294-
/* Always read extra bits, this keeps the logic simple,
1295-
* avoids branches, and avoids accidentally reading 0 bits.
1296-
*/
1297-
U32 const extraBits = LONG_OFFSETS_MAX_EXTRA_BITS_32;
1298-
offset = ofBase + (BIT_readBitsFast(&seqState->DStream, ofBits - extraBits) << extraBits);
1299-
BIT_reloadDStream(&seqState->DStream);
1300-
offset += BIT_readBitsFast(&seqState->DStream, extraBits);
1301-
} else {
1302-
offset = ofBase + BIT_readBitsFast(&seqState->DStream, ofBits/*>0*/); /* <= (ZSTD_WINDOWLOG_MAX-1) bits */
1303-
if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);
1304-
}
1294+
offset = ofBase + BIT_readBitsFast(&seqState->DStream, ofBits/*>0*/); /* <= (ZSTD_WINDOWLOG_MAX-1) bits */
13051295
prevOffset2 = prevOffset1;
13061296
prevOffset1 = prevOffset0;
13071297
prevOffset0 = offset;
@@ -1344,17 +1334,13 @@ ZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets, c
13441334
if (llBits > 0)
13451335
seq.litLength += BIT_readBitsFast(&seqState->DStream, llBits/*>0*/);
13461336

1347-
if (MEM_32bits())
1348-
BIT_reloadDStream(&seqState->DStream);
1349-
13501337
DEBUGLOG(6, "seq: litL=%u, matchL=%u, offset=%u",
13511338
(U32)seq.litLength, (U32)seq.matchLength, (U32)seq.offset);
13521339

13531340
if (!isLastSeq) {
13541341
/* Don't update FSE state for last sequence. */
13551342
ZSTD_updateFseStateWithDInfo(&seqState->stateLL, &seqState->DStream, llNext, llnbBits); /* <= 9 bits */
13561343
ZSTD_updateFseStateWithDInfo(&seqState->stateML, &seqState->DStream, mlNext, mlnbBits); /* <= 9 bits */
1357-
if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream); /* <= 18 bits */
13581344
ZSTD_updateFseStateWithDInfo(&seqState->stateOffb, &seqState->DStream, ofNext, ofnbBits); /* <= 8 bits */
13591345
BIT_reloadDStream(&seqState->DStream);
13601346
}

0 commit comments

Comments
 (0)