0

I'm trying to optimize some integer (_int64) operations using AVX. However, I can't even simple add operation. It keeps telling me illegal instruction. Pls can I be corrected on what i'm doing wrong? Thanks

for (int i = 0; i < 1; i+=4)
{
    __m256i rA, rB, rC;
    __m256i *iu, *ju, *ku;

    iu =  (__m256i *)(MatrixAiB1 + i);
    ju =    (__m256i *)(MatrixAjB1+ i);
    ku = (__m256i *) (store+ i);

    rA=_mm256_load_si256(iu);
    rB=_mm256_load_si256(ju);
    rC=_mm256_add_epi16(rA,rB);
    _mm256_store_si256(ku,rC);

}
FrancFine
  • 27
  • 3
  • have a look at cpuid: [here](http://msdn.microsoft.com/en-us/library/hskdteyh(v=vs.100).aspx) or [here](http://en.wikipedia.org/wiki/CPUID) – joy Apr 29 '13 at 18:35

1 Answers1

5

You are using instructions from the AVX 2 instruction set, which is not widely supported yet. The illegal instruction exception indicates that you are running the code on a machine that does not support these instructions.

These instructions are being first introduced in the Haswell processors this year - so "not widely supported" currently means "not supported by any publicly available processor".

Sam Harwell
  • 97,721
  • 20
  • 209
  • 280