I have code originally provided to me by someone working with MSVC, and I'm trying to get it to work on Clang. Here is the function I'm having problems with:
float vectorGetByIndex( __m128 V, unsigned int i ) { assert( i <= 3 ); return V.m128_f32[i]; }
The error I am getting is as follows:
Member reference has base type '__m128' is not a structure or union.
I looked around and found that Clang (and possibly GCC) has a problem handling __m128 as a structure or union. However, I could not find a direct answer on how I can return these values. I tried using the index operator and could not do it, and I looked through the huge list of functions of the embedded SSE and have not yet found a suitable one.
c ++ sse simd intrinsics clang
benwad
source share