How do you load/store from/to an array of doubles with GNU C Vector Extensions?

前端 未结 3 2002
北荒
北荒 2020-12-21 01:36

I\'m using GNU C Vector Extensions, not Intel\'s _mm_* intrinsics.

I want to do the same thing as Intel\'s _m256_loadu_pd intrinsic. Assign

3条回答
  •  無奈伤痛
    2020-12-21 01:43

    You can use the equivalent intrinsics from gcc for x86: __builtin_ia32_loadupd256 (https://gcc.gnu.org/onlinedocs/gcc/x86-Built-in-Functions.html#x86-Built-in-Functions).

    So something like:

    typedef double v4df __attribute__((vector_size(4 * sizeof(double))));
    
    void vector_copy(double *a, v4df *v)
    {
        *v = __builtin_ia32_loadupd256(a);
    }
    

提交回复
热议问题