comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeff C," <nolongersafeto@userealemailsniff.com>
Subject: Re: Problems converting Float to Integer efficiently
Date: Thu, 09 Oct 2003 03:36:51 GMT
Date: 2003-10-09T03:36:51+00:00	[thread overview]
Message-ID: <nJ4hb.717961$uu5.118748@sccrnsc04> (raw)
In-Reply-To: Ku4hb.8589$RU4.82535@newsfep4-glfd.server.ntli.net


"Dr. Adrian Wrigley" <amtw@linuxchip.demon.co.uk.uk.uk> wrote in message
news:Ku4hb.8589$RU4.82535@newsfep4-glfd.server.ntli.net...
> Jeff C, wrote:
> ...
> > begin
> >   Asm ("cvttss2si %1, %0",inputs  => float'asm_input("m", y),
> >                           Outputs => integer'asm_output("=r",temp));
> >   return temp;
> > end truncate;
> ...
>
> This looks like the kind of thing I was wanting the compiler to produce.
> I'm not a whizz at Intel Assember (nor package Machine_Code), so it might
have
> taken a long time to for me to figure out exactly what I needed.
>
> It's a bit disappointing that the compiler does not produce code like this
for
> some "obvious" source code.  I dislike Ada's default of rounding to
nearest, and
> it seems that a series of Float=>Integer attributes might help the
compiler.
>
> I have Athlons and GNAT 3.15, so I may have to experiment with this
approach.
> But it is now past my bedtime...
>
> Thanks for a speedy response on this problem!
> --
> Adrian Wrigley, Cambridge, England.
>


I don't really know what  I am doing with assembly lang inserts with GNAT
either. If I did I am
sure it would be pretty simple to make a 6-7 instruction insertion for this
that would
work with 3.15. The big problem of course is not so much the compiler as the
binutils needing
to know this instruction......

What OS are you running on?





  reply	other threads:[~2003-10-09  3:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-09  0:06 Problems converting Float to Integer efficiently Dr. Adrian Wrigley
2003-10-09  1:08 ` Jeffrey Carter
2003-10-09  2:36 ` Jeff C,
2003-10-09  3:21   ` Dr. Adrian Wrigley
2003-10-09  3:36     ` Jeff C, [this message]
2003-10-17 20:57     ` Randy Brukardt
2003-10-09 22:36   ` Dr. Adrian Wrigley
2003-10-10  2:05     ` Jeff C,
2003-10-10 17:15     ` Robert I. Eachus
2003-10-11  1:47     ` Waldek Hebisch
2003-10-09  7:10 ` Robert I. Eachus
replies disabled

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