alphalinux.org high-perf list (1998-2001)
 help / color / mirror / Atom feed
* request for perf improvement suggestions
@ 1998-11-25 21:15 Jonathan L Dubois
  1998-11-25 21:44 ` Adam
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jonathan L Dubois @ 1998-11-25 21:15 UTC (permalink / raw)


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

Hello everyone,

I have some code I would like to optomize and I could use some suggestions

and pointers for where to get started.

The function which is called most often and the most likely candidate

for improvement (I think) calculates the distance between two vectors.

The source I am currently using is locate below:

void r12(double *rij,double *x1,double *x2){

  int i;

  double tmp1,tmp2;

  tmp2 = 0;

  for(i=0;i<3;i++){

    tmp1 = x1[i]-x2[i];

    tmp2 += tmp1*tmp1;

  }

  tmp2 = sqrt(tmp2);

  *rij = tmp2;

}

my guess is that this is a pretty classic problem and there are some nifty

tricks I could apply in assembly to make this quite fast.  I'm fairly new

to this though (my only assembly experience was with the MC6800 several

years ago and I don't think I really understand all the issues involved

with optomization on a RISC chip)  So my questions are,  is this the best

form for the C code?  Is there an existing assembly routine for finding

the distance between two vectors?  If not, any suggestions for the

implementation of one?

Kind Regards,

Jonathan DuBois

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1998-11-26 15:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-11-25 21:15 request for perf improvement suggestions Jonathan L Dubois
1998-11-25 21:44 ` Adam
1998-11-26  9:45 ` Stefan Schroepfer
1998-11-26 15:48 ` Joachim Wesner

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