Extensions
Forms
2 (2 Legacy)
Data
Intel XED v2026.08.23

CMPPS compares the four singles of its first operand with those of the second and replaces each element of the first with all ones where the predicate holds and zero where it does not. The immediate chooses the predicate, and the legacy form reads only its bits 2:0, which give the eight below; a, the first operand, stands on the left of each relation. VCMPPS adds 24 predicates with bits 3 and 4 and can write a mask register; CMPPD, CMPSS and CMPSD use the same eight codes for doubles and single elements.

The eight predicates

ImmMnemonicTrue whenNaN givesQNaN sets IE
0CMPEQPSa = bfalseno
1CMPLTPSa < bfalseyes
2CMPLEPSa <= bfalseyes
3CMPUNORDPSa or b is NaNtrueno
4CMPNEQPSnot a = btrueno
5CMPNLTPSnot a < btrueyes
6CMPNLEPSnot a <= btrueyes
7CMPORDPSneither is NaNfalseno

A signaling NaN sets IE under every predicate. The negations are not the reversed relations: NLT differs from “greater or equal” exactly where a NaN makes the result true. There is no greater-than code: _mm_cmpgt_ps(a, b) compiles in our builds to cmpltps xmm1, xmm0, b first, and a MOVAPS back to XMM0, as the result replaces the first operand. The other legacy traits apply too: bits 128 and up stay (see SSE and AVX) and a memory operand must be aligned to 16 bytes.

On Zen 5

  • cmpps xmm4, xmm4, 0x8 acted as predicate 0: a quiet NaN compared unequal to itself and set no flag, where VCMPPS’s predicate 8 would have returned true.
  • cmpps xmm7, xmm11, 0x3, unordered, set DE for denormal inputs as well as IE for a signaling NaN; cmpps xmm8, xmm15, 0x7, ordered, set DE alone.
  • With IE unmasked, cmpps xmm0, xmm13, 0x5 set IE, raised #XM for a signaling NaN and left XMM0 as it was.

In baseline code

In our builds at -O2 for the default target, Clang 23 vectorizes compares over float arrays with CMPPS: < as CMPLTPS, > as CMPLTPS with the operands swapped, >= as CMPLEPS swapped, == as CMPEQPS, != as CMPNEQPS, and isnan(x) and isunordered as CMPUNORDPS. A select between two values adds ANDPS, ANDNPS and ORPS, or one BLENDVPS with -march=x86-64-v2. Like VCMPPS’s loops, isless used the signaling CMPLTPS. GCC 14 kept the same loops scalar, with COMISS and UCOMISS.

Forms

Every encoding of CMPPS that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
CMPPS xmm, m128, imm8 CMPPS_XMMps_MEMps_IMMbNP 0F C2 /r ibSSE
CMPPS xmm, xmm, imm8 CMPPS_XMMps_XMMps_IMMbNP 0F C2 /r ibSSE

Data flow

Where the elements of the sources go, element 0 on the right; results that depend on a control value are drawn for an example. How to read.

Element-wise: each single of the result comes from the single in the same place in each source.
CMPPS: element by elementResult single i comes from single i of xmm1 and xmm2. Result singles 3 to 0: r3, r2, r1, r0.0123xmm1ar0r1r2r3xmm10123xmm2or m128b

Result single i comes from single i of xmm1 and xmm2. Result singles 3 to 0: r3, r2, r1, r0.

Operation

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

for i in range(4):
    a = xmm1.f32[i]
    b = src2.f32[i]
    if fcmp(imm8 & 7, a, b):
        xmm1.d[i] = -1
    else:
        xmm1.d[i] = 0
# imm8 & 7: 0 ==, 1 <, 2 <=, 3 unordered, 4 !=, 5 !<, 6 !<=, 7 ordered
# bits 128 and up of the register are unchanged

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

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
CMPPS xmm, xmm/m128, imm8
xmmexplicitread, write
xmm/m128explicitread
imm8explicitread

Flags

None: XED records no flag that the forms test or change.

Exceptions

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

All forms
SSE_TYPE_2

Attributes

What else XED records about the forms. How to read.

All forms
follows MXCSR
Memory forms
aligned memory operand

Intrinsics

The C intrinsics of Clang 23.1.2 that compile to CMPPS, each with the form it compiles to and the Clang options it needs. The forms come from compiling every intrinsic and decoding the result with Intel XED; all intrinsics A–Z explains the method.

IntrinsicCompiles to
_mm_cmp_ps __m128 _mm_cmp_ps(__m128 a, __m128 b, const int c)

CMPPS xmm, xmm, imm8 Legacy -msse

_mm_cmpeq_ps __m128 _mm_cmpeq_ps(__m128 __a, __m128 __b)

CMPPS xmm, xmm, imm8 Legacy -msse

_mm_cmpge_ps __m128 _mm_cmpge_ps(__m128 __a, __m128 __b)

CMPPS xmm, xmm, imm8 Legacy -msse

_mm_cmpgt_ps __m128 _mm_cmpgt_ps(__m128 __a, __m128 __b)

CMPPS xmm, xmm, imm8 Legacy -msse

_mm_cmple_ps __m128 _mm_cmple_ps(__m128 __a, __m128 __b)

CMPPS xmm, xmm, imm8 Legacy -msse

_mm_cmplt_ps __m128 _mm_cmplt_ps(__m128 __a, __m128 __b)

CMPPS xmm, xmm, imm8 Legacy -msse

_mm_cmpneq_ps __m128 _mm_cmpneq_ps(__m128 __a, __m128 __b)

CMPPS xmm, xmm, imm8 Legacy -msse

_mm_cmpnge_ps __m128 _mm_cmpnge_ps(__m128 __a, __m128 __b)

CMPPS xmm, xmm, imm8 Legacy -msse

_mm_cmpngt_ps __m128 _mm_cmpngt_ps(__m128 __a, __m128 __b)

CMPPS xmm, xmm, imm8 Legacy -msse

_mm_cmpnle_ps __m128 _mm_cmpnle_ps(__m128 __a, __m128 __b)

CMPPS xmm, xmm, imm8 Legacy -msse

_mm_cmpnlt_ps __m128 _mm_cmpnlt_ps(__m128 __a, __m128 __b)

CMPPS xmm, xmm, imm8 Legacy -msse

_mm_cmpord_ps __m128 _mm_cmpord_ps(__m128 __a, __m128 __b)

CMPPS xmm, xmm, imm8 Legacy -msse

_mm_cmpunord_ps __m128 _mm_cmpunord_ps(__m128 __a, __m128 __b)

CMPPS xmm, xmm, imm8 Legacy -msse

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
SSE

SSE
CPUID.01H:EDX[25] SSE

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

More SSE instructions

All 65 SSE 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. Clang's x86 intrinsic headers, LLVM 23.1.2 (commit 85ac56026243): the intrinsics, their signatures and doc comments, and the Clang of that release, which compiled each of them.
  4. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2A, page 3-175 (CMPPS)
  5. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 1 (253665-093, September 2026)
  6. AMD64 Architecture Programmer's Manual, Volume 4: 128-Bit and 256-Bit Media Instructions (26568, rev. 3.25, November 2021), Wayback Machine copy of AMD's PDF

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 intrinsics and their signatures come from Clang, part of the LLVM Project, licensed under the Apache License 2.0 with LLVM Exceptions. The text is our own.