summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <Cyan4973@users.noreply.github.com>2022-01-27 20:08:27 (GMT)
committerGitHub <noreply@github.com>2022-01-27 20:08:27 (GMT)
commit5cc311893f1c94fe37e4151170d5a810c51c3330 (patch)
tree4df2fb8704755cd4b63896fc90028f842776dab0
parent4c9431e9af596af0556e5da0ae99305bafb2b10b (diff)
parentc2d00cb97b68cdaf3cc52dc910eecbeb4bee5015 (diff)
downloadlz4-5cc311893f1c94fe37e4151170d5a810c51c3330.zip
lz4-5cc311893f1c94fe37e4151170d5a810c51c3330.tar.gz
lz4-5cc311893f1c94fe37e4151170d5a810c51c3330.tar.bz2
Merge pull request #1054 from mcfi/patch-1
Disable _tzcnt_u64 for ARM64EC
-rw-r--r--lib/lz4.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index 2867c60..6a02ef5 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -517,7 +517,12 @@ 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)
+/*-*************************************************************************************************
+* ARM64EC is a Microsoft-designed ARM64 ABI compatible with AMD64 applications on ARM64 Windows 11.
+* The ARM64EC ABI does not support AVX/AVX2/AVX512 instructions, nor their relevant intrinsics
+* including _tzcnt_u64. Therefore, we need to neuter the _tzcnt_u64 code path for ARM64EC.
+****************************************************************************************************/
# if defined(__clang__) && (__clang_major__ < 10)
/* Avoid undefined clang-cl intrinics issue.
* See https://github.com/lz4/lz4/pull/1017 for details. */