问题
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);
}
回答1:
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".
来源:https://stackoverflow.com/questions/16284263/performing-avx-integer-operation