Article View: comp.std.c++
Article #2355Re: F90 vs C++/C, optimization question?
From: William B. Clodius
Date: Mon, 30 Oct 1995 17:56
Date: Mon, 30 Oct 1995 17:56
59 lines
3396 bytes
3396 bytes
bill@amber.ssd.hcsc.com (Bill Leonard) said:
> This discussion seems to me somewhat moot anyway. The main reason that
> Fortran 90 added lots of array manipulation syntax and intrinsic functions
> is to substantially reduce the necessity for compilers to figure out what
> array operation is being done by a loop. Unless and until C or C++ add
> such higher-level array operations, Fortran 90 is probably always going to
> give better performance than C/C++ in the realm of array manipulation,
> regardless of the aliasing issues.
This was one of two reasons for adding the syntax and functions, the other
was to enable users to write more legible and maintainable code. It should
be noted, however, that while these additions on parallel machines are
often translated to efficient code, the type of analysis required to
provide efficient code is not typical of the optimization analysis commonly
performed on scalar or pipelined processors. As a result most Fortran 90
compilers have followed the following path
1. Version 1 implement what you think is correct, with virtually all F77
optimizations, but only the simplest translation of F90 features.
2. Version 1.1 (six months to 1 year later) correct all obvious incorrect
interpretations of the standard and corrections to the standard by the ANSI
committee. Optimize the instrinsic functions. Perhaps iterate on versions
1.2, etc.
3. Version 2.0 (one and a half to three years after Version 1) implement
what you think are correct optimizations to the F90 syntactal additions to
the standard.
Because most F90 compilers came out after late 93, very few F90 compilers
properly optimize array syntax, and some other F90 additions, e.g.,
recursion and POINTERs. Indeed, the earliest F90 compiler, because it
presently compiles with C as its intermediate language, still cannot fully
optimize many aspects of F90. The array syntax has been more efficient in
achieving its second goal then its first goal.
Relative performance (F90 vs. C and C++) at this time is typically
dominated by the aliasing issue. It is very difficult for a compiler to
know the overlap characteristics in the presence of aliasing.
I am under the impression that the C++ draft standard incorporates a
limited, 1-D only, version of array syntax. Has that been implemented in
any compliers?
William B. Clodius Phone (505) 665-9370
Los Alamos Natl. Lab. NIS-1 FAX (505) 665-7395
PO Box 1663, MS-D466 Group Office (505) 667-2701
Los Alamos, NM 87545 email wclodius@lanl.gov
NIS-1: Nonproliferation and International Security Div./
Space and Atmospheric Physics Group
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<4733ji$ota@engnews1.eng.sun.com>Path:
arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamageShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage From: wclodius@lanl.gov (William B. Clodius) Newsgroups: comp.std.c++ Subject: Re: F90 vs C++/C, optimization question? Date: 30 Oct 1995 17:56:02 GMT Organization: ? Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <4733ji$ota@engnews1.eng.sun.com> NNTP-Posting-Host: taumet.eng.sun.com Content-Type: text/plain; charset="us-ascii" X-Lines: 55 Content-Length: 2661 Originator: clamage@taumet