Se recomienda usar Visual Studio 2017
Esta documentación está archivada y no tiene mantenimiento.


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