From 126b4362be3bb43ef8f7a10df710b40e8bba869d Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Mon, 2 Jul 2012 19:00:27 +0000 Subject: [PATCH] detect SSE level in visual studio git-svn-id: http://skia.googlecode.com/svn/trunk@4424 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkPreConfig.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/core/SkPreConfig.h b/include/core/SkPreConfig.h index 812e446..f4446c1 100644 --- a/include/core/SkPreConfig.h +++ b/include/core/SkPreConfig.h @@ -103,13 +103,17 @@ ////////////////////////////////////////////////////////////////////// /** + * SK_CPU_SSE_LEVEL + * * If defined, SK_CPU_SSE_LEVEL should be set to the highest supported level. * On non-intel CPU this should be undefined. */ + #define SK_CPU_LEVEL_SSE2_VALUE 20 #define SK_CPU_LEVEL_SSE3_VALUE 30 #define SK_CPU_LEVEL_SSSE3_VALUE 31 +// Are we in GCC? #ifndef SK_CPU_SSE_LEVEL #if defined(__SSSE3__) #define SK_CPU_SSE_LEVEL SK_CPU_LEVEL_SSSE3_VALUE @@ -120,6 +124,13 @@ #endif #endif +// Are we in VisualStudio? +#ifndef SK_CPU_SSE_LEVEL + #if _M_IX86_FP == 2 + #define SK_CPU_SSE_LEVEL SK_CPU_LEVEL_SSE2_VALUE + #endif +#endif + ////////////////////////////////////////////////////////////////////// #if (defined(__arm__) && !defined(__thumb__)) || defined(SK_BUILD_FOR_WINCE) || (defined(SK_BUILD_FOR_SYMBIAN) && !defined(__MARM_THUMB__)) -- 2.7.4