From c566fddd3728f146f25918b9c26fc8eb6a6b85eb Mon Sep 17 00:00:00 2001 From: mtklein Date: Sun, 20 Sep 2015 18:06:03 -0700 Subject: [PATCH] Revert of try stosd/w (patchset #2 id:20001 of https://codereview.chromium.org/1355063002/ ) Reason for revert: boink Original issue's description: > try stosd/w > > While we're trying things and reverting them, might as well try this too. > > BUG=skia:4316 > > Blinking in and out for perf.skia.org. > TBR=reed@google.com > > Committed: https://skia.googlesource.com/skia/+/3ca0f626a07e9b534d14a2d8213eedb93c5f7534 TBR=mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4316 Review URL: https://codereview.chromium.org/1356983004 --- include/core/SkUtils.h | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/include/core/SkUtils.h b/include/core/SkUtils.h index 6ddc40eab2..4e24bd0883 100644 --- a/include/core/SkUtils.h +++ b/include/core/SkUtils.h @@ -9,9 +9,6 @@ #define SkUtils_DEFINED #include "SkTypes.h" -#if defined(SK_BUILD_FOR_WIN) - #include -#endif namespace SkOpts { extern void (*memset16)(uint16_t[], uint16_t, int); @@ -34,15 +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_BUILD_FOR_WIN) - __stosw(buffer, value, count); -#elif defined(SK_CPU_X86) - __asm__ __volatile__ ( "rep stosw" : "+D"(buffer), "+c"(count) : "a"(value) ); -#elif defined(SK_ARM_HAS_NEON) - 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. @@ -51,15 +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_BUILD_FOR_WIN) - __stosd((PDWORD)buffer, value, count); -#elif defined(SK_CPU_X86) - __asm__ __volatile__ ( "rep stosl" : "+D"(buffer), "+c"(count) : "a"(value) ); -#elif defined(SK_ARM_HAS_NEON) - 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); } -- 2.34.1