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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ac78eacbae7081a6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-09-06 06:51:33 PST Message-ID: <39B64BC6.DF9ECCCC@maths.unine.ch> Date: Wed, 06 Sep 2000 15:51:01 +0200 From: Gautier de Montmollin Organization: Maths - Uni =?iso-8859-1?Q?Neuch=E2tel?= X-Mailer: Mozilla 4.75 (Macintosh; U; PPC) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: asm in ada References: <8p5e1h$ai5$1@nnrp1.deja.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: mac13-32.unine.ch X-Trace: 6 Sep 2000 15:51:02 +0100, mac13-32.unine.ch Path: supernews.google.com!sn-xit-02!sn-east!supernews.com!news-feed.riddles.org.uk!newsfeed.direct.ca!look.ca!sunqbc.risq.qc.ca!news.imp.ch!news.ifi.unizh.ch!news-zh.switch.ch!sitelnet.unine.ch!mac13-32.unine.ch Xref: supernews.google.com comp.lang.ada:522 Date: 2000-09-06T15:51:01+02:00 List-Id: Robert Dewar: > It is often better to either try to avoid the use of ASM > completely (it would be interesting to know why you are using > it, so often there are ways to do what you want in Ada after > all), or to write a small assembler routine (which surprisingly > is likely to be more portable than writing asm inserts). Apart of hardware-oriented instructions, asm code seems to me useless if the compiler provides advanced optimizations, like GNAT. It is in general useless to try to outperform it. It's better to see the feedback given by produced asm ("gcc -S") and execution speed, for choosing the most convenient data structures, "to inline or not to inline", etc. . A good surprise among others is that passing and using an elegant unconstrained vector seems faster than passing N numbers as parameters - surely it is more "speaking" to the optimizer. With 3.13 it is surely even nicer... As for ObjectAda, despite its wonderful programming environment, I fear that it doesn't optimize at all (slow code and no option beyond suppress_all). Unless I'm wrong ?... In the Borland Pascal days, "to optimize" meant "to write inline assembler code for that"... ______________________________________________________ Gautier -- http://members.xoom.com/gdemont/gsoft.htm