This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Use memcpy in memmove when possible
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Maxim Kuvyrkov <maxim at codesourcery dot com>
- Cc: GLIBC Devel <libc-alpha at sourceware dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Sat, 1 Sep 2012 05:51:44 -0700
- Subject: Re: [PATCH] Use memcpy in memmove when possible
- References: <A9D6160A-41F1-48E7-851F-F2D4F7134EB3@codesourcery.com>
On Sat, Sep 1, 2012 at 1:16 AM, Maxim Kuvyrkov <maxim@codesourcery.com> wrote:
> Several architectures, e.g., MIPS, have well-optimized memcpy implementations, which can also be used for either forward or backward direction in memmove. This patch adds an option for ports to define MEMCPY_OK_FOR_{FWD,BWD}_MEMMOVE macros to make generic memmove use memcpy when safe to do so.
>
> This patch speeds up forward-direction memmove on MIPS by 50%. Tested with no regressions.
>
If memcpy is safe for memmove, you can simply make memmove an alias of
memcpy in memcpy source. Why do you need to update string/memmove.c?
--
H.J.