comp.lang.ada
 help / color / mirror / Atom feed
From: Gautier de Montmollin <gautier.demontmollin@maths.unine.ch>
Subject: Re: asm in ada
Date: Wed, 06 Sep 2000 15:51:01 +0200
Date: 2000-09-06T15:51:01+02:00	[thread overview]
Message-ID: <39B64BC6.DF9ECCCC@maths.unine.ch> (raw)
In-Reply-To: 8p5e1h$ai5$1@nnrp1.deja.com

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



  reply	other threads:[~2000-09-06 13:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Ihps5.149$xr6.264251@nnrp6.proxad.net>
2000-09-06  3:35 ` asm in ada William J. Thomas
2000-09-06 12:41   ` Robert Dewar
2000-09-06 13:51     ` Gautier de Montmollin [this message]
2000-09-06 22:03       ` Samuel T. Harris
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox