_mm_cvtsi64_sd
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
);
Parameters
[in] a
A 128-bit parameter that contains two 64-bit floating point values.[in] b
A 64-bit signed integer.
Return value
The result can be expressed with the following equations:
r0 := FLT(b)
r1 := a1
Requirements
Intrinsic |
Architecture |
---|---|
_mm_cvtsi64_sd |
x64 |
Header file <emmintrin.h>
Remarks
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.
Example
#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