www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - question: prefer SSE over x87 asm code?

reply dennis luehring <dl.soluz gmx.net> writes:
hello all,

i've read that on newer architectures
SSE code should be prefered over x87 - because of speed
and i saw masses of SSE code in the math stuff of microsoft and intel 
compiler generated code

i know that the current fpu/sse support of DMD isn't that good, but are
there any attemps to use SSE code insinde of std.math implementation
wouldn't give SSE better results here (beside that someone needs to 
implement it)?

just as a question
Jan 21 2011
next sibling parent reply Don <nospam nospam.com> writes:
dennis luehring wrote:
 hello all,
 
 i've read that on newer architectures
 SSE code should be prefered over x87 - because of speed
 and i saw masses of SSE code in the math stuff of microsoft and intel 
 compiler generated code

At the present time, SSE and x87 are the same speed in most cases (most operations take just one cycle) -- except of course that you can do two or four operations at once with SSE.
 
 i know that the current fpu/sse support of DMD isn't that good, but are
 there any attemps to use SSE code insinde of std.math implementation
 wouldn't give SSE better results here (beside that someone needs to 
 implement it)?
 
 just as a question

Not for 32-bit. Even the last AMD 32-bit processors didn't support SSE2. For 64-bit, it makes sense, since all x86-64 processors can do SSE2. It will definitely happen for 64.
Jan 21 2011
parent bearophile <bearophileHUGS lycos.com> writes:
Don:

 At the present time, SSE and x87 are the same speed in most cases (most 
 operations take just one cycle) -- except of course that you can do two 
 or four operations at once with SSE.

SSE-something also allow some other operations, sqrt, etc. Even with GCC I've seen some performance improvements using SSE-something instructions. I suggest people to start looking at AVX instructions too. Bye, bearophile
Jan 21 2011
prev sibling parent Trass3r <un known.com> writes:
Note that SSE is less precise than x87.
Jan 23 2011