mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 18:13:01 +00:00
MEMMOVE_OR_MEMCPY: unroll word-copying loops in the hope of a small speedup.
This commit is contained in:
parent
23185f46a1
commit
c182a3c875
@ -964,6 +964,11 @@ static inline void my_exit ( int x )
|
||||
while ((s & WM) != 0 && n >= 1) \
|
||||
{ *(UChar*)d = *(UChar*)s; s += 1; d += 1; n -= 1; } \
|
||||
/* Copy UWords. */ \
|
||||
while (n >= WS * 4) \
|
||||
{ *(UWord*)d = *(UWord*)s; s += WS; d += WS; n -= WS; \
|
||||
*(UWord*)d = *(UWord*)s; s += WS; d += WS; n -= WS; \
|
||||
*(UWord*)d = *(UWord*)s; s += WS; d += WS; n -= WS; \
|
||||
*(UWord*)d = *(UWord*)s; s += WS; d += WS; n -= WS; } \
|
||||
while (n >= WS) \
|
||||
{ *(UWord*)d = *(UWord*)s; s += WS; d += WS; n -= WS; } \
|
||||
if (n == 0) \
|
||||
@ -991,6 +996,11 @@ static inline void my_exit ( int x )
|
||||
while ((s & WM) != 0 && n >= 1) \
|
||||
{ s -= 1; d -= 1; *(UChar*)d = *(UChar*)s; n -= 1; } \
|
||||
/* Copy UWords. */ \
|
||||
while (n >= WS * 4) \
|
||||
{ s -= WS; d -= WS; *(UWord*)d = *(UWord*)s; n -= WS; \
|
||||
s -= WS; d -= WS; *(UWord*)d = *(UWord*)s; n -= WS; \
|
||||
s -= WS; d -= WS; *(UWord*)d = *(UWord*)s; n -= WS; \
|
||||
s -= WS; d -= WS; *(UWord*)d = *(UWord*)s; n -= WS; } \
|
||||
while (n >= WS) \
|
||||
{ s -= WS; d -= WS; *(UWord*)d = *(UWord*)s; n -= WS; } \
|
||||
if (n == 0) \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user