Instruction
VCVTNEPS2BF16
Converts packed single-precision values to bfloat16, rounding to nearest even with denormals flushed to zero and without consulting MXCSR.
- Extensions
- Forms
- 10 (4 VEX, 6 EVEX)
- Data
- Intel XED v2026.08.23
VCVTNEPS2BF16 rounds each single of a register or of memory to
bfloat16, the upper 16 bits of a single, and packs the results into the
low half of the destination: 4 singles of an XMM source become 4 words
of an XMM register, 8 of a YMM source fill an XMM register and 16 of a
ZMM source a YMM one, and the bits above are cleared. It is the
one-source form of VCVTNE2PS2BF16, whose page
covers the fixed rounding: to nearest even whatever MXCSR says,
denormal inputs as zeros of their sign, NaNs made quiet, MXCSR neither
read nor written. It has two encodings: the EVEX one of AVX512_BF16,
with a write mask and a broadcast, and a VEX one at 128 and 256 bits
from AVX-NE-CONVERT, which the assembler marks {vex}.
Recorded on Zen 5
The 31 cases, all EVEX, agree with the SDM’s conversion routine, which adds 7FFFh plus the lowest kept bit to the single and keeps the upper half.
- Ties. 3F808000h gave 3F80h and 3F818000h gave 3F82h, each to the even neighbor, and 3F80C000h, above the tie, gave 3F81h.
- Overflow. 7F7F8000h, a tie below infinity, gave 7F80h, as did the largest single, while 7F7F0000h stayed 7F7Fh.
- Exceptions. With MXCSR 0, every exception unmasked, the signaling NaN 7F812345h gave 7FC1h without a fault, and MXCSR stayed 0.
- Masks. Zeroing masking cleared the words left out, and a broadcast of 3F818000h gave 3F82h in every word selected.
In compiled code
At -O2 with -march=znver5, Clang 23 converts float to __bf16
with VCVTNEPS2BF16, one value or, in a loop, 8 at a time from YMM
registers; with -mavxneconvert it uses the VEX form. GCC 14 calls
__truncsfbf2 for each element in every case, and emits the
instruction only for intrinsics such as _mm512_cvtneps_pbh. The two
differ on denormals: 007FC000h gives 0 here, where an exact rounding
gives 0080h, the smallest normal bfloat16.
AMD’s Zen 5 latency spreadsheet gives the XMM source one macro-op on pipe FP2 or FP3 and 3 cycles, and the YMM and ZMM sources two macro-ops with 6 and 7 cycles.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
VCVTNEPS2BF16 xmm, xmm
VCVTNEPS2BF16_XMMbf16_XMMf32 | VEX.128.F3.0F38.W0 72 /r | AVX_NE_CONVERT |
VCVTNEPS2BF16 xmm, m128
VCVTNEPS2BF16_XMMbf16_MEMf32_VL128 | VEX.128.F3.0F38.W0 72 /r | AVX_NE_CONVERT |
VCVTNEPS2BF16 xmm, ymm
VCVTNEPS2BF16_XMMbf16_YMMf32 | VEX.256.F3.0F38.W0 72 /r | AVX_NE_CONVERT |
VCVTNEPS2BF16 xmm, m256
VCVTNEPS2BF16_XMMbf16_MEMf32_VL256 | VEX.256.F3.0F38.W0 72 /r | AVX_NE_CONVERT |
VCVTNEPS2BF16 xmm {k}{z}, xmm
VCVTNEPS2BF16_XMMbf16_MASKmskw_XMMf32_AVX512 | EVEX.128.F3.0F38.W0 72 /r | AVX10.1 or AVX512_BF16 |
VCVTNEPS2BF16 xmm {k}{z}, m128/m32bcst
VCVTNEPS2BF16_XMMbf16_MASKmskw_MEMf32_AVX512_VL128 | EVEX.128.F3.0F38.W0 72 /r | AVX10.1 or AVX512_BF16 |
VCVTNEPS2BF16 xmm {k}{z}, ymm
VCVTNEPS2BF16_XMMbf16_MASKmskw_YMMf32_AVX512 | EVEX.256.F3.0F38.W0 72 /r | AVX10.1 or AVX512_BF16 |
VCVTNEPS2BF16 xmm {k}{z}, m256/m32bcst
VCVTNEPS2BF16_XMMbf16_MASKmskw_MEMf32_AVX512_VL256 | EVEX.256.F3.0F38.W0 72 /r | AVX10.1 or AVX512_BF16 |
VCVTNEPS2BF16 ymm {k}{z}, zmm
VCVTNEPS2BF16_YMMbf16_MASKmskw_ZMMf32_AVX512 | EVEX.512.F3.0F38.W0 72 /r | AVX10.1 or AVX512_BF16 |
VCVTNEPS2BF16 ymm {k}{z}, m512/m32bcst
VCVTNEPS2BF16_YMMbf16_MASKmskw_MEMf32_AVX512_VL512 | EVEX.512.F3.0F38.W0 72 /r | AVX10.1 or AVX512_BF16 |
Latency and throughput
| Model | xmm, xmm | xmm, m128 | xmm, ymm | xmm, m256 | xmm {k}{z}, xmmno mask | xmm {k}{z}, xmmwith a mask, zeroing | xmm {k}{z}, m128/m32bcstno mask, broadcast | xmm {k}{z}, m128/m32bcstwith a mask, zeroing | xmm {k}{z}, ymmno mask | xmm {k}{z}, ymmwith a mask, zeroing | xmm {k}{z}, m256/m32bcstno mask, broadcast | xmm {k}{z}, m256/m32bcstwith a mask, zeroing | ymm {k}{z}, zmmno mask | ymm {k}{z}, zmmwith a mask, zeroing | ymm {k}{z}, m512/m32bcstno mask, broadcast | ymm {k}{z}, m512/m32bcstwith a mask, zeroing |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Skylake-SP | 5 / 1p015 | 5 / 1p015 | 9 / 1p015 | 9 / 1p015 | 7 / 1p015 | 7 / 1p015 | 14 / 1p015 | 14 / 1p015 | 7 / 1p05 | 7 / 1p05 | 14 / 1p05 | 14 / 1p05 | ||||
| Sapphire Rapids | 8 / 1p015 | 10 / 1p015 | 15 / 1p015 | 17 / 1p015 | 8 / 1p015 | 10 / 1p015 | 16 / 1p015 | 18 / 1p015 | 8 / 2p05 | 10 / 2p05 | 16 / 2p05 | 18 / 2p05 | ||||
| Lunar Lake | 5 / 0.5V0 V1 V2 V3 | 5 / 0.5V0 V1 V2 V3 | 7 / 2V0 V1 V2 V3 | 7 / 2V0 V1 V2 V3 | ||||||||||||
| Zen 4 | 3 / 0.5FP2 FP3 | 3 / 0.5FP2 FP3 | 10 / 0.5FP2 FP3 | 10 / 0.5FP2 FP3 | 6 / 1FP2 FP3 | 6 / 1FP2 FP3 | 13 / 1FP2 FP3 | 13 / 1FP2 FP3 | 6 / 2FP2 FP3 | 6 / 2FP2 FP3 | 13 / 2FP2 FP3 | 13 / 2FP2 FP3 | ||||
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 zmm form; the xmm and ymm forms work the same on 4 and 8 singles. The EVEX forms write under a mask: where its bit is 0, the element keeps its old value, or zeroes it with {z}.
Result bfloat16s 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 // 32):
if k1[i]: # 1 without a write mask
a = src2.f32[i]
ymm1.bf16[i] = to_bf16_ne(a)
elif zeroing:
ymm1.bf16[i] = 0
# else: ymm1.bf16[i] keeps its value
for i in range(VL // 32, 8):
ymm1.w[i] = 0
# m32bcst: src2.f32[i] is the m32 for every i
# BF16: to nearest even, denormals flushed, no flags; MXCSR unused
# ymm1 is zeroed from bit 128 (xmm) or 256 (ymm) upRun on AMD Zen 5 (EPYC 9645): 31 cases. The AVX-NE-CONVERT forms were not run: none of these processors has AVX-NE-CONVERT.
Operands
| Operand | Kind | Action |
|---|---|---|
VCVTNEPS2BF16 xmm, xmm/m128 VCVTNEPS2BF16 xmm, ymm/m256 | ||
xmm | explicit | write |
xmm/m128, ymm/m256 | explicit | read |
VCVTNEPS2BF16 xmm {k}{z}, xmm/m128/m32bcst VCVTNEPS2BF16 xmm {k}{z}, ymm/m256/m32bcst VCVTNEPS2BF16 ymm {k}{z}, zmm/m512/m32bcst | ||
xmm, ymm | explicit | write (masked) |
{k} | explicit | read (write mask) |
xmm/m128/m32bcst, ymm/m256/m32bcst, zmm/m512/m32bcst | 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.
- VEX forms
avx-type-4- EVEX forms
AVX512-E4
Attributes
What else XED records about the forms. How to read.
- EVEX forms
- write masking
- VEX forms
- always rounds to nearest even; denormal inputs read as zero; denormal results flushed to zero
- EVEX memory forms
- embedded broadcast (tuple Full); memory fault suppression
Intrinsics
The C intrinsics of Clang 23.1.2 that compile to VCVTNEPS2BF16, 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_cvtneps_avx_pbh
__m128bh _mm_cvtneps_avx_pbh(__m128 __A) |
|
_mm_cvtneps_pbh
__m128bh _mm_cvtneps_pbh(__m128 A) |
|
_mm_mask_cvtneps_pbh
__m128bh _mm_mask_cvtneps_pbh(__m128bh __W, __mmask8 __U, __m128 __A) |
|
_mm_maskz_cvtneps_pbh
__m128bh _mm_maskz_cvtneps_pbh(__mmask8 __U, __m128 __A) |
|
_mm256_cvtneps_avx_pbh
__m128bh _mm256_cvtneps_avx_pbh(__m256 __A) |
|
_mm256_cvtneps_pbh
__m128bh _mm256_cvtneps_pbh(__m256 A) |
|
_mm256_mask_cvtneps_pbh
__m128bh _mm256_mask_cvtneps_pbh(__m128bh __W, __mmask8 __U, __m256 __A) |
|
_mm256_maskz_cvtneps_pbh
__m128bh _mm256_maskz_cvtneps_pbh(__mmask8 __U, __m256 __A) |
|
_mm512_cvtneps_pbh
__m256bh _mm512_cvtneps_pbh(__m512 __A) |
|
_mm512_mask_cvtneps_pbh
__m256bh _mm512_mask_cvtneps_pbh(__m256bh __W, __mmask16 __U, __m512 __A) |
|
_mm512_maskz_cvtneps_pbh
__m256bh _mm512_maskz_cvtneps_pbh(__mmask16 __U, __m512 __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 |
|---|---|---|
AVX_NE_CONVERT | AVX_NE_CONVERT | Arrow Lake, Panther Lake, Nova Lake, Diamond Rapids, Sierra Forest, Clearwater Forest, Zen 6 |
AVX512_BF16_128 | AVX10.1 or AVX512_BF16 XED and Intel’s SDM differ: In the alternative without AVX10.1, XED asks for the AVX512_BF16 bit, Sources: Intel XED v2026.08.23, datafiles/avx512-bf16/cpuid.xed.txt; Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026), VCVTNE2PS2BF16, VCVTNEPS2BF16 and VDPBF16PS: the opcode tables, pages 5-32, 5-38 and 5-160. | Nova Lake, Cooper Lake, Sapphire Rapids, Emerald Rapids, Granite Rapids, Diamond Rapids, Zen 4, Zen 5, Zen 6 |
AVX512_BF16_256 | Same as AVX512_BF16_128XED and Intel’s SDM differ: see the note on | Same as AVX512_BF16_128 |
AVX512_BF16_512 | Same as AVX512_BF16_128XED and Intel’s SDM differ: see the note on | Same as AVX512_BF16_128 |
More AVX-NE-CONVERT instructions
More AVX10.1 instructions
- VBROADCASTI32X8
- VBROADCASTI64X2
- VBROADCASTI64X4
- VBROADCASTSD
- VBROADCASTSS
- VCMPPD
- VCMPPH
- VCMPPS
- VCMPSD
- VCMPSH
- VCMPSS
- VCOMISD
- VCOMISH
- VCOMISS
- VCOMPRESSPD
- VCOMPRESSPS
- VCVTDQ2PD
- VCVTDQ2PH
- VCVTDQ2PS
- VCVTNE2PS2BF16
- VCVTPD2DQ
- VCVTPD2PH
- VCVTPD2PS
- VCVTPD2QQ
- VCVTPD2UDQ
- VCVTPD2UQQ
- VCVTPH2DQ
- VCVTPH2PD
- VCVTPH2PS
- VCVTPH2PSX
- VCVTPH2QQ
- VCVTPH2UDQ
- VCVTPH2UQQ
- VCVTPH2UW
- VCVTPH2W
- VCVTPS2DQ
- VCVTPS2PD
- VCVTPS2PH
- VCVTPS2PHX
- VCVTPS2QQ
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. - 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. - 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 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2C, page 5-38 (VCVTNEPS2BF16)
- Intel Advanced Vector Extensions 10.2 Architecture Specification, revision 7.0 (361050-007, April 2026)
- 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.