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

VCMPSH compares the low halves of its two sources under one of the 32 predicates of VCMPPS, chosen by bits 4:0 of the immediate, and writes the result to bit 0 of a mask register, clearing the others; a write mask with bit 0 clear forces the result to 0. It is the scalar form of VCMPPH and, like the EVEX form of VCMPSS, has only a mask destination. The encoding is C2h with the F3 prefix in the 0F3A map; the second source is an xmm register or two bytes of memory, and {sae} keeps the compare from reporting invalid or denormal. VADDPH covers the format and the CPUID bits.

Selects and the comi intrinsics

A mask bit feeds a masked move, so compilers use VCMPSH for a choice between two halves. At -O2 with -march=x86-64-v4 -mavx512fp16, Clang 23 compiles x < y ? p : q on _Float16 values to vcmpltsh k1, xmm0, xmm1 and a merge-masked VMOVSH, and x == y ? p : q the same way with the equal predicate. GCC 14 uses VCMPSH for the first too, with the inverted predicate 5, not less than, so that the masked move picks q; for the equality it tests the flags of VUCOMISH and branches. Clang’s fminf16 on halves uses VCMPSH with the unordered predicate to catch a NaN first argument, as VMINSH’s page shows.

A plain x < y returned as an integer goes to the flags instead, as VCOMISH’s page shows. The intrinsics named after COMISH do not: _mm_comi_sh(x, y, _CMP_LT_OS) and _mm_cmp_sh_mask(x, y, _CMP_NEQ_UQ) both become VCMPSH into K0, with predicates 1 and 4, and a KMOV of the bit to a general-purpose register.

AMD’s Zen 5 guide does not list AVX512-FP16, and this site’s recorded cases include none of VCMPSH.

Forms

Every encoding of VCMPSH that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
VCMPSH k {k}, xmm, xmm, imm8, {sae} VCMPSH_MASKmskw_MASKmskw_XMMf16_XMMf16_IMM8_AVX512EVEX.LIG.F3.0F3A.W0 C2 /r ibAVX10.1 or AVX512_FP16
VCMPSH k {k}, xmm, m16, imm8 VCMPSH_MASKmskw_MASKmskw_XMMf16_MEMf16_IMM8_AVX512EVEX.LIG.F3.0F3A.W0 C2 /r ibAVX10.1 or AVX512_FP16

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.
Modelk {k}, xmm, xmm, imm8, {sae}no mask, with a maskk {k}, xmm, xmm, imm8, {sae}with {sae}k {k}, xmm, m16, imm8
Sapphire Rapids3 / 1p54 / 0.5p013 / 1p5

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.

Only the low halves count: the result goes to bit 0 of k1, and its other bits are cleared.
VCMPSH: the low element to bit 0 of k1The result comes from half 0 of xmm2 and xmm3. Result bits 7 to 0: 0, 0, 0, 0, 0, 0, 0, r0.01234567xmm2a1k2r00k101234567xmm3or m16b

Where bit 0 of the write mask k2 is 0, the result bit is 0.

The result comes from half 0 of xmm2 and xmm3. Result bits 7 to 0: 0, 0, 0, 0, 0, 0, 0, r0.

Operation

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

a = xmm2.f16[0]
b = src3.f16[0]
k1[0] = k2[0] and fcmp(imm8, a, b)
# imm8 & 31: 0 ==, 1 <, 2 <=, 3 unordered, 4 !=, 5 !<, 6 !<=, 7 ordered ...
# {sae}: no exception flags
# the other bits of k1 are cleared

Not run on a processor: none of these processors has AVX512-FP16.

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
VCMPSH k {k}, xmm, xmm/m16, imm8, {sae}
kexplicitwrite (masked)
{k}explicitread (write mask)
xmmexplicitread
xmm/m16explicitread
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
AVX512-E3

Attributes

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

All forms
write masking; follows MXCSR
Memory forms
memory fault suppression

Intrinsics

The C intrinsics of Clang 23.1.2 that compile to VCMPSH, 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_round_sh_mask __mmask8 _mm_cmp_round_sh_mask(__m128h X, __m128h Y, const int P, const int R)

VCMPSH k, xmm, xmm, imm8, {sae} EVEX.LIG -mavx512fp16

_mm_cmp_sh_mask __mmask8 _mm_cmp_sh_mask(__m128h X, __m128h Y, const int P)

VCMPSH k, xmm, xmm, imm8 EVEX.LIG -mavx512fp16

_mm_comi_round_sh int _mm_comi_round_sh(__m128h A, __m128h B, const int P, const int R)

VCMPSH k, xmm, xmm, imm8, {sae} EVEX.LIG -mavx512fp16

_mm_comi_sh int _mm_comi_sh(__m128h A, __m128h B, const int pred)

VCMPSH k, xmm, xmm, imm8 EVEX.LIG -mavx512fp16

_mm_comieq_sh int _mm_comieq_sh(__m128h __A, __m128h __B)

VCMPSH k, xmm, xmm, imm8 EVEX.LIG -mavx512fp16

_mm_comige_sh int _mm_comige_sh(__m128h __A, __m128h __B)

VCMPSH k, xmm, xmm, imm8 EVEX.LIG -mavx512fp16

_mm_comigt_sh int _mm_comigt_sh(__m128h __A, __m128h __B)

VCMPSH k, xmm, xmm, imm8 EVEX.LIG -mavx512fp16

_mm_comile_sh int _mm_comile_sh(__m128h __A, __m128h __B)

VCMPSH k, xmm, xmm, imm8 EVEX.LIG -mavx512fp16

_mm_comilt_sh int _mm_comilt_sh(__m128h __A, __m128h __B)

VCMPSH k, xmm, xmm, imm8 EVEX.LIG -mavx512fp16

_mm_comineq_sh int _mm_comineq_sh(__m128h __A, __m128h __B)

VCMPSH k, xmm, xmm, imm8 EVEX.LIG -mavx512fp16

_mm_ucomieq_sh int _mm_ucomieq_sh(__m128h __A, __m128h __B)

VCMPSH k, xmm, xmm, imm8 EVEX.LIG -mavx512fp16

_mm_ucomige_sh int _mm_ucomige_sh(__m128h __A, __m128h __B)

VCMPSH k, xmm, xmm, imm8 EVEX.LIG -mavx512fp16

_mm_ucomigt_sh int _mm_ucomigt_sh(__m128h __A, __m128h __B)

VCMPSH k, xmm, xmm, imm8 EVEX.LIG -mavx512fp16

_mm_ucomile_sh int _mm_ucomile_sh(__m128h __A, __m128h __B)

VCMPSH k, xmm, xmm, imm8 EVEX.LIG -mavx512fp16

_mm_ucomilt_sh int _mm_ucomilt_sh(__m128h __A, __m128h __B)

VCMPSH k, xmm, xmm, imm8 EVEX.LIG -mavx512fp16

_mm_ucomineq_sh int _mm_ucomineq_sh(__m128h __A, __m128h __B)

VCMPSH k, xmm, xmm, imm8 EVEX.LIG -mavx512fp16

_mm_mask_cmp_round_sh_mask __mmask8 _mm_mask_cmp_round_sh_mask(__mmask8 M, __m128h X, __m128h Y, const int P, const int R)

VCMPSH k {k}, xmm, xmm, imm8, {sae} EVEX.LIG -mavx512fp16

_mm_mask_cmp_sh_mask __mmask8 _mm_mask_cmp_sh_mask(__mmask8 M, __m128h X, __m128h Y, const int P)

VCMPSH k {k}, xmm, xmm, imm8 EVEX.LIG -mavx512fp16

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
AVX512_FP16_SCALAR

AVX10.1
CPUID.(EAX=07H,ECX=1):EDX[19] AVX10
CPUID.(EAX=24H,ECX=0):EBX[7:0] ≥ 1 AVX10 version

or

AVX512_FP16
CPUID.(EAX=07H,ECX=0):EDX[23] AVX512_FP16

Nova Lake, Sapphire Rapids, Emerald Rapids, Granite Rapids, Diamond Rapids, Zen 6

More AVX10.1 instructions

All 686 AVX10.1 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. LLVM 23.1.2's x86 scheduling models (commit 85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them.
  5. Intel Advanced Vector Extensions 10.2 Architecture Specification, revision 7.0 (361050-007, April 2026)
  6. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2C, page 5-22 (VCMPSH)
  7. Software Optimization Guide for the AMD Zen5 Microarchitecture (58455, rev. 1.00, August 2024), Wayback Machine copy of AMD's ZIP

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 and the timings from LLVM's scheduling models, both part of the LLVM Project, licensed under the Apache License 2.0 with LLVM Exceptions. The text is our own.