如何在VC++中使用AVX? RRS feed

  • 问题

  • 如何在VC++中使用AVX?一下代码通过编译,当执行是出错了:

    Intel_AVX2_test.exe 中的 0x00e51573 处有未经处理的异常: 0xC000001D: Illegal Instruction

    #include "stdafx.h"
    #include <immintrin.h>
    #include <intrin.h>
    #include <iostream>
    using namespace std;
    void testavx2(void)
    __m256d a, b, c, d;
        int i;
        for (i = 0; i < 4; i++) {
            a.m256d_f64[i] = i;
            b.m256d_f64[i] = 2.;
            c.m256d_f64[i] = 3.;
        d = _mm256_macc_pd(a, b, c);
        for (i = 0; i < 4; i++) printf_s(" %.3lf", b.m256d_f64[i]);

    int _tmain(int argc, _TCHAR* argv[])
    char ch;
    cin >>ch;
    return 0;

    我的平台是i5 4570,win7 x64

    2013年11月29日 0:56


  • 你好,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2013年11月29日 9:32