• Willy Tarreau's avatar
    tools/nolibc/string: slightly simplify memmove() · d76232ff
    Willy Tarreau authored
    The direction test inside the loop was not always completely optimized,
    resulting in a larger than necessary function. This change adds a
    direction variable that is set out of the loop. Now the function is down
    to 48 bytes on x86, 32 on ARM and 68 on mips. It's worth noting that other
    approaches were attempted (including relying on the up and down functions)
    but they were only slightly beneficial on x86 and cost more on others.
    Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
    Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
    d76232ff
string.h 2.33 KB