_mm_floor_ps
Microsoft Specific
Emits the Streaming SIMD Extensions 4 (SSE4) instruction roundps. This instruction rounds the parameter down.
__m128 _mm_floor_ps( __m128 a );
r0-r3 and a0-a3 are the sequentially ordered 32-bit components of return value r and parameter a. r0 and a0 denote the least significant 32 bits.
This function is implemented as a macro that invokes _mm_round_ps.
Before you use this intrinsic, software must ensure that the processor supports the instruction.
#include <stdio.h>
#include <smmintrin.h>
int main ()
{
__m128 a;
a.m128_f32[0] = 0.0625;
a.m128_f32[1] = -3.25;
a.m128_f32[2] = 100.125;
a.m128_f32[3] = -0.5;
__m128 res = _mm_floor_ps(a);
printf_s("Original a: %f\t%f\t%f\t%f\n",
a.m128_f32[0], a.m128_f32[1], a.m128_f32[2], a.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;
}