Skip to content

Commit

Permalink
decomp: add prefetch for matched seq on aarch64 (#3164)
Browse files Browse the repository at this point in the history
match is used for following sequence copy. It is
only updated when extDict is needed, which is a
low probability case. So it can be prefetched to
reduce cache miss.
The benchmarks on various Arm platforms showed
uplift from 1% ~ 14% with gcc-11/clang-14.

Signed-off-by: Jun He <jun.he@arm.com>
Change-Id: If201af4799d2455d74c79f8387404439d7f684ae
  • Loading branch information
JunHe77 authored Jul 29, 2022
1 parent 85d6330 commit 558cf20
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/decompress/zstd_decompress_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,11 @@ size_t ZSTD_execSequence(BYTE* op,

assert(op != NULL /* Precondition */);
assert(oend_w < oend /* No underflow */);

#if defined(__aarch64__)
/* prefetch sequence starting from match that will be used for copy later */
PREFETCH_L1(match);
#endif
/* Handle edge cases in a slow path:
* - Read beyond end of literals
* - Match end is within WILDCOPY_OVERLIMIT of oend
Expand Down

0 comments on commit 558cf20

Please sign in to comment.