I would like to combine two __m128 values to one __m256.
Something like this:
__m128 a = _mm_set_ps(1, 2, 3, 4);
__m128 b = _mm_set_ps(5, 6, 7, 8);
to something like:
__m256 c = { 1, 2, 3, 4, 5, 6, 7, 8 };
are there any intrinsics that I can use to do this?
This should do what you want:
If the order is reversed from what you want, then just switch
aandb.The intrinsic of interest is
_mm256_insertf128_pswhich will let you insert a 128-bit register into either lower or upper half of a 256-bit AVX register:http://software.intel.com/sites/products/documentation/studio/composer/en-us/2011/compiler_c/intref_cls/common/intref_avx_insertf128_ps.htm
The complete family of them is here:
_mm256_insertf128_pd()_mm256_insertf128_ps()_mm256_insertf128_si256()