This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, mips, memmove] Remove memmove's use of memcpy on MIPS


On 26/01/2013, at 10:28 AM, Steve Ellcey wrote:

> On Fri, 2013-01-25 at 20:16 +0000, Joseph S. Myers wrote:
>> On Fri, 25 Jan 2013, Steve Ellcey  wrote:
>> 
>>> Rather then use a slower safer prefetch for memcpy, which would also fix
>>> this problem,  I would like to remove the setting of MEMCPY_OK_FOR_FWD_MEMMOVE
>>> in memmove.c.
>> 
>> Removing the MIPS memmove.c is OK.  There's no point in having the file 
>> when it doesn't define MEMCPY_OK_FOR_FWD_MEMMOVE
> 
> I am hoping to improve memcpy at some point so that it will be safe to
> use memcpy in memmove again.  Given that, do you think I should still
> just remove the MIPS memmove.c and recreate it later when needed or
> would it make sense to keep it so I can just set the macro when it is
> safe to do so.

If you want to keep memmove at top speed you could add a memmove-safe instance of memcpy.S and then use that one in memmove.  I.e. (roughly),

sysdeps/mips/memmove.c:
#define MEMCPY memcpy_for_memmove
#define MEMCPY_OK_FOR_FWD_MEMMOVE 1
#include <string/memmove.c> // Adjust string/memmove.c to use "MEMCPY" instead of "memcpy".

sysdeps/mips/memcpy_for_memmove.S:
#define MEMCPY memcpy_for_memmove
#define HIDDEN .hidden // Don't export this copy of memcpy.
#define PREFETCH ... // Define safe prefetch.
#include "memcpy.S"

--
Maxim Kuvyrkov
KugelWorks




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]