Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
1058 Discussions

Extracting XMM register elements gives compilation error

biplabraut
Beginner
249 Views
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. But it gives compilation error :-

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

1> if(xm1.m128i_i8)

1> ^

1>

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

1> if(xm1.m128i_i8)

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

With regards.

0 Kudos
3 Replies
Nicolae_P_Intel
Employee
249 Views

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?

Cheers,

Nick

biplabraut
Beginner
249 Views
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.
ILevi1
Valued Contributor I
249 Views

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

Reply