Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* How is sin and cos implemented on the ALPHA architecture?
@ 1996-11-20  5:00 Ian Lintault
  1996-11-20  5:00 ` Dirk Grunwald
  1996-11-20  5:00 ` Steve Lionel
  0 siblings, 2 replies; 4+ messages in thread
From: Ian Lintault @ 1996-11-20  5:00 UTC (permalink / raw)



Hello,

Does anyone know how sin and cos are implemented on the alpha.  We
want to do some very fast sin and cos.  Is there an assembler
instruction like in the pc or is it written in assembler in libm.  We
are using C++.


Ian Lintault





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

* Re: How is sin and cos implemented on the ALPHA architecture?
  1996-11-20  5:00 How is sin and cos implemented on the ALPHA architecture? Ian Lintault
  1996-11-20  5:00 ` Dirk Grunwald
@ 1996-11-20  5:00 ` Steve Lionel
  1 sibling, 0 replies; 4+ messages in thread
From: Steve Lionel @ 1996-11-20  5:00 UTC (permalink / raw)




In article <56tn8b$nkc@news0-alterdial.uu.net>, ian@adone.com (Ian Lintault) writes:
|>Hello,
|>
|>Does anyone know how sin and cos are implemented on the alpha.  We
|>want to do some very fast sin and cos.  Is there an assembler
|>instruction like in the pc or is it written in assembler in libm.  We
|>are using C++.

The SIN and COS functions are implemented using a specially optimized software
routine.  They are very fast.  There is an alternate "fast math library"
entry point which is faster, but somewhat less precise - this may suit your
needs.  You get at this using a -math_library fast switch when compiling
(I'm not sure if DEC C++ supports this.)  There are also routines that will
return both the SIN and COS of an argument, this is faster than calling
the SIN and COS routines separately.  Unfortunately, the sincos routine returns
values in registers F0 and F1, which is difficult to get at from languages
other than Fortran.
-- 

Steve Lionel                      mailto:lionel@quark.zko.dec.com
Fortran Development               http://www.digital.com/info/slionel.html
Digital Equipment Corporation     
110 Spit Brook Road, ZKO2-3/N30    
Nashua, NH 03062-2698             "Free advice is worth every cent"

For information on Digital Fortran, see http://www.digital.com/info/hpc/fortran/



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

* Re: How is sin and cos implemented on the ALPHA architecture?
  1996-11-20  5:00 How is sin and cos implemented on the ALPHA architecture? Ian Lintault
@ 1996-11-20  5:00 ` Dirk Grunwald
  1996-11-21  5:00   ` Steve Lionel
  1996-11-20  5:00 ` Steve Lionel
  1 sibling, 1 reply; 4+ messages in thread
From: Dirk Grunwald @ 1996-11-20  5:00 UTC (permalink / raw)



> needs.  You get at this using a -math_library fast switch when compiling
> (I'm not sure if DEC C++ supports this.)  There are also routines that will
> return both the SIN and COS of an argument, this is faster than calling
> the SIN and COS routines separately.  Unfortunately, the sincos routine returns
> values in registers F0 and F1, which is difficult to get at from languages
> other than Fortran.
> -- 

I'm assuming that Digital Unix uses a CORDIC method to implement
sin/cos?  If this is the case, sincos() should be exactly the same
speed as computing either sin() or cos().

There's also a vector sin/cos routine in the DXML. I don't know how
much faster it is.



-- 
Dirk Grunwald                 Assoc. Prof, Univ. of Colorado at Boulder



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

* Re: How is sin and cos implemented on the ALPHA architecture?
  1996-11-20  5:00 ` Dirk Grunwald
@ 1996-11-21  5:00   ` Steve Lionel
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Lionel @ 1996-11-21  5:00 UTC (permalink / raw)




In article <qxpybfwf8yb.fsf@foobar.cs.colorado.edu>, Dirk Grunwald 
<grunwald@foobar.cs.colorado.edu> writes:

|>I'm assuming that Digital Unix uses a CORDIC method to implement
|>sin/cos?  If this is the case, sincos() should be exactly the same
|>speed as computing either sin() or cos().

I don't know the exact algorithm, but I know that the reduction needs to be
done only once saving considerable time.
-- 

Steve Lionel                      mailto:lionel@quark.zko.dec.com
Fortran Development               http://www.digital.com/info/slionel.html
Digital Equipment Corporation     
110 Spit Brook Road, ZKO2-3/N30    
Nashua, NH 03062-2698             "Free advice is worth every cent"

For information on Digital Fortran, see http://www.digital.com/info/hpc/fortran/



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

end of thread, other threads:[~1996-11-21  5:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-11-20  5:00 How is sin and cos implemented on the ALPHA architecture? Ian Lintault
1996-11-20  5:00 ` Dirk Grunwald
1996-11-21  5:00   ` Steve Lionel
1996-11-20  5:00 ` Steve Lionel

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