background image

Vol. 1 11-9

PROGRAMMING WITH INTEL® STREAMING SIMD EXTENSIONS 2 (INTEL® SSE2)

11.4.1.6   SSE2 Conversion Instructions

SSE2 conversion instructions (see Figure 11-8) support packed and scalar conversions between:

Double-precision and single-precision floating-point formats

Double-precision floating-point and doubleword integer formats

Single-precision floating-point and doubleword integer formats

Conversion between double-precision and single-precision floating-points values — The following 
instructions convert operands between double-precision and single-precision floating-point formats. The operands 
being operated on are contained in XMM registers or memory (at most, one operand can reside in memory; the 
destination is always an MMX register).
The CVTPS2PD (convert packed single-precision floating-point values to packed double-precision floating-point 
values) instruction converts two packed single-
precision floating-point values to two double-precision floating-point values.
The CVTPD2PS (convert packed double-precision floating-point values to packed single-precision floating-point 
values) instruction converts two packed double-
precision floating-point values to two single-precision floating-point values. When a conversion is inexact, the 
result is rounded according to the rounding mode selected in the MXCSR register.
The CVTSS2SD (convert scalar single-precision floating-point value to scalar double-precision floating-point value) 
instruction converts a single-precision floating-point value to a double-precision floating-point value.
The CVTSD2SS (convert scalar double-precision floating-point value to scalar single-precision floating-point value) 
instruction converts a double-precision floating-point value to a single-precision floating-point value. When the 
conversion is inexact, the result is rounded according to the rounding mode selected in the MXCSR register.

Conversion between double-precision floating-point values and doubleword integers — The following 
instructions convert operands between double-precision floating-point and doubleword integer formats. Operands 

Figure 11-8.  SSE and SSE2 Conversion Instructions

CV

TP

S2

PI

CV

TT

PS

2D

Q

C

V

TD

Q

2P

S

CV

TP

I2

P

S

C

V

T

P

D

2

P

S

C

V

T

P

S

2

P

D

C

VT

P

D2DQ

CV

TD

Q2PD

CV

TT

PD

2P

I

C

V

TP

I2

P

D

CV

TS

S2

SI

C

VT

SI

2S

S

C

V

TS

I2

S

D

C

V

TT

S

D

2S

I

C

V

T

S

D

2

S

S

C

V

T

S

S

2

S

D

CV

TP

S2

DQ

4 Doubleword

Integer

Floating-Point

Doubleword

Integer 

2 Doubleword

Integer 

Single-Precision

Floating Point

C

V

TS

D

2S

I

CV

TP

D2

PI

CV

TT

P

D2

D

Q

CV

TT

PS

2P

I

CV

TT

SS

2S

I

2 Doubleword

Integer 

(r32/mem)

(MMX/mem)

(XMM/mem)

Double-Precision

 (XMM/mem)

(XMM/mem)

(XMM/mem)