FCMOV is a floating point conditional move opcode of the Intel x86 architecture, first introduced in Pentium Pro processors. In computer technology an opcode ( op eration code) is the portion of a Machine language instruction that specifies the operation to be performed See also X86 assembly language The generic term x86 refers to the most commercially successful Instruction set architecture in the history of Personal The Pentium Pro is a sixth-generation X86 -based Microprocessor developed and manufactured by Intel introduced in November 1995 It copies the contents of one of the floating point stack register, depending on the contents of EFLAGS integer flag register, to the ST(0) (top of stack) register. This article discusses the flag register specific to the x86 architecture There are 8 variants of the instruction, differing by the condition codes that need be set for the instruction to perform the move.
Similarly to the CMOV instruction, FCMOV allows to perform some conditional operations without the usual branching overhead. A branch (or jump on some Computer architectures, such as the PDP-8 and Intel x86) is a point in a Computer program where the [1] However, it has a higher latency than conditional branch instructions. Latency is a time delay between the moment something is initiated and the moment one of its effects begins or becomes detectable [2] Therefore, it is most useful for simple, but unpredictable comparison or conditional operations, where it can provide substantial performance gains.
The instruction is usually used with the FCOMI instruction or the FCOM-FSTSW-SAHF idiom to set the relevant conditions codes based on the result of a floating point comparison.
This table shows the variants of the FCMOV instructions. [1] In the Opcode column, i denotes the number of the floating point stack register used as the second operand (the first is always the ST(o) register - the top of the stack). Add it to the given number to obtain the corresponding opcode.
| Opcode | Mnemonic | Meaning | Condition |
|---|---|---|---|
| DA C0+i | FCMOVB | Move if below | Carry flag set |
| DA C8+i | FCMOVE | Move if equal | Zero flag set |
| DA D0+i | FCMOVBE | Move if below or equal | Carry flag or Zero flag set |
| DA D8+i | FCMOVU | Move if unordered | Parity flag set |
| DB C0+i | FCMOVNB | Move if not below | Carry flag cleared |
| DB C8+i | FCMOVNE | Move if not equal | Zero flag cleared |
| DB D0+i | FCMOVNBE | Move if not below or equal | Carry flag and Zero flag cleared |
| DB D8+i | FCMOVNU | Move if not unordered | Parity flag cleared |