From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14072 invoked by alias); 4 Sep 2012 17:03:14 -0000 Received: (qmail 14029 invoked by uid 22791); 4 Sep 2012 17:03:07 -0000 X-SWARE-Spam-Status: No, hits=-3.0 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, 04 Sep 2012 17:02:49 +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 q84H2ksM018297; Tue, 4 Sep 2012 10:02:46 -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 2A3313645FF; Tue, 4 Sep 2012 10:02:42 -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, 4 Sep 2012 10:02:40 -0700 Subject: Re: [PATCH] Optimize MIPS memcpy From: Steve Ellcey To: "Carlos O'Donell" CC: Andrew T Pinski , Maxim Kuvyrkov , "Joseph S. Myers" , In-Reply-To: <50461AD3.50307@mentor.com> References: <5044746c.23eb440a.75e2.618f@mx.google.com> <1346771341.14333.20.camel@ubuntu-sellcey> <50461AD3.50307@mentor.com> Content-Type: multipart/mixed; boundary="=-JdH6rSFsIuqUzQ3kdy/L" Date: Tue, 04 Sep 2012 17:03:00 -0000 Message-ID: <1346778160.14333.36.camel@ubuntu-sellcey> MIME-Version: 1.0 X-EMS-Proccessed: 6LP3oGfGVdcdb8o1aBnt6w== X-EMS-STAMP: yeLJdYE5fIPSLUcSktb2gw== 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-09/txt/msg00007.txt.bz2 --=-JdH6rSFsIuqUzQ3kdy/L Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-length: 865 > Exactly what benchmarks did you run to verify the performance gains? > > The one thing I'd like to continue seeing is strong rationalization for > performance patches such that we have reproducible data in the event that > someone else comes along and wants to make a change. > > For example see: > http://sourceware.org/glibc/wiki/benchmarking/results_2_17 > > and: > http://sourceware.org/glibc/wiki/benchmarking/benchmarks > > Cheers, > Carlos. We had a few tests around here that I used and I wrote one of my own too. I have attached my test, when using it with -UVERIFY and testing on a 74K system I got the following timings (32 bits, little-endian): The FSF memcpy: 3m9.34s Maxim's memcpy: 2m0.41s My memcpy: 1m22.20s If there are any official or recommended memcpy benchmarks I'd be happy to try them as well. Steve Ellcey sellcey@mips.com --=-JdH6rSFsIuqUzQ3kdy/L Content-Disposition: attachment; filename="test_memcpy.c" Content-Type: text/x-csrc; name="test_memcpy.c"; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-length: 1379 #include #include #define SIZE 1024*100 #define MAXCOPYSIZE 1024*50 #define MAXSRCOFFSET 13 #define MAXDSTOFFSET 18 #define SRCVAL(N) ((N+10000) % 13) #define DSTVAL(N) ((N+20001) % 17) char src[SIZE], dst[SIZE]; #ifndef MEMCPY_NAME #define MEMCPY_NAME memcpy #endif extern void *MEMCPY_NAME(void *, const void *, size_t); test(int src_offset, int dst_offset, int size) { int i; char *x, *y; for (i = 0; i < SIZE; i++) { src[i] = SRCVAL(i); dst[i] = DSTVAL(i); } x = src; y = dst; x = x + src_offset; y = y + dst_offset; MEMCPY_NAME(&dst[dst_offset], &src[src_offset], size); for (i = 0; i < SIZE; i++) { if (src[i] != SRCVAL(i)) printf("FAIL, src got changed\n"); if (i < dst_offset) { if (dst[i] != DSTVAL(i)) printf("FAIL, dst got changed before it should be\n"); } else if (i >= (dst_offset+size)) { if (dst[i] != DSTVAL(i)) printf("FAIL, dst got changed after it should be (%d %d %d %d)\n", src_offset, dst_offset, size, i); } else { if (dst[i] != SRCVAL(i-dst_offset+src_offset)) { printf("FAIL, dst was not changed when it should be (%d %d %d %d)\n", src_offset, dst_offset, size, i); } } } } main() { int i, j, k; for (i = 8; i < MAXDSTOFFSET; i++) for (j = 8; j < MAXSRCOFFSET; j++) for (k = MAXCOPYSIZE-20; k < MAXCOPYSIZE; k++) test(i, j, k); } --=-JdH6rSFsIuqUzQ3kdy/L--