From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 31444 invoked from network); 22 Mar 1999 05:28:23 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 22 Mar 1999 05:28:23 -0000 Received: from paralleldata.com (smtp.paralleldata.com [38.153.145.2]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id AAA19865 for ; Mon, 22 Mar 1999 00:15:59 -0500 Received: by paralleldata.com from localhost (router,SLMail V2.5); Sun, 21 Mar 1999 23:18:49 -0600 Received: by paralleldata.com from paralleldata.com (207.158.82.3::mail daemon; unverified,SLMail V2.5); Sun, 21 Mar 1999 23:18:43 -0600 Sender: "Wsb" Message-ID: <36F5D151.58FA7D47@paralleldata.com> Date: Sun, 21 Mar 1999 23:12:49 -0600 From: "Wes Bauske" Organization: Parallel Data Systems X-Mailer: Mozilla 4.07 [en] (X11; I; Linux 2.0.36 i686) MIME-Version: 1.0 To: axp-list@redhat.com Subject: Re: XP1000 and Linux References: <278EEF4F1348D211940600A0C95BCF7F1F01AC@yellow-fin.alpha-processor.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Stig Telfer wrote: > > I think the key here is that your gcc output contains no write hints for the > destination. If you're writing a buffer without first reading it, this > instruction is near-essential; otherwise, the CPU will fetch the destination > cacheline from memory before you write all over it. Adding a wh64 > instruction (in theory) allocates a 64-byte cache block without filling from > memory. That could explain the 2x shortfall in memory bandwidth you're > seeing. > > I was hoping to provide an example to test this, but gnu as doesn't seem to > know the instruction, at least not the version I have (and not with the > mnemonic in the arch handbook). Hand-assembling may do the trick for now. > I wonder how much effort gcc makes to use it? > I patched my gas with Richard's update. It does accept wh64 opcodes now. I'll see about updating the asm with it for the 8 way unrolled case. I do have a comment about how gcc unrolls loops. It may or may not be useful. In general, when I hand code unrolled loops, what I thought was the standard way to do this is apparently NOT how gcc does it. The general form of unrolls I use in C: for(i=0; i < n-unroll+1; i+=unroll) { a[i]=b[i]; . . . a[i+unroll-1]=b[i+unroll-1]; } nleft=n%unroll; if(nleft > 0) for(i=n-nleft; i < n; i++) a[i]=b[i]; It seems gcc inserts compares inside the main loop to see when to leave it after each piece of the unroll which seems like a waste of energy to me. Isn't the above form more efficient cpu-wise?? Seems so since it doesn't waste any cycles checking when to quit in the loop you really care about. Wes