System programming in D (Was: The God Language)

Walter Bright newshound2 at digitalmars.com
Thu Dec 29 12:09:13 PST 2011


On 12/29/2011 5:13 AM, a wrote:
> The needles loads and stores would make it impossible to write an efficient
> simd add function even if the functions containing asm blocks could be
> inlined.

This does what you're asking for:

void test(ref float a, ref float b)
{
     asm
     {
         naked;
         movaps  XMM0,[RSI];
         addps   XMM0,[RDI];
         movaps  [RSI],XMM0;
         movaps  XMM0,[RSI];
         addps   XMM0,[RDI];
         movaps  [RSI],XMM0;
         ret;
     }
}


More information about the Digitalmars-d mailing list