From 527a0c8235b454f5d0475a9a3e34caa9520db3a2 Mon Sep 17 00:00:00 2001 From: mtklein Date: Sun, 20 Sep 2015 19:04:21 -0700 Subject: [PATCH] try simplest code: inline whenever vaguely sensible BUG=skia:4316 Will land and revert. TBR=reed@google.com Review URL: https://codereview.chromium.org/1351403005 --- include/core/SkUtils.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/include/core/SkUtils.h b/include/core/SkUtils.h index 4e24bd0883..d349755234 100644 --- a/include/core/SkUtils.h +++ b/include/core/SkUtils.h @@ -31,12 +31,11 @@ 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_CPU_ARM64) - while (count --> 0) { *buffer++ = value; } return; -#elif defined(SK_CPU_ARM32) - if (count <= 10) { while (count --> 0) { *buffer++ = value; } return; } -#endif +#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); +#endif } /** Similar to memset(), but it assigns a 32bit value into the buffer. @@ -45,12 +44,11 @@ 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_CPU_ARM64) - while (count --> 0) { *buffer++ = value; } return; -#elif defined(SK_CPU_ARM32) - if (count <= 10) { while (count --> 0) { *buffer++ = value; } return; } -#endif +#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); +#endif } -- 2.34.1