From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,8a773f114aa79a78 X-Google-Attributes: gidfee84,public From: lionel@quark.zko.dec.com (Steve Lionel) Subject: Re: How is sin and cos implemented on the ALPHA architecture? Date: 1996/11/20 Message-ID: <56vp9k$t7q$1@nntpd.lkg.dec.com>#1/1 X-Deja-AN: 197753285 distribution: world sender: lionel@quark.enet.dec.com (Steve Lionel) references: <56tn8b$nkc@news0-alterdial.uu.net> organization: Digital Equipment Corporation, Nashua NH reply-to: lionel@quark.zko.dec.com (Steve Lionel) newsgroups: comp.unix.osf.osf1 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/