3-178
INSTRUCTION SET REFERENCE
FCMOVccFloating-Point Conditional Move
Description
This instruction tests the status flags in the EFLAGS register and moves the source operand
(second operand) to the destination operand (first operand) if the given test condition is true. The
conditions for each mnemonic are given in the Description column above and in Table 6-4 in
Chapter 6, Instruction Set Summary of the Intel Architecture Software Developers Manual,
Volume 1. The source operand is always in the ST(i) register and the destination operand is
always ST(0).
The FCMOVcc instructions are useful for optimizing small IF constructions. They also help
eliminate branching overhead for IF operations and the possibility of branch mispredictions by
the processor.
A processor may not support the FCMOVcc instructions. Software can check if the FCMOVcc
instructions are supported by checking the processors feature information with the CPUID
instruction (refer to COMISSScalar Ordered Single-FP Compare and Set EFLAGS in this
chapter). If both the CMOV and FPU feature bits are set, the FCMOVcc instructions are
supported.
Intel Architecture Compatibility
The FCMOVcc instructions were introduced to the Intel Architecture in the Pentium
®
Pro
processor family and is not available in earlier Intel Architecture processors.
Operation
IF condition TRUE
ST(0)
<
ST(i)
FI;
FPU Flags Affected
C1
Set to 0 if stack underflow occurred.
C0, C2, C3
Undefined.
Opcode
Instruction
Description
DA C0+i
FCMOVB ST(0), ST(i)
Move if below (CF=1)
DA C8+i
FCMOVE ST(0), ST(i)
Move if equal (ZF=1)
DA D0+i
FCMOVBE ST(0), ST(i)Move if below or equal (CF=1 or ZF=1)
DA D8+i
FCMOVU ST(0), ST(i)Move if unordered (PF=1)
DB C0+i
FCMOVNB ST(0), ST(i)Move if not below (CF=0)
DB C8+i
FCMOVNE ST(0), ST(i)Move if not equal (ZF=0)
DB D0+i
FCMOVNBE ST(0), ST(i)Move if not below or equal (CF=0 and ZF=0)
DB D8+i
FCMOVNU ST(0), ST(i)Move if not unordered (PF=0)