Integer Conversions Operations for Streaming SIMD Extensions 2

The following two conversion intrinsics and their respective instructions are functional in the Streaming SIMD Extensions 2 (SSE2).

The prototypes for SSE2 intrinsics are in the emmintrin.h header file.

__m128i _mm_cvtsi32_si128(int a)

(uses MOVD) Moves 32-bit integer a to the least significant 32 bits of an __m128i object. Copies the sign bit of a into the upper 96 bits of the __m128i object.
r0 := a
r1 := 0x0 ; r2 := 0x0 ; r3 := 0x0

__m128i _mm_cvtsi64_si128(__int64 a)

(uses MOVQ) Moves 64-bit integer a to the lower 64 bits of an __m128i object, zeroing the upper bits.
r0 := a
r1 := 0x0

int _mm_cvtsi128_si32(__m128i a)

(uses MOVD) Moves the least significant 32 bits of a to a 32-bit integer.
r := a0

__int64 _mm_cvtsi128_si64(__m128i a)

(uses MOVQ) Moves the lower 64 bits of a to a 64-bit integer.
r := a0

__m128d _mm_cvtsi64_sd(__m128d a, __int64 b)

(uses CVTSI2SD) Converts the signed 64-bit integer value in b to a DP FP value. The upper DP FP value in a is passed through.

r0 := (double)b

r1 := a1

__int64 _mm_cvtsd_si64(__m128d a)

(uses CVTSD2SI) Converts the lower DP FP value of a to a 64-bit signed integer value according to the current rounding mode.

r := (__int64) a0

__int64 _mm_cvttsd_si64(__m128d a)

(uses CVTTSD2SI) Converts the lower DP FP value of a to a 64-bit signed integer value using truncation.

r := (__int64) a0

__m128 _mm_cvtepi32_ps(__m128i a)

Converts the 4 signed 32-bit integer values of a to SP FP values.
r0 := (float) a0
r1 := (float) a1
r2 := (float) a2
r3 := (float) a3

__m128i _mm_cvtps_epi32(__m128 a)

Converts the 4 SP FP values of a to signed 32-bit integer values.
r0 := (int) a0
r1 := (int) a1
r2 := (int) a2
r3 := (int) a3

__m128i _mm_cvttps_epi32(__m128 a)

Converts the 4 SP FP values of a to signed 32 bit integer values using truncate.
r0 := (int) a0
r1 := (int) a1
r2 := (int) a2
r3 := (int) a3