diff --git a/CMakeLists.txt b/CMakeLists.txt index ab5bba723..83feabc10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -447,6 +447,7 @@ add_library(liblzma src/liblzma/check/check.c src/liblzma/check/check.h src/liblzma/check/crc_common.h + src/liblzma/check/crc_e2k_clmul.h src/liblzma/check/crc_x86_clmul.h src/liblzma/check/crc32_arm64.h src/liblzma/common/block_util.c diff --git a/src/liblzma/check/Makefile.inc b/src/liblzma/check/Makefile.inc index 6c0e37396..94fb40e09 100644 --- a/src/liblzma/check/Makefile.inc +++ b/src/liblzma/check/Makefile.inc @@ -13,6 +13,7 @@ liblzma_la_SOURCES += \ check/check.c \ check/check.h \ check/crc_common.h \ + check/crc_e2k_clmul.h \ check/crc_x86_clmul.h \ check/crc32_arm64.h diff --git a/src/liblzma/check/crc32_fast.c b/src/liblzma/check/crc32_fast.c index f492cdff0..acdddd30e 100644 --- a/src/liblzma/check/crc32_fast.c +++ b/src/liblzma/check/crc32_fast.c @@ -17,6 +17,9 @@ #if defined(CRC_X86_CLMUL) # define BUILDING_CRC32_CLMUL # include "crc_x86_clmul.h" +#elif defined(CRC_E2K_CLMUL) +# define BUILDING_CRC32_CLMUL +# include "crc_e2k_clmul.h" #elif defined(CRC32_ARM64) # include "crc32_arm64.h" #endif diff --git a/src/liblzma/check/crc64_fast.c b/src/liblzma/check/crc64_fast.c index 43f3f3adb..e3662c5da 100644 --- a/src/liblzma/check/crc64_fast.c +++ b/src/liblzma/check/crc64_fast.c @@ -16,6 +16,9 @@ #if defined(CRC_X86_CLMUL) # define BUILDING_CRC64_CLMUL # include "crc_x86_clmul.h" +#elif defined(CRC_E2K_CLMUL) +# define BUILDING_CRC64_CLMUL +# include "crc_e2k_clmul.h" #endif diff --git a/src/liblzma/check/crc_common.h b/src/liblzma/check/crc_common.h index 7106646f0..84da29f6f 100644 --- a/src/liblzma/check/crc_common.h +++ b/src/liblzma/check/crc_common.h @@ -86,8 +86,11 @@ // // NOTE: Keep this in sync with the NO_CRC32_TABLE macro in crc32_table.c // and NO_CRC64_TABLE in crc64_table.c. -# if (defined(__SSSE3__) && defined(__SSE4_1__) && defined(__PCLMUL__)) \ - || (defined(__e2k__) && __iset__ >= 6) +# if defined(__e2k__) && __iset__ >= 6 +# define CRC32_ARCH_OPTIMIZED 1 +# define CRC64_ARCH_OPTIMIZED 1 +# define CRC_E2K_CLMUL 1 +# elif defined(__SSSE3__) && defined(__SSE4_1__) && defined(__PCLMUL__) # define CRC32_ARCH_OPTIMIZED 1 # define CRC64_ARCH_OPTIMIZED 1 # define CRC_X86_CLMUL 1