AMD amd64 architecture User Manual

Page of 336
64-Bit Media Programming
225
24592—Rev. 3.15—November 2009
AMD64 Technology
The 3DNow! PF2IW instruction converts two single-precision floating-point values in the second
operand (an MMX register or a 64-bit memory location) to two 16-bit signed integer values, sign-
extended to 32-bits, and writes the converted values into the first operand (an MMX register). The
3DNow! PF2ID instruction converts two single-precision floating-point values in the second operand
to two 32-bit signed integer values, and writes the converted values into the first operand. If the result
of either conversion is an inexact value, the value is truncated (rounded toward zero).
As described in “Floating-Point Data Types” on page 205, PF2IW and PF2ID do not fully comply with
the IEEE-754 standard. Conversion of some source operands of the C type float (IEEE-754 single-
precision)—specifically NaNs, infinities, and denormals—are not supported. Attempts to convert such
source operands produce undefined results, and no exceptions are generated.
5.7.3 Arithmetic
The floating-point vector-arithmetic instructions perform an arithmetic operation on two floating-
point operands. For a description of 3DNow! instruction saturation on overflow and underflow
conditions, see “Floating-Point Data Types” on page 205.
Addition
PFADD—Packed Floating-Point Add
The PFADD instruction adds each single-precision floating-point value in the first operand (an MMX
register) to the corresponding single-precision floating-point value in the second operand (an MMX
register or 64-bit memory location). The instruction then writes the result of each addition into the
corresponding doubleword of the destination.
Subtraction
PFSUB—Packed Floating-Point Subtract
PFSUBR—Packed Floating-Point Subtract Reverse
The PFSUB instruction subtracts each single-precision floating-point value in the second operand
from the corresponding single-precision floating-point value in the first operand. The instruction then
writes the result of each subtraction into the corresponding quadword of the destination.
The PFSUBR instruction performs a subtraction that is the reverse of the PFSUB instruction. It
subtracts each value in the first operand from the corresponding value in the second operand. The
provision of both the PFSUB and PFSUBR instructions allows software to choose which source
operand to overwrite during a subtraction.
Multiplication
PFMUL—Packed Floating-Point Multiply
The PFMUL instruction multiplies each of the two single-precision floating-point values in the first
operand by the corresponding single-precision floating-point value in the second operand and writes
the result of each multiplication into the corresponding doubleword of the destination.