Developer Guide and Reference

Contents

Conversion Intrinsics

The prototypes for Intel® Streaming SIMD Extensions (Intel® SSE) intrinsics for conversion operations are in the
xmmintrin.h
header file.
To use these intrinsics, include the
immintrin.h
file as follows:
#include <immintrin.h>
The results of each intrinsic operation are placed in a register. This register is illustrated for each intrinsic with R or R0-R3. R0, R1, R2, and R3 each represent one of the four 32-bit pieces of the result register.
Intrinsics marked with * are available only on Intel® 64 architecture. The rest of the intrinsics can be implemented on both IA-32 and Intel® 64 architectures.
Intrinsic Name
Operation
Corresponding
Intel® SSE Instruction
_mm_cvtss_si32
Convert to 32-bit integer
CVTSS2SI
_mm_cvtss_si64*
Convert to 64-bit integer
CVTSS2SI
_mm_cvtps_pi32
Convert to two 32-bit integers
CVTPS2PI
_mm_cvttss_si32
Convert to 32-bit integer
CVTTSS2SI
_mm_cvttss_si64*
Convert to 64-bit integer
CVTTSS2SI
_mm_cvttps_pi32
Convert to two 32-bit integers
CVTTPS2PI
_mm_cvtsi32_ss
Convert from 32-bit integer
CVTSI2SS
_mm_cvtsi64_ss*
Convert from 64-bit integer
CVTSI2SS
_mm_cvtpi32_ps
Convert from two 32-bit integers
CVTTPI2PS
_mm_cvtpi16_ps
Convert from four 16-bit integers
composite
_mm_cvtpu16_ps
Convert from four 16-bit integers
composite
_mm_cvtpi8_ps
Convert from four 8-bit integers
composite
_mm_cvtpu8_ps
Convert from four 8-bit integers
composite
_mm_cvtpi32x2_ps
Convert from four 32-bit integers
composite
_mm_cvtps_pi16
Convert to four 16-bit integers
composite
_mm_cvtps_pi8
Convert to four 8-bit integers
composite
_mm_cvtss_f32
Extract
composite

_mm_cvtss_si32

int _mm_cvtss_si32(__m128 a);
Converts the lower SP FP value of
a
to a 32-bit integer according to the current rounding mode.
R
(int)a0

_mm_cvtss_si64

__int64 _mm_cvtss_si64(__m128 a);
Converts the lower SP FP value of
a
to a 64-bit signed integer according to the current rounding mode.
Use only on Intel® 64 architecture.
R
(__int64)a0

_mm_cvtps_pi32

__m64 _mm_cvtps_pi32(__m128 a);
Converts the two lower SP FP values of
a
to two 32-bit integers according to the current rounding mode, returning the integers in packed form.
R0