AMD amd64 architecture User Manual

Page of 336
228
64-Bit Media Programming
AMD64 Technology
24592—Rev. 3.15—November 2009
The PFRSQRT instruction can be used together with the PFRSQIT1 instruction and the PFRCPIT2
instruction (described in “Reciprocal Estimation” on page 227) to increase the accuracy of a single-
precision significand.
5.7.4 Compare
The floating-point vector-compare instructions compare two operands, and they either write a mask or
they write the maximum or minimum value.
Compare and Write Mask
PFCMPEQ—Packed Floating-Point Compare Equal
PFCMPGT—Packed Floating-Point Compare Greater Than
PFCMPGE—Packed Floating-Point Compare Greater or Equal
The PFCMPx instructions compare each of the two single-precision floating-point values in the first
operand with the corresponding single-precision floating-point value in the second operand. The
instructions then write the result of each comparison into the corresponding doubleword of the
destination. If the comparison test (equal, greater than, greater or equal) is true, the result is a mask of
all 1s. If the comparison test is false, the result is a mask of all 0s.
Compare and Write Minimum or Maximum
PFMAX—Packed Floating-Point Maximum
PFMIN—Packed Floating-Point Minimum
The PFMAX and PFMIN instructions compare each of the two single-precision floating-point values
in the first operand with the corresponding single-precision floating-point value in the second operand.
The instructions then write the maximum (PFMAX) or minimum (PFMIN) of the two values for each
comparison into the corresponding doubleword of the destination.
The PFMIN and PFMAX instructions are useful for clamping, such as color clamping in 3D geometry
and rasterization. They can also be used to avoid branching.
5.8
Instruction Effects on Flags
The 64-bit media instructions do not read or write any flags in the rFLAGS register, nor do they write
any exception-status flags in the x87 status-word register, nor is their execution dependent on any
mask bits in the x87 control-word register. The only x87 state affected by the 64-bit media instructions
is described in “Actions Taken on Executing 64-Bit Media Instructions” on page 232.
5.9
Instruction Prefixes
Instruction prefixes, in general, are described in “Instruction Prefixes” on page 71. The following
restrictions apply to the use of instruction prefixes with 64-bit media instructions.