_mm_floor_ss
Microsoft Specific
Emits the Streaming SIMD Extensions 4 (SSE4) instruction roundss. This instruction rounds a parameter down. The rounded value replaces the lower 64 bits of the other parameter.
__m128 _mm_floor_ss( __m128 a, __m128 b );
r0-r3, a0-a3, and b0-b3 are the sequentially ordered 32-bit components of return value r and parameters a and b. r0, a0, and b0 denote the least significant 32 bits.
This function is implemented as a macro that invokes intrinsic _mm_round_ss.
Before you use this intrinsic, software must ensure that the processor supports the instruction.
#include <stdio.h>
#include <smmintrin.h>
int main ()
{
__m128 a, b;
a.m128_f32[0] = 0.0;
a.m128_f32[1] = 3.5;
a.m128_f32[2] = 500;
a.m128_f32[3] = 25.25;
b.m128_f32[0] = -1.625;
b.m128_f32[1] = 0.0;
b.m128_f32[2] = 0.0;
b.m128_f32[3] = 0.0;
__m128 res = _mm_floor_ss(a, b);
printf_s("Original a: %f\t%f\t%f\t%f\nOriginal b: %f\t%f\t%f\t%f\n",
a.m128_f32[0], a.m128_f32[1], a.m128_f32[2], a.m128_f32[3],
b.m128_f32[0], b.m128_f32[1], b.m128_f32[2], b.m128_f32[3]);
printf_s("Result res: %f\t%f\t%f\t%f\n",
res.m128_f32[0], res.m128_f32[1], res.m128_f32[2], res.m128_f32[3]);
return 0;
}