Extensions
Mnemonics
CCMPO, CCMPNO, CCMPB, CCMPC, CCMPNAE, CCMPNB, CCMPNC, CCMPAE, CCMPZ, CCMPE, CCMPNZ, CCMPNE, CCMPBE, CCMPNA, CCMPNBE, CCMPA, CCMPS, CCMPNS, CCMPT, CCMPF, CCMPL, CCMPNGE, CCMPNL, CCMPGE, CCMPLE, CCMPNG, CCMPNLE, CCMPG
Forms
12 (12 EVEX)
Data
Intel XED v2026.08.23

CCMPscc lets a compiler evaluate a chain of comparisons such as a == 1 && b > c without a branch per term. The source condition (scc, one of the usual condition codes) is tested against the current flags:

  • If it holds, the instruction is an ordinary CMP and sets the flags from the comparison.
  • If it does not, the comparison is skipped. OF, SF, ZF and CF are set from the four-bit default flags value (dfv) in the instruction, PF is set equal to CF, and AF is cleared.

Two extra condition codes replace the parity conditions: T (always true) makes CCMPT an ordinary compare, and F (always false) sets the flags to dfv unconditionally. A memory operand may fault even when the condition is false. CTESTscc is the same idea for TEST.

Forms

Every encoding of CCMPscc that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
CCMPscc {dfv} r8, r8 CCMPscc_GPR8i8_GPR8i8_DFV_APX_N3EVEX.LLZ.NP.MAP4.WIG 38 /r SC=scc
EVEX.LLZ.NP.MAP4.WIG 3A /r SC=scc
APX_F + APX_NCI_NDD_NF
CCMPscc {dfv} m8, r8 CCMPscc_MEMi8_GPR8i8_DFV_APX_N3EVEX.LLZ.NP.MAP4.WIG 38 /r SC=sccAPX_F + APX_NCI_NDD_NF
CCMPscc {dfv} r16/32/64, imm8 CCMPscc_GPRv_IMM8_DFV_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 83 /7 ib SC=sccAPX_F + APX_NCI_NDD_NF
CCMPscc {dfv} m16/32/64, imm8 CCMPscc_MEMv_IMM8_DFV_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 83 /7 ib SC=sccAPX_F + APX_NCI_NDD_NF
CCMPscc {dfv} r16/32/64, r16/32/64 CCMPscc_GPRv_GPRv_DFV_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 39 /r SC=scc
EVEX.LLZ.NP.MAP4.SCALABLE 3B /r SC=scc
APX_F + APX_NCI_NDD_NF
CCMPscc {dfv} m16/32/64, r16/32/64 CCMPscc_MEMv_GPRv_DFV_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 39 /r SC=sccAPX_F + APX_NCI_NDD_NF
CCMPscc {dfv} r8, m8 CCMPscc_GPR8i8_MEMi8_DFV_APX_N3EVEX.LLZ.NP.MAP4.WIG 3A /r SC=sccAPX_F + APX_NCI_NDD_NF
CCMPscc {dfv} r16/32/64, m16/32/64 CCMPscc_GPRv_MEMv_DFV_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 3B /r SC=sccAPX_F + APX_NCI_NDD_NF
CCMPscc {dfv} r8, imm8 CCMPscc_GPR8i8_IMM8_DFV_APX_N3EVEX.LLZ.NP.MAP4.WIG 80 /7 ib SC=sccAPX_F + APX_NCI_NDD_NF
CCMPscc {dfv} m8, imm8 CCMPscc_MEMi8_IMM8_DFV_APX_N3EVEX.LLZ.NP.MAP4.WIG 80 /7 ib SC=sccAPX_F + APX_NCI_NDD_NF
CCMPscc {dfv} r16/32/64, imm16/32 CCMPscc_GPRv_IMMz_DFV_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 81 /7 iw/id SC=sccAPX_F + APX_NCI_NDD_NF
CCMPscc {dfv} m16/32/64, imm16/32 CCMPscc_MEMv_IMMz_DFV_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 81 /7 iw/id SC=sccAPX_F + APX_NCI_NDD_NF

Operation

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

a = src1.read()                  # memory is read, and can fault, even
b = sext(src2)                   # when the condition is false
if cond(CC):
    flags = sub_flags(a, b)      # as CMP src1, src2
else:
    of = dfv >> 3 & 1            # the flags of {dfv}
    sf = dfv >> 2 & 1
    zf = dfv >> 1 & 1
    cf = dfv & 1
    pf = dfv & 1                 # PF as CF
    af = 0

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
CCMPscc {dfv} r/m8, r8 CCMPscc {dfv} r/m16/32/64, r16/32/64
r/m8/16/32/64explicitread
r8/16/32/64explicitread
RFLAGSimplicitwrite
CCMPscc {dfv} r/m8, imm8 CCMPscc {dfv} r/m16/32/64, imm8 CCMPscc {dfv} r/m16/32/64, imm16/32
r/m8/16/32/64explicitread
imm8/16/32explicitread
RFLAGSimplicitwrite
CCMPscc {dfv} r8, m8 CCMPscc {dfv} r16/32/64, m16/32/64
r8/16/32/64explicitread
m8/16/32/64explicitread
RFLAGSimplicitwrite

Flags

M modified; blank: not affected. How to read.
OFSFZFAFPFCF
All forms
MMMMMM

Exceptions

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

All forms
APX-EVEX-CCMP

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
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. Intel Advanced Performance Extensions (Intel APX) Architecture Specification, revision 9.0 (355828-009, August 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 text is our own.