From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,7f84976ed48a7472 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 2001-06-16 13:50:08 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!194.42.224.136!diablo.netcom.net.uk!netcom.net.uk!not-for-mail From: Tobias Oed Newsgroups: comp.sys.dec Subject: Re: Optimal use of the L2 cache Date: Sat, 16 Jun 2001 16:50:05 -0400 Organization: Old Dominion University Sender: tobias@physics.odu.edu Message-ID: <3B2BC67D.719769CB@physics.odu.edu> References: <3B2A74B6.5F18718A@physics.odu.edu> <3B2A98FB.9C766616@physics.odu.edu> <9gg5po$mri$1@netnews.upenn.edu> NNTP-Posting-Host: bernoulli.physics.odu.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: taliesin.netcom.net.uk 992724607 1906 128.82.242.52 (16 Jun 2001 20:50:07 GMT) X-Complaints-To: abuse@corp.netcom.net.uk NNTP-Posting-Date: Sat, 16 Jun 2001 20:50:07 +0000 (UTC) X-Mailer: Mozilla 4.77 [en] (X11; U; OSF1 V4.0 alpha) X-Accept-Language: en Xref: archiver1.google.com comp.sys.dec:4524 Paul Hughett wrote: > > Tobias Oed wrote: > > : for(i=0;i : recontri=redeno*contri[i]; > : imcontri=imdeno*contri[i]; > : for(j=0;j : iso_ff[i][j][RE]+=recontri*iso_coefs[j]; > : iso_ff[i][j][IM]+=imcontri*iso_coefs[j]; > : } > : } > > Not related to your cache question, but I see a few other improvements > that you could make: > > (1) About half of your contri[i] values are set to zero just above this > code. Add a test to avoid doing the inner loop at all when this is true. There are 9 non zero ones. > (2) Similarly, many of iso_coefs[j] values are zero. Unroll the > N_ISOSPIN loop by hand and omit those calculations. There are 4 non zero ones. Since redeno is zero as well, out of the 16*6*2=192 iso_ff only 9*4=36 will have a contribution. The assembly shows exactly 36 stt $fxx,yy($18) (as well as 36 ldt $fxx,yy($18). So I think that the compiler was smart enough to do all that for me. > (3) Look at the assembly code to see if your compiler optimizes > iso_ff[i][j][IM] into something reasonable. If not, convert iso_ff into > a single-dimensional array and do the address calculations by hand. > > Paul Hughett Thanks for the idea, Tobias.