Instruction
VUCOMISH
Compares the low half-precision values and sets ZF, PF and CF, clearing OF, SF and AF; only a signaling NaN raises an invalid exception.
- Extensions
- Forms
- 2 (2 EVEX)
- Data
- Intel XED v2026.08.23
VUCOMISH is the quiet twin of VCOMISH: it compares the
low halves of two operands into ZF, PF and CF in the same way, and
clears OF, SF and AF, but raises the invalid-operation exception only
for a signaling NaN, not for a quiet one. That makes it the compare for
==, != and the C99 macros such as isless, which must not signal on
a quiet NaN; VUCOMISS and UCOMISS
cover the same split for singles. Its opcode is 2Eh in EVEX map 5, it
takes {sae} and no write mask, and EVEX.vvvv must be 1111b.
VADDPH covers the format; FP16 instructions ignore
MXCSR.DAZ, so a denormal half is compared as the value it holds.
In our builds
At -O2 with -march=x86-64-v4 -mavx512fp16, GCC 14 compiles a == b on
_Float16 values to VUCOMISH, SETNP and a CMOVNE that clears the result
when ZF is clear, and isless(a, b) and isunordered(a, b) to VUCOMISH
with SETA and SETP. Clang 23 uses VUCOMISH for <, <= and those
macros, and for a branch on == (JNE and JP to skip the call), but for
the value of a == b it emits VCMPSH into K0 and
KMOVW. _mm_ucomilt_sh became VCMPSH with the quiet predicate
_CMP_LT_OQ in both compilers, not VUCOMISH.
Without AVX512-FP16, as with -march=znver5, the compilers widen both
halves with VCVTPH2PS and compare the singles with
VUCOMISS or VCMPSS. The order comes out the same, since every half is
exactly a single, and a signaling NaN still sets IE, in the conversion,
as VCVTPH2PS’s page shows; a denormal half, which VUCOMISH may report
with DE, becomes a normal single and sets nothing.
AVX10.2 adds VUCOMXSH, opcode 2Eh with an F3 prefix, which also sets OF and SF for the signed conditions. AMD’s Zen 5 guide does not list AVX512-FP16, and this site’s recorded cases include none of VUCOMISH.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
VUCOMISH xmm, xmm, {sae}
VUCOMISH_XMMf16_XMMf16_AVX512 | EVEX.LIG.NP.MAP5.W0 2E /r | AVX10.1 or AVX512_FP16 |
VUCOMISH xmm, m16
VUCOMISH_XMMf16_MEMf16_AVX512 | EVEX.LIG.NP.MAP5.W0 2E /r | AVX10.1 or AVX512_FP16 |
Latency and throughput
| Model | xmm, xmm, {sae} | xmm, m16 |
|---|---|---|
| Sapphire Rapids | 4 / 1p0 | 10 / 1p0 |
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.
The flags come from half 0 of xmm1 and xmm2. RFLAGS: CF, PF, ZF.
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
x = ucomi(xmm1.f16[0], src2.f16[0]) # 0 >, 1 <, 2 =, 3 unordered
zf = x in (2, 3)
pf = x == 3
cf = x in (1, 3)
of = sf = af = 0
# only an SNaN raises IE
# {sae}: no exception flagsNot run on a processor: none of these processors has AVX512-FP16.
Operands
| Operand | Kind | Action |
|---|---|---|
VUCOMISH xmm, xmm/m16, {sae} | ||
xmm | explicit | read |
xmm/m16 | explicit | read |
RFLAGS | implicit | write |
Flags
| OF | SF | ZF | AF | PF | CF |
|---|---|---|---|---|---|
| All forms | |||||
| 0 | 0 | M | 0 | M | M |
Exceptions
The exception class is XED's name for the set of exception conditions that a form follows. How to read.
- All forms
AVX512-E3NF
Attributes
What else XED records about the forms. How to read.
- All forms
- follows MXCSR
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.
| ISA set | CPUID | Processors |
|---|---|---|
AVX512_FP16_SCALAR | AVX10.1 or AVX512_FP16 | Nova Lake, Sapphire Rapids, Emerald Rapids, Granite Rapids, Diamond Rapids, Zen 6 |
More AVX10.1 instructions
- VRSQRT14SD
- VRSQRT14SS
- VRSQRTPH
- VRSQRTSH
- VSCALEFPD
- VSCALEFPH
- VSCALEFPS
- VSCALEFSD
- VSCALEFSH
- VSCALEFSS
- VSCATTERDPD
- VSCATTERDPS
- VSCATTERQPD
- VSCATTERQPS
- VSHUFF32X4
- VSHUFF64X2
- VSHUFI32X4
- VSHUFI64X2
- VSHUFPD
- VSHUFPS
- VSQRTPD
- VSQRTPH
- VSQRTPS
- VSQRTSD
- VSQRTSH
- VSQRTSS
- VSUBPD
- VSUBPH
- VSUBPS
- VSUBSD
- VSUBSH
- VSUBSS
- VUCOMISD
- VUCOMISS
- VUNPCKHPD
- VUNPCKHPS
- VUNPCKLPD
- VUNPCKLPS
- VXORPD
- VXORPS
Sources
- Intel XED v2026.08.23 (commit
0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model. - The CPU data of x86-64.net: Zen 3 to Zen 6, from GCC’s
-marchfeature sets and AMD’s Processor Programming References, which the page of each processor cites. - LLVM 23.1.2's x86 scheduling models (commit
85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them. - Intel Advanced Vector Extensions 10.2 Architecture Specification, revision 7.0 (361050-007, April 2026)
- Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2C, page 5-774 (VUCOMISH)
- 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 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.