Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: Paul Hughett <hughett@mercur.uphs.upenn.edu>
Subject: Re: Optimal use of the L2 cache
Date: 16 Jun 2001 17:42:16 GMT	[thread overview]
Message-ID: <9gg5po$mri$1@netnews.upenn.edu> (raw)
In-Reply-To: 3B2A98FB.9C766616@physics.odu.edu

Tobias Oed <tobias@physics.odu.edu> wrote:

: for(i=0;i<N_FORMFACTORS;i++){
:         recontri=redeno*contri[i];
:         imcontri=imdeno*contri[i];
:         for(j=0;j<N_ISOSPIN;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.

(2) Similarly, many of iso_coefs[j] values are zero.  Unroll the
N_ISOSPIN loop by hand and omit those calculations.

(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


  parent reply	other threads:[~2001-06-16 17:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-15 20:48 Optimal use of the L2 cache Tobias Oed
2001-06-15 22:22 ` Hoff Hoffman
2001-06-15 23:23   ` Tobias Oed
2001-06-16  1:23     ` Hoff Hoffman
2001-06-16 17:42     ` Paul Hughett [this message]
2001-06-16 20:50       ` Tobias Oed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox