Skip to content

Commit

Permalink
liblzma: CRC CLMUL: Omit is_arch_extension_supported() when not needed
Browse files Browse the repository at this point in the history
On E2K the function compiles only due to compiler emulation but the
function is never used. It's cleaner to omit the function when it's
not needed even though it's a "static inline" function.

Thanks to Ilya Kurdyukov.
  • Loading branch information
Larhzu committed Jun 16, 2024
1 parent 888cef9 commit 3427b26
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/liblzma/check/crc_x86_clmul.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ crc64_arch_optimized(const uint8_t *buf, size_t size, uint64_t crc)
}


// Even though this is an inline function, compile it only when needed.
// This way it won't appear in E2K builds at all.
#if defined(CRC32_GENERIC) || defined(CRC64_GENERIC)
// Inlining this function duplicates the function body in crc32_resolve() and
// crc64_resolve(), but this is acceptable because this is a tiny function.
static inline bool
Expand Down Expand Up @@ -376,3 +379,4 @@ is_arch_extension_supported(void)
// code as is it only reads a variable set at startup but a few bytes
// doesn't matter here.
}
#endif

0 comments on commit 3427b26

Please sign in to comment.