Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Claus Denk <denk@obelix.cica.es>
Subject: Re: Interesting gcc to cc comparison
Date: Thu, 20 Mar 1997 21:19:21 +0100	[thread overview]
Message-ID: <d13412d5bf9bf20183d8a52e04f1aa3f.axp-list@archive.invalid> (raw)

Jim Nance wrote:
> 
> Hello All,
>     I have a program here that I thought you all might be interested in.
> Its a little benchmark that I wrote that multiplies 2 matrices.  The nice
> things about it are that it is quite short and it does a good job of
> exposing weaknesses in gcc.  Hopefully it will be of interest to people
> working on improving gcc.  
> snip ...
> Here are the results for multiplying
> two 400x400 matrices 3 times:
> 
>                 Simple          2x2             4x4
> cc              8.016346        2.849886        4.199832
> gcc -O2         12.232844       3.833180        10.182926
> gcc -O3         12.032852       3.383198        10.116262
>
Note: that was AlphaStation 500/500 384M, DU 4.0  

Hi Jim and all,

I got your
source code and made some tests. We have a PC164/500 Mhz 1 Mb Cache
over here, and I would be interested in some of your timings for
smaller matrices, so that they fit into 1 Mb Cache. (I think your
machine has 8 Mb, right ?). Could you send me some ?

My results with your original program are:
(gcc -static -O3 -funroll-all-loops )
                  1     2     3
a.out 400 3    : 17.77 5.31 11.21
a.out 100 500  : 12.22 4.56 23.19
a.out 40 10000 : 11.28 4.29 28.74

(where i commented out the printf(".") + fflush(stdout) statements)

You can speed up mat_mul_3 quite a bit (for gcc) using a temporary
variable sum for the innermost loop, like you do in mat_mul_1:

                        double sum = 0;
                        for(kk=0; kk<4; kk++) {
                            sum += aa[ii][kk] * bb[kk][jj];
                        }
                        cc[ii][jj] = sum;

                              3
a2.out 400 3   :             7.71
a2.out 100 500 :            15.65
a2.out 40 1000 :            19.10

So that looks like as if gcc definitely could do something better
here (Or is the programmer supposed to do that ?).

I would be really interested in your results (with cc & gcc)
for the smaller matrices, so if you find the time...
I think I can not run the DU 4.0 binaries, due to my 2.0.23 kernel.

regards,

Claus Denk

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

             reply	other threads:[~1997-03-20 20:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-20 20:19 Claus Denk [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-03-20 20:30 Interesting gcc to cc comparison Claus Denk
     [not found] <Pine.LNX.3.95L01at.970318142302.18255A-100000@wopr.campus.luth.se>
1997-03-18 13:33 ` Andreas Johansson
     [not found] <9703181310.AA03085@halfpint.rtp.avanticorp.com>
1997-03-18 13:30 ` Andreas Johansson
1997-03-18 13:10 Jim Nance
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