Skip to content

Commit

Permalink
liblzma: memcmplen.h: Use 8-byte method on 64-bit unaligned archs
Browse files Browse the repository at this point in the history
Previously it was enabled only on x86-64 and ARM64 when also support
for unaligned access was detected or manually enabled at built time.

In the default build configuration, the 8-byte method is now enabled
also on 64-bit RISC-V and 64-bit PowerPC (both endiannesses). It was
reported that on big endian POWER9, encoding time may reduce 12-13 %.

This change only affects builds with GCC and Clang because the code
uses __builtin_ctzll or __builtin_clzll.

Thanks to Marcus Comstedt for testing on POWER9.
  • Loading branch information
Larhzu committed Jan 13, 2025
1 parent 96336b0 commit 51f038f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/liblzma/common/memcmplen.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ lzma_memcmplen(const uint8_t *buf1, const uint8_t *buf2,

#if defined(TUKLIB_FAST_UNALIGNED_ACCESS) \
&& (((TUKLIB_GNUC_REQ(3, 4) || defined(__clang__)) \
&& (defined(__x86_64__) \
|| defined(__aarch64__))) \
&& SIZE_MAX == UINT64_MAX) \
|| (defined(__INTEL_COMPILER) && defined(__x86_64__)) \
|| (defined(__INTEL_COMPILER) && defined(_M_X64)) \
|| (defined(_MSC_VER) && (defined(_M_X64) \
Expand Down

0 comments on commit 51f038f

Please sign in to comment.