pro64-support
[Top] [All Lists]

math library performance issue

To: pro64-support@xxxxxxxxxxx
Subject: math library performance issue
From: Clemens Helf <helf@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 10 May 2001 13:29:09 +0200
Sender: owner-pro64-support@xxxxxxxxxxx
User-agent: Mutt/1.2.5i
Dear all,

The function 'double pow (double x, double y)' (libmsgi.a) seems to
have a severe performance problem.

Substituting the call by 'exp(log(x)*y)' cuts down execution time
by about one third.

Annother question is related to vector math:

Will the compiler substitute a call to e.g. 'exp(x)' by the
corresponding vector math function after loop optimization ?

Will the compiler adjust a call to a vector math function found in
the source code when it does further loop optimization ?

Clemens Helf
RUS/HLRS

e.g. loop orginal:

struct data {
   double a[2];
   };

data array[10000];

for (int i=0; i<n; i++)
   {
   for (int j=0; j<2; j++)
      {
      double &arg = array[i].a[j];
      arg = exp(arg);
      }
   }

transformed by hand to:

for (int i=0; i<n; i++) {
   double a[2];

   double a[0] = array[i].a[0];
   double a[1] = array[i].a[2];

   vexp (a, a, 2, 1, 1);   // <---

   array[i].a[0] = a[0];
   array[i].a[1] = a[1];
   }

Will the call to vexp be properly modified,
if the compiler stripmines the outer loop ?

<Prev in Thread] Current Thread [Next in Thread>