From: mtklein Date: Mon, 21 Sep 2015 02:05:01 +0000 (-0700) Subject: Revert of try simplest code: inline whenever vaguely sensible (patchset #1 id:1 of... X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~795 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b1cc9daa654b2e55ef270a1fa8d39383897367ff;p=platform%2Fupstream%2FlibSkiaSharp.git Revert of try simplest code: inline whenever vaguely sensible (patchset #1 id:1 of https://codereview.chromium.org/1351403005/ ) Reason for revert: pingpong Original issue's description: > try simplest code: inline whenever vaguely sensible > > BUG=skia:4316 > > Will land and revert. > TBR=reed@google.com > > Committed: https://skia.googlesource.com/skia/+/527a0c8235b454f5d0475a9a3e34caa9520db3a2 TBR=reed@google.com,mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4316 Review URL: https://codereview.chromium.org/1355073002 --- diff --git a/include/core/SkUtils.h b/include/core/SkUtils.h index d349755..4e24bd0 100644 --- a/include/core/SkUtils.h +++ b/include/core/SkUtils.h @@ -31,11 +31,12 @@ namespace SkOpts { @param count The number of times value should be copied into the buffer. */ static inline void sk_memset16(uint16_t buffer[], uint16_t value, int count) { -#if defined(SK_ARM_HAS_NEON) || SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 - while (count --> 0) { *buffer++ = value; } -#else - SkOpts::memset16(buffer, value, count); +#if defined(SK_CPU_ARM64) + while (count --> 0) { *buffer++ = value; } return; +#elif defined(SK_CPU_ARM32) + if (count <= 10) { while (count --> 0) { *buffer++ = value; } return; } #endif + SkOpts::memset16(buffer, value, count); } /** Similar to memset(), but it assigns a 32bit value into the buffer. @@ -44,11 +45,12 @@ static inline void sk_memset16(uint16_t buffer[], uint16_t value, int count) { @param count The number of times value should be copied into the buffer. */ static inline void sk_memset32(uint32_t buffer[], uint32_t value, int count) { -#if defined(SK_ARM_HAS_NEON) || SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 - while (count --> 0) { *buffer++ = value; } -#else - SkOpts::memset32(buffer, value, count); +#if defined(SK_CPU_ARM64) + while (count --> 0) { *buffer++ = value; } return; +#elif defined(SK_CPU_ARM32) + if (count <= 10) { while (count --> 0) { *buffer++ = value; } return; } #endif + SkOpts::memset32(buffer, value, count); }