FUCOM Unordered compare real Exceptions: I D S FUCOMP Unordered compare real and pop C3 C2 C1 C0: * * * * FUCOMPP Unordered compare real and pop twice FPU: 387+
FUCOM [source] FUCOMP [source] FUCOMPP
Logic ; FUCOM ; FUCOMP ; FUCOMPP if source operand if source operand CMP ST, ST(1) CMP ST, ST(i) CMP ST, ST(i) set condition codes else else pop ST CMP ST, ST(1) CMP ST, ST(1) pop ST endif endif set condition codes set condition codes pop ST
C3 C1 C0 0 0 0 ST > source 0 0 1 ST < source 1 0 0 ST = source 1 1 1 unordered
FUCOM compares two registers and leaves the result encoded in the status word as shown above. If no source is specified, ST(1) is compared to ST. Otherwise, the source register is compared to ST.
FUCOMP does what FUCOM does, and then pops the stack.
FUCOMPP compares ST and ST(1), leaves the result encoded in the status word as shown above, and pops the stack twice.
The FUCOM instructions perform the same operation as the FCOM instructions. The only difference is that the FUCOM instruction raises the invalid-arithmetic-operand exception (#IA) only when either or both operands is an SNaN or is in an unsupported format; QNaNs cause the condition code flags to be set to unordered, but do not cause an exception to be generated. The FCOM instruction raises an invalid-operation exception when either or both of the operands is a NaN value of any kind or is in an unsupported format.
Opcode Format DD E0 + i FUCOM ST(i) DD E1 FUCOM DD E8 + i FUCOMP ST(i) DD E9 FUCOMP DD EA FUCOMPP
Timing Variations 8087 287 387 486 Pentium fucom - - 24 4 4/1 FX fucomp - - 26 4 4/1 FX fucompp - - 26 5 4/1 FX