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-16 13:08:07 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.infostrada.it!newsfeeder.inwind.it!inwind.it!newsfeed01.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: Sun, 16 Jun 2002 22:07:09 +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 1024258029 06 8686 hCMQbuXTSra+nu 020616 20:07:09 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:26087 Date: 2002-06-16T22:07:09+02:00 List-Id: I think, that this job should be done by the compiler itself, without changing the language: a) I do not want to specify everywhere which feature to use b) vectorisation could be useful in many places, don't we want to use it anywhere, we get speed gain from the vector unit? c) there are good examples that there is no need - think of x86 architecture and intel's c compiler, it uses mmx/sse/sse2 if one let's him to use, everywhere it makes sense and the performance gain is for clean written programs high d) why binding this to variables - in one place it would be usefull to use vectorisation for this part of code, in the other place is it not, with the same variables - so explicitly using it just for one bunch of array variables could be very inefficient comparing to another approach - why not grouping together variables used in records (e.g. someone using for 3d-representation a record with x,y and z kartesian coordinates)? Ok one could enhance this feature, to record constructs, but why? e) on many architectures the vector unit is just a coprocessor, so fpu could calculate one part and vu the other one, I think we want to let the optimizer decide how to use both units to get the best performance - so why we don't let the optimizer decide when to use vu, too? GNAT uses as backend the GNU Compiler Suite - in 3.1 it is implemented - so using the same code generator, which is capable of using mmx/sse/3dnow or something now in some way (do not ask me how much - I just know, that povray is far faster after compiling it with the intel c compiler ...). Dale Stanbrough wrote: > Guillaume Foliard wrote: > >> Hello, >> >> I start to learn how to use the Intel's SSE instruction set in Ada >> programs with inline assembly. And while reading Intel documentation (1) >> I was asking myself if Ada could provide a clean way of vectorization >> through its strong-typed approach. Could it be sensible, for the next Ada >> revision, to create some new attributes for array types to explicitly >> hint the compiler that we want to use SIMD instructions ? >> Language lawyers comments are definitly welcome. As SIMD in modern >> general purpose processors is largely available nowadays (SSE, SSE2, >> Altivec, etc...), IMHO, it would be a mistake for Ada to ignore the >> performance benefit this could bring. > > > I think the best way to do this is via pragmas. There is one pragma - > Annotate - which would be perfect for the job. > I think Annotate is a Gnat only thing - the real work would have > to be done with an ASIS like tool. > > Very much like the fortran world, where the structured comments can > be ignored by ignorant compilers, and the program still behaves > correctly (if not as fast). > > Dale -- Greetings Matthias Kretschmer