diff options
author | 2012-07-09 13:02:35 +0000 | |
---|---|---|
committer | 2012-07-09 13:02:35 +0000 | |
commit | 00aad94f01a9078d26363db3116f8005d84440f2 (patch) | |
tree | b29c160d721c94d64b34368d3f91cb0019ec092c /include/core | |
parent | e60b9106ba4405fc499ac9f66ae7379327f0ff86 (diff) |
define SK_CPU_SSE_LEVEL to a min of SSE2 if we're on 64bit x86
git-svn-id: http://skia.googlecode.com/svn/trunk@4463 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkPreConfig.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/include/core/SkPreConfig.h b/include/core/SkPreConfig.h index 4c93837c07..63fa815ee8 100644 --- a/include/core/SkPreConfig.h +++ b/include/core/SkPreConfig.h @@ -109,24 +109,35 @@ * On non-intel CPU this should be undefined. */ +#define SK_CPU_SSE_LEVEL_SSE1 10 #define SK_CPU_SSE_LEVEL_SSE2 20 #define SK_CPU_SSE_LEVEL_SSE3 30 #define SK_CPU_SSE_LEVEL_SSSE3 31 // Are we in GCC? #ifndef SK_CPU_SSE_LEVEL - #if defined(__SSSE3__) + #if defined(__SSE2__) #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE2 #elif defined(__SSE3__) #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE3 - #elif defined(__SSE2__) + #elif defined(__SSSE3__) #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSSE3 #endif #endif // Are we in VisualStudio? #ifndef SK_CPU_SSE_LEVEL - #if _M_IX86_FP == 2 + #if _M_IX86_FP == 1 + #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE1 + #elif _M_IX86_FP >= 2 + #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE2 + #endif +#endif + +// 64bit intel guarantees at least SSE2 +#if defined(__x86_64__) || defined(_WIN64) + #if !defined(SK_CPU_SSE_LEVEL) || (SK_CPU_SSE_LEVEL < SK_CPU_SSE_LEVEL_SSE2) + #undef SK_CPU_SSE_LEVEL #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE2 #endif #endif |