Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.
1094 Discussions

error C2677: binary '[' : no global operator found which takes type '__m128i'

Smart_Lubobya
Beginner
1,453 Views

how can i deal with this error?
//Biggy.h

protected:

static const int Usualdjust[6][3];

//Biggy.cpp

const int biggy::UsualAdjust[6][3] =

{

{13107, 5243, 8066 },

{11916, 4660, 7490 },

{10082, 4194, 6554 },

{ 9362, 3647, 5825 },

{ 8192, 3355, 5243 },

{ 7282, 2893, 4559 }

};

.

.

.

_m128i x0 ,r,_qm,_f, tmp1,tmp2;

tmp1= _mm_mulhi_epi16(_mm_sub_epi16(_mm_setzero_si128(), x0), UsualAdjust[_qm]);//error on this line __error C2677: binary '[' : no global operator found which takes type '__m128i' (or there is no acceptable conversion)

0 Kudos
3 Replies
TimP
Honored Contributor III
1,453 Views
You would need to specify explicitly which 32 or 64 bits of _qm is to be extracted as a subscript.
0 Kudos
Smart_Lubobya
Beginner
1,453 Views

how can i deal with this error? see added code lines from previous post. i have shown all codes in whuch _qm has been used.
//Biggy.h

protected:

static const int Usualdjust[6][3];

int _q;//added line

int _qm;//added line

//Biggy.cpp

const int biggy::UsualAdjust[6][3] =

{

{13107, 5243, 8066 },

{11916, 4660, 7490 },

{10082, 4194, 6554 },

{ 9362, 3647, 5825 },

{ 8192, 3355, 5243 },

{ 7282, 2893, 4559 }

};

biggy::biggy() // added code lines

{

_q = 1;

_qm = _q % 6;

}

.

.

.

_m128i x0 ,r,_qm,_f, tmp1,tmp2;

tmp1= _mm_mulhi_epi16(_mm_sub_epi16(_mm_setzero_si128(), x0), UsualAdjust[_qm]);//error on this line __error C2677: binary '[' : no global operator found which takes type '__m128i' (or there is no acceptable conversion)

0 Kudos
Brijender_B_Intel
1,453 Views

_qm is declared as _m128i and same as _r. Usualadjsut[] requires two integer indexes. _qm and _r are arrays itself of 4 integers. As Tim said, you want to be specific which element of _qm and _r is passed. you may want to look the the type of __m128i defined in emmintrin.h or someother file. You need to give that structure element as an input for array index.

0 Kudos
Reply