This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Calculating cosinus/sinus
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: jacob navia <jacob at jacob dot remcomp dot fr>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 11 May 2013 11:30:36 +0200 (CEST)
- Subject: Re: Calculating cosinus/sinus
- References: <518E0C29 dot 6050204 at jacob dot remcomp dot fr>
- Reply-to: gcc at gcc dot gnu dot org
On Sat, 11 May 2013, jacob navia wrote:
Hi
When caculating the cos/sinus, gcc generates a call to a complicated routine
that takes several thousand instructions to execute.
Suppose the value is stored in some XMM register, say xmm0 and the result
should be in another xmm register, say xmm1.
Why it doesn't generate:
movsd %xmm0,(%rsp)
fldl (%rsp)
fsin
fstpl (%rsp)
movsd (%rsp),%xmm1
My compiler system (lcc-win) is generating that when optimizations are ON.
Maybe there are some flags in gcc that I am missing?
Òr there is some other reason?
fsin is slower and less precise than the libc SSE2 implementation.
--
Marc Glisse