![Intel ITANIUM ARCHITECTURE Manual Download Page 122](http://html.mh-extra.com/html/intel/itanium-architecture/itanium-architecture_manual_2073403122.webp)
Volume 4: Base IA-32 Instruction Reference
4:115
FCOMI/FCOMIP/
FUCOMI/FUCOMIP—Compare Real and Set EFLAGS
Description
Compares the contents of register ST(0) and ST(
i
) and sets the status flags ZF, PF, and
CF in the EFLAGS register according to the results (see the table below). The sign of
zero is ignored for comparisons, so that -0.0 = +0.0.
The FCOMI/FCOMIP instructions perform the same operation as the FUCOMI/FUCOMIP
instructions. The only difference is how they handle QNaN operands. The
FCOMI/FCOMIP instructions set the status flags to “unordered” and generate an
invalid-arithmetic-operand exception (#IA) when either or both of the operands is a
NaN value (SNaN or QNaN) or is in an unsupported format.
The FUCOMI/FUCOMIP instructions perform the same operation as the FCOMI/FCOMIP
instructions, except that they do not generate an invalid-arithmetic-operand exception
for QNaNs.
If invalid-operation exception is unmasked, the status flags are not set if the
invalid-arithmetic-operand exception is generated.
The FCOMIP and FUCOMIP instructions also pop the register stack following the
comparison operation. To pop the register stack, the processor marks the ST(0) register
as empty and increments the stack pointer (TOP) by 1.
Opcode
Instruction
Description
DB F0+i
FCOMI ST, ST(
i
)
Compare ST(0) with ST(
i
) and set status flags accordingly
DF F0+i
FCOMIP ST, ST(
i
)
Compare ST(0) with ST(
i
), set status flags accordingly, and pop
register stack
DB E8+i
FUCOMI ST, ST(
i
)
Compare ST(0) with ST(
i
), check for ordered values, and set
status flags accordingly
DF E8+i
FUCOMIP ST, ST(
i
)
Compare ST(0) with ST(
i
), check for ordered values, set status
flags accordingly, and pop register stack
Comparison Results
ZF
PF
CF
ST0 > ST(
i
)
0
0
0
ST0 < ST(
i
)
0
0
1
ST0 = ST(
i
)
1
0
0
Unordered
a
a. Flags not set if unmasked invalid-arithmetic- operand
(#IA) exception is generated.
1
1
1
Summary of Contents for ITANIUM ARCHITECTURE
Page 1: ......
Page 7: ...402 Intel Itanium Architecture Software Developer s Manual Rev 2 3 ...
Page 199: ...4 192 Volume 4 Base IA 32 Instruction Reference FWAIT Wait See entry for WAIT ...
Page 352: ...Volume 4 Base IA 32 Instruction Reference 4 345 ROL ROR Rotate See entry for RCL RCR ROL ROR ...
Page 589: ...4 582 Volume 4 IA 32 SSE Instruction Reference ...
Page 590: ...Index Intel Itanium Architecture Software Developer s Manual Rev 2 3 Index ...
Page 591: ...Index Intel Itanium Architecture Software Developer s Manual Rev 2 3 ...
Page 603: ...INDEX Index 12 Index for Volumes 1 2 3 and 4 ...
Page 604: ......