sk_memcpy32 should fall back on libc memcpy.
Writing it out ourselves was a ~2x slowdown on ARM. BUG=skia: R=henrik.smiding@intel.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/292663013 git-svn-id: http://skia.googlecode.com/svn/trunk@14886 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
53c63a5136
commit
b0c769abe1
@ -34,18 +34,6 @@
|
|||||||
*(dst)++ = value; *(dst)++ = value; \
|
*(dst)++ = value; *(dst)++ = value; \
|
||||||
*(dst)++ = value; *(dst)++ = value; \
|
*(dst)++ = value; *(dst)++ = value; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define copy_16_longs(dst, src) \
|
|
||||||
do { \
|
|
||||||
*(dst)++ = *(src)++; *(dst)++ = *(src)++; \
|
|
||||||
*(dst)++ = *(src)++; *(dst)++ = *(src)++; \
|
|
||||||
*(dst)++ = *(src)++; *(dst)++ = *(src)++; \
|
|
||||||
*(dst)++ = *(src)++; *(dst)++ = *(src)++; \
|
|
||||||
*(dst)++ = *(src)++; *(dst)++ = *(src)++; \
|
|
||||||
*(dst)++ = *(src)++; *(dst)++ = *(src)++; \
|
|
||||||
*(dst)++ = *(src)++; *(dst)++ = *(src)++; \
|
|
||||||
*(dst)++ = *(src)++; *(dst)++ = *(src)++; \
|
|
||||||
} while (0)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -122,21 +110,7 @@ static void sk_memset32_portable(uint32_t dst[], uint32_t value, int count) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void sk_memcpy32_portable(uint32_t dst[], const uint32_t src[], int count) {
|
static void sk_memcpy32_portable(uint32_t dst[], const uint32_t src[], int count) {
|
||||||
SkASSERT(dst != NULL && count >= 0);
|
memcpy(dst, src, count * sizeof(uint32_t));
|
||||||
|
|
||||||
int sixteenlongs = count >> 4;
|
|
||||||
if (sixteenlongs) {
|
|
||||||
do {
|
|
||||||
copy_16_longs(dst, src);
|
|
||||||
} while (--sixteenlongs != 0);
|
|
||||||
count &= 15;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count) {
|
|
||||||
do {
|
|
||||||
*dst++ = *src++;
|
|
||||||
} while (--count != 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void choose_memset16(SkMemset16Proc* proc) {
|
static void choose_memset16(SkMemset16Proc* proc) {
|
||||||
|
Loading…
Reference in New Issue
Block a user