alphalinux.org high-perf list (1998-2001)
 help / color / mirror / Atom feed
From: naohiko shimizu <nshimizu@et.u-tokai.ac.jp>
Subject: Re: Questions on performance methods
Date: Mon, 7 Dec 1998 12:24:51 +0900 (JST)	[thread overview]
Message-ID: <199812070324.MAA23378@et.u-tokai.ac.jp> (raw)
In-Reply-To: <199812010624.PAA02425@et.u-tokai.ac.jp>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1225 bytes --]

When I checked the generated code of the find_jastrow_sub,

I found the gcc generates unnecessary stores.

In this paticuler problem, we don't need to use software pipelining.

Because:

 1. The vector will be divided into a block which will fit in Dcache.

 2. The block size may be very small.

Then replace the subroutine with following code.

-------------------------------------------------------------

double find_jastrow_sub(double *vtemp, double b, int count) {

  int i;

  double tmp0,tmp1,tmp2,tmp3;

    dsqrtiv(vtemp, vtemp, count);

    tmp0 = tmp1 = tmp2 = tmp3 = 1.0;

    for(i=0;i < count-4; i+=4){

          tmp0 *= (1.0 - b * vtemp[i+0]);

          tmp1 *= (1.0 - b * vtemp[i+1]);

          tmp2 *= (1.0 - b * vtemp[i+2]);

          tmp3 *= (1.0 - b * vtemp[i+3]);

    }

/*

The rest of the loop will be here.

*/

    for(i=i;i < count; i++)

          tmp0 *= (1.0 - b * vtemp[i]);

    return tmp0*tmp1*tmp2*tmp3;

  }

Naohiko Shimizu

Dept. Communication Engr./Univ. TOKAI.

1117 Kitakaname Hiratsuka 259-12 Japan

TEL.+81-463-58-1211(ext. 4084) FAX.+81-463-58-8320

<URL http://shimizu-lab.et.u-tokai.ac.jp/>

  parent reply	other threads:[~1998-12-07  3:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-27  7:49 Questions on performance methods Martin Kahlert
1998-11-27 15:42 ` pshimizu
1998-11-28 12:53 ` Kazushige Goto
1998-11-28 19:28   ` Jonathan L Dubois
1998-11-29  3:40     ` Kazushige Goto
1998-11-29 18:09       ` pshimizu
1998-11-30  2:54         ` naohiko shimizu
1998-12-01  6:24           ` naohiko shimizu
1998-12-01 14:19             ` Joachim Wesner
1998-12-02  3:35               ` naohiko shimizu
1998-12-02  9:21                 ` Joachim Wesner
1998-12-02 15:42                   ` pshimizu
1998-12-02 16:48                     ` Joachim Wesner
1998-12-07  3:24             ` naohiko shimizu [this message]
  -- strict thread matches above, loose matches on Subject: below --
1998-11-30 14:09 Richard Gorton
     [not found] <Pine.LNX.3.96.981201174956.16291A-100000@bec.physics.udel.edu>
1998-12-04  2:39 ` naohiko shimizu
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