_mm_floor_sd
Visual Studio 2010
Microsoft Specific
Emits the Streaming SIMD Extensions 4 (SSE4) instruction roundsd. This instruction rounds a parameter down. The rounded value replaces the lower 64 bits of the other parameter.
__m128d _mm_floor_sd( __m128d a, __m128d b );
r0, a0, and b0 are the lower 64 bits of return value r and parameters a and b. r1, a1, and b1 are the higher 64 bits of return value r and parameters a and b.
This function is implemented as a macro that invokes intrinsic _mm_round_sd.
Before you use this intrinsic, software must ensure that the processor supports the instruction.
#include <stdio.h>
#include <smmintrin.h>
int main ()
{
__m128d a, b;
a.m128d_f64[0] = 0.0;
a.m128d_f64[1] = 500.25;
b.m128d_f64[0] = -0.0625;
b.m128d_f64[1] = 0.0;
__m128d res = _mm_floor_sd(a, b);
printf_s("Original a: %I64f\t%I64f\nOriginal b: %I64f\t%I64f\n",
a.m128d_f64[0], a.m128d_f64[1], b.m128d_f64[0], b.m128d_f64[1]);
printf_s("Result res: %I64f\t%I64f\n",
res.m128d_f64[0], res.m128d_f64[1]);
return 0;
}
Original a: 0.000000 500.250000 Original b: -0.062500 0.000000 Result res: -1.000000 500.250000