Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
* poor fp performance on alpha/linux/gcc
@ 1999-09-17  4:00 William Snyder
  1999-09-18  4:00 ` James D. Freels
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: William Snyder @ 1999-09-17  4:00 UTC (permalink / raw)


Hi

I am running Redhat 6.0 on both an alpha 21164A 533Mhz and a celeron
333Mhz. When I compile and run a simple floating point intensive program
under gcc I get about the same performance on these machines. The alpha
should be more than twice as fast. I am using the fast floating point
library (libfm) for the alpha. My optimization is:

OPTSPENT = -O3 -mpentium \
-fomit-frame-pointer -fno-strength-reduce -pipe -malign-loops=2 \
-malign-jumps=2 -malign-functions=2 -fshort-enums -fno-common

OPTSALPHA = -O3 -mcpu=ev56 \
-fomit-frame-pointer -fno-schedule-insns -fschedule-insns2

I am aware of the compaq ccc compiler but I need c++. Is this
performance expected or am I missing some tricks for further
improvement? I am looking forward to the compaq c++ compiler as well as
one from KAI in the future.

Many thanks



--
William Snyder   mailto://will@alumni.caltech.edu





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

* Re: poor fp performance on alpha/linux/gcc
  1999-09-17  4:00 poor fp performance on alpha/linux/gcc William Snyder
@ 1999-09-18  4:00 ` James D. Freels
  1999-09-20  4:00   ` Tito Lopez Ciudad
  1999-09-20  4:00 ` clarksimsgnu
  1999-09-24  4:00 ` rsimpson
  2 siblings, 1 reply; 5+ messages in thread
From: James D. Freels @ 1999-09-18  4:00 UTC (permalink / raw)


William Snyder <will@alumni.caltech.edu> writes:

> I am aware of the compaq ccc compiler but I need c++. Is this
> performance expected or am I missing some tricks for further
> improvement? I am looking forward to the compaq c++ compiler as well as
> one from KAI in the future.

Yes.  This is precisely why there is a market for Compaq Tru64 
FORTRAN and C compilers for the linux/alpha.  There is also the 
issue of incompatible floating point between Linux and Tru64 that
is still not corrected.



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

* Re: poor fp performance on alpha/linux/gcc
  1999-09-17  4:00 poor fp performance on alpha/linux/gcc William Snyder
  1999-09-18  4:00 ` James D. Freels
@ 1999-09-20  4:00 ` clarksimsgnu
  1999-09-24  4:00 ` rsimpson
  2 siblings, 0 replies; 5+ messages in thread
From: clarksimsgnu @ 1999-09-20  4:00 UTC (permalink / raw)


In article <37E3273E.60EA22C7@alumni.caltech.edu>,
  William Snyder <will@alumni.caltech.edu> wrote:
> Hi
>
> I am running Redhat 6.0 on both an alpha 21164A 533Mhz and a celeron
> 333Mhz. When I compile and run a simple floating point intensive
program
> under gcc I get about the same performance on these machines. The
alpha
> should be more than twice as fast. I am using the fast floating point
> library (libfm) for the alpha. My optimization is:
>

Have you profiled the program?
If you hand optimize the problematic loops with register variables, you
should get close to optimum performance. I have included an example of
a hand optimized template function for multiplying matrixes. Notice
that all intermost loops are executed using register variables.

template<class L, class R, class P, class S>
   void Matrix_Multiply(
      const L * lhs ,
      S         lnum,
      S         ldim,
      S         lfmt,
      const R * rhs ,
      S         rnum,
      S         rdim,
      S         rfmt,
      P *       prod,
      S         pnum,
      S         pdim,
      S         pfmt,
      int       skip_na)
   {
      S i, j;
      register const L * pl;
      register const R * pr, * prend;
      register P* pp;
      P pna;
      short all_na;

      if (skip_na)
      {
         pna = 0l;
         pna /= 0l;
      }


      if (ldim!=rnum || lnum!=pnum || rdim!=pdim) {
         error( "matrix's have mismatched dimensions in
Matrix_Multiply");
      }

      for (i=0;i<lnum;i++) {
         for (j=0;j<rdim;j++) {
            pp = prod + i + j*pfmt;
            pl = lhs  + i         ;
            pr = rhs  + j * rfmt  ;
            prend = pr + ldim;

            *pp = 0;

            if (skip_na)
            {
               all_na = 1;
               while (pr!=prend)
               {
                  if (!_is_nan( pl) && !_is_nan( pr))
                  {
                     *pp += *pl * *pr++;
                     all_na = 0;
                  }
                  else {
                     pr++;
                  }
                  pl  += lfmt;
               }
               if (all_na)
               {
                  *pp = pna;
               }
            }
            else
            {
               while (pr!=prend)
               {
                  *pp += *pl * *pr++;
                  pl  += lfmt;
               }
            }

            // prod[i+k*lnum] = 0;
            // for (j=0;j<ldim;j++) {
            //    prod[i+k*lnum] += lhs[i+j*lnum] * rhs[j+k*rnum];
            // }
         }
      }
   }




Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



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

* Re: poor fp performance on alpha/linux/gcc
  1999-09-18  4:00 ` James D. Freels
@ 1999-09-20  4:00   ` Tito Lopez Ciudad
  0 siblings, 0 replies; 5+ messages in thread
From: Tito Lopez Ciudad @ 1999-09-20  4:00 UTC (permalink / raw)


You must use the library libffm, it's really great.
It don't reach the velocity of compaq compiler but it's better.
look at 
http://people.frankfurt.netsurf.de/Joachim.Wesner/
The speed is improved...



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

* Re: poor fp performance on alpha/linux/gcc
  1999-09-17  4:00 poor fp performance on alpha/linux/gcc William Snyder
  1999-09-18  4:00 ` James D. Freels
  1999-09-20  4:00 ` clarksimsgnu
@ 1999-09-24  4:00 ` rsimpson
  2 siblings, 0 replies; 5+ messages in thread
From: rsimpson @ 1999-09-24  4:00 UTC (permalink / raw)


You need libcpml and/or the new Compaq compilers currently available under
beta test.  Check out:

http://www.unix.digital.com/linux/software.htm

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

Richard Simpson
Farnborough, Hants, Uk                 Fax: 01252 392118
rsimpson@ewrcsdra.Cut_This_Out.demon.co.uk

I am not aware of any views shared by myself and my employers.



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

end of thread, other threads:[~1999-09-24  4:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-09-17  4:00 poor fp performance on alpha/linux/gcc William Snyder
1999-09-18  4:00 ` James D. Freels
1999-09-20  4:00   ` Tito Lopez Ciudad
1999-09-20  4:00 ` clarksimsgnu
1999-09-24  4:00 ` rsimpson

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