How to transfer SSE data to my functions / operators?

I am writing a couple of wrapper classes for Intrinsics SSE - mainly for getting geometry operations using a type, but also for adding a few handy functions. All my functions and operators are built-in. Theoretically, they will all be compiled directly to the SSE assembly (without function calls), and my electrons will never leave the XMM registers.

How to pass SSE classes as arguments to provide this result?

I never change my arguments, so the choice is mainly to pass by value or pass by reference const. I assume that a good compiler optimizes both styles on the same code. But I don’t know for sure. Can anyone with more experience in the field state best practices?

Thanks in advance!

+5
source share
1 answer

Either works fine for most compilers, but if you want the code to be compiled using Visual Studio, use const links, since the Visual Studio compiler is somewhat dead brain and applies unnecessary ABI restrictions, even when the function is inline.

+4
source

All Articles