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.


Microsoft Specific

Emits the Streaming SIMD Extensions 2 (SSE2) instruction cvtsi2sd. This instruction converts a 64-bit signed integer to a floating point number and concatenates it with another 64-bit floating point number.

__m128d _mm_cvtsi64_sd( 
   __m128d a,
   __int64 b

[in] a

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

[in] b

A 64-bit signed integer.

The result can be expressed with the following equations:

r0 := FLT(b)
r1 := a1





Header file <emmintrin.h>

r0 and a0 are the lower 64 bits of return value r and parameter a. r1 and a1 are the upper 64 bits of return value r and parameter a.

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

#include <stdio.h>
#include <emmintrin.h>

int main ()
    __m128d a;
    __int64 b;

    a.m128d_f64[0] = -10.5;
    a.m128d_f64[1] = 200.31;
    b = 65535;

    __m128d res = _mm_cvtsi64_sd(a, b);

    printf_s("Original a: %I64f\t%I64f\n", a.m128d_f64[1], a.m128d_f64[0]);
    printf_s("Original b: %I64d\n", b);
    printf_s("Result res: %I64f\t%I64f\n", res.m128d_f64[1], res.m128d_f64[0]);

    return 0;
Original a: 200.310000 -10.500000 Original b: 65535 Result res: 200.310000 65535.000000

Community Additions

© 2015 Microsoft