Instruction
VCOMISH
Compares the low half-precision values and sets ZF, PF and CF, clearing OF, SF and AF; any NaN signals an invalid exception.
- Extensions
- Forms
- 2 (2 EVEX)
- Data
- Intel XED v2026.08.23
VCOMISH compares the low half of an XMM register with the low half of
another register or a 16-bit memory operand and reports the result in
EFLAGS the way VCOMISS does for singles: ZF, PF and CF
all set for unordered, CF alone for less, ZF alone for equal, none for
greater, and OF, SF and AF cleared. Like it, VCOMISH raises the
invalid-operation exception for a NaN of either kind, where
VUCOMISH does so only for a signaling NaN, and with
that exception unmasked it faults without changing EFLAGS. It writes no
register, so it takes no write mask; {sae} suppresses the exception.
The encoding is EVEX map 5, opcode 2Fh, that of COMISS, with EVEX.vvvv
required to be 1111b; VADDPH covers the format and the
CPUID bits.
In our builds
At -O2 with -march=x86-64-v4 -mavx512fp16, GCC 14 compiles a < b and
a <= b on _Float16 values to vcomish xmm1, xmm0 with SETA or
SETAE, the operands swapped as COMISS’s page explains, and uses VUCOMISH
for ==; Clang 23 uses VUCOMISH for all three, as it does for floats.
The intrinsics part ways with their single-precision ones, which GCC
compiles to VCOMISS as that page shows: for _mm_comi_round_sh,
_mm_comilt_sh and _mm_comieq_sh both compilers emit
VCMPSH into K0 with the matching predicate, {sae}
where asked, and read the bit with KMOVB or KMOVW. Without AVX512-FP16,
as with -march=znver5, both widen the halves with
VCVTPH2PS and compare singles, which gives the same
order since every half is exactly a single: GCC with VCOMISS for <,
Clang with VUCOMISS.
AVX10.2 adds VCOMXSH, the same opcode with an F3 prefix, which also sets OF and SF so that the signed conditions such as JL and JLE test less than directly. AMD’s Zen 5 guide does not list AVX512-FP16, and this site’s recorded cases include none of VCOMISH.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
VCOMISH xmm, xmm, {sae}
VCOMISH_XMMf16_XMMf16_AVX512 | EVEX.LIG.NP.MAP5.W0 2F /r | AVX10.1 or AVX512_FP16 |
VCOMISH xmm, m16
VCOMISH_XMMf16_MEMf16_AVX512 | EVEX.LIG.NP.MAP5.W0 2F /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 = comi(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
# a QNaN raises IE too
# {sae}: no exception flagsNot run on a processor: none of these processors has AVX512-FP16.
Operands
| Operand | Kind | Action |
|---|---|---|
VCOMISH 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
- VBLENDMPS
- VBROADCASTF32X2
- VBROADCASTF32X4
- VBROADCASTF32X8
- VBROADCASTF64X2
- VBROADCASTF64X4
- VBROADCASTI32X2
- VBROADCASTI32X4
- VBROADCASTI32X8
- VBROADCASTI64X2
- VBROADCASTI64X4
- VBROADCASTSD
- VBROADCASTSS
- VCMPPD
- VCMPPH
- VCMPPS
- VCMPSD
- VCMPSH
- VCMPSS
- VCOMISD
- VCOMISS
- VCOMPRESSPD
- VCOMPRESSPS
- VCVTDQ2PD
- VCVTDQ2PH
- VCVTDQ2PS
- VCVTNE2PS2BF16
- VCVTNEPS2BF16
- VCVTPD2DQ
- VCVTPD2PH
- VCVTPD2PS
- VCVTPD2QQ
- VCVTPD2UDQ
- VCVTPD2UQQ
- VCVTPH2DQ
- VCVTPH2PD
- VCVTPH2PS
- VCVTPH2PSX
- VCVTPH2QQ
- VCVTPH2UDQ
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-24 (VCOMISH)
- 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.