Setting __m256i to the value of two __m128i values

后端 未结 2 1163
逝去的感伤
逝去的感伤 2021-01-05 07:46

So, AVX has a function from immintrin.h, which should allow to store the concatenation of two __m128i values into a single __m256i val

2条回答
  •  逝去的感伤
    2021-01-05 08:24

    We had the same problem and used a macro to work around it.

    #ifdef __GNUC__ 
    #if __GNUC__ < 8
    #define _mm256_set_m128i(xmm1, xmm2) _mm256_permute2f128_si256(_mm256_castsi128_si256(xmm1), _mm256_castsi128_si256(xmm2), 2)
    #define _mm256_set_m128f(xmm1, xmm2) _mm256_permute2f128_ps(_mm256_castps128_ps256(xmm1), _mm256_castps128_ps256(xmm2), 2)
    #endif
    #endif
    

提交回复
热议问题