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

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

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][r]);//error on this line __error C2677: binary '[' : no global operator found which takes type '__m128i' (or there is no acceptable conversion)

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

You would need to specify explicitly which 32 or 64 bits of _qm is to be extracted as a subscript.

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][r]);//error on this line __error C2677: binary '[' : no global operator found which takes type '__m128i' (or there is no acceptable conversion)

_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.

Leave a Comment

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