7-37
FLOATING-POINT UNIT
The FICOM and FICOMP instructions also operate the same as the FCOM and FCOMP instruc-
tions, except that the source operand is an integer value in memory. The integer value is auto-
matically converted into an extended real value prior to making the comparison. The FICOMP
instruction pops the FPU register stack following the comparison operation.
The FTST instruction performs the same operation as the FCOM instruction, except that the
value in register ST(0) is always compared with the value 0.0.
The FCOMI and FCOMIP instructions are new in the Intel Pentium
®
Pro processor. They
perform the same comparison as the FCOM and FCOMP instructions, except that they set the
status flags (ZF, PF, and CF) in the EFLAGS register to indicate the results of the comparison
(refer to Table 7-16) instead of the FPU condition code flags. The FCOMI and FCOMIP instruc-
tions allow condition branch instructions (Jcc) to be executed directly from the results of their
comparison.
The FUCOMI and FUCOMIP instructions operate the same as the FCOMI and FCOMIP
instructions, except that they do not generate a floating-point invalid operation exception if the
unordered condition is the result of one or both of the operands being a QNaN. The FCOMIP
and FUCOMIP instructions pop the FPU register stack following the comparison operation.
The FXAM instruction determines the classification of the real value in the ST(0) register (that
is, whether the value is zero, a denormal number, a normal finite number,
?
, a NaN, or an unsup-
ported format) or that the register is empty. It sets the FPU condition code flags to indicate the
classification (refer to FXAMExamine in Chapter 3, Instruction Set Reference, of the Intel
Architecture Software Developers Manual, Volume 2). It also sets the C1 flag to indicate the sign
of the value.
Table 7-15. Setting of FPU Condition Code Flags for Real Number Comparisons
Condition
C3
C2
C0
ST(0) > Source Operand
0
0
0
ST(0) < Source Operand
0
0
1
ST(0) = Source Operand
1
0
0
Unordered
1
1
1
Table 7-16. Setting of EFLAGS Status Flags for Real Number Comparisons
Comparison Results
ZF
PF
CF
ST0 > ST(i)
0
0
0
ST0 < ST(i)
0
0
1
ST0 = ST(i)
1
0
0
Unordered
1
1
1