From 1e0bac6a9c2dcb340e7e80acce67ec67f53fd1c5 Mon Sep 17 00:00:00 2001 From: Nick Terrell Date: Wed, 12 Sep 2018 10:35:16 -0700 Subject: [PATCH 1/2] [libzstd] Fix cpu for MSFT ARM The `__cpuid()` and `__cpuidex()` intrinsics are only available on x86 and x86_64. --- lib/common/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common/cpu.h b/lib/common/cpu.h index 88e0ebf4..957f3e50 100644 --- a/lib/common/cpu.h +++ b/lib/common/cpu.h @@ -36,7 +36,7 @@ MEM_STATIC ZSTD_cpuid_t ZSTD_cpuid(void) { U32 f1d = 0; U32 f7b = 0; U32 f7c = 0; -#ifdef _MSC_VER +#if defined(_MSC_VER) && defined(_M_X64) int reg[4]; __cpuid((int*)reg, 0); { From f6daddf2dbeddc444a90a8f79f94cc55e82cbbe9 Mon Sep 17 00:00:00 2001 From: Nick Terrell Date: Wed, 12 Sep 2018 12:05:32 -0700 Subject: [PATCH 2/2] Also allow x86 --- lib/common/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common/cpu.h b/lib/common/cpu.h index 957f3e50..eeb428ad 100644 --- a/lib/common/cpu.h +++ b/lib/common/cpu.h @@ -36,7 +36,7 @@ MEM_STATIC ZSTD_cpuid_t ZSTD_cpuid(void) { U32 f1d = 0; U32 f7b = 0; U32 f7c = 0; -#if defined(_MSC_VER) && defined(_M_X64) +#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86)) int reg[4]; __cpuid((int*)reg, 0); {