From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30170 invoked by alias); 15 Oct 2012 17:49:58 -0000 Received: (qmail 30161 invoked by uid 22791); 15 Oct 2012 17:49:56 -0000 X-SWARE-Spam-Status: No, hits=-3.3 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; Mon, 15 Oct 2012 17:49:50 +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 q9FHnfWI005605; Mon, 15 Oct 2012 10:49:42 -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 279D436465B; Mon, 15 Oct 2012 10:49:37 -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; Mon, 15 Oct 2012 10:49:33 -0700 Subject: Re: [PATCH] Optimize MIPS memcpy From: Steve Ellcey To: Maxim Kuvyrkov CC: Andrew T Pinski , "Joseph S. Myers" , In-Reply-To: <954E9625-0D5C-4295-9229-C16A3F5C200D@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> Content-Type: multipart/mixed; boundary="=-2sM9k09LOcX4qhpKEUcC" Date: Mon, 15 Oct 2012 17:49:00 -0000 Message-ID: <1350323373.2044.7.camel@ubuntu-sellcey> MIME-Version: 1.0 X-EMS-Proccessed: 6LP3oGfGVdcdb8o1aBnt6w== X-EMS-STAMP: NmlpRaACTXfnvtnkPsbdjg== 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/msg00021.txt.bz2 --=-2sM9k09LOcX4qhpKEUcC Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-length: 1284 On Tue, 2012-10-09 at 11:30 +1300, Maxim Kuvyrkov wrote: > I too want to keep prepare-for-store prefetches is possible. For debugging purposes you could amend > prepare-for-store prefetch macros to trigger a loop that would unconditionally clobber memory locations > that prepare-for-store is expected to zero-out. Or add some other assertions to help out with debugging. > > Thanks, > > -- > Maxim Kuvyrkov > CodeSourcery / Mentor Graphics Maxim, Could you try running this test program on your system. I want to see if it verifies that your machine is doing 32 byte prefetches. The output I get looks like: 0x004754a0, (0x004754a0 to 0x004754c0, 32 byte prefetch) 0x004754a1, (0x004754a0 to 0x004754c0, 32 byte prefetch) 0x004754a2, (0x004754a0 to 0x004754c0, 32 byte prefetch) 0x004754a3, (0x004754a0 to 0x004754c0, 32 byte prefetch) 0x004754a4, (0x004754a0 to 0x004754c0, 32 byte prefetch) 0x004754a5, (0x004754a0 to 0x004754c0, 32 byte prefetch) . . . 0x0047589b, (0x00475880 to 0x004758a0, 32 byte prefetch) 0x0047589c, (0x00475880 to 0x004758a0, 32 byte prefetch) 0x0047589d, (0x00475880 to 0x004758a0, 32 byte prefetch) 0x0047589e, (0x00475880 to 0x004758a0, 32 byte prefetch) 0x0047589f, (0x00475880 to 0x004758a0, 32 byte prefetch) Steve Ellcey sellcey@mips.com --=-2sM9k09LOcX4qhpKEUcC Content-Disposition: attachment; filename="check_prefetch_size.c" Content-Type: text/x-csrc; name="check_prefetch_size.c"; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-length: 1066 #include char dummy[409600]; char buffer[3072]; check_buffer(char *p) { int i, zero_start, zero_stop; /* Initialize buffer to non-zero data */ for (i = 0; i < 2048; i++) buffer[i] = 1; /* Clear buffer out of cache */ for (i = 0; i < 409600; i++) dummy[i] = 9; #if 1 __asm__ ("pref 30, 0x0(%0)" : : "r" (p)); #endif /* Check contents for single block of zeros */ zero_start = 0; while ((buffer[zero_start] == 1) && (zero_start < 2048)) zero_start++; zero_stop = zero_start; while ((buffer[zero_stop] == 0) && (zero_stop < 2048)) zero_stop++; for (i = zero_stop; i < 2048; i++) if (buffer[i] == 0) printf("Error, extra set of zeros\n"); if (zero_start >= 2048) printf("0x%8.8x, (no zeros)\n", p); else printf("0x%8.8x, (0x%8.8x to 0x%8.8x, %d byte prefetch)\n", p, &buffer[zero_start], &buffer[zero_stop], (zero_stop - zero_start)); #if 0 /* Dump buffer contents */ for (i = 0; i < 2048; i++) printf("%1d", buffer[i]); printf("\n"); #endif } main() { int i; for (i = 1024; i < 2048; i++) check_buffer(&buffer[i]); } --=-2sM9k09LOcX4qhpKEUcC--