aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-10-27 13:06:47 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-10-27 13:06:47 -0700
commit6885a1e7c04450c0377a85d3ec8698badc58cbea (patch)
tree16faa896b72817b2d6985722a364fd6e585fa0c8
parent35e5d1b4495478ca3bede66914ae07f50a447c4d (diff)
Make SK_PREFETCH work on Windows too.
- Use _mm_prefetch() if available, e.g. with MSVC. - Some other tidying up. No public API changes. TBR=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/1427663002
-rw-r--r--include/core/SkPostConfig.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index f228937305..76f504f459 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__)
+ #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
//////////////////////////////////////////////////////////////////////