[PATCH] sh4: use optimized asm version of memcpy - add config option to support backward copying

Paul Mundt lethal at linux-sh.org
Sun Mar 25 19:02:03 PDT 2007


On Sun, Mar 25, 2007 at 09:18:33AM -0400, Mike Frysinger wrote:
> On Wednesday 21 March 2007, Carmelo AMOROSO wrote:
> > I'm currently using on uClibc-nptl for sh4 an optimized version
> > of the memcpy function (from Stuart Menefy @STMicroelectronics).
> > This implementation is based on 'backward copying'
> > and brakes the current implementation of 'memmove'
> > (libc/string/generic/memmove.c)
> > that, as clearly stated, assumes memcpy does a forward copying.
> >
> > The attached patch provides a solution for this adding a config option
> > to specify what kind of memcpy implementation the architecture provides.
> > In this way the memmove works with both implementation.
> 
> if anything, this option should not be exported for the user to try and figure 
> out ... either the architecture provides it or it doesnt which means it'd be 
> a hardcoded selection in the arch-specific config.in files ...
> 
> wouldnt it be simpler to provide a superh optimized memmove/memcpy ?  then it 
> wouldnt matter what the generic implementations assume ...

It has to be split out separately for sh4, given the movca.l usage.


More information about the uClibc mailing list