# Intrinsics for Blend Operations

The prototypes for Intel® Advanced Vector Extensions 512 (Intel® AVX-512) intrinsics are located in the zmmintrin.h header file.
To use these intrinsics, include the immintrin.h file as follows:

    #include <immintrin.h>

### Note

The opmask register is not used as a writemask for these instructions. Instead, the mask is used as an element selector: every element of the destination is conditionally selected between first source or second source using the value of the related mask bit ('0' for the first source operand, '1' for the second source operand), the elements with corresponding mask bit value of '0' in the destination operand are zeroed.

Intrinsic Name | Operation | Corresponding Intel® AVX-512 Instruction
--- | --- | ---
`_mm512_mask_blend_pd` | Blend float64 vector elements using instruction mask. | `VBLENDMPD`
`_mm512_mask_blend_ps` | Blend float32 vector elements using instruction mask. | `VBLENDMPS`
`_mm512_mask_blend_epi32` | Blend int32 vectors using instruction mask. | `VPBLENDMD`
`_mm512_mask_blend_epi64` | Blend int64 vectors using instruction mask. | `VPBLENDMQ`

variable | definition
--- | ---
k | instruction mask used as a selector
a | first source vector element
b | second source vector element

_mm512_mask_blend_pd

    extern m512d __cdecl _mm512_mask_blend_pd(__mmask8 k, __m512d a, __m512d b);

Performs element-by-element blending of float64 source vectors a and b, using the instruction mask k as selector.

The result is written into float64 vector destination register.

_mm512_mask_blend_ps

     extern m512 __cdecl _mm512_mask_blend_ps(__mmask16 k, __m512 a, __m512 b);

Performs element-by-element blending of float32 source vectors a and b, using the instruction mask k as selector.

The result is written into an float32 vector register.

_mm512_mask_blend_epi32

    extern m512i __cdecl _mm512_mask_blend_epi32(__mmask16 k, __m512i a, __m512i b);

Performs element-by-element blending of int32 source vectors a and b, using the instruction mask k as selector.

The result is written into an int32 vector register.

_mm512_mask_blend_epi64

    extern m512i __cdecl _mm512_mask_blend_epi64(__mmask8 k, __m512i a, __m512i b);

Performs element-by-element blending of int64 source vectors a and b, using the instruction mask k as selector.

The result is written into an int64 vector register.

Parent topic: Intrinsics for Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Instructions