move reinterpret_cast into SK_PREFETCH

no public API changes
TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1419573011
This commit is contained in:
mtklein 2015-10-28 09:52:20 -07:00 committed by Commit bot
parent bdef140b50
commit 72815e9b15
2 changed files with 3 additions and 3 deletions

View File

@ -296,8 +296,8 @@
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE1 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE1
#define SK_PREFETCH(ptr) _mm_prefetch(ptr, _MM_HINT_T0) #define SK_PREFETCH(ptr) _mm_prefetch(reinterpret_cast<const char*>(ptr), _MM_HINT_T0)
#define SK_WRITE_PREFETCH(ptr) _mm_prefetch(ptr, _MM_HINT_T0) #define SK_WRITE_PREFETCH(ptr) _mm_prefetch(reinterpret_cast<const char*>(ptr), _MM_HINT_T0)
#elif defined(__GNUC__) #elif defined(__GNUC__)
#define SK_PREFETCH(ptr) __builtin_prefetch(ptr) #define SK_PREFETCH(ptr) __builtin_prefetch(ptr)
#define SK_WRITE_PREFETCH(ptr) __builtin_prefetch(ptr, 1) #define SK_WRITE_PREFETCH(ptr) __builtin_prefetch(ptr, 1)

View File

@ -209,7 +209,7 @@ static void box_blur(const SkPMColor* src, int srcStride, SkPMColor* dst, int ke
} }
sptr += srcStrideX; sptr += srcStrideX;
if (srcDirection == BlurDirection::kY) { if (srcDirection == BlurDirection::kY) {
SK_PREFETCH(reinterpret_cast<const char*>(sptr + (rightOffset + 1) * srcStrideX)); SK_PREFETCH(sptr + (rightOffset + 1) * srcStrideX);
} }
dptr += dstStrideX; dptr += dstStrideX;
} }