AMD amd64 architecture User Manual

Page of 336
224
64-Bit Media Programming
AMD64 Technology
24592—Rev. 3.15—November 2009
For a summary of the 128-bit media floating-point instructions, see “Instruction Summary—Floating-
Point Instructions” on page 156. 
For a summary of the x87 floating-point instructions, see “Instruction
Summary” on page 261.
The instructions are organized here by functional group—such as data-transfer, vector arithmetic, and
so on. Software running at any privilege level can use any of these instructions, if the CPUID
instruction reports support for the instructions (see “Feature Detection” on page 229). More detail on
individual instructions is given in the alphabetically organized “64-Bit Media Instruction Reference”in Volume 5.
5.7.1 Syntax
The 64-bit media floating-point instructions have the same syntax rules as those for the 64-bit media
integer instructions, described in “Syntax” on page 207, except that the mnemonics of most floating-
point instructions begin with the following prefix:
PF—Packed floating-point
5.7.2 Data Conversion
These data-conversion instructions convert operands from floating-point to integer formats. The
instructions take 32-bit or 64-bit floating-point source operands. For data-conversion instructions that
take 64-bit integer source operands, see “Data Conversion” on page 211. For data-conversion
instructions that take 128-bit source operands, see “Data Conversion” on page 139 and “Data
Conversion” on page 162.
Convert Floating-Point to Integer
CVTPS2PI—Convert Packed Single-Precision Floating-Point to Packed Doubleword Integers
CVTTPS2PI—Convert Packed Single-Precision Floating-Point to Packed Doubleword Integers,
Truncated
CVTPD2PI—Convert Packed Double-Precision Floating-Point to Packed Doubleword Integers
CVTTPD2PI—Convert Packed Double-Precision Floating-Point to Packed Doubleword Integers,
Truncated
PF2IW—Packed Floating-Point to Integer Word Conversion
PF2ID—Packed Floating-Point to Integer Doubleword Conversion
The CVTPS2PI and CVTTPS2PI instructions convert two single-precision (32-bit) floating-point
values in the second operand (the low-order 64 bits of an XMM register or a 64-bit memory location)
to two 32-bit signed integers, and write the converted values into the first operand (an MMX register).
For the CVTPS2PI instruction, if the conversion result is an inexact value, the value is rounded as
specified in the rounding control (RC) field of the MXCSR register (“MXCSR Register” on page 117),
but for the CVTTPS2PI instruction such a result is truncated (rounded toward zero).
The CVTPD2PI and CVTTPD2PI instructions perform conversions analogous to CVTPS2PI and
CVTTPS2PI but for two double-precision (64-bit) floating-point values.