Extensions
Mnemonics
CMOVO, CMOVNO, CMOVB, CMOVC, CMOVNAE, CMOVNB, CMOVNC, CMOVAE, CMOVZ, CMOVE, CMOVNZ, CMOVNE, CMOVBE, CMOVNA, CMOVNBE, CMOVA, CMOVS, CMOVNS, CMOVP, CMOVPE, CMOVNP, CMOVPO, CMOVL, CMOVNGE, CMOVNL, CMOVGE, CMOVLE, CMOVNG, CMOVNLE, CMOVG
Forms
4 (2 Legacy, 2 EVEX)
Data
Intel XED v2026.08.23

CMOVcc copies its source to a register only when a condition on the flags holds, so code can pick one of two values without a branch. The condition codes are those of Jcc and SETcc, and the CMP page shows which to use for signed and unsigned comparisons. GCC 14 and Clang 23 at -O2 compile a < b ? c : a to a MOV, a CMP and a CMOVL or CMOVGE (depending on which value each moves first), and both round a signed division by 8 toward zero with lea rax, [rdi + 7], test rdi, rdi, cmovns rax, rdi and sar rax, 3.

Branch or CMOVcc

A branch lets the processor guess the outcome and go on; CMOVcc instead makes its result wait for both values and the flags. Intel’s optimization manual therefore recommends CMOVcc only for branches that are hard to predict, and advises against it for predictable ones (Section 3.4.1.1, Coding Rule 2).

What it cannot do

  • Skip a memory access. The source is read whether or not the condition holds, so a load that is only safe when the condition is true still faults when it is false. Both compilers therefore compile c ? *p : 0 to a branch around the load. APX’s CFCMOVcc suppresses the access and its faults.
  • Store. The destination is always a register; a conditional store needs a branch, or CFCMOVcc again.
  • Bytes and constants. The forms are 16, 32 and 64 bits wide, and the source is a register or memory, so choosing between two constants first puts one of them in a register.
  • Leave a 32-bit register alone. A 32-bit CMOVcc clears bits 63:32 of its destination even when the condition is false, so it is never a no-op on a 64-bit value.

Availability and APX

CMOV arrived with Intel’s P6 family and has its own CPUID bit, but every x86-64 processor has it, so 64-bit code uses it without a check. APX adds a form with a new destination, CMOVcc r1, r2, r3/m, which writes r3 to r1 when the condition holds and r2 otherwise: a select that keeps both sources. Its memory operand, too, is read either way.

In the optimization guide

What the optimization guide says about CMOVcc, a line per claim. Each links to the claim in the guide, with its sources and where they differ.

Branches

  • CMOV and branchless code: CMOVcc and SETcc replace a branch with a data dependence: nothing can be mispredicted, but the result waits for the condition and for both inputs, and the core can no longer run ahead on a guessed path.
  • CMOV and branchless code: Branchless code wins when the work it adds costs fewer cycles than the branch it removes costs on average.
  • CMOV and branchless code: A CMOV with a memory source always reads it, and may fault on it, even when the condition is false, so it cannot replace a branch that guards a load from a pointer that may be invalid.
  • CMOV and branchless code: LLVM 23.1.2 turns CMOVs back into branches where a branch is likely faster.

Haswell and Broadwell

  • What Broadwell changed: A micro-op of Haswell’s reads three inputs only for FMA, so ADC, SBB and CMOV, which read two registers and the flags, are two micro-ops each; Broadwell makes them one, though stores and blends stay at two.

Vulnerability mitigations

Mitigations of these processor vulnerabilities use CMOVcc:

Forms

Every encoding of CMOVcc that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
CMOVcc r16/32/64, m16/32/64 CMOVcc_GPRv_MEMv0F 40+cc /rCMOV
CMOVcc r16/32/64, r16/32/64 CMOVcc_GPRv_GPRv0F 40+cc /rCMOV
CMOVcc r16/32/64, r16/32/64, r16/32/64 NDD CMOVcc_GPRv_GPRv_GPRv_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 40+cc /r ND=1APX_F + APX_NCI_NDD_NF
CMOVcc r16/32/64, r16/32/64, m16/32/64 NDD CMOVcc_GPRv_GPRv_MEMv_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 40+cc /r ND=1APX_F + APX_NCI_NDD_NF

Latency and throughput

What the scheduling models of LLVM 23.1.2 give for each form, not measurements: latency / reciprocal throughput in cycles, the ports under them. A row is a model, or models that agree; a dash, a form that its processors lack. Memory forms: latency from the address, ports without the load and store units. Which processors each model covers.
Modelr16, m16
r32, m32
r64, m64
r16, m16CMOVBE, CMOVNBE
r32, m32CMOVBE, CMOVNBE
r64, m64CMOVBE, CMOVNBE
r16, r16
r32, r32
r64, r64
r16, r16CMOVBE, CMOVNBE
r32, r32CMOVBE, CMOVNBE
r64, r64CMOVBE, CMOVNBE
Sandy Bridge7 / 0.67p0158 / 1p0152 / 0.67p0153 / 1p015
Haswell7 / 0.5p01568 / 0.75p01562 / 0.5p01563 / 0.75p0156
Broadwell6 / 0.5p067 / 0.5p01561 / 0.5p062 / 0.5p0156
Skylake, Skylake-SP, Ice Lake6 / 0.5p067 / 1p061 / 0.5p062 / 1p06
Alder Lake, Sapphire Rapids7 / 0.5p067 / 0.5p061 / 0.5p061 / 0.5p06
Lunar Lake5 / 1.33p0123455 / 1.33p0123451 / 0.17p0123451 / 0.17p012345
Bonnell1 / 1p01 / 1p01 / 0.5p011 / 0.5p01
Silvermont5 / 1IEC0 IEC1 MEC5 / 1IEC0 IEC1 MEC2 / 1IEC0 IEC12 / 1IEC0 IEC1
Piledriver5 / 1.5EX0 EX15 / 1.5EX0 EX11 / 0.5EX0 EX11 / 0.5EX0 EX1
Zen5 / 0.5ALU0 ALU1 ALU2 ALU35 / 0.5ALU0 ALU1 ALU2 ALU31 / 0.25ALU0 ALU1 ALU2 ALU31 / 0.25ALU0 ALU1 ALU2 ALU3
Zen 25 / 0.33ALU0 ALU1 ALU2 ALU35 / 0.33ALU0 ALU1 ALU2 ALU31 / 0.25ALU0 ALU1 ALU2 ALU31 / 0.25ALU0 ALU1 ALU2 ALU3
Zen 3, Zen 45 / 0.5ALU0 ALU35 / 0.5ALU0 ALU31 / 0.5ALU0 ALU31 / 0.5ALU0 ALU3
Jaguar4 / 1ALU0 ALU14 / 1ALU0 ALU11 / 0.5ALU0 ALU11 / 0.5ALU0 ALU1

Operation

What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.

Legacy forms
v = src.read()                   # memory is read, and can fault, even
                                 # when the condition is false
r = v if cond(CC) else dest
dest.write(r)                    # a 32-bit register gets bits 63:32
                                 # cleared either way

Run on AMD Zen 5 (EPYC 9645): 144 cases.

EVEX forms
a = src1.read()
b = src2.read()                  # memory is read, and can fault, even
                                 # when the condition is false
r = b if cond(CC) else a
dest.write(r)                    # the new destination: bits 63:OSIZE
                                 # cleared, even for 16 bits

Not run on a processor: none of these processors has APX.

Operands

What each form reads and writes, as Intel XED records it: the operands of its syntax, in order, and the implicit ones that the syntax does not name. How to read.
OperandKindAction
CMOVcc r16/32/64, r/m16/32/64
r16/32/64explicitconditional write
r/m16/32/64explicitread
RFLAGSimplicitread
CMOVcc r16/32/64, r16/32/64, r/m16/32/64 NDD
r16/32/64explicitwrite
r16/32/64explicitread
r/m16/32/64explicitread
RFLAGSimplicitread

Flags

T tested; blank: not affected. How to read.
WhenOFSFZFPFCF
All forms
CMOVOT
CMOVNOT
CMOVBT
CMOVNBT
CMOVZT
CMOVNZT
CMOVBETT
CMOVNBETT
CMOVST
CMOVNST
CMOVPT
CMOVNPT
CMOVLTT
CMOVNLTT
CMOVLETTT
CMOVNLETTT

Exceptions

The exception class is XED's name for the set of exception conditions that a form follows. How to read.

Legacy forms
none in XED
EVEX forms
APX-EVEX-INT

CPUID and processors

Each form belongs to an XED ISA set. A form can be used when the processor reports every CPUID bit of one of its ISA set's alternatives.

CPUID requirements and processors of the XED ISA sets above. Alternatives are separated by “or”; processors follow XED’s chip model, whose AMD processors end with Zen 2, and the CPU data of this site for Zen 3 to Zen 6.
ISA setCPUIDProcessors
CMOV

CMOV
CPUID.01H:EDX[15] CMOV

Every x86-64 processor in XED’s model and Zen 3 to Zen 6
APX_F_N3

APX_F + APX_NCI_NDD_NF
CPUID.(EAX=07H,ECX=1):EDX[21] APX_F
CPUID.(EAX=29H,ECX=0):EBX[0] APX_NCI_NDD_NF

Nova Lake, Diamond Rapids

More APX instructions

All 88 APX instructions

Sources

  1. Intel XED v2026.08.23 (commit 0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model.
  2. The CPU data of x86-64.net: Zen 3 to Zen 6, from GCC’s -march feature sets and AMD’s Processor Programming References, which the page of each processor cites.
  3. LLVM 23.1.2's x86 scheduling models (commit 85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them.
  4. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2A, page 3-157 (CMOVcc)
  5. Intel Advanced Performance Extensions (Intel APX) Architecture Specification, revision 9.0 (355828-009, August 2026)
  6. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 1 (253665-093, September 2026)
  7. AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and System Instructions (24594, rev. 3.39, October 2026)
  8. Intel 64 and IA-32 Architectures Optimization Reference Manual, Volume 1 (248966-051, October 2026)

The tables are derived from Intel XED, Copyright Intel Corporation, licensed under the Apache License 2.0; x86-64.net converted and reformatted them. The timings come from LLVM's scheduling models, part of the LLVM Project, licensed under the Apache License 2.0 with LLVM Exceptions. The text is our own.