summaryrefslogtreecommitdiffstats
path: root/lib/lz4.c
diff options
context:
space:
mode:
authorBen Niu <niuben003@gmail.com>2022-01-27 02:02:31 (GMT)
committerGitHub <noreply@github.com>2022-01-27 02:02:31 (GMT)
commitbee421b93d79c613ecb67c13687d9a7127698609 (patch)
tree97cfa0ea1f5c42172dd2d10bddc6755b6f098463 /lib/lz4.c
parent4c9431e9af596af0556e5da0ae99305bafb2b10b (diff)
downloadlz4-bee421b93d79c613ecb67c13687d9a7127698609.zip
lz4-bee421b93d79c613ecb67c13687d9a7127698609.tar.gz
lz4-bee421b93d79c613ecb67c13687d9a7127698609.tar.bz2
Disable _tzcnt_u64 for ARM64EC
The ARM64EC is a new Microsoft-designed ARM64 ABI that is compatible with AMD64 code. However, not all AMD64 intrinsic functions are supported. For, intrinsics that are lowered to AVX, AVX2 and AVX512 instructions are not supported, including the _tzcnt_u64. To make sure this file compiles for ARM64EC, the use of _tzcnt_u64 should be neutered.
Diffstat (limited to 'lib/lz4.c')
-rw-r--r--lib/lz4.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index 2867c60..fb91047 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -517,7 +517,7 @@ static unsigned LZ4_NbCommonBytes (reg_t val)
assert(val != 0);
if (LZ4_isLittleEndian()) {
if (sizeof(val) == 8) {
-# if defined(_MSC_VER) && (_MSC_VER >= 1800) && defined(_M_AMD64) && !defined(LZ4_FORCE_SW_BITCOUNT)
+# if defined(_MSC_VER) && (_MSC_VER >= 1800) && (defined(_M_AMD64) && !defined(_M_ARM64EC)) && !defined(LZ4_FORCE_SW_BITCOUNT)
# if defined(__clang__) && (__clang_major__ < 10)
/* Avoid undefined clang-cl intrinics issue.
* See https://github.com/lz4/lz4/pull/1017 for details. */