From 186ffdfcde580b609ed46af10553924408bed878 Mon Sep 17 00:00:00 2001 From: Samuel Neves Date: Thu, 2 Jul 2020 03:46:23 +0100 Subject: [PATCH] x86_64 always has at least SSE2 --- src/blake2-dispatch.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/blake2-dispatch.c b/src/blake2-dispatch.c index ad5cea6..9777fc6 100644 --- a/src/blake2-dispatch.c +++ b/src/blake2-dispatch.c @@ -31,6 +31,11 @@ typedef enum XOP = 5, /* AVX2 = 6, */ #endif +#if defined(__x86_64__) || defined(_M_X64) + DEFAULT = SSE2 +#else + DEFAULT = NONE +#endif } cpu_feature_t; static const char feature_names[][8] = @@ -98,7 +103,7 @@ static inline cpu_feature_t get_cpu_features( void ) { #if defined(HAVE_X86) static volatile int initialized = 0; - static cpu_feature_t feature = NONE; // Safe default + static cpu_feature_t feature = DEFAULT; uint32_t eax, ecx, edx, ebx; if( initialized )