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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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 15:14:22 PST Path: supernews.google.com!sn-xit-02!sn-east!supernews.com!news-feed.riddles.org.uk!newsfeed.direct.ca!look.ca!news.he.net!news-hog.berkeley.edu!ucberkeley!cnn.nas.nasa.gov!niven.ksc.nasa.gov!usenet From: "Samuel T. Harris" Newsgroups: comp.lang.ada Subject: Re: asm in ada Date: Wed, 06 Sep 2000 17:03:28 -0500 Organization: Raytheon Aerospace Engineering Services Message-ID: <39B6BF30.D5DD7FE@Raytheon.com> References: <8p5e1h$ai5$1@nnrp1.deja.com> <39B64BC6.DF9ECCCC@maths.unine.ch> Reply-To: samuel_t_harris@raytheon.com NNTP-Posting-Host: sstf-fw.jsc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.7 [en] (X11; U; IRIX64 6.2 IP19) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:532 Date: 2000-09-06T17:03:28-05:00 List-Id: Gautier de Montmollin wrote: > > 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. When our hardware vendor gave us some machine code to do semaphores which outperforms an Ada task for the same purpose, and that semaphore is used hundreds of times a second, then we use a machine code subprogram. I would say it is usually useless to try to outperform the compiler. But the thoughful developer will recognize the appropriate opportunities and exploit them. -- Samuel T. Harris, Principal Engineer Raytheon, Aerospace Engineering Services "If you can make it, We can fake it!"