On 12/29/11 2:13 PM, a wrote:
void test(ref V a, ref V b)
{
     asm
     {
         movaps XMM0, a;
         addps  XMM0, b;
         movaps a, XMM0;
     }
     asm
     {
         movaps XMM0, a;
         addps  XMM0, b;
         movaps a, XMM0;
     }
}

[…]

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.

Yes, this is indeed a problem, and as far as I'm aware, usually solved in the gamedev world by using the (SSE) intrinsics your favorite C++ compiler provides, instead of resorting to inline asm.

David

Reply via email to