From 70d1be5f9447bfeba59fedc8283ac734dc89a0e2 Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Mon, 16 Jul 2012 16:07:42 +0000 Subject: [PATCH] land http://codereview.appspot.com/6325044/ by Lei git-svn-id: http://skia.googlecode.com/svn/trunk@4622 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/opts/opts_check_SSE2.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/opts/opts_check_SSE2.cpp b/src/opts/opts_check_SSE2.cpp index 5da6412..711ee33 100644 --- a/src/opts/opts_check_SSE2.cpp +++ b/src/opts/opts_check_SSE2.cpp @@ -64,8 +64,8 @@ static inline void getcpuid(int info_type, int info[4]) { #endif #endif -#if defined(__x86_64__) || defined(_WIN64) -/* All x86_64 machines have SSE2, so don't even bother checking. */ +#if defined(__x86_64__) || defined(_WIN64) || SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 +/* All x86_64 machines have SSE2, or we know it's supported at compile time, so don't even bother checking. */ static inline bool hasSSE2() { return true; } @@ -78,11 +78,19 @@ static inline bool hasSSE2() { } #endif +#if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 +/* If we know SSSE3 is supported at compile time, don't even bother checking. */ +static inline bool hasSSSE3() { + return true; +} +#else + static inline bool hasSSSE3() { int cpu_info[4] = { 0 }; getcpuid(1, cpu_info); return (cpu_info[2] & 0x200) != 0; } +#endif static bool cachedHasSSE2() { static bool gHasSSE2 = hasSSE2(); -- 2.7.4