aboutsummaryrefslogtreecommitdiff
path: root/benchmarks/common
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/common')
-rw-r--r--benchmarks/common/syscalls.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/benchmarks/common/syscalls.c b/benchmarks/common/syscalls.c
index 39547b3..7a7b7fd 100644
--- a/benchmarks/common/syscalls.c
+++ b/benchmarks/common/syscalls.c
@@ -381,7 +381,21 @@ void* memcpy(void* dest, const void* src, size_t len)
if ((((uintptr_t)dest | (uintptr_t)src | len) & (sizeof(uintptr_t)-1)) == 0) {
const uintptr_t* s = src;
uintptr_t *d = dest;
- while (d < (uintptr_t*)(dest + len))
+ uintptr_t *end = dest + len;
+ while (d + 8 < end) {
+ uintptr_t reg[8] = {s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7]};
+ d[0] = reg[0];
+ d[1] = reg[1];
+ d[2] = reg[2];
+ d[3] = reg[3];
+ d[4] = reg[4];
+ d[5] = reg[5];
+ d[6] = reg[6];
+ d[7] = reg[7];
+ d += 8;
+ s += 8;
+ }
+ while (d < end)
*d++ = *s++;
} else {
const char* s = src;