MEMMOVE_OR_MEMCPY: unroll word-copying loops in the hope of a small speedup.

This commit is contained in:
Julian Seward 2018-03-09 18:51:39 +01:00
parent 23185f46a1
commit c182a3c875

View File

@ -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) \