From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2ac7208e3d69354f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-18 13:14:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeed.belnet.be!news.belnet.be!fr.usenet-edu.net!usenet-edu.net!newsfeed00.sul.t-online.de!newsmm01.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: Matthias Kretschmer Newsgroups: comp.lang.ada Subject: Re: Ada and vectorization Date: Tue, 18 Jun 2002 22:12:35 +0200 Organization: Private Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1024431155 06 337 nkkpbpVSdYjgS 020618 20:12:35 X-Complaints-To: abuse@t-online.com X-Sender: 520099920815-0001@t-dialin.net User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:26301 Date: 2002-06-18T22:12:35+02:00 List-Id: Robert A Duff wrote: > Matthias Kretschmer writes: > >> maybe cheaper, but let me cite Dijkstra: "Are you quite sure that all >> those bells and whistles, all those wonderful facilities of your >> so-called powerful programming languages belong to the solution set >> rather than to the problem set?" > > Buggy optimizers are part of my problem set, too. sure :) - but hopefully this won't happen - but this could happen with any piece of code of any language, if the optimizer/compiler is written poorly > > You're probably right in this case, but surely in *some* cases, it is > appropriate to let the programmer give the compiler hints about how to > optimize. The compiler is still doing the error-prone part (deciding > whether the optimization is correct, and actually performing the > transformation). The programmer is merely suggesting that the > optimization is worthwhile. > > - Bob Yeah, but the compiler should use it even the programmer isn't suggesting it - if you look at pragma inline (so I do not know how gnat which I currently only use handles this, but there are good examples that not only functions or procedures which are told to be inlined are inlined to gain speed with, e.g. Intel's C++ Compiler) - of course only if it is useful, which of course means more performance (or regulated the more speed <-> more size measurement about optimization flags or something). As suggest in this thread using pragma for loops only isn't enough I think (so making it complicated I think - bloating the language up), because if you just think about something like: a := a1*a2; b := b1*b2; c := c1*c2; d := d1*d2 wouldn't be cool if it is vectorized? you may say, throw anything in an array and then put it in a loop, but can't it happen, that these a,b,c and d aren't related, so putting it together into one array wouldn't be very wise. And these situations could be achived without having these statements put together somewhere in one procedure or something, think of these inter-procedure optimization features of compilers like sun's c compiler (sorry but I do not know much about available Ada compilers, so my examples are from other languages adapter, but they aren't depended on c itself) which are able to optimize code and vectorize it if useful even if some frictions of code are written in other procedures/functions - this of course includes some inlinening and the code is very useless if one wants to debug - but who really cares how the code gets faster if one needs speed? :) Btw. are there Ada compilers available (beside gcc 3.1 - yes the backend is capable of using the vector units of at least x86-based cpus as stated on gcc.gnu.org) which currently use vectorization and/or inter-procedure optimization? -- Greetings Matthias Kretschmer