【问题标题】:index not accepted in simd instructionssimd 指令中不接受索引
【发布时间】:2013-09-24 05:30:54
【问题描述】:
for(y=0; y<line; y++){
    base=y*line;
    gx[base]=ptr[base];

    for(x=0; x<line-4; x+4){
        i=base+x;
        prec = _mm_load_ps(&ptr1[i]);
        succ = _mm_load_ps(&ptr2[i]);
        res = _mm_sub_ps(succ,prec);
        _mm_store_ps(&gx[i+1],res);
    }

我在“_mm_store”上出现执行错误,为什么? 不接受索引 i+1;用 i 是正确的

【问题讨论】:

  • 这个错误肯定伴随着某种消息?此外,您的内部 for 循环看起来不正确 - x+4 不会增加 x

标签: c++ intel sse simd


【解决方案1】:

_mm_store_ps 需要一个 16 字节对齐的目标地址。对未对齐的商店使用_mm_storeu_ps

【讨论】:

    猜你喜欢
    • 2014-06-20
    • 2021-06-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-15
    • 1970-01-01
    • 2014-03-31
    相关资源
    最近更新 更多