Performing AVX integer operation

拥有回忆 提交于 2019-12-13 06:04:39

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!