Software Archive
Read-only legacy content
17061 Discussions

Does MIC have blend intrinsics?

songlinhai
Beginner
414 Views

I have two vectors, vector A = {1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31}

vector B = {2,4,6,8,10,12,14,16,18,20,22,24,26,28,30}

Does MIC have intrinsics such that I can generate two new vectors as follows,

new_A={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}

new_B = {17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32}

Thanks

0 Kudos
1 Reply
Kevin_D_Intel
Employee
414 Views

The _mm512_mask_blend_epi32, _mm512_mask_blend_epi64, _mm512_mask_blend_ps, _mm512_mask_blend_pd (present in zmmintrin.h) are missing from the C++ User Guide and will be documented in our coming Composer XE 2013 SP1 release later this year.

/*
 * Blending between two vectors.
 */
extern __m512i __ICL_INTRINCC _mm512_mask_blend_epi32(__mmask16, __m512i,
                                                      __m512i);
extern __m512i __ICL_INTRINCC _mm512_mask_blend_epi64(__mmask8, __m512i,
                                                      __m512i);
extern __m512  __ICL_INTRINCC _mm512_mask_blend_ps(__mmask16, __m512,
                                                   __m512);
extern __m512d __ICL_INTRINCC _mm512_mask_blend_pd(__mmask8, __m512d,
                                                   __m512d);

Each performs a blend on vectors (of specific type) using the instruction mask.

For example:

_mm512_mask_blend_epi32
Blends int32 vectors using the instruction mask. Corresponding instruction is VPBLENDMD. This intrinsic only applies to Intel® Many Integrated Core Architecture (Intel® MIC Architecture).

Syntax
extern __m512i __cdecl _mm512_mask_blend_epi32(__mmask16 k1, __m512i v2, __m512i v3);
 

Parameters
v2
 int32 vector used for the blend operation
v3
 int32 vector used for the blend operation
k1
 instruction mask used for blend selection

Description
This intrinsic performs an element-by-element blending between int32 vectors v2 and v3, using mask k1 as selector. The result is written to int32 vector v2.

The k1 mask is not used as a write-mask for this instruction. Instead, the k1 mask is used as an element selector: every element of the destination is conditionally selected between vectors v2 or v3 using the value of the related mask bit ('0' for source vector v2, '1' for source vector v3).

Returns
Returns the result of the blend operation.

0 Kudos
Reply