执行AVX整数运算 [英] Performing AVX integer operation

查看:589
本文介绍了执行AVX整数运算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用AVX优化一些整数(_int64)操作。但是,我甚至不能简单的添加操作。它一直告诉我非法教学。我可以纠正我做错了什么?感谢

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);

}


推荐答案

使用来自 AVX 2 指令集的说明,该指令集尚未得到广泛支持。非法指令异常表示您正在不支持这些指令的计算机上运行代码。

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.

这些说明是今年首次在Haswell处理器中引入的 - 因此未广泛支持当前表示不受任何公开处理器支持。

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

这篇关于执行AVX整数运算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆