comp.lang.ada
 help / color / mirror / Atom feed
From: Gautier Write-only <gautier@somewhere.nil>
Subject: Re: Compute a Sin(X) and Cos(X) pair, FSINCOS, inlining
Date: Sat, 12 Jul 2003 08:26:22 +0200
Date: 2003-07-12T08:26:22+02:00	[thread overview]
Message-ID: <3F0FAA0E.7BCA9AA7@somewhere.nil> (raw)
In-Reply-To: 3F0C7B5D.81F0FDCD@somewhere.nil

Jerry van Dijk:

# Sorry, the original article already scrolled off my system.

Nice... (what system! even with on a VT220 I could scroll up news ;-)

# Although there are very good reasons not to, if you are really need it,
# why not define your own, something like (could probably be improved, it's 
# been a while...):

[the correct one:]

   procedure Sin_Cos (Angle : Float; Sin : out Float; Cos : out Float);
   pragma Inline (Sin_Cos);

   procedure Sin_Cos (Angle : Float; Sin : out Float; Cos : out Float) is
      use ASCII;
   begin
      Asm (("fsincos"  & LF & HT &
            "fstp  %0" & LF & HT &
            "fst   %1"),
           Outputs => (Float'Asm_Output ("=m", Cos),
                      (Float'Asm_Output ("=m", Sin))),
           Inputs  => (Float'Asm_Input ("t", Angle)));
   end Sin_Cos;

Thanks! I don't have an urgent need but one never knows...
BTW, what is the variant for Long_Float ?
In any case, it would be nice to have a compiler producing FSINCOS - e.g.
for those users not familiar with machine code.
________________________________________________________
Gautier  --  http://www.mysunrise.ch/users/gdm/gsoft.htm

NB: For a direct answer, e-mail address on the Web site!



  parent reply	other threads:[~2003-07-12  6:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-09 20:30 Compute a Sin(X) and Cos(X) pair, FSINCOS, inlining Gautier Write-only
2003-07-09 20:40 ` Florian Weimer
2003-07-10  1:51 ` Jeffrey Carter
2003-07-12  6:26 ` Gautier Write-only [this message]
2003-07-13 23:32   ` Jerry van Dijk
replies disabled

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