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] Optimize MIPS memcpy


On Tue, 2012-10-30 at 20:16 +1300, Maxim Kuvyrkov wrote:
> On 30/10/2012, at 7:00 AM, Steve Ellcey wrote:
> 
> > On Wed, 2012-10-17 at 10:29 -0700, Steve Ellcey wrote:
> > 
> >> OK, Here is a version of memcpy that uses the STORE_STREAMING prefetch.
> >> While it is optimized for a 32 byte prefetch, it will work correctly
> >> regardless of the size of the prefetch.
> >> 
> >> Is this version OK to checkin?
> >> 
> >> Steve Ellcey
> >> sellcey@mips.com
> > 
> > Maxim,  have you had a chance to test this version of memcpy for MIPS?
> 
> I have tested your latest version.  Good news: there are no correctness issues.  Bad news: it underperforms compared to my patch by 2-3 times on both N32 and N64 (didn't test O32) on the benchmark that I used.  I've run the benchmark several times and results are consistent.  I use oprofile on libc.so to determine how much time is spent in memcpy.
> 
> Would you please confirm that your current implementation is faster on YOUR benchmark than my patch in http://sourceware.org/ml/libc-ports/2012-09/msg00000.html ?  Please make sure that PREFETCH macro in ports/sysdeps/mips/sys/asm.h gets defined to "pref", not "nop", in your build.
> 
> Thanks,
> 
> --
> Maxim Kuvyrkov
> CodeSourcery / Mentor Graphics

Maxim, With O32 ABI I am seeing my version as slightly faster for large
memcpy's and slightly slower for small memcpy's compared to yours.

With N32 and 64 ABI's I see my version as slightly faster across the
board (a couple of percentage points).  I am definitely not seeing
anything like a 2X difference.  Are you sure prefetch is defined when
you tested my version?  How about using double loads and stores?  They
should both get set by default.

Steve Ellcey
sellcey@mips.com


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