Esta documentación está archivada y no tiene mantenimiento.


Microsoft Specific

Generates the Convert Double Word Integer to Scalar Double-Precision Floating-Point Value (cvtsi2sd) instruction.

__m128d _mm_cvtsi64x_sd( 
   __m128d a 
   __int64 b 

[in] a

An __m128d structure containing two double-precision floating-point values.

[in] b

A 64-bit integer.

An __m128d structure with the result of the conversion in the first position, and the second position copied from a.





Header file <intrin.h>

The result of the conversion is placed in the first element of the __m128d structure passed in as a, and the result is returned. The __m128d structure represents an XMM register, so this intrinsic allows the value b from system memory to be placed in an XMM register.

This routine is only available as an intrinsic.

// _mm_cvtsi64x_sd.cpp
// processor: x64

#include <intrin.h>
#include <stdio.h>

#pragma intrinsic(_mm_cvtsi64x_sd)

int main()
    __m128d a;
    __int64 b = 117;

    double adbl[2] = { 1.8E6, 200.5 };

    // loads the double values into d
    // (moves data into the XMM registers)
    a = _mm_loadu_pd (adbl);

    // Copy b into the first element of a
    a = _mm_cvtsi64x_sd(a, b);

    printf_s("%lf %lf\n", a.m128d_f64[0], a.m128d_f64[1] );
117.000000 200.500000