SSE asm with functions

Walter Bright newshound2 at digitalmars.com
Thu Jun 16 14:22:15 PDT 2011


On 6/16/2011 10:20 AM, Byron wrote:
> I reduced the complexity of the problem, seems to be SSE and returning local copies.

What you've run into is the "named return value" optimization. 'r' is rewritten 
by the compiler as a reference to a vector in the caller's stack frame, this 
avoids unnecessary copying when returning r.

The trouble is, the inline assembler does no such rewrites.

I'll file this in bugzilla. In the meantime, you've already discovered the 
workaround in test2().


More information about the Digitalmars-d mailing list