Skip to content

Commit

Permalink
Merge pull request #1040 from zeux/m1-fastdec
Browse files Browse the repository at this point in the history
Enable fast decoding on Apple/AArch64 builds (18-25% faster decompression)
  • Loading branch information
Cyan4973 committed Nov 23, 2021
2 parents 8f61d8e + 22e232d commit db57809
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/lz4.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,12 @@ static const int dec64table[8] = {0, 0, 0, -1, -4, 1, 2, 3};
#ifndef LZ4_FAST_DEC_LOOP
# if defined __i386__ || defined _M_IX86 || defined __x86_64__ || defined _M_X64
# define LZ4_FAST_DEC_LOOP 1
# elif defined(__aarch64__) && defined(__APPLE__)
# define LZ4_FAST_DEC_LOOP 1
# elif defined(__aarch64__) && !defined(__clang__)
/* On aarch64, we disable this optimization for clang because on certain
* mobile chipsets, performance is reduced with clang. For information
* refer to https://github.com/lz4/lz4/pull/707 */
/* On non-Apple aarch64, we disable this optimization for clang because
* on certain mobile chipsets, performance is reduced with clang. For
* more information refer to https://github.com/lz4/lz4/pull/707 */
# define LZ4_FAST_DEC_LOOP 1
# else
# define LZ4_FAST_DEC_LOOP 0
Expand Down

0 comments on commit db57809

Please sign in to comment.