Instruction
VFMADDCPH
Multiplies packed complex numbers, each a pair of half-precision values, and adds the products to the destination.
- Extensions
- Forms
- 6 (6 EVEX)
- Data
- Intel XED v2026.08.23
VFMADDCPH multiplies the complex numbers of its two sources, pairs of
halves with the real part in the even element, and adds each product to
the complex number already in the destination: acc += x × y for 16
complex values per zmm register. Intel’s optimization manual describes
it as two fused multiply-adds for each part, the real part acc + ac - bd
and the imaginary part acc + ad + bc, each rounded to FP16 before the
next, so the result carries a little more error than one rounding
(Sections 18.4.3 and 18.5.3). VFMULCPH covers the
layout, the masking and broadcast per pair and the #UD when the
destination is also a source; VFCMADDCPH uses the
conjugate of the second source, and VFMADDCSH works
on the lowest pair. Its encoding is opcode 56h with the F3 prefix in
EVEX map 6.
The accumulator is the destination
Like VFMADD231PH, the instruction keeps its addend
in the destination, but there is no other operand order to choose.
_mm512_mask3_fmadd_pch(a, b, c, k), which keeps c where a mask bit
is clear, maps to it directly. _mm512_mask_fmadd_pch(a, k, b, c) must
keep a, a factor, so at -O2 with -march=x86-64-v4 -mavx512fp16 GCC
14 and Clang 23 both compute the masked product into c’s register and
then merge it into a with a masked VMOVAPS. The unmasked
_mm512_fmadd_pch also ends with a move in both, since the sum builds
up in c’s register and is returned in that of a.
Loops over complex halves
z[i] += x[i] * y[i] over _Complex _Float16 arrays stays scalar in
both compilers by default, with a call to the library’s __mulhc3 for a
NaN product. With -ffast-math, GCC vectorizes it to VFMADDCPH on zmm
registers, the old z as the accumulator and x from memory; with only
-fcx-limited-range it keeps the multiply and the add apart, as
VFMULCPH and VADDPH. Clang splits the real and
imaginary parts instead and, with -ffast-math, combines them with
VFMADD231PH and VFNMADD231PH.
AMD’s Zen 5 guide does not list AVX512-FP16, and this site’s recorded cases include none of VFMADDCPH.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
VFMADDCPH xmm {k}{z}, xmm, xmm
VFMADDCPH_XMM2f16_MASKmskw_XMM2f16_XMM2f16_AVX512 | EVEX.128.F3.MAP6.W0 56 /r | AVX10.1 or AVX512_FP16 + AVX512VL |
VFMADDCPH xmm {k}{z}, xmm, m128/m32bcst
VFMADDCPH_XMM2f16_MASKmskw_XMM2f16_MEM2f16_AVX512 | EVEX.128.F3.MAP6.W0 56 /r | AVX10.1 or AVX512_FP16 + AVX512VL |
VFMADDCPH ymm {k}{z}, ymm, ymm
VFMADDCPH_YMM2f16_MASKmskw_YMM2f16_YMM2f16_AVX512 | EVEX.256.F3.MAP6.W0 56 /r | AVX10.1 or AVX512_FP16 + AVX512VL |
VFMADDCPH ymm {k}{z}, ymm, m256/m32bcst
VFMADDCPH_YMM2f16_MASKmskw_YMM2f16_MEM2f16_AVX512 | EVEX.256.F3.MAP6.W0 56 /r | AVX10.1 or AVX512_FP16 + AVX512VL |
VFMADDCPH zmm {k}{z}, zmm, zmm, {er}
VFMADDCPH_ZMM2f16_MASKmskw_ZMM2f16_ZMM2f16_AVX512 | EVEX.512.F3.MAP6.W0 56 /r | AVX10.1 or AVX512_FP16 |
VFMADDCPH zmm {k}{z}, zmm, m512/m32bcst
VFMADDCPH_ZMM2f16_MASKmskw_ZMM2f16_MEM2f16_AVX512 | EVEX.512.F3.MAP6.W0 56 /r | AVX10.1 or AVX512_FP16 |
Latency and throughput
| Model | xmm {k}{z}, xmm, xmmno maskymm {k}{z}, ymm, ymmno mask | xmm {k}{z}, xmm, xmmwith a mask, zeroingymm {k}{z}, ymm, ymmwith a mask, zeroing | xmm {k}{z}, xmm, m128/m32bcstno mask, broadcastymm {k}{z}, ymm, m256/m32bcstno mask, broadcast | xmm {k}{z}, xmm, m128/m32bcstwith a mask, zeroingymm {k}{z}, ymm, m256/m32bcstwith a mask, zeroing | zmm {k}{z}, zmm, zmm, {er}no mask, with {er} | zmm {k}{z}, zmm, zmm, {er}with a mask, zeroing | zmm {k}{z}, zmm, m512/m32bcstno mask, broadcast | zmm {k}{z}, zmm, m512/m32bcstwith a mask, zeroing |
|---|---|---|---|---|---|---|---|---|
| Sapphire Rapids | 9 / 1p01 | 15 / 1p01 | 16 / 1p01 | 21 / 1p01 | 9 / 2p0 | 15 / 2p0 | 16 / 2p0 | 21 / 2p0 |
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.
Every FP16 pair works alike: 4, 8 and 16 FP16 pairs in the xmm, ymm and zmm forms. The forms write under a mask: where its bit is 0, the element keeps its old value, or zeroes it with {z}. With m32bcst, one FP16 pair from memory stands for every element of the last source. The sources are drawn above the result, each element in its own column.
Result FP16 pair i comes from FP16 pair i of xmm1, xmm2 and xmm3. Result FP16 pairs 3 to 0: r3, unchanged (bit 2 of k1 is 0), r1, r0.
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
if zmm1.number == zmm2.number:
fault(UD)
if not src3.is_memory:
if zmm1.number == src3.number:
fault(UD)
for i in range(VL // 32):
if k1[i]:
ar = zmm2.f16[2 * i]
ai = zmm2.f16[2 * i + 1]
br = src3.f16[2 * i]
bi = src3.f16[2 * i + 1]
x = zmm1.f16[2 * i]
y = zmm1.f16[2 * i + 1]
x = fmadd(ar, br, x)
y = fmadd(ai, br, y)
x = fnmadd(ai, bi, x)
y = fmadd(ar, bi, y)
zmm1.d[i] = y << 16 | x
elif zeroing:
zmm1.d[i] = 0
# else: zmm1.d[i] keeps its value
# m32bcst: src3.d[i] is the m32 for every i
# x + y*i += (ar + ai*i)(br + bi*i)
# {er}: the form's rounding, not MXCSR.RC, and no flags
# exceptions as if masked (flags, never #XM): the SDM's claim, unchecked here
# zmm1 is zeroed from bit VL upNot run on a processor: none of these processors has AVX512-FP16. The tests check its arithmetic against MPFR.
Operands
| Operand | Kind | Action |
|---|---|---|
VFMADDCPH xmm {k}{z}, xmm, xmm/m128/m32bcst VFMADDCPH ymm {k}{z}, ymm, ymm/m256/m32bcst VFMADDCPH zmm {k}{z}, zmm, zmm/m512/m32bcst, {er} | ||
xmm, ymm, zmm | explicit | read, write (masked) |
{k} | explicit | read (write mask) |
xmm, ymm, zmm | explicit | read |
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.
- All forms
AVX512-E4
Attributes
What else XED records about the forms. How to read.
- All forms
- write masking; follows MXCSR
- Memory forms
- embedded broadcast (tuple Full); memory fault suppression
Intrinsics
The C intrinsics of Clang 23.1.2 that compile to VFMADDCPH, 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_fmadd_pch
__m128h _mm_fmadd_pch(__m128h __A, __m128h __B, __m128h __C) |
|
_mm_mask3_fmadd_pch
__m128h _mm_mask3_fmadd_pch(__m128h __A, __m128h __B, __m128h __C, __mmask8 __U) |
|
_mm_maskz_fmadd_pch
__m128h _mm_maskz_fmadd_pch(__mmask8 __U, __m128h __A, __m128h __B, __m128h __C) |
|
_mm256_fmadd_pch
__m256h _mm256_fmadd_pch(__m256h __A, __m256h __B, __m256h __C) |
|
_mm256_mask3_fmadd_pch
__m256h _mm256_mask3_fmadd_pch(__m256h __A, __m256h __B, __m256h __C, __mmask8 __U) |
|
_mm256_maskz_fmadd_pch
__m256h _mm256_maskz_fmadd_pch(__mmask8 __U, __m256h __A, __m256h __B, __m256h __C) |
|
_mm512_fmadd_pch
__m512h _mm512_fmadd_pch(__m512h __A, __m512h __B, __m512h __C) |
|
_mm512_fmadd_round_pch
__m512h _mm512_fmadd_round_pch(__m512h A, __m512h B, __m512h C, const int R) |
|
_mm512_mask3_fmadd_pch
__m512h _mm512_mask3_fmadd_pch(__m512h __A, __m512h __B, __m512h __C, __mmask16 __U) |
|
_mm512_mask3_fmadd_round_pch
__m512h _mm512_mask3_fmadd_round_pch(__m512h A, __m512h B, __m512h C, __mmask16 U, const int R) |
|
_mm512_maskz_fmadd_pch
__m512h _mm512_maskz_fmadd_pch(__mmask16 __U, __m512h __A, __m512h __B, __m512h __C) |
|
_mm512_maskz_fmadd_round_pch
__m512h _mm512_maskz_fmadd_round_pch(__mmask16 U, __m512h A, __m512h B, __m512h C, const int R) |
|
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_128 | AVX10.1 or AVX512_FP16 + AVX512VL | Nova Lake, Sapphire Rapids, Emerald Rapids, Granite Rapids, Diamond Rapids, Zen 6 |
AVX512_FP16_256 | Same as AVX512_FP16_128 | Same as AVX512_FP16_128 |
AVX512_FP16_512 | AVX10.1 or AVX512_FP16 | Same as AVX512_FP16_128 |
More AVX10.1 instructions
- VFIXUPIMMSD
- VFIXUPIMMSS
- VFMADD132PD
- VFMADD132PH
- VFMADD132PS
- VFMADD132SD
- VFMADD132SH
- VFMADD132SS
- VFMADD213PD
- VFMADD213PH
- VFMADD213PS
- VFMADD213SD
- VFMADD213SH
- VFMADD213SS
- VFMADD231PD
- VFMADD231PH
- VFMADD231PS
- VFMADD231SD
- VFMADD231SH
- VFMADD231SS
- VFMADDCSH
- VFMADDSUB132PD
- VFMADDSUB132PH
- VFMADDSUB132PS
- VFMADDSUB213PD
- VFMADDSUB213PH
- VFMADDSUB213PS
- VFMADDSUB231PD
- VFMADDSUB231PH
- VFMADDSUB231PS
- VFMSUB132PD
- VFMSUB132PH
- VFMSUB132PS
- VFMSUB132SD
- VFMSUB132SH
- VFMSUB132SS
- VFMSUB213PD
- VFMSUB213PH
- VFMSUB213PS
- VFMSUB213SD
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 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-180 (VFCMADDCPH/
VFMADDCPH) - Intel 64 and IA-32 Architectures Optimization Reference Manual, Volume 1 (248966-051, October 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.