Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(617)

Unified Diff: include/core/SkPostConfig.h

Issue 1427663002: Make SK_PREFETCH work on Windows too. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: actually, SSE1 Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPostConfig.h
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index f22893730523a16b746698b23e2002d6c147f794..76f504f4592a7565934de72bd82abade588cca69 100644
--- a/include/core/SkPostConfig.h
+++ b/include/core/SkPostConfig.h
@@ -295,12 +295,15 @@
//////////////////////////////////////////////////////////////////////
-#if defined(__clang__) || defined(__GNUC__)
-# define SK_PREFETCH(ptr) __builtin_prefetch(ptr)
-# define SK_WRITE_PREFETCH(ptr) __builtin_prefetch(ptr, 1)
+#if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE1
+ #define SK_PREFETCH(ptr) _mm_prefetch(ptr, _MM_HINT_T0)
+ #define SK_WRITE_PREFETCH(ptr) _mm_prefetch(ptr, _MM_HINT_T0)
+#elif defined(__GNUC__)
Stephen White 2015/10/27 20:03:20 We don't need "define(__clang__) ||" here anymore?
mtklein 2015/10/27 20:05:55 Nah, Clang defines __GNUC__. Seemed confusing to
+ #define SK_PREFETCH(ptr) __builtin_prefetch(ptr)
+ #define SK_WRITE_PREFETCH(ptr) __builtin_prefetch(ptr, 1)
#else
-# define SK_PREFETCH(ptr)
-# define SK_WRITE_PREFETCH(ptr)
+ #define SK_PREFETCH(ptr)
+ #define SK_WRITE_PREFETCH(ptr)
#endif
//////////////////////////////////////////////////////////////////////
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698