_mm_blend_pd
Microsoft Specific
Emits the Streaming SIMD Extensions 4 (SSE4) instruction blendpd. This instruction blends packed double precision floating point values.
__m128d _mm_blend_pd( __m128d a, __m128d b, const int mask );
r0, a0, b0 are the low order 64 bits of return value r and parameters a and b. r1, a1, and b1 are the high order 64 bits of return value r and parameters a and b.
mask0 and mask1 are the two least significant bits of parameter mask.
Before using this intrinsic, software must ensure that the processor supports the instruction.
#include <stdio.h>
#include <smmintrin.h>
int main () {
__m128d a, b;
const int mask = 2;
a.m128d_f64[1] = -10.5;
a.m128d_f64[0] = -3.14159;
b.m128d_f64[1] = 500.25;
b.m128d_f64[0] = 2.19;
__m128d res = _mm_blend_pd( a, b, mask );
printf_s("Original a: %10f %10f\nOriginal b: %10f %10f\n",
a.m128d_f64[1], a.m128d_f64[0],
b.m128d_f64[1], b.m128d_f64[0]);
printf_s("Result res: %10f %10f\n",
res.m128d_f64[1], res.m128d_f64[0]);
return 0;
}