Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
* fast array calculation in C
@ 1999-10-07  4:00 Alex Rhomberg
  1999-10-09  4:00 ` Greg Lindahl
  0 siblings, 1 reply; 18+ messages in thread
From: Alex Rhomberg @ 1999-10-07  4:00 UTC (permalink / raw)


Hi

I'm trying to do fast arrays/matrixes/vectors in C
Not easy

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.

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. 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:

- Alex


**************Listing of find_stalls ***************
#!/usr/bin/perl -wlp
# usage:
#objdump -d myobject.o | find_stalls|more
#then search for UGLY!
use strict;
use vars qw/$target/;
BEGIN {$target = "alotta garbaga"}

chomp;
$_ .= "\t\t#UGLY!!" if /\Q$target,/;

$target = "allotta garbaga";
$target = $1 if /ldt\s+(\$f\d+),/;  #target is first arg of ldt
$target = $1 if /(?:mult|subt|addt)\s+.*(\$f\d+)/; 
	#target is last arg of mlt, subt and add



^ permalink raw reply	[flat|nested] 18+ messages in thread
[parent not found: <3809E64D.85BDCAFC@ife.ee.ethz.ch>]

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

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-10-07  4:00 fast array calculation in C Alex Rhomberg
1999-10-09  4:00 ` Greg Lindahl
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

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