SIMD benchmark

Walter Bright newshound2 at digitalmars.com
Mon Jan 16 10:59:43 PST 2012


On 1/16/2012 8:48 AM, Andrei Alexandrescu wrote:
> My point was that the version using float arrays should opportunistically use
> hardware ops whenever possible.

Yes, you're right. The compiler can opportunistically convert a number of vector 
operations on static arrays to the SIMD instructions.

Now that the basics are there, there are many, many opportunities to improve the 
code generation. Even for things like:

   int i,j;
   i *= 3;
   foo();
   j *= 3;

the two multiplies can be combined. Also, if operations on a particular integer 
variable are a subset that is supported by SIMD, that variable could be 
enregistered in an XMM register, instead of a GP register.

But don't worry, I'm not planning on working on that at the moment :-)


More information about the Digitalmars-d mailing list