Extracting XMM register elements gives compilation error

Extracting XMM register elements gives compilation error

I have recently started with SIMD and SSE instructions coding. To access individual elements of the 128 bits register, I do like this xml.m128i_i8[i]. But it gives compilation error :-

1>.outline_correct_C.cpp(65): error: union "__m128i" has no member "m128i_i8"

1> if(xm1.m128i_i8[i])

1> ^


1>.outline_correct_C.cpp(65): error: expression must have class type

1> if(xm1.m128i_i8[i])

But, I have checked similar uses in the manuals also. Can you please clarify.

With regards.

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The __m128i type is definedas the following - please see the emmintrin.h include file

typedef union { char c[16]; } __m128i;

and therefore the error that you get is actuallyOK froma compiler ppoint of view and does not have anything to do with the SSE or SIMD per se.Could you please post your source code so that we can get you started?



Thanks for your prompt reply.. I was using Intel's Compiler 10.1 with this which was giving this error. But, on using VC++ compiler, it does not give.

That is because Intel Compiler xmmintrin.h has different definition for __m128i than MSVC compiler.

Igor Levicki

Leave a Comment

Please sign in to add a comment. Not a member? Join today