Packed Blending Intrinsincs for Streaming SIMD Extensions 4

These intrinsics pack multiple operations in a single instruction. Blending conditionally copies one field in the source onto the corresponding field in the destination.

Intrinsic Syntax

Operation

Corresponding
SSE4 Instruction

__m128 _mm_blend_ps(__m128 v1, __m128 v2, const int mask)

Selects float single precision data from 2 sources using constant mask

BLENDPS

__m128d _mm_blend_pd(__m128d v1, __m128d v2, const int mask)

Selects float double precision data from 2 sources using constant mask

BLENDPD

__m128 _mm_blendv_ps(__m128 v1, __m128 v2, __m128 v3)

Selects float single precision data from 2 sources using variable mask

BLENDVPS

__m128d _mm_blendv_pd(__m128d v1, __m128d v2, __m128d v3)

Selects float double precision data from 2 sources using variable mask

BLENDVPD

__m128i _mm_blendv_epi8(__m128i v1, __m128i v2, __m128i mask)

Selects integer bytes from 2 sources using variable mask

PBLENDVB

__m128i _mm_blend_epi16(__m128i v1, __m128i v2, const int mask)

Selects integer words from 2 sources using constant mask

PBLENDW