comp.lang.ada
 help / color / mirror / Atom feed
* about fsincos
@ 2003-07-10 23:18 Jerry van Dijk
  2003-07-10 23:22 ` Jerry van Dijk
  0 siblings, 1 reply; 2+ messages in thread
From: Jerry van Dijk @ 2003-07-10 23:18 UTC (permalink / raw)



Sorry, the original article already scrolled off my system.

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...):

   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
      Sin := 0.0; Cos := 0.0;
      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;

and write modified numerics functions to take advantage of it ?


-- 
--  Jerry van Dijk   | email: jvandyk@attglobal.net
--  Leiden, Holland  | web:   users.ncrvnet.nl/gmvdijk



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: about fsincos
  2003-07-10 23:18 about fsincos Jerry van Dijk
@ 2003-07-10 23:22 ` Jerry van Dijk
  0 siblings, 0 replies; 2+ messages in thread
From: Jerry van Dijk @ 2003-07-10 23:22 UTC (permalink / raw)



Jerry van Dijk <jvandyk@attglobal.net> writes:

Oops, that shoud of course be:

   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;

-- 
--  Jerry van Dijk   | email: jvandyk@attglobal.net
--  Leiden, Holland  | web:   users.ncrvnet.nl/gmvdijk



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-07-10 23:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-10 23:18 about fsincos Jerry van Dijk
2003-07-10 23:22 ` Jerry van Dijk

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