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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8699b57cedf0852c X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news3.google.com!out01a.usenetserver.com!news.usenetserver.com!in02.usenetserver.com!news.usenetserver.com!cycny01.gnilink.net!spamkiller2.gnilink.net!gnilink.net!trndny01.POSTED!c9e1c1fe!not-for-mail From: Jeffrey Creem User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada and SIMD References: <1189996579.648567.17960@w3g2000hsg.googlegroups.com> In-Reply-To: <1189996579.648567.17960@w3g2000hsg.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <71d3s4-ob9.ln1@newserver.thecreems.com> Date: Mon, 17 Sep 2007 23:15:01 GMT NNTP-Posting-Host: 71.168.66.159 X-Complaints-To: abuse@verizon.net X-Trace: trndny01 1190070901 71.168.66.159 (Mon, 17 Sep 2007 19:15:01 EDT) NNTP-Posting-Date: Mon, 17 Sep 2007 19:15:01 EDT Xref: g2news2.google.com comp.lang.ada:2003 Date: 2007-09-17T23:15:01+00:00 List-Id: Adrian Hoe wrote: > Hi, > > Does anyone have any idea or experience with Ada on SIMD (Singe > Instruction, Multiple Data)? And also multi-stage pipelining and of > course SIMD (e.g. 128-bit integer) on Intel Core 2 Duo and equivalent > processors? > > Has anybody done any kind of such implementation and how Ada is doing > with SIMD? > > Thanks. > -- > Adrian Hoe > http://adrianhoe.net > I don't know about Ada in general on this topic but I can tell you that GNAT (at least in terms of the FSF GCC version) is not doing at all well. A few thoughts 1) To really get SIMD bang it helps to write code that is fully SIMD aware. Most compilers support some sort of intrinsic types/procedures to support SIMD in one flavor or another. GNAT does have support (not that I have used) for Altivec intrinsics and further, it emulates them as scalar ops on non-altivec platforms. 2) Last I checked, there was not an equivalent version of the intrinsics for GNAT x86 SSE style SIMD. 3) Newer GCC versions also support auto vectorization where the compiler attempts to discover vectorizable loops. You will almost certainly never achieve the same level of performance with this approach as you can by structuring the application to use intrinsics...But it can be enough at times. Unfortunately, there is been a GCC bug open for almost a year indicating that even the most trivial loops will not vectorize from GNAT code. (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29533) As for multi-stage pipelining...I am not exactly sure what you are looking for on this topic. GNAT (and most other Ada compilers I've used) typically are aware of pipeline depth and do attempt to schedule instructions around it to some extent. On a related (but not the same topic) I can also confirm that the Greenhills compiler appears capable of emitting fused multiply add instructions.. I have not attempted to use Greenhills Ada on any target processor that has SIMD so i can't really comment on its ability to autovectorize. I vaguely recall seeing some libraries that looked like they might support altivec via something like the intrinsics....but I never used it.