# Packed Blending Intrinsics

These Intel® Streaming SIMD Extensions 4 (Intel® SSE4) intrinsics pack multiple operations in a single instruction. Blending conditionally copies one field in the source onto the corresponding field in the destination. The prototypes for these intrinsics are in the smmintrin.h file.

To use these intrinsics, include the immintrin.h file as follows:

    #include <immintrin.h>

Intrinsic Syntax | Operation | Corresponding Intel® SSE4 Instruction
--- | --- | ---
__m128 _mm_blend_ps(__m128 v1, __m128 v2, const int mask) | Selects single precision float data from two sources using constant mask | `BLENDPS`
__m128d _mm_blend_pd(__m128d v1, __m128d v2, const int mask) | Selects double precision float data from two sources using constant mask | `BLENDPD`
__m128 _mm_blendv_ps(__m128 v1, __m128 v2, __m128 v3) | Selects single precision float data from two sources using variable mask | `BLENDVPS`
__m128d _mm_blendv_pd(__m128d v1, __m128d v2, __m128d v3) | Selects double precision float data from two sources using variable mask | `BLENDVPD`
__m128i _mm_blendv_epi8(__m128i v1, __m128i v2, __m128i mask) | Selects integer bytes from two sources using variable mask | `PBLENDVB`
__m128i _mm_blend_epi16(__m128i v1, __m128i v2, const int mask) | Selects integer words from two sources using constant mask | `PBLENDW`

Parent topic: Vectorizing Compiler and Media Accelerators