Instruction
VCVTHF82PH
Converts packed E4M3 FP8 values to half precision, which is exact.
- Extensions
- Forms
- 6 (6 EVEX)
- Data
- Intel XED v2026.08.23
VCVTHF82PH widens E4M3 values to half precision. Every E4M3 number, denormals included, is a normal half or a zero, since FP16’s exponents reach down to 2^-14 and its 10 fraction bits hold E4M3’s 3, so the result is exact: no rounding, no flag, no exception, MXCSR unused. The bytes come from the low half of the source: 32 bytes from a ymm register or memory give 32 halves in a zmm register, and the 128-bit form reads 8 bytes, an m64. There is no broadcast form. It belongs to AVX10.2, opcode 1Eh with the F2 prefix in EVEX map 5, with a write mask of one bit per half. VCVTPH2HF8 converts the other way, rounding.
Some values
E4M3’s largest number, 448 (7Eh), becomes 5F00h, and its smallest denormal, 2^-9 (01h), becomes 1800h, a normal half. The NaN, 7Fh, becomes 7F80h, a quiet half NaN, and FFh becomes FF80h. A conversion to E4M3 and back with this instruction therefore rounds a half to E4M3’s precision, except that values too large, and infinities, come back as NaN.
No E5M2 counterpart
There is no instruction for E5M2, since an E5M2 byte is the upper byte
of the half it stands for: Clang 23 compiles _mm512_cvtbf8_ph to
VPMOVZXBW and vpsllw zmm0, zmm0, 8, while _mm512_cvthf8_ph gives
vcvthf82ph zmm0, ymm0. GCC 14 rejects -mavx10.2. ACE adds
conversions of both 8-bit formats to singles,
VCVTHF82PS and VCVTBF82PS.
Its exception class
Revision 7.0 of the AVX10.2 specification moved the instruction from exception class E2 to E4, because it raises no SIMD floating-point exception and leaves MXCSR alone. The two classes differ in E2’s #XM, which this exact conversion never raises, and in E4’s #UD for an EVEX.b that the instruction gives no meaning, which matters here, as there is no broadcast. The ACE specification, version 1.16.2, still lists the instruction under E2 in its table of classes, and its revision 1.14 calls that a correction. No AVX10.2 processor appears in this site’s recorded cases.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
VCVTHF82PH xmm {k}{z}, xmm
VCVTHF82PH_XMMf16_MASKmskw_XMMhf8_AVX512 | EVEX.128.F2.MAP5.W0 1E /r | AVX10.2 or AVX10_V1_AUX |
VCVTHF82PH xmm {k}{z}, m64
VCVTHF82PH_XMMf16_MASKmskw_MEMhf8_AVX512 | EVEX.128.F2.MAP5.W0 1E /r | AVX10.2 or AVX10_V1_AUX |
VCVTHF82PH ymm {k}{z}, xmm
VCVTHF82PH_YMMf16_MASKmskw_XMMhf8_AVX512 | EVEX.256.F2.MAP5.W0 1E /r | AVX10.2 or AVX10_V1_AUX |
VCVTHF82PH ymm {k}{z}, m128
VCVTHF82PH_YMMf16_MASKmskw_MEMhf8_AVX512 | EVEX.256.F2.MAP5.W0 1E /r | AVX10.2 or AVX10_V1_AUX |
VCVTHF82PH zmm {k}{z}, ymm
VCVTHF82PH_ZMMf16_MASKmskw_YMMhf8_AVX512 | EVEX.512.F2.MAP5.W0 1E /r | AVX10.2 or AVX10_V1_AUX |
VCVTHF82PH zmm {k}{z}, m256
VCVTHF82PH_ZMMf16_MASKmskw_MEMhf8_AVX512 | EVEX.512.F2.MAP5.W0 1E /r | AVX10.2 or AVX10_V1_AUX |
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.
Shown for the ymm form; the xmm and zmm forms work the same on 8 and 32 bytes. The forms write under a mask: where its bit is 0, the element keeps its old value, or zeroes it with {z}.
Result halves 15 to 0: a15, unchanged (bit 14 of k1 is 0), a13, a12, a11, a10, a9, a8, a7, a6, a5, a4, a3, a2, a1, a0.
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
for i in range(VL // 16):
if k1[i]:
zmm1.f16[i] = to_f16(src2.hf8[i])
elif zeroing:
zmm1.f16[i] = 0
# else: zmm1.f16[i] keeps its value
# HF8: exact, no flags; MXCSR unused
# zmm1 is zeroed from bit VL upNot run on a processor: none of these processors has AVX10.2. The tests check its arithmetic against MPFR.
Operands
| Operand | Kind | Action |
|---|---|---|
VCVTHF82PH xmm {k}{z}, xmm/m64 VCVTHF82PH ymm {k}{z}, xmm/m128 VCVTHF82PH zmm {k}{z}, ymm/m256 | ||
xmm, ymm, zmm | explicit | write (masked) |
{k} | explicit | read (write mask) |
xmm/m64, xmm/m128, ymm/m256 | explicit | read |
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-E4
Attributes
What else XED records about the forms. How to read.
- All forms
- write masking; always rounds to nearest even
- Memory forms
- memory fault suppression
Intrinsics
The C intrinsics of Clang 23.1.2 that compile to VCVTHF82PH, 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.
| Intrinsic | Compiles to |
|---|---|
_mm_cvthf8_ph
__m128h _mm_cvthf8_ph(__m128i __A) |
|
_mm_mask_cvthf8_ph
__m128h _mm_mask_cvthf8_ph(__m128h __W, __mmask8 __U, __m128i __A) |
|
_mm_maskz_cvthf8_ph
__m128h _mm_maskz_cvthf8_ph(__mmask8 __U, __m128i __A) |
|
_mm256_cvthf8_ph
__m256h _mm256_cvthf8_ph(__m128i __A) |
|
_mm256_mask_cvthf8_ph
__m256h _mm256_mask_cvthf8_ph(__m256h __W, __mmask16 __U, __m128i __A) |
|
_mm256_maskz_cvthf8_ph
__m256h _mm256_maskz_cvthf8_ph(__mmask16 __U, __m128i __A) |
|
_mm512_cvthf8_ph
__m512h _mm512_cvthf8_ph(__m256i __A) |
|
_mm512_mask_cvthf8_ph
__m512h _mm512_mask_cvthf8_ph(__m512h __W, __mmask32 __U, __m256i __A) |
|
_mm512_maskz_cvthf8_ph
__m512h _mm512_maskz_cvthf8_ph(__mmask32 __U, __m256i __A) |
|
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_FP8_CONVERT_128 | AVX10.2 or AVX10_V1_AUX | Nova Lake, Diamond Rapids |
AVX512_FP8_CONVERT_256 | Same as AVX512_FP8_CONVERT_128 | Same as AVX512_FP8_CONVERT_128 |
AVX512_FP8_CONVERT_512 | Same as AVX512_FP8_CONVERT_128 | Same as AVX512_FP8_CONVERT_128 |
More AVX10.2 instructions
- VADDBF16
- VCMPBF16
- VCOMISBF16
- VCOMXSD
- VCOMXSH
- VCOMXSS
- VCVT2PH2BF8
- VCVT2PH2BF8S
- VCVT2PH2HF8
- VCVT2PH2HF8S
- VCVT2PS2PHX
- VCVTBF162IBS
- VCVTBF162IUBS
- VCVTBIASPH2BF8
- VCVTBIASPH2BF8S
- VCVTBIASPH2HF8
- VCVTBIASPH2HF8S
- VCVTPH2BF8
- VCVTPH2BF8S
- VCVTPH2HF8
- VCVTPH2HF8S
- VCVTPH2IBS
- VCVTPH2IUBS
- VCVTPS2IBS
- VCVTPS2IUBS
- VCVTTBF162IBS
- VCVTTBF162IUBS
- VCVTTPD2DQS
- VCVTTPD2QQS
- VCVTTPD2UDQS
- VCVTTPD2UQQS
- VCVTTPH2IBS
- VCVTTPH2IUBS
- VCVTTPS2DQS
- VCVTTPS2IBS
- VCVTTPS2IUBS
- VCVTTPS2QQS
- VCVTTPS2UDQS
- VCVTTPS2UQQS
- VCVTTSD2SIS
Sources
- Intel XED v2026.08.23 (commit
0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model. - 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. - Intel Advanced Vector Extensions 10.2 Architecture Specification, revision 7.0 (361050-007, April 2026)
- x86 Ecosystem Advisory Group: AI Compute Extensions (ACE) Specification, version 1.16.2 (July 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 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.