Condividi tramite


_mm_ceil_pd

Microsoft Specific

Emits the Streaming SIMD Extensions 4 (SSE4) instruction roundpd. This instruction rounds up a packed double precision floating point value.

__m128d _mm_ceil_pd( 
   __m128d a
);

Parameters

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

Return value

r0 := CEIL(a0)
r1 := CEIL(a1)

Requirements

Intrinsic

Architecture

_mm_ceil_pd

x86, x64

Header file <smmintrin.h>

Remarks

r0, a0 are the low order 64 bits of return value r and parameter a.

r1, a1 are the high order 64 bits of return value r and parameter a.

This function is implemented as a macro that invokes intrinsic _mm_round_pd with appropriate rounding control.

Before using this intrinsic, software must ensure that the processor supports the instruction.

Example

#include <stdio.h>
#include <smmintrin.h>

int main () {
    __m128d a;

    a.m128d_f64[1] = 10.4;
    a.m128d_f64[0] = -6.5;

    __m128d res = _mm_ceil_pd( a );

    printf_s("Original a: %8f %8f\n",
                a.m128d_f64[1], a.m128d_f64[0]);

    printf_s("Result res: %8f %8f\n",
               res.m128d_f64[1], res.m128d_f64[0]);

    return 0;
}
Original a: 10.400000 -6.500000
Result res: 11.000000 -6.000000

See Also

Reference

Compiler Intrinsics