Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: lindahl@pbm.com (Greg Lindahl)
Subject: Re: fast array calculation in C
Date: 1999/10/09	[thread overview]
Message-ID: <7tockg$230o@news2.newsguy.com> (raw)
In-Reply-To: 37FCEB06.5F23041F@ife.ee.ethz.ch

Alex Rhomberg <rhomberg@ife.ee.ethz.ch> writes:

> I've found that looking at the produces assembler is important.
> In my case, the Compaq ccc compiler produces nearly three times faster
> code than gcc. It gets dependencies much better.

OK.

> I've found that the biggest difference in code efficience comes if the
> compiler thinks that lvalue and rvalue accesses could be the same
> address or not.

This is usually known as the "aliasing problem" -- the compiler isn't
sure if a given pointer store is the same as a different pointer load,
so it doesn't re-use values in variables.

> By feeding the produced assembler into a short Perl
> script, I was able to identify ugly code, optimize it and shave 30% of
> the execution time of a 700 line function by optimizing 4 lines.
> 
> I'll post the perl-script for those who are interested.
> It finds the lines where the target of a ldt/addt/mult/subt function
> appears in the following line, which means pipeline stalls:

.. but this is a different problem, an instruction scheduling
problem. What I am saying, mostly, is that I obviously don't
understand what you are saying.

In addition, is this savings in gcc or in ccc?

Are you using a 21264 or a 21164? The 21264 has enough out-of-order
execution stuff that the above problem doesn't always cause a stall.

If you are interested in this from a computer-science research side,
you can look at the Atlas and FFTW projects, which do a more
complicated version of what you have done.

-- g



  reply	other threads:[~1999-10-09  4:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-07  4:00 fast array calculation in C Alex Rhomberg
1999-10-09  4:00 ` Greg Lindahl [this message]
1999-10-11  4:00   ` Alex Rhomberg
1999-10-11  4:00     ` Greg Lindahl
1999-10-11  4:00       ` memore0
1999-10-11  4:00         ` Greg Lindahl
1999-10-12  4:00         ` Alex Rhomberg
1999-10-12  4:00           ` memore0
1999-10-12  4:00             ` Alex Rhomberg
1999-10-12  4:00           ` Eberhard Burr
1999-10-13  4:00             ` Alex Rhomberg
1999-10-13  4:00               ` Robert Harley
1999-10-12  4:00       ` Alex Rhomberg
     [not found] <3809E64D.85BDCAFC@ife.ee.ethz.ch>
     [not found] ` <7ud6gc$2o94@news2.newsguy.com>
1999-10-18  4:00   ` Alex Rhomberg
1999-10-18  4:00     ` Greg Lindahl
1999-10-18  4:00       ` Alex Rhomberg
1999-10-18  4:00   ` Emil Briggs
1999-10-18  4:00     ` Greg Lindahl
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