From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29798 invoked by alias); 30 Oct 2012 17:46:39 -0000 Received: (qmail 29626 invoked by uid 22791); 30 Oct 2012 17:46:36 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD,TW_CP X-Spam-Check-By: sourceware.org Received: from dns1.mips.com (HELO dns1.mips.com) (12.201.5.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 30 Oct 2012 17:46:28 +0000 Received: from mailgate1.mips.com (mailgate1.mips.com [12.201.5.111]) by dns1.mips.com (8.13.8/8.13.8) with ESMTP id q9UHjuRY031498; Tue, 30 Oct 2012 10:45:59 -0700 X-M-MSG: Received: from exchdb01.mips.com (unknown [192.168.36.84]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mailgate1.mips.com (Postfix) with ESMTP id 26A9636464F; Tue, 30 Oct 2012 10:45:51 -0700 (PDT) Received: from [192.168.65.53] (192.168.65.53) by exchhub01.mips.com (192.168.36.84) with Microsoft SMTP Server id 14.1.270.1; Tue, 30 Oct 2012 10:45:49 -0700 Subject: Re: [PATCH] Optimize MIPS memcpy From: Steve Ellcey To: Maxim Kuvyrkov CC: Andrew Pinski , "Joseph S. Myers" , In-Reply-To: <0CA30903-22E1-47EF-BA7F-9A82E5DC8961@codesourcery.com> References: <5044746c.23eb440a.75e2.618f@mx.google.com> <1346771341.14333.20.camel@ubuntu-sellcey> <596797ED-6575-456D-98FD-C13A209DBC49@mentor.com> <1346948701.14333.152.camel@ubuntu-sellcey> <1347376645.14333.319.camel@ubuntu-sellcey> <1348166309.6170.55.camel@ubuntu-sellcey> <25105334-8813-4532-AC0E-B3A44BE69A19@codesourcery.com> <5B30D440-A918-4352-8DED-A7D681DF0338@codesourcery.com> <1349715796.30194.131.camel@ubuntu-sellcey> <954E9625-0D5C-4295-9229-C16A3F5C200D@codesourcery.com> <1350323373.2044.7.camel@ubuntu-sellcey> <1350333255.2044.15.camel@ubuntu-sellcey> <1350337000.2044.23.camel@ubuntu-sellcey> <1350494987.2660.5.camel@ubuntu-sellcey> <1351533617.15035.98.camel@ubuntu-sellcey> <0CA30903-22E1-47EF-BA7F-9A82E5DC8961@codesourcery.com> Content-Type: text/plain; charset="UTF-8" Date: Tue, 30 Oct 2012 17:46:00 -0000 Message-ID: <1351619149.15035.110.camel@ubuntu-sellcey> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-EMS-Proccessed: 6LP3oGfGVdcdb8o1aBnt6w== X-EMS-STAMP: 8Caf9LQNPHNbgDKhqauRNQ== Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2012-10/txt/msg00109.txt.bz2 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