comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin D. Condic" <mcondic-nospam@quadruscorp.com>
Subject: Re: Matrix Multiplication
Date: 1999/12/15
Date: 1999-12-15T17:55:15+00:00	[thread overview]
Message-ID: <3857D640.C1991F0C@quadruscorp.com> (raw)
In-Reply-To: 3857B51F.4B1E0F1E@maths.unine.ch

Gautier wrote:
> 
> > Intrigued about the 'renames' bit.  I thought the renames was just a
> > compiler overhead and had no run-time effect at all.
> 
> IIRC the renames takes `aliases' the its target its present state.
> E.g.
>   declare
>     x: thing renames complicated(i,j).k;
>   begin
>     -- i,j could change, doesn't affect x
> 
> The ARM gurus will comment better...

It would seem that if the compiler were smart, it would compute I and J
once and find the position once, then reuse it throughout the loop. (I'm
presuming this would be done in nested "for" loops.) I'm not an expert
in compiler theory, but I recall seeing output from more than one
compiler/language doing this sort of thing. (loop invariant code? code
hoisting? some terminology I've long since archived to tape.) So while
the "renames" may help the compiler along in this respect, I think that
it could/should get there without the help.

Of course, I've seen lots of things where a compiler "ought" to do
something, but won't unless you trick it into doing it with syntactic
deceptions. Thats more a comment on the quality of the compiler. In this
case, I'd think that Fortran could produce the optimization without a
"renames" so Ada ought to be able to do the same.

The original question in this thread had to do with "Ada can't do
floating point math as fast as Fortran" - which is slightly different
from Matrix Math in Ada/Fortran. Maybe someone can correct me if I'm
wrong, (or just plain call me an ignoramus! :-) but I don't see much
syntactic or semantic difference between Ada arithmetic and Fortran
arithmetic. For that matter, there isn't much apparent difference in
array processing. So once you disable the runtime checks, (O.K., maybe
that's part of the semantics) the differences don't amount to a warm
bucket of spit. Any performance difference should be attributable to the
quality of the compilers in question. (This is probably the most often
misunderstood thing about language efficiency. Most of the "unwashed
masses" seem to be incapable of distinguishing between the quality of a
language and the quality of a specific compiler. So the compiler writers
have a special responsibility to put out good quality products lest they
besmirch the language in the minds of many! :-)

MDC
-- 
=============================================================
Marin David Condic   - Quadrus Corporation -   1.800.555.3393
1015-116 Atlantic Boulevard, Atlantic Beach, FL 32233
http://www.quadruscorp.com/

Visit my web site at:  http://www.mcondic.com/

"Capitalism without failure is like religion without sin." 
        --  Allan Meltzer, Economist 
=============================================================




  reply	other threads:[~1999-12-15  0:00 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-14  0:00 Matrix Multiplication William Dale
1999-12-14  0:00 ` David C. Hoos, Sr.
1999-12-14  0:00 ` Gautier
     [not found]   ` <5l1f5s4kck891a2s6o8bhvkirm4q79hm6c@4ax.com>
1999-12-15  0:00     ` Gautier
1999-12-15  0:00       ` Marin D. Condic [this message]
1999-12-15  0:00         ` Ted Dennison
1999-12-15  0:00           ` Gautier
1999-12-15  0:00             ` Tucker Taft
1999-12-16  0:00             ` Ted Dennison
1999-12-16  0:00             ` Ted Dennison
1999-12-15  0:00         ` Gautier
1999-12-16  0:00           ` Marin D. Condic
1999-12-27  0:00             ` Jeffrey L Straszheim
1999-12-15  0:00   ` Gautier
1999-12-15  0:00 ` E. Robert Tisdale
     [not found]   ` <3856FD3F.8291A71C@ucar.edu>
1999-12-15  0:00     ` E. Robert Tisdale
1999-12-14  0:00       ` Richard Maine
1999-12-15  0:00 ` Ted Dennison
1999-12-15  0:00   ` William B. Clodius
1999-12-15  0:00     ` Ted Dennison
1999-12-15  0:00       ` William B. Clodius
1999-12-16  0:00         ` Robert A Duff
1999-12-16  0:00           ` William B. Clodius
     [not found] ` <01bf4708$99ef98f0$022a6282@dieppe>
1999-12-15  0:00   ` Robert A Duff
1999-12-15  0:00     ` Marin D. Condic
1999-12-16  0:00     ` Pascal Obry
1999-12-16  0:00       ` Greg Martin
1999-12-16  0:00       ` Brian Rogoff
1999-12-16  0:00     ` Dieter Britz
1999-12-15  0:00   ` Gautier
1999-12-15  0:00 ` Greg Lindahl
1999-12-15  0:00   ` Preben Randhol
  -- strict thread matches above, loose matches on Subject: below --
1999-12-15  0:00 Carlisle, Martin
1999-12-15  0:00 ` Mario Klebsch
1999-12-19  0:00   ` Robert Dewar
1999-12-19  0:00 ` Robert Dewar
1999-12-19  0:00 ` Robert Dewar
1999-12-16  0:00 Carlisle, Martin
1999-12-16  0:00 ` Howard W. LUDWIG
     [not found] <637de084-0e71-4077-a1c5-fc4200cad3cf@googlegroups.com>
2012-07-10  8:39 ` Does Ada need elemental functions to make it suitable for scientific work? Nasser M. Abbasi
2012-07-10  9:07   ` Dmitry A. Kazakov
2012-07-12  0:31     ` robin.vowels
2012-07-12  7:12       ` Dmitry A. Kazakov
2012-07-29 13:39         ` Robin Vowels
2012-07-29 14:22           ` Dmitry A. Kazakov
2012-07-29 20:54             ` glen herrmannsfeldt
     [not found]               ` <apib1897s56dkultqmfl3emvk1os3tfdak@invalid.netcom.com>
2012-07-30  4:15                 ` glen herrmannsfeldt
     [not found]                   ` <nfhd181tv9u87mcqfb7rgd8lm48ihr9f4r@invalid.netcom.com>
2012-07-31  8:53                     ` MATRIX MULTIPLICATION Robin Vowels
2012-07-31  9:05                       ` Robin Vowels
replies disabled

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