From: Peter Korsgaard Date: Sat, 29 Oct 2011 01:28:06 +0200 Subject: [U-Boot] [PATCH] lib/string: memmove: use memcpy if it is safe to do so In-Reply-To: <20111028202530.1231B1809855@gemini.denx.de> (Wolfgang Denk's message of "Fri, 28 Oct 2011 22:25:30 +0200") References: <1319789046-17715-1-git-send-email-jacmet@sunsite.dk> <20111028202530.1231B1809855@gemini.denx.de> Message-ID: <87vcr8ofw9.fsf@macbook.be.48ers.dk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de >>>>> "Wolfgang" == Wolfgang Denk writes: Hi, >> memmove is used in a number of performance critical places, like copying the >> linux kernel from nor flash to ram, so optimizing it can be interesting. >> >> Unfortunately, an arch specific version of memmove often isn't used, and >> not supported at all on a number of archs (arm/mips/nds32/nios2/x86) - >> But memcpy typically is. Wolfgang> So you are adding code, making the system even less efficient? This Wolfgang> sounds to be acounter-productive approach. Well, slightly less efficient for the (uncommon) situation where src/dest overlaps in return for significantly more efficiency for the situation where they don't. Wolfgang> Can you not instead arrange for arch specific, optimized versions Wolfgang> memmove() to be used? That's another option, but more work for implementers - So I would prefer this trivial patch instead. But I'll drop it if you disagree. -- Bye, Peter Korsgaard