_mm_floor_sd

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
);

Parameters

  • [in] a
    A 128-bit parameter that contains two 64-bit floating point values.

  • [in] b
    A 128-bit parameter that contains a floating point value in the lowest 64 bits.

Return value

The result can be expressed with the following equations:

r0 := FLOOR(b0)
r1 := a1

Requirements

Intrinsic

Architecture

_mm_floor_sd

x86, x64

Header file <smmintrin.h>

Remarks

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.

Example

#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

See Also

Concepts

Compiler Intrinsics