Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

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

[in] a

A 128-bit parameter that contains two 64-bit floating point values.

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

Intrinsic

Architecture

_mm_ceil_pd

x86, x64

Header file <smmintrin.h>

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.

#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

Community Additions

ADD
Show:
© 2015 Microsoft