Sign in to follow this  
discman1028

Pass+return by register in SSE?

Recommended Posts

discman1028    212
Anyone know a trick to do this? For example: __declspec(noinline) inline __m128 MyAdd( __m128 a, __m128 b ) { return _mm_add_ps( a, b ); } will pass and return in vector registers. But trying to do the same thing with a wrapped class does not work: class MyVector { public: // ... __m128 v; }; Sometimes SIMD units have ways to flag a class or struct as being "passable/returnable by register". Anyone know of such a trick for SSE? Thanks.

Share this post


Link to post
Share on other sites
Starfox    504
Just use intrinsics, use __m128 where it's suitable, go x64 and MSVC should do The Right Thing.

x86-32, go __declspec(naked) and handle it all on your own! ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this