From a1e2f8344fb02660a329f20963a78a4fe1639423 Mon Sep 17 00:00:00 2001 From: Ryan Crosby Date: Wed, 1 Aug 2018 14:49:52 +1000 Subject: [PATCH] Added SSE version check for MSC --- spectre.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spectre.c b/spectre.c index 2f1ce8d..f7985a7 100644 --- a/spectre.c +++ b/spectre.c @@ -19,13 +19,20 @@ #pragma optimize("gt",on) #else #include /* for rdtsc, rdtscp, clflush */ +#endif /* ifdef _MSC_VER */ /* Automatically detect if SSE2 is not available when SSE is advertized */ -#if defined(__SSE__) && !defined(__SSE2__) +#ifdef _MSC_VER +/* MSC */ +#if _M_IX86_FP==1 #define NOSSE2 #endif - +#else +/* Not MSC */ +#if defined(__SSE__) && !defined(__SSE2__) +#define NOSSE2 #endif +#endif /* ifdef _MSC_VER */ #ifdef NOSSE2 #define NORDTSCP