News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Sine in SSE2 vs. FSIN

Started by GregL, February 28, 2005, 12:53:18 AM

Previous topic - Next topic

GregL

I have been reading about Windows XP x64 Edition. x87 FPU and MMX instructions are not supported, SSE/SSE2 only.

Question:  Could a sine function written for SSE2 equal or outperform FSIN on a Pentium 4?

I originally thought it would be considerably slower, but now I am not sure. I would try to figure this out myself but I have a Pentium III (no SSE2).


GregL

#1
I found the answer. I looked at the Intel 'Approximate Math Library'. It does sine, cosine, tangent etc. in SSE or SSE2 code faster than the equivalent FPU instructions. The accuracy is a little less but it is is better than what is achievable with lookup tables. I'll be darned. :red :dazzled:

You can find it here:
http://www.intel.com/design/pentiumiii/devtools/AMaths.zip

(updated the link)

Ratch

Greg,

Have you checked out the method from this site? Ratch

http://www.bmath.net/bmath/halfstaff.html

GregL

Ratch,

Thanks for the link, I'll check it out.


GregL

QuoteI have been reading about Windows XP x64 Edition. x87 FPU and MMX instructions are not supported, SSE/SSE2 only.

I know this is an old post but this is not true. See this post.

daydreamer

sine and cosine can be calculated by taylorseries, take a look and you see its highly parallelizable to perform all these in parallel and perform a final adds and subs
if you really want performance write a SSEsine that calculcates several sine in parallel and unroll it as long as you have free xmm regs